[Qemu-devel] [PATCH 3/6] qcow2: use an LRU algorithm to replace entries from the L2 cache

2015-04-30 Thread Alberto Garcia
positions 8 and higher are rarely (if ever) evicted. This can be seen even with the default cache size, but with larger caches the problem becomes more obvious. Using an LRU algorithm makes the chances of being removed from the cache independent from the position. Signed-off-by: Alberto Garcia

[Qemu-devel] [PATCH 0/6] qcow2 L2/refcount cache improvements

2015-04-30 Thread Alberto Garcia
find the changes worthwhile. Regards, Berto Alberto Garcia (6): qcow2: use one single memory block for the L2/refcount cache tables qcow2: simplify qcow2_cache_put() and qcow2_cache_entry_mark_dirty() qcow2: use an LRU algorithm to replace entries from the L2 cache qcow2: remove

[Qemu-devel] [PATCH 4/6] qcow2: remove qcow2_cache_find_entry_to_replace()

2015-04-30 Thread Alberto Garcia
A cache miss means that the whole array was traversed and the entry we were looking for was not found, so there's no need to traverse it again in order to select an entry to replace. Signed-off-by: Alberto Garcia --- block/qcow2-cache.c | 45 - 1

Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] block: Detect multiplication overflow in bdrv_getlength

2015-05-15 Thread Alberto Garcia
On Fri 15 May 2015 03:39:10 AM CEST, Fam Zheng wrote: > int64_t ret = bdrv_nb_sectors(bs); > > +ret = (int64_t)(ret * BDRV_SECTOR_SIZE) < 0 ? -EFBIG : ret; > return ret < 0 ? ret : ret * BDRV_SECTOR_SIZE; Maybe in this case you're safe, but in general there's no guarantee that if

Re: [Qemu-devel] [Qemu-block] [PATCH 2/2] qemu-iotests: qemu-img info on afl VMDK image with a huge capacity

2015-05-15 Thread Alberto Garcia
On Fri 15 May 2015 03:39:11 AM CEST, Fam Zheng wrote: > The image is contributed by Richard W.M. Jones. > > Cc: Richard W.M. Jones > Signed-off-by: Fam Zheng Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH v2 1/2] block: Detect multiplication overflow in bdrv_getlength

2015-05-15 Thread Alberto Garcia
heng Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH 11/11] qemu-iotests: test overlapping block-stream operations

2015-05-15 Thread Alberto Garcia
On Fri 15 May 2015 04:56:09 AM CEST, Fam Zheng wrote: >> +# If node4 is the active node, the id of the block job is drive0 >> +if self.num_imgs == 5: > > Isn't self.num_imgs a constant (9) ? Yes, but the number is arbitrary. The idea is to let users change it if they want to, so t

Re: [Qemu-devel] [PATCH 04/11] block: Support streaming to an intermediate layer

2015-05-15 Thread Alberto Garcia
On Fri 15 May 2015 04:33:19 AM CEST, Fam Zheng wrote: >> +/* Make sure that the image is opened in read-write mode */ >> +orig_bs_flags = bdrv_get_flags(bs); >> +if (!(orig_bs_flags & BDRV_O_RDWR)) { >> +if (bdrv_reopen(bs, orig_bs_flags | BDRV_O_RDWR, errp) != 0) { > > I don't

Re: [Qemu-devel] [PATCH 1/1] docs: document how to configure the qcow2 L2/refcount caches

2015-05-18 Thread Alberto Garcia
On Mon 18 May 2015 06:28:03 PM CEST, Max Reitz wrote: >> +This work is licensed under the terms of the GNU GPL, version 2 or >> +later. See the COPYING file in the top-level directory. > > Well, GPL is strange for documentation but I guess it works (also, > it's the implicit license for any docum

[Qemu-devel] [PATCH 2/3] qcow2: add option to clean unused cache entries after some time

2015-05-18 Thread Alberto Garcia
ring periods of inactivity. This feature currently relies on MADV_DONTNEED to free that memory, so it is not useful in systems that don't follow that behavior. Signed-off-by: Alberto Garcia --- block/qcow2-cache.c | 35 block

[Qemu-devel] [PATCH 0/3] Clean unused entries in the qcow2 L2/refcount cache

2015-05-18 Thread Alberto Garcia
These patches use MADV_DONTNEED to clean unused cache entries. Under Linux it frees the memory used by those pages. Berto Alberto Garcia (3): qcow2: mark the memory as no longer needed after qcow2_cache_empty() qcow2: add option to clean unused cache entries after some time qcow2: reorder

[Qemu-devel] [PATCH 3/3] qcow2: reorder fields in Qcow2CachedTable to reduce padding

2015-05-18 Thread Alberto Garcia
Changing the current ordering saves 8 bytes per cache entry in x86_64. Signed-off-by: Alberto Garcia --- block/qcow2-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index a215f5b..43590ff 100644 --- a/block/qcow2-cache.c

[Qemu-devel] [PATCH 1/3] qcow2: mark the memory as no longer needed after qcow2_cache_empty()

2015-05-18 Thread Alberto Garcia
(and fills both caches), then it empties the top image. At this point the data in that cache is no longer needed so it's just wasting memory. Signed-off-by: Alberto Garcia --- block/qcow2-cache.c | 20 1 file changed, 20 insertions(+) diff --git a/block/qcow2-cache.c b/

Re: [Qemu-devel] [PATCH v4 05/16] qapi: Simplify c_enum_const()

2015-05-19 Thread Alberto Garcia
On Thu 14 May 2015 02:50:51 PM CEST, Eric Blake wrote: > From: Markus Armbruster > > Signed-off-by: Markus Armbruster > Signed-off-by: Eric Blake Reviewed-by: Alberto Garcia Berto

[Qemu-devel] [PATCH 3/8] throttle: Add throttle group infrastructure tests

2015-05-19 Thread Alberto Garcia
Signed-off-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi --- tests/test-throttle.c | 79 --- 1 file changed, 69 insertions(+), 10 deletions(-) diff --git a/tests/test-throttle.c b/tests/test-throttle.c index 458f577..aa0e297 100644 --- a/tests

[Qemu-devel] [PATCH 8/8] qemu-iotests: expand test 093 to support group throttling

2015-05-19 Thread Alberto Garcia
and 3 drives, but the maximum number of simultaneous drives is configurable. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/093 | 93 +++--- 1 file changed, 65 insertions(+), 28 deletions(-) diff --git a/tests/qemu-iotests/093 b/tests/qemu

[Qemu-devel] [PATCH 7/8] throttle: Update throttle infrastructure copyright

2015-05-19 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- include/qemu/throttle.h | 8 +--- util/throttle.c | 8 +--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h index 2c560db..5af76f0 100644 --- a/include/qemu/throttle.h +++ b

[Qemu-devel] [PATCH 2/8] throttle: Add throttle group infrastructure

2015-05-19 Thread Alberto Garcia
Signed-off-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi --- block/Makefile.objs | 1 + block/throttle-groups.c | 261 include/block/block_int.h | 1 + include/block/throttle-groups.h | 39 ++ 4 files changed, 302

[Qemu-devel] [PATCH v8 0/8] Block Throttle Group Support

2015-05-19 Thread Alberto Garcia
that there was actually a request in the queue, and schedule a new one otherwise. - Protect bdrv_swap() by locking the throttling group. - throttle_group_co_io_limits_intercept() is now marked as a coroutine function. - Documentation updates. Regards, Berto Alberto Garcia (7): thr

[Qemu-devel] [PATCH 5/8] throttle: acquire the ThrottleGroup lock in bdrv_swap()

2015-05-19 Thread Alberto Garcia
hread can try to use them. Signed-off-by: Alberto Garcia --- block.c | 16 block/throttle-groups.c | 31 ++- include/block/throttle-groups.h | 3 +++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/bloc

[Qemu-devel] [PATCH 6/8] throttle: add the name of the ThrottleGroup to BlockDeviceInfo

2015-05-19 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- block/qapi.c | 3 +++ hmp.c| 6 -- qapi/block-core.json | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index a5ac312..a738148 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -93,6

[Qemu-devel] [PATCH 1/8] throttle: Extract timers from ThrottleState into a separate structure

2015-05-19 Thread Alberto Garcia
common ThrottleState to have its own timer. Signed-off-by: Benoit Canet Signed-off-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi --- block.c | 11 --- block/io.c| 24 -- include/block/block_int.h | 1 + include/qemu/throttle.h | 38

[Qemu-devel] [PATCH 4/8] throttle: Add throttle group support

2015-05-19 Thread Alberto Garcia
timer will be armed so the token will become the next active BDS. Signed-off-by: Alberto Garcia --- block.c | 15 +-- block/io.c | 75 +++--- block/qapi.c| 5 +- block/throttle-groups.c | 214

Re: [Qemu-devel] [PATCH 1/2] qobject: Use 'bool' for qbool

2015-05-19 Thread Alberto Garcia
On Sat 16 May 2015 12:24:59 AM CEST, Eric Blake wrote: > We require a C99 compiler, so let's use 'bool' instead of 'int' > when dealing with boolean values. There are few enough clients > to fix them all in one pass. > > Signed-off-by: Eric Blake Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH 2/2] qobject: Use 'bool' inside qdict

2015-05-19 Thread Alberto Garcia
emantics. > > Signed-off-by: Eric Blake Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH] MAINTAINERS: Add header files to Block Layer Core section

2015-05-20 Thread Alberto Garcia
On Wed 20 May 2015 12:05:55 PM CEST, Kevin Wolf wrote: > Suggested-by: Markus Armbruster > Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH 01/34] qdict: Add qdict_array_entries()

2015-05-20 Thread Alberto Garcia
On Fri 08 May 2015 10:06:35 PM CEST, Eric Blake wrote: >> +for (i = 0; i < UINT_MAX; i++) { >> +QObject *subqobj; >> +int subqdict_entries; >> +size_t slen = 32 + subqdict_len; >> +char indexstr[slen], prefix[slen]; > > And more dependence on a working C99 compi

Re: [Qemu-devel] [Qemu-block] [PATCH 03/34] quorum: Use bdrv_open_image()

2015-05-20 Thread Alberto Garcia
-by: Kevin Wolf Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH 05/34] block: Use macro for cache option names

2015-05-20 Thread Alberto Garcia
On Fri 08 May 2015 07:21:37 PM CEST, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH 1/3] qcow2: mark the memory as no longer needed after qcow2_cache_empty()

2015-05-26 Thread Alberto Garcia
On Tue 26 May 2015 05:39:12 PM CEST, Max Reitz wrote: >> After having emptied the cache, the data in the cache tables is no >> longer useful, so we can tell the kernel that we are done with it. In >> Linux this frees the resources associated with it. > Looks good, but by applying the same logic,

Re: [Qemu-devel] [PATCH 3/3] qcow2: reorder fields in Qcow2CachedTable to reduce padding

2015-05-26 Thread Alberto Garcia
On Tue 26 May 2015 06:10:11 PM CEST, Max Reitz wrote: > On 18.05.2015 18:48, Alberto Garcia wrote: >> Changing the current ordering saves 8 bytes per cache entry in x86_64. > > Hm, not seven? No, the size is 32 before the patch and 24 afterwards. What you save is the 7 bytes o

[Qemu-devel] [PATCH 3/3] qcow2: reorder fields in Qcow2CachedTable to reduce padding

2015-05-26 Thread Alberto Garcia
Changing the current ordering saves 8 bytes per cache entry in x86_64. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index a215f5b..43590ff 100644 --- a

[Qemu-devel] [PATCH 2/3] qcow2: add option to clean unused cache entries after some time

2015-05-26 Thread Alberto Garcia
ring periods of inactivity. This feature currently relies on MADV_DONTNEED to free that memory, so it is not useful in systems that don't follow that behavior. Signed-off-by: Alberto Garcia --- block/qcow2-cache.c | 35 block

[Qemu-devel] [PATCH 1/3] qcow2: mark the memory as no longer needed after qcow2_cache_empty()

2015-05-26 Thread Alberto Garcia
fills both caches), then it empties the top image. At this point the data in that cache is no longer needed so it's just wasting memory. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-cache.c | 20 1 file changed, 20 insertions(+) diff --git a/

[Qemu-devel] [PATCH v2 0/3] Clean unused entries in the qcow2 L2/refcount cache

2015-05-26 Thread Alberto Garcia
.html Regards, Berto Alberto Garcia (3): qcow2: mark the memory as no longer needed after qcow2_cache_empty() qcow2: add option to clean unused cache entries after some time qcow2: reorder fields in Qcow2CachedTable to reduce padding block/qcow2-cache.c | 57

Re: [Qemu-devel] [PATCH 2/3] qcow2: add option to clean unused cache entries after some time

2015-05-26 Thread Alberto Garcia
On Tue 26 May 2015 08:52:41 PM CEST, Eric Blake wrote: >> +# @cache-clean-interval: #optional clean unused entries in the L2 and >> refcount >> +# caches. The interval is in seconds (since 2.4) >> +# >> # Since: 1.7 > > Is there any QMP command that can query the curren

[Qemu-devel] [PATCH 3/3] qcow2: reorder fields in Qcow2CachedTable to reduce padding

2015-05-27 Thread Alberto Garcia
Changing the current ordering saves 8 bytes per cache entry in x86_64. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Eric Blake --- block/qcow2-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index

[Qemu-devel] [PATCH v3 0/3] Clean unused entries in the qcow2 L2/refcount cache

2015-05-27 Thread Alberto Garcia
nd cast it accordingly to prevent it from overflowing. v1: https://lists.gnu.org/archive/html/qemu-devel/2015-05/msg03510.html Regards, Berto Alberto Garcia (3): qcow2: mark the memory as no longer needed after qcow2_cache_empty() qcow2: add option to clean unused cache entries after some ti

[Qemu-devel] [PATCH 2/3] qcow2: add option to clean unused cache entries after some time

2015-05-27 Thread Alberto Garcia
ring periods of inactivity. This feature currently relies on MADV_DONTNEED to free that memory, so it is not useful in systems that don't follow that behavior. Signed-off-by: Alberto Garcia Cc: Max Reitz --- block/qcow2-cache.c | 35 block

[Qemu-devel] [PATCH 1/3] qcow2: mark the memory as no longer needed after qcow2_cache_empty()

2015-05-27 Thread Alberto Garcia
fills both caches), then it empties the top image. At this point the data in that cache is no longer needed so it's just wasting memory. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-cache.c | 20 1 file changed, 20 insertions(+) diff --git a/

Re: [Qemu-devel] [PATCH 2/3] qcow2: add option to clean unused cache entries after some time

2015-05-27 Thread Alberto Garcia
On Wed 27 May 2015 02:27:35 PM CEST, Eric Blake wrote: >> +static void cache_clean_timer_init(BlockDriverState *bs, AioContext >> *context) > > This function sets up a timer for non-zero interval, but does nothing > if interval is zero. [1] Right, zero means there's no interval. I could clarify

Re: [Qemu-devel] [Qemu-block] [PATCH] blockdev: no need to drain+flush in hmp_drive_del

2015-05-28 Thread Alberto Garcia
On Thu 28 May 2015 04:17:09 PM CEST, Paolo Bonzini wrote: > bdrv_close already does that, and in fact hmp_drive_del would need > another drain after the flush (which bdrv_close does). So remove > the duplication. > > Signed-off-by: Paolo Bonzini Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH 2/3] qcow2: add option to clean unused cache entries after some time

2015-05-28 Thread Alberto Garcia
On Thu 28 May 2015 04:56:34 PM CEST, Max Reitz wrote: >> 'compat': 'str', >> '*lazy-refcounts': 'bool', >> '*corrupt': 'bool', >> - 'refcount-bits': 'int' >> + 'refcount-bits': 'int', >> + 'cache-clean-interval': 'int' >> } } > > I'm not too happy about ma

Re: [Qemu-devel] [PATCH 2/3] qcow2: add option to clean unused cache entries after some time

2015-05-28 Thread Alberto Garcia
On Thu 28 May 2015 05:14:12 PM CEST, Max Reitz wrote: 'compat': 'str', '*lazy-refcounts': 'bool', '*corrupt': 'bool', - 'refcount-bits': 'int' + 'refcount-bits': 'int', + 'cache-clean-interval': 'int' } } >>> I'm not

Re: [Qemu-devel] [PATCH 2/3] qcow2: add option to clean unused cache entries after some time

2015-05-28 Thread Alberto Garcia
On Thu 28 May 2015 05:23:40 PM CEST, Max Reitz wrote: Can we mark the parameter optional, and only provide it when it is non-zero? That way, qemu-img (which cannot set an interval) will not report it, and the only time it will appear is if it was set as part of opening the blo

Re: [Qemu-devel] [PATCH 2/3] qcow2: add option to clean unused cache entries after some time

2015-05-28 Thread Alberto Garcia
On Thu 28 May 2015 06:44:55 PM CEST, Kevin Wolf wrote: >> Yeah, I'm not sure such duplication helps. I'd still like it >> reported somewhere, though, as it is nice to query that a requested >> setting is actually working. > > This isn't duplicated information. You can have ImageInfoSpecificQCow2 >

[Qemu-devel] [PATCH 3/3] qcow2: reorder fields in Qcow2CachedTable to reduce padding

2015-05-29 Thread Alberto Garcia
Changing the current ordering saves 8 bytes per cache entry in x86_64. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Eric Blake --- block/qcow2-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index

[Qemu-devel] [PATCH 1/3] qcow2: mark the memory as no longer needed after qcow2_cache_empty()

2015-05-29 Thread Alberto Garcia
fills both caches), then it empties the top image. At this point the data in that cache is no longer needed so it's just wasting memory. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-cache.c | 20 1 file changed, 20 insertions(+) diff --git a/

[Qemu-devel] [PATCH 2/3] qcow2: add option to clean unused cache entries after some time

2015-05-29 Thread Alberto Garcia
ring periods of inactivity. This feature currently relies on MADV_DONTNEED to free that memory, so it is not useful in systems that don't follow that behavior. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-cache.c | 35 block

[Qemu-devel] [PATCH v4 0/3] Clean unused entries in the qcow2 L2/refcount cache

2015-05-29 Thread Alberto Garcia
rom overflowing. v1: https://lists.gnu.org/archive/html/qemu-devel/2015-05/msg03510.html Regards, Berto Alberto Garcia (3): qcow2: mark the memory as no longer needed after qcow2_cache_empty() qcow2: add option to clean unused cache entries after some time qcow2: reorder fields in Qcow2C

Re: [Qemu-devel] [PATCH 8/8] qemu-iotests: expand test 093 to support group throttling

2015-05-29 Thread Alberto Garcia
On Fri 29 May 2015 02:32:45 PM CEST, Stefan Hajnoczi wrote: >> def setUp(self): >> -self.vm = iotests.VM().add_drive(self.test_img) >> +self.vm = iotests.VM() >> +for i in range(0, self.max_drives): >> +self.vm.add_drive(self.test_img) > > Unique files are

Re: [Qemu-devel] [PATCH 9/9] throttle: add name of ThrottleGroup to BlockDeviceInfo

2015-03-03 Thread Alberto Garcia
On Wed, Mar 04, 2015 at 08:09:22AM +0100, Markus Armbruster wrote: > >> { 'type': 'ThrottleGroupInfo', > >> 'data': { 'name': 'str', 'nodes': ['BlockDeviceInfo'] } } > >> > >> { 'command': 'query-block-throttle', > >> 'returns': ['ThrottleGroupInfo'] } > We need a coherent set of block queri

Re: [Qemu-devel] [PATCH 2/9] throttle: Add throttle group infrastructure

2015-03-04 Thread Alberto Garcia
On Tue, Mar 03, 2015 at 10:38:45AM -0600, Stefan Hajnoczi wrote: > > +qemu_mutex_init(&tg->lock); > > +throttle_init(&tg->ts); > > +QLIST_INIT(&tg->head); > > +tg->refcount = 1; > > + > > +/* insert new entry in the list */ > > +QTAILQ_INSERT_TAIL(&throttle_groups, tg, list

Re: [Qemu-devel] [PATCH 7/9] throttle: Add throttle group support

2015-03-04 Thread Alberto Garcia
On Tue, Mar 03, 2015 at 03:00:06PM -0600, Stefan Hajnoczi wrote: > > +throttle_group_lock(bs->throttle_state); > > +bdrv_throttle_group_remove(bs); > > +throttle_group_unlock(bs->throttle_state); > > + > > +throttle_group_unref(bs->throttle_state); > > +bs->throttle_state = NUL

Re: [Qemu-devel] [PATCH 7/9] throttle: Add throttle group support

2015-03-04 Thread Alberto Garcia
On Wed, Mar 04, 2015 at 10:04:27AM -0600, Stefan Hajnoczi wrote: > > > This pattern suggests throttle_timer_fired() should acquire the > > > lock internally instead. > > > > The idea is that the ThrottleState code itself doesn't know > > anything about locks or groups. As I understood it BenoƮt >

Re: [Qemu-devel] [PATCH 1/3] block: Support streaming to an intermediate layer

2015-03-05 Thread Alberto Garcia
On Thu, Mar 05, 2015 at 03:04:25PM +0100, Kevin Wolf wrote: > The bs parameter is now only used for the following things: > > 1. As the default for top Right. > 2. For error handling: Any errors are reported for bs, even though >they are actually for top. Is this correct behaviour? It looks

Re: [Qemu-devel] [PATCH 2/3] block: Add QMP support for streaming to an intermediate layer

2015-03-05 Thread Alberto Garcia
On Thu, Mar 05, 2015 at 03:09:58PM +0100, Kevin Wolf wrote: > > { 'command': 'block-stream', > > - 'data': { 'device': 'str', '*base': 'str', '*backing-file': 'str', > > -'*speed': 'int', '*on-error': 'BlockdevOnError' } } > > + 'data': { 'device': 'str', '*base': 'str', '*top': 'st

Re: [Qemu-devel] [PATCH 1/3] block: Support streaming to an intermediate layer

2015-03-05 Thread Alberto Garcia
On Thu, Mar 05, 2015 at 04:15:52PM +0100, Kevin Wolf wrote: > > > 3. As the BDS that owns the job > > > > > > My question is whether we can't simply call stream_start() > > > with an intermediate node as bs instead of introducing a new > > > parameter. I'm not completely sure about the consequenc

[Qemu-devel] [PATCH 6/6] throttle: Update throttle infrastructure copyright

2015-03-10 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- include/qemu/throttle.h | 8 +--- util/throttle.c | 8 +--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h index 2c560db..5af76f0 100644 --- a/include/qemu/throttle.h +++ b

[Qemu-devel] [PATCH 2/6] throttle: Add throttle group infrastructure

2015-03-10 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- block/Makefile.objs | 1 + block/throttle-groups.c | 244 include/block/block_int.h | 1 + include/block/throttle-groups.h | 41 +++ 4 files changed, 287 insertions(+) create mode

[Qemu-devel] [PATCH 5/6] throttle: add the name of the ThrottleGroup to BlockDeviceInfo

2015-03-10 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- block/qapi.c | 3 +++ hmp.c| 6 -- qapi/block-core.json | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index abeeb38..a0c7e6e 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -91,6

[Qemu-devel] [PATCH 3/6] throttle: Add throttle group infrastructure tests

2015-03-10 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- tests/test-throttle.c | 37 +++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/tests/test-throttle.c b/tests/test-throttle.c index 458f577..995d41d 100644 --- a/tests/test-throttle.c +++ b/tests/test-throttle.c

[Qemu-devel] [PATCH 1/6] throttle: Extract timers from ThrottleState into a separate structure

2015-03-10 Thread Alberto Garcia
common ThrottleState to have its own timer. Signed-off-by: Benoit Canet Signed-off-by: Alberto Garcia --- block.c | 35 include/block/block_int.h | 1 + include/qemu/throttle.h | 38 ++ tests/test-throttle.c | 82

[Qemu-devel] [PATCH v3 0/6] Block Throttle Group Support

2015-03-10 Thread Alberto Garcia
rottling groups, but since there is no consensus yet I haven't included it in this series. And I think that's all. As usual, comments and feedback are welcome. Berto Alberto Garcia (5): throttle: Add throttle group infrastructure throttle: Add throttle group infrastructure tests

Re: [Qemu-devel] [PATCH 0/1] Get the list of arguments from a QMP command

2015-03-11 Thread Alberto Garcia
On Fri, Mar 06, 2015 at 10:11:39AM -0700, Eric Blake wrote: > I'm still thinking about the actual patch, and whether we want > to commit to this or just bite the bullet and go for full > introspection. At any rate, it's a bit late for 2.3, so we have the > full 2.4 cycle to get it right. I under

Re: [Qemu-devel] [PATCH 2/3] block: Add QMP support for streaming to an intermediate layer

2015-03-11 Thread Alberto Garcia
On Thu, Mar 05, 2015 at 03:09:58PM +0100, Kevin Wolf wrote: > > { 'command': 'block-stream', > > - 'data': { 'device': 'str', '*base': 'str', '*backing-file': 'str', > > -'*speed': 'int', '*on-error': 'BlockdevOnError' } } > > + 'data': { 'device': 'str', '*base': 'str', '*top': 'st

[Qemu-devel] [PATCH 4/6] throttle: Add throttle group support

2015-03-12 Thread Alberto Garcia
timer will be armed so the token will become the next active BDS. Signed-off-by: Alberto Garcia --- block.c | 65 ++-- block/qapi.c| 5 +- block/throttle-groups.c | 127 blockdev.c

Re: [Qemu-devel] [PATCH 0/1] Get the list of arguments from a QMP command

2015-03-12 Thread Alberto Garcia
On Wed, Mar 11, 2015 at 11:21:43AM +0100, Markus Armbruster wrote: > > I can actually try to implement full introspection support, but I > > would like to know what API you would like. Something like this? > > > >'query-commands' > >'query-enums' > >'query-events' > >'query-types'

Re: [Qemu-devel] [PATCH 1/3] block: Support streaming to an intermediate layer

2015-03-12 Thread Alberto Garcia
(Ccing Markus and Jeff as suggested) On Thu, Mar 05, 2015 at 03:04:25PM +0100, Kevin Wolf wrote: > My question is whether we can't simply call stream_start() with an > intermediate node as bs instead of introducing a new parameter. I'm > not completely sure about the consequences of 3., i.e. movi

Re: [Qemu-devel] [PATCH] block/throttle: Use host clock type

2015-03-13 Thread Alberto Garcia
itted bypassing the throttling settings. But that's not related to these changes. > Signed-off-by: Fam Zheng > --- > block.c | 2 +- > tests/test-throttle.c | 14 +++--- > 2 files changed, 8 insertions(+), 8 deletions(-) Reviewed-By: Alberto Garcia Berto

[Qemu-devel] [PATCH] MAINTAINERS: Add myself as the maintainer of the Quorum driver

2015-03-16 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d7e9ba2..1fcf1e0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1176,3 +1176,8 @@ Bootdevice M: Gonglei S: Maintained F: bootdevice.c + +Quorum +M: Alberto

Re: [Qemu-devel] [PATCH qom v1 3/4] irq: Allocate IRQs individually

2014-06-02 Thread Alberto Garcia
2 +- > hw/ipack/ipack.c | 2 +- > include/hw/irq.h | 2 +- > 5 files changed, 11 insertions(+), 17 deletions(-) Acked-by: Alberto Garcia

Re: [Qemu-devel] [PATCH 05/16] block: Convert bs->file to BdrvChild

2015-09-25 Thread Alberto Garcia
On Thu 17 Sep 2015 03:48:09 PM CEST, Kevin Wolf wrote: > @@ -1929,6 +1925,11 @@ void bdrv_close(BlockDriverState *bs) > bdrv_unref(backing_hd); > } > > +if (bs->file != NULL) { > +bdrv_unref(bs->file->bs); > +bs->file = NULL; > +} >

Re: [Qemu-devel] [PATCH] block: disable I/O limits at the beginning of bdrv_close()

2015-09-25 Thread Alberto Garcia
On Fri 25 Sep 2015 04:22:26 PM CEST, Eric Blake wrote: >> Disabling I/O limits from a BDS also drains all pending throttled >> requests, so it should be done at the beginning of bdrv_close() with >> the rest of the bdrv_drain() calls before the BlockDriver is closed. > > Can this be abused? If I h

Re: [Qemu-devel] [PATCH] block: disable I/O limits at the beginning of bdrv_close()

2015-09-28 Thread Alberto Garcia
On Mon 28 Sep 2015 02:18:33 AM CEST, Fam Zheng wrote: >> > Can this be abused? If I have a guest running in a cloud where the >> > cloud provider has put severe throttling limits on me, but lets me >> > hotplug to my heart's content, couldn't I just repeatedly >> > plug/unplug the disk to get aro

Re: [Qemu-devel] [PATCH 08/16] block: Manage backing file references in bdrv_set_backing_hd()

2015-09-28 Thread Alberto Garcia
On Thu 17 Sep 2015 03:48:12 PM CEST, Kevin Wolf wrote: > --- a/block/stream.c > +++ b/block/stream.c > @@ -55,28 +55,7 @@ static int coroutine_fn stream_populate(BlockDriverState > *bs, > static void close_unused_images(BlockDriverState *top, BlockDriverState > *base, >

Re: [Qemu-devel] [PATCH 10/16] block/io: Make bdrv_requests_pending() public

2015-09-28 Thread Alberto Garcia
On Thu 17 Sep 2015 03:48:14 PM CEST, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > block/io.c| 2 +- > include/block/block_int.h | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH 12/16] block: Introduce parents list

2015-09-28 Thread Alberto Garcia
On Thu 17 Sep 2015 03:48:16 PM CEST, Kevin Wolf wrote: > @@ -1090,6 +1090,7 @@ static BdrvChild *bdrv_attach_child(BlockDriverState > *parent_bs, > }; > > QLIST_INSERT_HEAD(&parent_bs->children, child, next); > +QLIST_INSERT_HEAD(&child_bs->parents, child, next_parent); > >

Re: [Qemu-devel] [PATCH 16/16] block: Remove bdrv_swap()

2015-09-28 Thread Alberto Garcia
On Thu 17 Sep 2015 03:48:20 PM CEST, Kevin Wolf wrote: > bdrv_swap() is unused now. Remove it and all functions that have > no other users than bdrv_swap(). In particular, this removes the > .bdrv_rebind callbacks from block drivers. > > Signed-off-by: Kevin Wolf Reviewed-by:

[Qemu-devel] [PATCH v2] iotests: disable core dumps in test 061

2015-09-28 Thread Alberto Garcia
abort() will produce a core dump, we should use SIGKILL instead (that does not produce any) and update the test output accordingly. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/061 | 8 tests/qemu-iotests/061.out | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff

Re: [Qemu-devel] [PATCH v5 03/38] blockdev: Allow creation of BDS trees without BB

2015-09-29 Thread Alberto Garcia
cified; otherwise, > the BDS tree would no longer be accessible. > > Many BDS options which are not parsed by bdrv_open() (like caching) > cannot be specified for these BB-less BDS trees yet. A future patch will > remove this limitation. > > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH v5 02/38] block: Set BDRV_O_INCOMING in bdrv_fill_options()

2015-09-29 Thread Alberto Garcia
z Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH v5 07/38] block: Make bdrv_is_inserted() recursive

2015-09-29 Thread Alberto Garcia
On Fri 18 Sep 2015 05:22:42 PM CEST, Max Reitz wrote: > If bdrv_is_inserted() is called on the top level BDS, it should make > sure all nodes in the BDS tree are actually inserted. > > Signed-off-by: Max Reitz > --- > block.c | 12 +--- > 1 file changed, 9 insertions(+), 3 deletions(-) >

Re: [Qemu-devel] [PATCH v5 08/38] block/raw_bsd: Drop raw_is_inserted()

2015-09-29 Thread Alberto Garcia
On Fri 18 Sep 2015 05:22:43 PM CEST, Max Reitz wrote: > With the new automatically-recursive implementation of > bdrv_is_inserted() checking by default whether all the children of a BDS > are inserted, we can drop raw's own implementation. > > Signed-off-by: Max Reitz

Re: [Qemu-devel] [PATCH v5 17/38] block: Add BlockBackendRootState

2015-09-29 Thread Alberto Garcia
On Tue 22 Sep 2015 05:00:05 PM CEST, Max Reitz wrote: >> The correct way to solve this seems to be that each BB has its own >> I/O throttling filter. Actually, if we could lift the throttling code >> to BlockBackend, that might solve the problem. > > So yes, as long as we have throttling on the BD

Re: [Qemu-devel] [PATCH 12/16] block: Introduce parents list

2015-09-30 Thread Alberto Garcia
On Tue 29 Sep 2015 02:21:37 PM CEST, Kevin Wolf wrote: >> > @@ -1090,6 +1090,7 @@ static BdrvChild *bdrv_attach_child(BlockDriverState >> > *parent_bs, >> > }; >> > >> > QLIST_INSERT_HEAD(&parent_bs->children, child, next); >> > +QLIST_INSERT_HEAD(&child_bs->parents, child, next_pa

Re: [Qemu-devel] [PATCH v5 24/38] blockdev: Pull out blockdev option extraction

2015-09-30 Thread Alberto Garcia
ned-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

[Qemu-devel] [PATCH v2 12/22] qemu-io: Account for failed, invalid and flush operations

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- qemu-io-cmds.c | 9 + 1 file changed, 9 insertions(+) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index d6572a8..f8f02ab 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -1364,6 +1364,7 @@ static void aio_write_done(void *opaque, int ret) if

[Qemu-devel] [PATCH v2 06/22] block: Add "supports_stats" field to BlockStats

2015-10-02 Thread Alberto Garcia
igned-off-by: Alberto Garcia --- block/qapi.c | 2 ++ qapi/block-core.json | 3 +++ qmp-commands.hx | 6 ++ 3 files changed, 11 insertions(+) diff --git a/block/qapi.c b/block/qapi.c index 66f2604..518b658 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -343,6 +343,8 @@ s

[Qemu-devel] [PATCH v2 18/22] atapi: Account for failed and invalid operations

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- hw/ide/atapi.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 747f466..cf0b78e 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -108,27 +108,30 @@ static void

[Qemu-devel] [PATCH v2 07/22] block: Add statistics for failed and invalid I/O operations

2015-10-02 Thread Alberto Garcia
y are cancelled immediately when they are started. Signed-off-by: Alberto Garcia --- block/accounting.c | 18 ++ block/qapi.c | 10 ++ include/block/accounting.h | 4 qapi/block-core.json | 23 ++- qmp-commands.hx

[Qemu-devel] [PATCH v2 04/22] util: Infrastructure for computing recent averages

2015-10-02 Thread Alberto Garcia
both windows and the data is always returned from the oldest one. Signed-off-by: Alberto Garcia --- include/qemu/timed-average.h | 63 + tests/Makefile | 4 + tests/test-timed-average.c | 89 ++ util/Makefile.objs | 1 + util/timed

[Qemu-devel] [PATCH v2 10/22] block: Add average I/O queue depth to BlockDeviceTimedStats

2015-10-02 Thread Alberto Garcia
This patch adds two new fields to BlockDeviceTimedStats that track the average number of pending read and write requests for a block device. The values are calculated for the period of time defined for that interval. Signed-off-by: Alberto Garcia --- block/accounting.c | 12

[Qemu-devel] [PATCH v2 08/22] block: Allow configuring whether to account failed and invalid ops

2015-10-02 Thread Alberto Garcia
This patch adds two options, "stats-account-invalid" and "stats-account-failed", that can be used to decide whether invalid and failed I/O operations must be used when collecting statistics for latency and last access time. Signed-off-by: Alberto Garcia --- block/accou

[Qemu-devel] [PATCH v2 11/22] block: New option to define the intervals for collecting I/O statistics

2015-10-02 Thread Alberto Garcia
intervals. Signed-off-by: Alberto Garcia --- blockdev.c | 37 + qapi/block-core.json | 4 2 files changed, 41 insertions(+) diff --git a/blockdev.c b/blockdev.c index 61a80fb..86dd03c 100644 --- a/blockdev.c +++ b/blockdev.c @@ -462,6 +462,7

[Qemu-devel] [PATCH v2 21/22] scsi-disk: Account for failed operations

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- hw/scsi/scsi-disk.c | 46 +++--- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index bada9a7..20a31a7 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c

[Qemu-devel] [PATCH v2 02/22] ide: Account for write operations correctly

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- hw/ide/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 317406d..b559f1b 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -895,7 +895,7 @@ static void ide_sector_write(IDEState *s

[Qemu-devel] [PATCH v2 09/22] block: Compute minimum, maximum and average I/O latencies

2015-10-02 Thread Alberto Garcia
: Alberto Garcia --- block/accounting.c | 43 ++ block/block-backend.c | 1 + block/qapi.c | 28 + include/block/accounting.h | 14 + qapi/block-core.json | 52

[Qemu-devel] [PATCH v2 03/22] block: define 'clock_type' for the accounting code

2015-10-02 Thread Alberto Garcia
Its value is still QEMU_CLOCK_REALTIME, but having it in a variable will allow us to change its value easily in the future when running in qtest mode. Signed-off-by: Alberto Garcia --- block/accounting.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block

[Qemu-devel] [PATCH v2 01/22] xen_disk: Account for flush operations

2015-10-02 Thread Alberto Garcia
Currently both BLKIF_OP_WRITE and BLKIF_OP_FLUSH_DISKCACHE are being accounted as write operations. Signed-off-by: Alberto Garcia --- hw/block/xen_disk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 1bbc111..4869518

<    1   2   3   4   5   6   7   8   9   10   >