Re: [Qemu-devel] [PATCH v2 2/4] blockdev: Fix 'change' for slot devices

2016-01-22 Thread Alberto Garcia
On Wed 20 Jan 2016 07:29:19 PM CET, Max Reitz wrote: > @@ -2424,6 +2442,15 @@ static void qmp_blockdev_insert_anon_medium(const char > *device, > > blk_insert_bs(blk, bs); > > +if (!blk_dev_has_tray(blk)) { > +/* For tray-less devices, blockdev-close-tray is a no-op (or may no

Re: [Qemu-devel] [PATCH v3 2/4] blockdev: Fix 'change' for slot devices

2016-01-25 Thread Alberto Garcia
{insert,remove}-medium (for tray-less devices only). > > Reported-by: Peter Maydell > Cc: qemu-stable > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] RFC: Operation Blockers in QEMU Block Nodes

2016-01-25 Thread Alberto Garcia
Hi, I'm late to the party but I wanted to say that I generally like the idea of expressing the notion of op blockers in terms of the specific things that they allow and require in each one of the affected nodes. I don't know if all current operations can be expressed easily with these semantics,

Re: [Qemu-devel] QCOW rebases on running VMs

2016-01-29 Thread Alberto Garcia
On Thu, Jan 28, 2016 at 08:25:18AM -0700, Eric Blake wrote: > > Sadly what I need is block-stream to an intermediate layer (as I > > want to merge in the other direction); I don't think that proposal > > was ever implemented. > > > > http://wiki.qemu.org/Features/Snapshots#Streaming_to_an_Interme

Re: [Qemu-devel] [PULL 33/44] block: New option to define the intervals for collecting I/O statistics

2015-11-11 Thread Alberto Garcia
On Tue 10 Nov 2015 06:23:36 PM CET, Eric Blake wrote: >> +# @stats-intervals: #optional colon-separated list of intervals for >> +# collecting I/O statistics, in seconds (default: none) >> +# (Since 2.5) > > Eww. Sorry for not noticing this sooner, but can we p

[Qemu-devel] [PATCH] block: make 'stats-intervals' a list of integers

2015-11-11 Thread Alberto Garcia
This is the natural JSON representation and prevents us from having to decode the list manually. Signed-off-by: Alberto Garcia --- blockdev.c | 64 ++ qapi/block-core.json | 7 +++--- tests/qemu-iotests/136 | 2 +- 3 files changed

Re: [Qemu-devel] [Qemu-block] [PATCH v2 2/8] block: Add blk_next_inserted()

2015-11-11 Thread Alberto Garcia
On Tue 10 Nov 2015 04:27:43 AM CET, Max Reitz wrote: > This function skips to the next BlockBackend for which blk_is_inserted() > is true. > > Signed-off-by: Max Reitz > Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH for-2.5] block: make 'stats-intervals' a list of integers

2015-11-11 Thread Alberto Garcia
On Wed 11 Nov 2015 04:32:42 PM CET, Eric Blake wrote: >> -for (i = 0; !error && intervals[i] != NULL; i++) { >> +case QTYPE_QSTRING: { > >> +case QTYPE_QINT: { > > Why are we accepting both string and int here, but typing it as 'int' in > qapi? I guess its due t

Re: [Qemu-devel] [Qemu-block] [PATCH] iotests: fix race in 030

2015-11-12 Thread Alberto Garcia
he important thing is that we are still testing that it has stopped, > and that it finishes successfully after we send a resume command. > > Signed-off-by: John Snow Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PULL v3 00/43] Block layer patches (Stefan's tree)

2015-11-12 Thread Alberto Garcia
of the accounting code (2015-11-12 16:22:47 +0100) > > > Block layer patches (rebased Stefan's pull request) > > ---- > Alberto Garcia (21): > xen_disk: Account for flush operations > ide: Account for wr

Re: [Qemu-devel] [Qemu-block] [PATCH] block: make 'stats-intervals' a list of integers

2015-11-13 Thread Alberto Garcia
On Fri 13 Nov 2015 11:15:52 AM CET, Stefan Hajnoczi wrote: > blockdev.c: In function ‘blockdev_init’: > blockdev.c:636:17: error: ‘length’ may be used uninitialized in this function > [-Werror=maybe-uninitialized] > block_acct_add_interval(blk_get_stats(blk), length); >

[Qemu-devel] [PATCH for-2.5] block: Call external_snapshot_clean after blockdev-snapshot

2015-11-13 Thread Alberto Garcia
Otherwise the AioContext will never be released. Signed-off-by: Alberto Garcia --- blockdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/blockdev.c b/blockdev.c index fc85128..4dcc510 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2070,6 +2070,7 @@ static const BlkActionOps actions

[Qemu-devel] [PATCH v2 1/1] block: make 'stats-interval' an array of ints instead of a string

2015-11-16 Thread Alberto Garcia
This is the natural JSON representation and prevents us from having to decode the list manually. Signed-off-by: Alberto Garcia --- blockdev.c | 91 +++--- qapi/block-core.json | 7 ++-- tests/qemu-iotests/136 | 2 +- 3 files changed

[Qemu-devel] [PATCH for-2.5 v2 0/1] block: make 'stats-interval' an array of ints instead of a string

2015-11-16 Thread Alberto Garcia
l_dict and interval_list are now initialized to NULL v1: https://lists.gnu.org/archive/html/qemu-block/2015-11/msg00432.html Regards, Berto Alberto Garcia (1): block: make 'stats-interval' an array of ints instead of a string blockdev.c | 91 +++-

Re: [Qemu-devel] [Qemu-block] [PATCH] block: make 'stats-intervals' a list of integers

2015-11-16 Thread Alberto Garcia
On Mon 16 Nov 2015 04:46:44 AM CET, Stefan Hajnoczi wrote: >> early_err: >> qemu_opts_del(opts); >> +QDECREF(interval_dict); >> +QDECREF(interval_list); > > There is a codepath that reaches here without initializing interval_dict > or interval_list: > > qemu_opts_absorb_qdict(opts,

[Qemu-devel] [PATCH for-2.5 2/2] atapi: Fix code indentation

2015-11-24 Thread Alberto Garcia
This was accidentally changed by commit 5f81724d Signed-off-by: Alberto Garcia --- hw/ide/atapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 5e3791c..65f8dd4 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -443,7 +443,7 @@ eot

[Qemu-devel] [PATCH for-2.5 1/2] atapi: Account for failed and invalid operations in cd_read_sector()

2015-11-24 Thread Alberto Garcia
Commit 5f81724d made PIO read requests async but didn't add the relevant block_acct_failed() and block_acct_invalid() calls. Signed-off-by: Alberto Garcia --- hw/ide/atapi.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 7b

Re: [Qemu-devel] [Qemu-block] [PATCH for-2.5 1/2] atapi: Account for failed and invalid operations in cd_read_sector()

2015-11-24 Thread Alberto Garcia
On Tue 24 Nov 2015 01:47:52 PM CET, Kevin Wolf wrote: > Am 24.11.2015 um 13:17 hat Alberto Garcia geschrieben: >> Commit 5f81724d made PIO read requests async but didn't add the >> relevant block_acct_failed() and block_acct_invalid() calls. >> >> Signed-off-

[Qemu-devel] [PATCH for-2.5] xen_disk: Remove ioreq.postsync

2015-11-25 Thread Alberto Garcia
This code has been dead for three years (since commit 7e7b7cba1). Signed-off-by: Alberto Garcia --- hw/block/xen_disk.c | 8 1 file changed, 8 deletions(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 02eda6e..8146650 100644 --- a/hw/block/xen_disk.c +++ b/hw/block

[Qemu-devel] [PATCH 09/13] throttle: Add command-line settings to define the burst periods

2016-02-05 Thread Alberto Garcia
This patch adds all the throttling.*-max-length command-line parameters to define the length of the burst periods. Signed-off-by: Alberto Garcia --- blockdev.c | 37 + 1 file changed, 37 insertions(+) diff --git a/blockdev.c b/blockdev.c index c9e91ab

[Qemu-devel] [PATCH 11/13] qapi: Add burst length fields to BlockDeviceInfo

2016-02-05 Thread Alberto Garcia
This patch adds the new bps_*_max_length and iops_*_max_length parameters to the BlockDeviceInfo struct. Signed-off-by: Alberto Garcia --- block/qapi.c | 20 qapi/block-core.json | 39 +-- 2 files changed, 53 insertions(+), 6

[Qemu-devel] [PATCH 05/13] throttle: Set always an average value when setting a maximum value

2016-02-05 Thread Alberto Garcia
f the throttling configuration. This patch ensures that the value of bucket.avg is valid when setting bucket.max. Signed-off-by: Alberto Garcia --- tests/test-throttle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-throttle.c b/tests/test-throttle.c index 5f0b7d4..5031eb7 100644 --- a/

[Qemu-devel] [PATCH 04/13] throttle: Make throttle_is_valid() set errp

2016-02-05 Thread Alberto Garcia
The caller does not need to set it, and this will allow us to refactor this function later. Signed-off-by: Alberto Garcia --- blockdev.c | 4 +--- include/qemu/throttle.h | 2 +- tests/test-throttle.c | 2 +- util/throttle.c | 5 - 4 files changed, 7 insertions(+), 6

[Qemu-devel] [PATCH 13/13] throttle: Test throttle_compute_wait() during bursts

2016-02-05 Thread Alberto Garcia
This test simulates an I/O burst for more than two seconds and checks that it works as expected. Signed-off-by: Alberto Garcia --- tests/test-throttle.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/tests/test-throttle.c b/tests/test-throttle.c index 11ede23

[Qemu-devel] [PATCH 12/13] throttle: Check that burst_level leaks correctly

2016-02-05 Thread Alberto Garcia
This patch expands test_leak_bucket() to check that burst_level leaks correctly. Signed-off-by: Alberto Garcia --- tests/test-throttle.c | 16 1 file changed, 16 insertions(+) diff --git a/tests/test-throttle.c b/tests/test-throttle.c index cf81033..11ede23 100644 --- a/tests

[Qemu-devel] [PATCH 06/13] throttle: Merge all functions that check the configuration into one

2016-02-05 Thread Alberto Garcia
There's no need to keep throttle_conflicting(), throttle_is_valid() and throttle_max_is_missing_limit() as separate functions, so this patch merges all three into one. As a consequence, check_throttle_config() becomes redundant and can be replaced with throttle_is_valid(). Signed-off-by: Al

[Qemu-devel] [PATCH 10/13] qapi: Add burst length parameters to block_set_io_throttle

2016-02-05 Thread Alberto Garcia
This patch adds the new bps_*_max_length and iops_*_max_length parameters to the block_set_io_throttle command. Signed-off-by: Alberto Garcia --- blockdev.c | 31 +++ hmp.c| 12 qapi/block-core.json | 51

[Qemu-devel] [PATCH 01/13] throttle: Make throttle_compute_timer() static

2016-02-05 Thread Alberto Garcia
This function is only used internally in throttle.c Signed-off-by: Alberto Garcia --- include/qemu/throttle.h | 6 -- util/throttle.c | 8 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h index d0c98ed

[Qemu-devel] [PATCH 00/13] throttle: Allow I/O bursts for a user-defined period of time

2016-02-05 Thread Alberto Garcia
a more clear API. And I think that's all. Thanks! Berto Alberto Garcia (13): throttle: Make throttle_compute_timer() static throttle: Make throttle_conflicting() set errp throttle: Make throttle_max_is_missing_limit() set errp throttle: Make throttle_is_valid() set errp throttle: S

[Qemu-devel] [PATCH 03/13] throttle: Make throttle_max_is_missing_limit() set errp

2016-02-05 Thread Alberto Garcia
The caller does not need to set it, and this will allow us to refactor this function later. Signed-off-by: Alberto Garcia --- blockdev.c | 4 +--- include/qemu/throttle.h | 2 +- tests/test-throttle.c | 6 +++--- util/throttle.c | 5 - 4 files changed, 9 insertions

[Qemu-devel] [PATCH 02/13] throttle: Make throttle_conflicting() set errp

2016-02-05 Thread Alberto Garcia
The caller does not need to set it, and this will allow us to refactor this function later. Signed-off-by: Alberto Garcia --- blockdev.c | 4 +--- include/qemu/throttle.h | 2 +- tests/test-throttle.c | 12 ++-- util/throttle.c | 11 +-- 4 files changed

[Qemu-devel] [PATCH 07/13] throttle: Use throttle_config_init() to initialize ThrottleConfig

2016-02-05 Thread Alberto Garcia
. Signed-off-by: Alberto Garcia --- blockdev.c | 4 ++-- include/qemu/throttle.h | 2 ++ tests/test-throttle.c | 28 +--- util/throttle.c | 10 ++ 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/blockdev.c b/blockdev.c index

[Qemu-devel] [PATCH 08/13] throttle: Add support for burst periods

2016-02-05 Thread Alberto Garcia
This patch adds support for burst periods to the throttling code. With this feature the user can keep performing bursts as defined by the LeakyBucket.max rate for a configurable period of time. Signed-off-by: Alberto Garcia --- include/qemu/throttle.h | 41 +++ util

Re: [Qemu-devel] [PATCH V2] quorum: fix segfault when read fails in fifo mode

2016-02-05 Thread Alberto Garcia
On Fri 05 Feb 2016 03:25:22 AM CET, Changlong Xie wrote: > Signed-off-by: Wen Congyang > Signed-off-by: Changlong Xie Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH v9 03/16] block: Add BB-BDS remove/insert notifiers

2016-02-08 Thread Alberto Garcia
-off-by: Max Reitz > Reviewed-by: Kevin Wolf > Reviewed-by: Fam Zheng Reviewed-by: Alberto Garcia Berto

[Qemu-devel] [PATCH 3/3] block: Update the x-blockdev-del documentation

2016-02-08 Thread Alberto Garcia
Explain what happens if the user tries to delete a BlockBackend that contains media that was added separately using blockdev-add. Signed-off-by: Alberto Garcia --- qapi/block-core.json | 5 - qmp-commands.hx | 5 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/qapi

[Qemu-devel] [PATCH 1/3] block: Allow x-blockdev-del on a BB with a monitor-owned BDS

2016-02-08 Thread Alberto Garcia
ss the BDS is ejected first. This is an unnecessary restriction. Now that we have a list of monitor-owned BDSs we can allow x-blockdev-del to work in this scenario if the BDS has exactly one extra reference and that reference is from the monitor. Signed-off-by: Alberto Garcia --- block

[Qemu-devel] [PATCH 2/3] iotests: Update test 139 after the changes in x-blockdev-del

2016-02-08 Thread Alberto Garcia
functionality works as expected. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/139 | 30 +- tests/qemu-iotests/139.out | 4 ++-- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139 index a4b9694..a6fc299

Re: [Qemu-devel] [PATCH v9 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-02-08 Thread Alberto Garcia
On Fri 22 Jan 2016 09:02:10 PM CET, "Dr. David Alan Gilbert" wrote: >> In general, what do you do to make sure that the data in a new >> Quorum child is consistent with that of the rest of the array? >> >>> >> >>> Quorum can have more than one child when it starts. But we don't >> >>>

Re: [Qemu-devel] [PATCH 1/3] block: Allow x-blockdev-del on a BB with a monitor-owned BDS

2016-02-09 Thread Alberto Garcia
n this scenario if the BDS has exactly one >> extra reference and that reference is from the monitor. >> >> Signed-off-by: Alberto Garcia > > This means that what you created with two blockdev-add commands would be > destroyed with a single blockdev-del command. I think we all

Re: [Qemu-devel] [PATCH 1/3] block: Allow x-blockdev-del on a BB with a monitor-owned BDS

2016-02-09 Thread Alberto Garcia
On Tue 09 Feb 2016 04:34:09 PM CET, Eric Blake wrote: > On 02/08/2016 07:14 AM, Alberto Garcia wrote: > > When sending a multi-patch series, you should always include a 0/3 cover > letter. The cover letter is optional only for a lone patch. Sorry, I didn't know. The descrip

Re: [Qemu-devel] [PATCH 2/3] iotests: Update test 139 after the changes in x-blockdev-del

2016-02-09 Thread Alberto Garcia
On Tue 09 Feb 2016 04:36:31 PM CET, Eric Blake wrote: >> Both testAttachMedia() and testSnapshot() are splitted in two: one > > s/splitted/split/ (one of those weird English words whose past tense > is identical to present tense) :) >> tests/qemu-iotests/139 | 30 +--

[Qemu-devel] [PATCH v2 0/2] Allow x-blockdev-del on a BB with a monitor-owned BDS

2016-02-09 Thread Alberto Garcia
2 (with the tests) into the first one with the code [Eric] - s/splitted/split/ in the description of the tests [Eric] v1: https://lists.gnu.org/archive/html/qemu-block/2016-02/msg00247.html - Initial version Alberto Garcia (2): block: Allow x-blockdev-del on a BB with a monitor-owned BDS

[Qemu-devel] [PATCH v2 2/2] block: Update the x-blockdev-del documentation

2016-02-09 Thread Alberto Garcia
Explain what happens if the user tries to delete a BlockBackend that contains media that was added separately using blockdev-add. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- qapi/block-core.json | 5 - qmp-commands.hx | 5 - 2 files changed, 8 insertions(+), 2

[Qemu-devel] [PATCH v2 1/2] block: Allow x-blockdev-del on a BB with a monitor-owned BDS

2016-02-09 Thread Alberto Garcia
his change. Both testAttachMedia() and testSnapshot() are split in two: one version keeps the previous behavior, and a second version checks that the new functionality works as expected. Signed-off-by: Alberto Garcia --- blockdev.c | 13 ++--- tests/qemu-iotests/13

Re: [Qemu-devel] [PATCH 00/13] throttle: Allow I/O bursts for a user-defined period of time

2016-02-12 Thread Alberto Garcia
On Fri 12 Feb 2016 06:19:06 PM CET, Kevin Wolf wrote: > Anyway, the cover letter makes sense to me. And thanks for this great > writeup! Can we turn it into documentation? Throttling seems to be quite > underdocumented, and your explanation above let me understand for the > first time what these *

Re: [Qemu-devel] [PATCH 08/13] throttle: Add support for burst periods

2016-02-16 Thread Alberto Garcia
On Tue 16 Feb 2016 11:45:32 AM CET, Kevin Wolf wrote: >> +/* If the bucket is not full yet we have to make sure that we >> + * fulfill the goal of bkt->max units per second. */ >> +if (bkt->burst_length > 1) { >> +/* We use 1/10 of the max value to smooth the throttling. >> +

Re: [Qemu-devel] [Qemu-block] [PATCH 00/13] throttle: Allow I/O bursts for a user-defined period of time

2016-02-16 Thread Alberto Garcia
On Mon 15 Feb 2016 05:40:29 PM CET, Stefan Hajnoczi wrote: > On Fri, Feb 05, 2016 at 12:59:10PM +0200, Alberto Garcia wrote: >> - With this series we set "a maximum of X operations/second for a >>period of T seconds". If would also be possible to make it "a

Re: [Qemu-devel] [Qemu-block] [PATCH v2 01/21] qcow2: Add .bdrv_join_options callback

2015-11-30 Thread Alberto Garcia
adds a .bdrv_join_options callback to BlockDriver and > implements it for qcow2. > > Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH v2 02/21] block: Fix reopen with semantically overlapping options

2015-11-30 Thread Alberto Garcia
ld result in an options QDict that has both > "overlap-check.template=all" and "overlap-check=none", which obviously > conflicts. In this case, the old option should be overridden by the > newly specified option. > > Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH v2 03/21] mirror: Error out when a BDS would get two BBs

2015-11-30 Thread Alberto Garcia
On Mon 23 Nov 2015 04:59:42 PM CET, Kevin Wolf wrote: > @@ -370,11 +371,22 @@ static void mirror_exit(BlockJob *job, void *opaque) > if (s->to_replace) { > to_replace = s->to_replace; > } > + > +/* This was checked in mirror_start_job(), but meanwhile one of

Re: [Qemu-devel] [Qemu-block] [PATCH v2 05/21] block: Consider all block layer options in append_open_options

2015-11-30 Thread Alberto Garcia
> Signed-off-by: Kevin Wolf > Reviewed-by: Eric Blake > Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH 1/8] qapi: Drop QERR_UNKNOWN_BLOCK_FORMAT_FEATURE

2015-12-01 Thread Alberto Garcia
t do it here. > > This changes the output for iotest 036 (to the better, in my opinion), > so the reference output needs to be changed accordingly. > > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH 2/8] block: Drop useless bdrv_new() calls

2015-12-01 Thread Alberto Garcia
it, too. > > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH 4/8] block: Drop BB name from bad option error

2015-12-01 Thread Alberto Garcia
tribution is naturally unambiguous). Furthermore, as of a future > patch, bdrv_get_device_name(bs) will always return the empty string > before bdrv_open_inherit() returns. > > Therefore, just dropping that information seems to be the best course of > action. > > Signed-off-by: Max Re

Re: [Qemu-devel] [Qemu-block] [PATCH 5/8] block: Drop blk_new_with_bs()

2015-12-01 Thread Alberto Garcia
On Tue 10 Nov 2015 04:44:20 AM CET, Max Reitz wrote: > Its only caller is blk_new_open(), so we can just inline it there. Since > bdrv_new_root() is only a wrapper around bdrv_new(), we can just use > bdrv_new() instead. > > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH 6/8] block: Drop bdrv_new_root()

2015-12-01 Thread Alberto Garcia
On Tue 10 Nov 2015 04:44:21 AM CET, Max Reitz wrote: > It is unused now, so we may just as well drop it. > > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH 8/8] block: Assert !bs->refcnt in bdrv_close()

2015-12-01 Thread Alberto Garcia
s() which in turn assumes that no frozen > bitmaps are attached to the BDS). > > In addition, being called only in bdrv_delete() means that we can drop > bdrv_close()'s forward declaration at the top of block.c. > > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH 7/8] block: Make bdrv_open() return a BDS

2015-12-01 Thread Alberto Garcia
return statement: bs = bdrv_lookup_bs(reference, reference, errp); if (bs) { bdrv_ref(bs); } return bs; but I'm fine either way. Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH 3/8] block: Let bdrv_open_inherit() return the snapshot

2015-12-01 Thread Alberto Garcia
ing 'ret' anymore there's a "ret = total_size" line earlier in this function that is useless now. Other than that, Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH v2 07/21] block: Pass driver-specific options to .bdrv_refresh_filename()

2015-12-02 Thread Alberto Garcia
re already filtered out. Works much better this > way. > > Signed-off-by: Kevin Wolf > Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH v2 09/21] block: Allow specifying child options in reopen

2015-12-02 Thread Alberto Garcia
> Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH v2 18/21] blkdebug: Enable reopen

2015-12-02 Thread Alberto Garcia
On Mon 23 Nov 2015 04:59:57 PM CET, Kevin Wolf wrote: > Just reopening the children (as block.c does now) is enough. > > Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] blockdev: Error out on negative throttling option values

2016-01-12 Thread Alberto Garcia
On Mon 11 Jan 2016 06:42:38 AM CET, Fam Zheng wrote: > The implicit casting from unsigned int to double changes negative > values into large positive numbers, whereas explicitly casting to > signed integer first will let us catch the invalid value and report > error correctly: > > $ qemu-syst

Re: [Qemu-devel] [PATCH v2 2/2] iotests: Test that negative throttle values are rejected

2016-01-13 Thread Alberto Garcia
On Wed 13 Jan 2016 01:52:30 AM CET, Fam Zheng wrote: > +echo === Catching nagative throttling values === s/nagative/negative/ (there are several of these in the patch) You could also test the upper limits now. Berto

Re: [Qemu-devel] [PATCH v2 1/2] blockdev: Error out on negative throttling option values

2016-01-13 Thread Alberto Garcia
On Wed 13 Jan 2016 01:52:29 AM CET, Fam Zheng wrote: > The implicit casting from unsigned int to double changes negative values > into large positive numbers and accepts them. We should instead print > an error. > > Check the number range so this case is catched and reported. I still don't know

Re: [Qemu-devel] [PATCH v2 1/2] blockdev: Error out on negative throttling option values

2016-01-13 Thread Alberto Garcia
On Wed 13 Jan 2016 12:02:00 PM CET, Fam Zheng wrote: >> > Check the number range so this case is catched and reported. >> >> I still don't know why qemu_opt_get_number() convert silently >> negative numbers into positive ones, shouldn't it just fail with an >> "invalid parameter" error? > > Becau

Re: [Qemu-devel] [Qemu-block] [PATCH 1/4] block: Add blk_dev_has_tray()

2016-01-18 Thread Alberto Garcia
u-stable > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH 2/4] blockdev: Fix 'change' for slot devices

2016-01-18 Thread Alberto Garcia
{insert,remove}-medium (for tray-less devices only). > > Reported-by: Peter Maydell > Cc: qemu-stable > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [Qemu-block] [PATCH 4/4] block/qapi: Emit tray_open only if there is a tray

2016-01-18 Thread Alberto Garcia
On Tue 12 Jan 2016 04:47:54 PM CET, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > block/qapi.c | 2 +- > tests/qemu-iotests/067.out | 4 > 2 files changed, 1 insertion(+), 5 deletions(-) > > diff --git a/block/qapi.c b/block/qapi.c > index 58d3975..12a0f25 100644 > --- a

Re: [Qemu-devel] [PATCH v4 1/2] blockdev: Error out on negative throttling option values

2016-01-19 Thread Alberto Garcia
On Mon 18 Jan 2016 02:09:22 AM CET, Fam Zheng wrote: >> > -error_setg(errp, "bps/iops/maxs values must be 0 or greater"); >> > +error_setg(errp, "bps/iops/max values must be within [0, %" PRId64 >> > + ")", (int64_t)THROTTLE_VALUE_MAX); >> >> I think that s

Re: [Qemu-devel] [PATCH v4 2/2] iotests: Test that negative and large throttle values are rejected

2016-01-19 Thread Alberto Garcia
w that you're at it, you could also check that 0 and 1000 _do_ work. Either way, Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH v5 0/2] block: Reject negative values for throttling options

2016-01-20 Thread Alberto Garcia
Now the negative values are silently converted to a huge positive number > because we are doing implicit casting from uint64_t to double. Fix it and add > a > test case (this was once fixed in 7d81c1413c9 but regressed when the block > device option parsing code was changed). Series Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH v9 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-01-20 Thread Alberto Garcia
On Fri 25 Dec 2015 10:22:55 AM CET, Changlong Xie wrote: > @@ -875,9 +878,9 @@ static int quorum_open(BlockDriverState *bs, QDict > *options, int flags, > ret = -EINVAL; > goto exit; > } > -if (s->num_children < 2) { > +if (s->num_children < 1) { > error_set

Re: [Qemu-devel] [PATCH v9 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-01-21 Thread Alberto Garcia
On Thu 21 Jan 2016 02:54:10 AM CET, Wen Congyang wrote: >>> @@ -875,9 +878,9 @@ static int quorum_open(BlockDriverState *bs, QDict >>> *options, int flags, >>> ret = -EINVAL; >>> goto exit; >>> } >>> -if (s->num_children < 2) { >>> +if (s->num_children < 1) { >>>

Re: [Qemu-devel] [PATCH] gtk: use setlocale() for LC_MESSAGES only

2015-12-18 Thread Alberto Garcia
>> > We do however have translations for a few simple strings for the GTK+ >> > menu items, so in order to run QEMU using the C locale, and yet have a >> > translated UI let's use setlocale() for LC_MESSAGES only. >> > >> Not sure why I noticed it only now and if it's related to any recent >> pac

Re: [Qemu-devel] [Qemu-block] Jobs 2.0 QAPI [RFC]

2015-12-21 Thread Alberto Garcia
On Thu 17 Dec 2015 01:50:08 AM CET, John Snow wrote: > In working through a prototype to enable multiple block jobs. A few > problem spots in our API compatibility become apparent. > > In a nutshell, old Blockjobs rely on the "device" to identify the job, > which implies: > > 1) A job is always at

Re: [Qemu-devel] [Qemu-block] Jobs 2.0 QAPI [RFC]

2015-12-22 Thread Alberto Garcia
On Mon 21 Dec 2015 08:40:26 PM CET, John Snow wrote: > However, better flexibility also plays a part. Say we have two devices: > > [drive0]: [X] --> [Y] --> [Z] > [drive1]: [A] --> [B] > > In theory, we should be able to commit Z into Y into X while we > simultaneously perform a backup from X to A

[Qemu-devel] [PATCH v2 02/17] throttle: Make throttle_conflicting() set errp

2016-02-18 Thread Alberto Garcia
The caller does not need to set it, and this will allow us to refactor this function later. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- blockdev.c | 4 +--- include/qemu/throttle.h | 2 +- tests/test-throttle.c | 12

[Qemu-devel] [PATCH v2 04/17] throttle: Make throttle_is_valid() set errp

2016-02-18 Thread Alberto Garcia
The caller does not need to set it, and this will allow us to refactor this function later. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- blockdev.c | 4 +--- include/qemu/throttle.h | 2 +- tests/test-throttle.c | 2 +- util/throttle.c

[Qemu-devel] [PATCH v2 14/17] qemu-iotests: Extend iotest 093 to test bursts

2016-02-18 Thread Alberto Garcia
This patch adds a new test that checks that the burst settings ('iops_max', 'iops_max_length', etc.) of the throttling code work as expected. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/093 | 65 -- tests/qemu-iotests

[Qemu-devel] [PATCH v2 13/17] throttle: Test throttle_compute_wait() during bursts

2016-02-18 Thread Alberto Garcia
This test simulates an I/O burst for more than two seconds and checks that it works as expected. Signed-off-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi --- tests/test-throttle.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/tests/test-throttle.c b/tests/test

[Qemu-devel] [PATCH v2 07/17] throttle: Use throttle_config_init() to initialize ThrottleConfig

2016-02-18 Thread Alberto Garcia
. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- blockdev.c | 4 ++-- include/qemu/throttle.h | 2 ++ tests/test-throttle.c | 28 +--- util/throttle.c | 10 ++ 4 files changed, 31 insertions(+), 13

[Qemu-devel] [PATCH v2 05/17] throttle: Set always an average value when setting a maximum value

2016-02-18 Thread Alberto Garcia
f the throttling configuration. This patch ensures that the value of bucket.avg is valid when setting bucket.max. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- tests/test-throttle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-throttle.c b/

[Qemu-devel] [PATCH v2 11/17] qapi: Add burst length fields to BlockDeviceInfo

2016-02-18 Thread Alberto Garcia
This patch adds the new bps_*_max_length and iops_*_max_length parameters to the BlockDeviceInfo struct. Signed-off-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi --- block/qapi.c | 20 qapi/block-core.json | 39 +-- 2 files

[Qemu-devel] [PATCH v2 01/17] throttle: Make throttle_compute_timer() static

2016-02-18 Thread Alberto Garcia
This function is only used internally in throttle.c Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- include/qemu/throttle.h | 6 -- util/throttle.c | 8 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/qemu

[Qemu-devel] [PATCH v2 00/17] throttle: Allow I/O bursts for a user-defined period of time

2016-02-18 Thread Alberto Garcia
itial version Alberto Garcia (17): throttle: Make throttle_compute_timer() static throttle: Make throttle_conflicting() set errp throttle: Make throttle_max_is_missing_limit() set errp throttle: Make throttle_is_valid() set errp throttle: Set always an average value when setting a maximum

[Qemu-devel] [PATCH v2 15/17] qapi: Correct the name of the iops_rd parameter

2016-02-18 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- qapi/block-core.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index fbbc709..9bf1b22 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1321,7 +1321,7 @@ # # @iops: total I/O

[Qemu-devel] [PATCH v2 09/17] throttle: Add command-line settings to define the burst periods

2016-02-18 Thread Alberto Garcia
This patch adds all the throttling.*-max-length command-line parameters to define the length of the burst periods. Signed-off-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi --- blockdev.c | 37 + 1 file changed, 37 insertions(+) diff --git a/blockdev.c b

[Qemu-devel] [PATCH v2 16/17] docs: Document the throttling infrastructure

2016-02-18 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- docs/throttle.txt | 252 ++ 1 file changed, 252 insertions(+) create mode 100644 docs/throttle.txt diff --git a/docs/throttle.txt b/docs/throttle.txt new file mode 100644 index 000..28204e4 --- /dev/null

[Qemu-devel] [PATCH v2 06/17] throttle: Merge all functions that check the configuration into one

2016-02-18 Thread Alberto Garcia
There's no need to keep throttle_conflicting(), throttle_is_valid() and throttle_max_is_missing_limit() as separate functions, so this patch merges all three into one. As a consequence, check_throttle_config() becomes redundant and can be replaced with throttle_is_valid(). Signed-off-by: Al

[Qemu-devel] [PATCH v2 12/17] throttle: Check that burst_level leaks correctly

2016-02-18 Thread Alberto Garcia
This patch expands test_leak_bucket() to check that burst_level leaks correctly. Signed-off-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi --- tests/test-throttle.c | 16 1 file changed, 16 insertions(+) diff --git a/tests/test-throttle.c b/tests/test-throttle.c index

[Qemu-devel] [PATCH v2 17/17] MAINTAINERS: Add myself as maintainer of the throttling code

2016-02-18 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 02710f8..c2f2dd7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1276,6 +1276,15 @@ S: Maintained F: include/qemu/sockets.h F: util/qemu-sockets.c

[Qemu-devel] [PATCH v2 10/17] qapi: Add burst length parameters to block_set_io_throttle

2016-02-18 Thread Alberto Garcia
This patch adds the new bps_*_max_length and iops_*_max_length parameters to the block_set_io_throttle command. Signed-off-by: Alberto Garcia --- blockdev.c | 31 +++ hmp.c| 12 qapi/block-core.json | 51

[Qemu-devel] [PATCH v2 08/17] throttle: Add support for burst periods

2016-02-18 Thread Alberto Garcia
This patch adds support for burst periods to the throttling code. With this feature the user can keep performing bursts as defined by the LeakyBucket.max rate for a configurable period of time. Signed-off-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi --- include/qemu/throttle.h | 41

[Qemu-devel] [PATCH v2 03/17] throttle: Make throttle_max_is_missing_limit() set errp

2016-02-18 Thread Alberto Garcia
The caller does not need to set it, and this will allow us to refactor this function later. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- blockdev.c | 4 +--- include/qemu/throttle.h | 2 +- tests/test-throttle.c | 6 +++--- util

Re: [Qemu-devel] [PATCH v2 1/1] quorum: Change vote rules for 64 bits hash

2016-02-18 Thread Alberto Garcia
On Tue 16 Feb 2016 03:15:44 AM CET, Changlong Xie wrote: > If quorum has two children(A, B). A do flush sucessfully, but B flush > failed. We MUST choice A as winner rather than just pick anyone of > them. Otherwise the filesystem of guest will become read-only with > following errors: > > end_r

Re: [Qemu-devel] [PATCH v2 1/1] quorum: Change vote rules for 64 bits hash

2016-02-19 Thread Alberto Garcia
On Fri 19 Feb 2016 09:26:53 AM CET, Wen Congyang wrote: >>> If quorum has two children(A, B). A do flush sucessfully, but B >>> flush failed. We MUST choice A as winner rather than just pick >>> anyone of them. Otherwise the filesystem of guest will become >>> read-only with following errors: >>

Re: [Qemu-devel] [PATCH v2 1/1] quorum: Change vote rules for 64 bits hash

2016-02-22 Thread Alberto Garcia
On Sat 20 Feb 2016 03:28:03 PM CET, Max Reitz wrote: >> That said, I'm not very convinced of the current logics of the Quorum >> flush code either, so it's not even a problem with your patch... it >> seems to me that the code should follow the same logics as in the >> read/write case: if the numb

Re: [Qemu-devel] [PATCH v2 1/1] quorum: Change vote rules for 64 bits hash

2016-02-22 Thread Alberto Garcia
On Mon 22 Feb 2016 02:31:30 PM CET, Alberto Garcia wrote: >> Anyway, regardless of that, if we do take the threshold into account, >> we should not use the exact error value for voting but just whether >> an error occurred or not. If all but one children fail to flush (all >&g

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