Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 2/5] block: Allow reopen rw without BDRV_O_ALLOW_RDWR

2017-08-03 Thread Eric Blake
On 08/03/2017 10:21 AM, Eric Blake wrote: > On 08/03/2017 10:02 AM, Kevin Wolf wrote: >> BDRV_O_ALLOW_RDWR is a flag that tells whether qemu can internally >> reopen a node read-write temporarily because the user requested >> read-write for the top-level image, but qemu decided that read-only is

[Qemu-block] [PATCH v4 17/22] libqtest: Add qmp_args() helper

2017-08-03 Thread Eric Blake
Similar to the previous helper, we can reduce the boilerplate of most callers by passing the command name separately from the interpolated arguments. Adjust the majority of the callers that can use the new helpers; in the process, fixing a few places where we would have failed

[Qemu-block] [PATCH v4 16/22] libqtest: Add qmp_cmd() helper

2017-08-03 Thread Eric Blake
Now that we've asserted that all of our interpolated QMP commands include 'execute', we can reduce some of the caller boilerplate by providing a helpr function to wrap commands with no arguments (later patches will cover commands with arguments). Adjust all callers that can use the new helpers;

[Qemu-block] [PATCH v4 20/22] tests/libqos/pci: Clean up string interpolation into QMP input

2017-08-03 Thread Eric Blake
From: Markus Armbruster Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in previous commits. The case in qpci_plug_device_test() is a bit complicated: it interpolates several JSON object members, not just a value. Clean

[Qemu-block] [PATCH v4 22/22] libqtest: Rename qmp_cmd() to qmp()

2017-08-03 Thread Eric Blake
Now that the previous patch got rid of the old signature of qmp(), we can go back to using the shortest possible name for the common action. Performed mechanically with: for f in $(git grep -l qmp_cmd tests/); do case $f in *qemu-iotests*) continue;; esac sed -i s/qmp_cmd/qmp/ $f; done

[Qemu-block] [PATCH v4 14/22] libqtest: Separate qmp_discard_response() from command

2017-08-03 Thread Eric Blake
Upcoming patches will be adding new convenience methods for constructing QMP commands. But making every variation of sending support every variation of response handling becomes unwieldy; it's easier to specify that discarding a JSON response is unassociated with sending the command, where

Re: [Qemu-block] [PATCH V5 10/10] block/qcow2: add compress info to image specific info

2017-08-03 Thread Peter Lieven
Am 25.07.2017 um 23:55 schrieb Eric Blake: > On 07/25/2017 09:41 AM, Peter Lieven wrote: >> Signed-off-by: Peter Lieven >> --- >> block/qcow2.c| 7 +++ >> qapi/block-core.json | 6 +- >> 2 files changed, 12 insertions(+), 1 deletion(-) >> >> +++

[Qemu-block] [PATCH v3 3/4] qga: Give more --version information

2017-08-03 Thread Eric Blake
Include the package version information (useful for detecting builds from git or downstream backports), and the copyright notice. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrange --- qga/main.c | 6 -- 1 file changed, 4 insertions(+), 2

[Qemu-block] [PATCH v3 2/4] qemu-io: Give more --version information

2017-08-03 Thread Eric Blake
Include the package version information (useful for detecting builds from git or downstream backports), and the copyright notice. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrange Acked-by: Kevin Wolf --- qemu-io.c | 4 +++- 1

[Qemu-block] [PATCH v3 for-2.10 0/4] improved --version/--help tweaks

2017-08-03 Thread Eric Blake
Not sure if this should go through Kevin's block tree, Paolo's miscellaneous patches, or if I should just do a pull request myself (since patch 4 includes a change to qemu-nbd) since v2: add R-b on 2-4; also sort 'qemu-img --help' create text 001/4:[0012] [FC] 'qemu-img: Sort sub-command names

[Qemu-block] [PATCH v3 4/4] maint: Include bug-reporting info in --help output

2017-08-03 Thread Eric Blake
These days, many programs are including a bug-reporting address, or better yet, a link to the project web site, at the tail of their --help output. However, we were not very consistent at doing so: only qemu-nbd and qemu-qa mentioned anything, with the latter pointing to an individual person

[Qemu-block] [PATCH v3 1/4] qemu-img: Sort sub-command names in --help

2017-08-03 Thread Eric Blake
'amend' and 'create' were not listed alphabetically; hoist them earlier. Separate the @end table block to make it easier to copy-and-paste the addition of future sub-commands. Signed-off-by: Eric Blake --- v3: also sort 'create' [Kevin] --- qemu-img-cmds.hx | 21

Re: [Qemu-block] [PATCH for-2.10 5/5] qemu-iotests: Test reopen between read-only and read-write

2017-08-03 Thread Jeff Cody
On Thu, Aug 03, 2017 at 05:03:01PM +0200, Kevin Wolf wrote: > This serves as a regression test for the bugs that were just fixed for > bdrv_reopen() between read-only and read-write mode. > > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/187 | 69 >

Re: [Qemu-block] [PATCH for-2.10 4/5] qemu-io: Allow reopen read-write

2017-08-03 Thread Jeff Cody
On Thu, Aug 03, 2017 at 05:03:00PM +0200, Kevin Wolf wrote: > This allows qemu-iotests to test the switch between read-only and > read-write mode for block devices. > > Signed-off-by: Kevin Wolf > --- > qemu-io-cmds.c | 19 +-- > 1 file changed, 17

Re: [Qemu-block] [PATCH for-2.10 3/5] block: Set BDRV_O_ALLOW_RDWR during rw reopen

2017-08-03 Thread Jeff Cody
On Thu, Aug 03, 2017 at 05:02:59PM +0200, Kevin Wolf wrote: > Reopening an image should be consistent with opening it, so we should > set BDRV_O_ALLOW_RDWR for any image that is reopened read-write like in > bdrv_open_inherit(). > > Signed-off-by: Kevin Wolf > --- > block.c |

Re: [Qemu-block] [PATCH for-2.10 2/5] block: Allow reopen rw without BDRV_O_ALLOW_RDWR

2017-08-03 Thread Jeff Cody
On Thu, Aug 03, 2017 at 05:02:58PM +0200, Kevin Wolf wrote: > BDRV_O_ALLOW_RDWR is a flag that tells whether qemu can internally > reopen a node read-write temporarily because the user requested > read-write for the top-level image, but qemu decided that read-only is > enough for this node (a

Re: [Qemu-block] [Qemu-devel] [PATCH v2 4/4] maint: Include bug-reporting info in --help output.

2017-08-03 Thread Philippe Mathieu-Daudé
On 07/28/2017 01:47 PM, Eric Blake wrote: These days, many programs are including a bug-reporting address, or better yet, a link to the project web site, at the tail of their --help output. However, we were not very consistent at doing so: only qemu-nbd and qemu-qa mentioned anything, with the

Re: [Qemu-block] [PATCH for-2.10 1/5] block: Fix order in bdrv_replace_child()

2017-08-03 Thread Jeff Cody
On Thu, Aug 03, 2017 at 05:02:57PM +0200, Kevin Wolf wrote: > Commit 8ee03995 refactored the code incorrectly and broke the release of > permissions on the old BDS. Instead of changing the permissions to the > new required values after removing the old BDS from the list of > children, it only

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 5/5] qemu-iotests: Test reopen between read-only and read-write

2017-08-03 Thread Eric Blake
On 08/03/2017 10:03 AM, Kevin Wolf wrote: > This serves as a regression test for the bugs that were just fixed for > bdrv_reopen() between read-only and read-write mode. If I'm right that this also fixes the difference between intermediate vs. live commit to an initial read-write image that can't

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 4/5] qemu-io: Allow reopen read-write

2017-08-03 Thread Eric Blake
On 08/03/2017 10:03 AM, Kevin Wolf wrote: > This allows qemu-iotests to test the switch between read-only and > read-write mode for block devices. > > Signed-off-by: Kevin Wolf > --- > qemu-io-cmds.c | 19 +-- > 1 file changed, 17 insertions(+), 2 deletions(-)

Re: [Qemu-block] [PATCH v2 1/4] qemu-img: Sort sub-command names in --help

2017-08-03 Thread Eric Blake
On 08/03/2017 10:14 AM, Kevin Wolf wrote: > Am 28.07.2017 um 18:47 hat Eric Blake geschrieben: >> 'amend' was the only sub-command not listed alphabetically; > > Not completel true: create is the second one that is in the wrong place, > it should come after commit/compare/convert. Do you want to

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 3/5] block: Set BDRV_O_ALLOW_RDWR during rw reopen

2017-08-03 Thread Eric Blake
On 08/03/2017 10:02 AM, Kevin Wolf wrote: > Reopening an image should be consistent with opening it, so we should > set BDRV_O_ALLOW_RDWR for any image that is reopened read-write like in > bdrv_open_inherit(). > > Signed-off-by: Kevin Wolf > --- > block.c | 5 - > 1 file

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 2/5] block: Allow reopen rw without BDRV_O_ALLOW_RDWR

2017-08-03 Thread Eric Blake
On 08/03/2017 10:02 AM, Kevin Wolf wrote: > BDRV_O_ALLOW_RDWR is a flag that tells whether qemu can internally > reopen a node read-write temporarily because the user requested > read-write for the top-level image, but qemu decided that read-only is > enough for this node (a backing file). > >

Re: [Qemu-block] [PATCH v2 2/4] qemu-io: Give more --version information

2017-08-03 Thread Kevin Wolf
Am 28.07.2017 um 18:47 hat Eric Blake geschrieben: > Include the package version information (useful for detecting > builds from git or downstream backports), and the copyright notice. > > Signed-off-by: Eric Blake Acked-by: Kevin Wolf

Re: [Qemu-block] [PATCH v2 1/4] qemu-img: Sort sub-command names in --help

2017-08-03 Thread Kevin Wolf
Am 28.07.2017 um 18:47 hat Eric Blake geschrieben: > 'amend' was the only sub-command not listed alphabetically; Not completel true: create is the second one that is in the wrong place, it should come after commit/compare/convert. Do you want to fix that one, too? > hoist it earlier, and

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 1/5] block: Fix order in bdrv_replace_child()

2017-08-03 Thread Eric Blake
On 08/03/2017 10:02 AM, Kevin Wolf wrote: > Commit 8ee03995 refactored the code incorrectly and broke the release of > permissions on the old BDS. Instead of changing the permissions to the > new required values after removing the old BDS from the list of > children, it only re-obtains the

[Qemu-block] [PATCH for-2.10 3/5] block: Set BDRV_O_ALLOW_RDWR during rw reopen

2017-08-03 Thread Kevin Wolf
Reopening an image should be consistent with opening it, so we should set BDRV_O_ALLOW_RDWR for any image that is reopened read-write like in bdrv_open_inherit(). Signed-off-by: Kevin Wolf --- block.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[Qemu-block] [PATCH for-2.10 5/5] qemu-iotests: Test reopen between read-only and read-write

2017-08-03 Thread Kevin Wolf
This serves as a regression test for the bugs that were just fixed for bdrv_reopen() between read-only and read-write mode. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/187 | 69 ++ tests/qemu-iotests/187.out | 18

[Qemu-block] [PATCH for-2.10 2/5] block: Allow reopen rw without BDRV_O_ALLOW_RDWR

2017-08-03 Thread Kevin Wolf
BDRV_O_ALLOW_RDWR is a flag that tells whether qemu can internally reopen a node read-write temporarily because the user requested read-write for the top-level image, but qemu decided that read-only is enough for this node (a backing file). bdrv_reopen() is different, it is also used for cases

[Qemu-block] [PATCH for-2.10 4/5] qemu-io: Allow reopen read-write

2017-08-03 Thread Kevin Wolf
This allows qemu-iotests to test the switch between read-only and read-write mode for block devices. Signed-off-by: Kevin Wolf --- qemu-io-cmds.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index

[Qemu-block] [PATCH for-2.10 0/5] block: bdrv_reopen() fixes

2017-08-03 Thread Kevin Wolf
This is the first part of some fixes to bdrv_reopen(), which seems reasonable enough to merge for 2.10. There is much more wrong with bdrv_reopen() currently, especially with respect to op blocker permissions (basically the required permissions can change based on the options used in

Re: [Qemu-block] [PATCH v3 7/7] block: add throttle block filter driver interface tests

2017-08-03 Thread Manos Pitsidianakis
On Thu, Aug 03, 2017 at 03:32:58PM +0200, Kevin Wolf wrote: Am 03.08.2017 um 15:24 hat Manos Pitsidianakis geschrieben: On Thu, Aug 03, 2017 at 10:07:50AM +0200, Kevin Wolf wrote: > Am 31.07.2017 um 11:54 hat Manos Pitsidianakis geschrieben: > > Signed-off-by: Manos Pitsidianakis

Re: [Qemu-block] [PATCH v3 7/7] block: add throttle block filter driver interface tests

2017-08-03 Thread Kevin Wolf
Am 03.08.2017 um 15:24 hat Manos Pitsidianakis geschrieben: > On Thu, Aug 03, 2017 at 10:07:50AM +0200, Kevin Wolf wrote: > > Am 31.07.2017 um 11:54 hat Manos Pitsidianakis geschrieben: > > > Signed-off-by: Manos Pitsidianakis > > > > I would add at least two more cases: >

Re: [Qemu-block] [PATCH v3 7/7] block: add throttle block filter driver interface tests

2017-08-03 Thread Manos Pitsidianakis
On Thu, Aug 03, 2017 at 10:07:50AM +0200, Kevin Wolf wrote: Am 31.07.2017 um 11:54 hat Manos Pitsidianakis geschrieben: Signed-off-by: Manos Pitsidianakis I would add at least two more cases: * Both limits and throttle-group are given in blockdev-add This exists in

Re: [Qemu-block] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM

2017-08-03 Thread Manos Pitsidianakis
On Thu, Aug 03, 2017 at 01:17:01PM +0200, Kevin Wolf wrote: Am 03.08.2017 um 12:53 hat Stefan Hajnoczi geschrieben: On Thu, Aug 03, 2017 at 10:08:01AM +0200, Kevin Wolf wrote: > Am 02.08.2017 um 12:57 hat Manos Pitsidianakis geschrieben: > > On Wed, Aug 02, 2017 at 11:39:22AM +0100, Stefan

Re: [Qemu-block] [Qemu-devel] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-03 Thread Eric Blake
On 08/03/2017 03:07 AM, Kevin Wolf wrote: > Am 31.07.2017 um 11:54 hat Manos Pitsidianakis geschrieben: >> block/throttle.c uses existing I/O throttle infrastructure inside a >> block filter driver. I/O operations are intercepted in the filter's >> read/write coroutines, and referred to

Re: [Qemu-block] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-03 Thread Manos Pitsidianakis
On Thu, Aug 03, 2017 at 10:07:41AM +0200, Kevin Wolf wrote: Am 31.07.2017 um 11:54 hat Manos Pitsidianakis geschrieben: +/* Extract ThrottleConfig options. Assumes cfg is initialized and will be + * checked for validity. + */ +static int throttle_extract_options(QemuOpts *opts, ThrottleConfig

Re: [Qemu-block] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM

2017-08-03 Thread Kevin Wolf
Am 03.08.2017 um 12:53 hat Stefan Hajnoczi geschrieben: > On Thu, Aug 03, 2017 at 10:08:01AM +0200, Kevin Wolf wrote: > > Am 02.08.2017 um 12:57 hat Manos Pitsidianakis geschrieben: > > > On Wed, Aug 02, 2017 at 11:39:22AM +0100, Stefan Hajnoczi wrote: > > > > On Tue, Aug 01, 2017 at 07:49:33PM

Re: [Qemu-block] [PATCH 3/3] block: remove legacy I/O throttling

2017-08-03 Thread Kevin Wolf
Am 01.08.2017 um 15:49 hat Manos Pitsidianakis geschrieben: > This commit removes all I/O throttling from block/block-backend.c. In > order to support the existing interface, it is changed to use the > block/throttle.c filter driver. > > The throttle filter node that is created by the legacy

Re: [Qemu-block] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM

2017-08-03 Thread Stefan Hajnoczi
On Thu, Aug 03, 2017 at 10:08:01AM +0200, Kevin Wolf wrote: > Am 02.08.2017 um 12:57 hat Manos Pitsidianakis geschrieben: > > On Wed, Aug 02, 2017 at 11:39:22AM +0100, Stefan Hajnoczi wrote: > > > On Tue, Aug 01, 2017 at 07:49:33PM +0300, Manos Pitsidianakis wrote: > > > > On Tue, Aug 01, 2017 at

Re: [Qemu-block] [PATCH 2/3] block: skip implicit nodes in snapshots, blockjobs

2017-08-03 Thread Kevin Wolf
Am 01.08.2017 um 15:49 hat Manos Pitsidianakis geschrieben: > Implicit filter nodes added at the top of nodes can interfere with block > jobs. This is not a problem when they are added by other jobs since > adding another job will issue a QERR_DEVICE_IN_USE, but it can happen in > the next commit

Re: [Qemu-block] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-03 Thread Kevin Wolf
Am 31.07.2017 um 11:54 hat Manos Pitsidianakis geschrieben: > block/throttle.c uses existing I/O throttle infrastructure inside a > block filter driver. I/O operations are intercepted in the filter's > read/write coroutines, and referred to block/throttle-groups.c > > The driver can be used with

Re: [Qemu-block] [PATCH v3 4/7] block: convert ThrottleGroup to object with QOM

2017-08-03 Thread Kevin Wolf
Am 02.08.2017 um 12:57 hat Manos Pitsidianakis geschrieben: > On Wed, Aug 02, 2017 at 11:39:22AM +0100, Stefan Hajnoczi wrote: > > On Tue, Aug 01, 2017 at 07:49:33PM +0300, Manos Pitsidianakis wrote: > > > On Tue, Aug 01, 2017 at 04:47:03PM +0100, Stefan Hajnoczi wrote: > > > > On Mon, Jul 31,

Re: [Qemu-block] [PATCH v3 7/7] block: add throttle block filter driver interface tests

2017-08-03 Thread Kevin Wolf
Am 31.07.2017 um 11:54 hat Manos Pitsidianakis geschrieben: > Signed-off-by: Manos Pitsidianakis I would add at least two more cases: * Both limits and throttle-group are given in blockdev-add * limits and throttle-group are both missing It would also be nice to test that