Re: [Qemu-block] [Qemu-devel] [PATCH v5 0/3] block: allow flush on devices with open tray

2016-09-22 Thread Fam Zheng
On Thu, 09/22 21:45, John Snow wrote: > When I said "Final re-send," I was lying. Here's a v5. > The title is also a misnomer by now :) > > The move to blk_flush altered the behavior of migration and flushing > nodes that are not reachable via the guest, but are still reachable > via QEMU and may

Re: [Qemu-block] [Qemu-devel] [PATCH v7 02/20] qapi: Add lock-mode in blockdev-add options

2016-09-22 Thread Fam Zheng
On Thu, 09/22 09:58, Eric Blake wrote: > On 08/08/2016 08:13 AM, Fam Zheng wrote: > > To allow overriding the default locking behavior when opening the image. > > > > Signed-off-by: Fam Zheng > > --- > > qapi/block-core.json | 19 ++- > > 1 file changed, 18

[Qemu-block] [PATCH v5 3/3] block-backend: remove blk_flush_all

2016-09-22 Thread John Snow
We can teach Xen to drain and flush each device as it needs to, instead of trying to flush ALL devices. This removes the last user of blk_flush_all. The function is therefore removed under the premise that any new uses of blk_flush_all would be the wrong paradigm: either flush the single device

[Qemu-block] [PATCH v5 1/3] block: reintroduce bdrv_flush_all

2016-09-22 Thread John Snow
Commit fe1a9cbc moved the flush_all routine from the bdrv layer to the block-backend layer. In doing so, however, the semantics of the routine changed slightly such that flush_all now used blk_flush instead of bdrv_flush. blk_flush can fail if the attached device model reports that it is not

[Qemu-block] [PATCH v5 0/3] block: allow flush on devices with open tray

2016-09-22 Thread John Snow
When I said "Final re-send," I was lying. Here's a v5. The title is also a misnomer by now :) The move to blk_flush altered the behavior of migration and flushing nodes that are not reachable via the guest, but are still reachable via QEMU and may or may not need to be flushed. This is intended

[Qemu-block] [PATCH v5 2/3] qemu: use bdrv_flush_all for vm_stop et al

2016-09-22 Thread John Snow
Reimplement bdrv_flush_all for vm_stop. In contrast to blk_flush_all, bdrv_flush_all does not have device model restrictions. This allows us to flush and halt unconditionally without error. This allows us to do things like migrate when we have a device with an open tray, but has a node that may

Re: [Qemu-block] [Qemu-devel] [PATCH 0/3] Add -blockdev command line option

2016-09-22 Thread Eric Blake
On 09/22/2016 12:12 PM, no-re...@ec2-52-6-146-230.compute-1.amazonaws.com wrote: > Hi, > > Your series failed automatic build test. Please find the testing commands and > their output below. If you have docker installed, you can probably reproduce > it > locally. > > Type: series > Message-id:

[Qemu-block] [PATCH 0/1] ahci: fix ncq aiocb-related segfault

2016-09-22 Thread John Snow
Fix ncq_cb to prevent a segfault on sys_reset. John Snow (1): ahci: clear aiocb in ncq_cb hw/ide/ahci.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4

[Qemu-block] [PATCH 1/1] ahci: clear aiocb in ncq_cb

2016-09-22 Thread John Snow
Similar to existing fixes for IDE and ATAPI, the AIOCB must be cleared in the callback. Otherwise, we may accidentally try to reset it after the object has been released. Signed-off-by: John Snow --- hw/ide/ahci.c | 1 + 1 file changed, 1 insertion(+) diff --git

[Qemu-block] [PATCH v3] fixup! iscsi: Fix divide-by-zero regression on raw SG devices

2016-09-22 Thread Eric Blake
[keep original commit message] Reported-by: Holger Schranz Signed-off-by: Eric Blake CC: qemu-sta...@nongnu.org --- Paolo just sent a pull request, but if I'm not too late, this should be squashed in. If I am too late, then we can rework the commit

Re: [Qemu-block] [PATCH 3/3] doc: Document driver-specific -blockdev options

2016-09-22 Thread Eric Blake
On 09/22/2016 10:42 AM, Kevin Wolf wrote: > This documents the driver-specific options for the raw, qcow2 and file > block drivers for the man page. For everything else, we refer to the > QAPI documentation. > > Signed-off-by: Kevin Wolf > --- > qemu-options.hx | 62 >

Re: [Qemu-block] [PATCH 2/3] doc: Document generic -blockdev options

2016-09-22 Thread Eric Blake
On 09/22/2016 10:42 AM, Kevin Wolf wrote: > This adds documentation for the -blockdev options that apply to all > nodes independent of the block driver used. > > All options that are shared by -blockdev and -drive are now explained in > the section for -blockdev. The documentation of -drive

Re: [Qemu-block] [PATCH v3] fixup! iscsi: Fix divide-by-zero regression on raw SG devices

2016-09-22 Thread Eric Blake
On 09/22/2016 01:30 PM, Paolo Bonzini wrote: > >> Paolo just sent a pull request, but if I'm not too late, this should >> be squashed in. If I am too late, then we can rework the commit >> message to make it this is an obvious followup. > > I just replaced MIN_NON_ZERO with MAX. > Works for

Re: [Qemu-block] [PATCH 1/3] block: Add '-blockdev' command line option

2016-09-22 Thread Eric Blake
On 09/22/2016 10:42 AM, Kevin Wolf wrote: > This is an option that is directly mapped to the blockdev-add QMP > command. It works more or less like -drive, except that it doesn't > create a BlockBackend and doesn't support legacy options. > > This patch adds minimal documentation, the next

Re: [Qemu-block] [PATCH v3] fixup! iscsi: Fix divide-by-zero regression on raw SG devices

2016-09-22 Thread Paolo Bonzini
> Paolo just sent a pull request, but if I'm not too late, this should > be squashed in. If I am too late, then we can rework the commit > message to make it this is an obvious followup. I just replaced MIN_NON_ZERO with MAX. Paolo > v3: preserve 4k iscsilun->block_size > v2: avoid second

[Qemu-block] [PULL 31/33] block: Avoid printing NULL string in error messages

2016-09-22 Thread Kevin Wolf
Even for nodes that have a BlockBackend attached, bdrv_get_parent_name() can return NULL if the BB is anonymous (e.g. it belongs to a block job or a device that was created with a drive= option). Remove the information from the error message. The user probably knows already why the node is still

[Qemu-block] [PULL 24/33] qemu-iotests/071: Avoid blockdev-add with id

2016-09-22 Thread Kevin Wolf
We want to remove the 'id' option for blockdev-add. This removes one user of the option and makes it use only node names. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- tests/qemu-iotests/071 | 8 1 file changed, 4 insertions(+), 4

[Qemu-block] [PULL 19/33] block: Accept device model name for blockdev-change-medium

2016-09-22 Thread Kevin Wolf
In order to remove the need for BlockBackend names in the external API, we want to allow qdev device names in all device related commands. This converts blockdev-change-medium to accept a qdev device name. Signed-off-by: Kevin Wolf --- blockdev.c| 18

[Qemu-block] [PULL 22/33] qemu-iotests/041: Avoid blockdev-add with id

2016-09-22 Thread Kevin Wolf
We want to remove the 'id' option for blockdev-add. This removes one user of the option and makes it use only node names. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- tests/qemu-iotests/041 | 71 +++--- 1

[Qemu-block] [PULL 21/33] qemu-iotests/118: Test media change with qdev name

2016-09-22 Thread Kevin Wolf
We just added the option to use qdev device names in all device related block QMP commands. This patch converts some of the test cases in 118 to use qdev device names instead of BlockBackend names to cover the new way. It converts cases for each of the media change commands, but only for CD-ROM

[Qemu-block] [PULL 13/33] qdev-monitor: Factor out find_device_state()

2016-09-22 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- qdev-monitor.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/qdev-monitor.c b/qdev-monitor.c index e19617f..bc0213f 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c

[Qemu-block] [PULL 32/33] qemu-iotests/141: Avoid blockdev-add with id

2016-09-22 Thread Kevin Wolf
We want to remove the 'id' option for blockdev-add. This removes one user of the option and makes it use only node names. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- tests/qemu-iotests/141 | 24 ++--

[Qemu-block] [PULL 30/33] qemu-iotests/139: Avoid blockdev-add with id

2016-09-22 Thread Kevin Wolf
We want to remove the 'id' option for blockdev-add. This removes one user of the option and makes it use only node names. Some test cases that used to work with an unattached BlockBackend are removed, either because they don't make sense with an attached device or because the equivalent test case

[Qemu-block] [PULL 06/33] block: Update bs->open_flags earlier in bdrv_open_common()

2016-09-22 Thread Kevin Wolf
From: Alberto Garcia We're only doing this immediately before opening the image, but bs->open_flags is used earlier in the function. At the moment this is not causing problems because none of the checked flags are modified by update_flags_from_options(), but this will change

[Qemu-block] [PULL 29/33] qemu-iotests/124: Avoid blockdev-add with id

2016-09-22 Thread Kevin Wolf
We want to remove the 'id' option for blockdev-add. This removes one user of the option and makes it use only node names. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- tests/qemu-iotests/124 | 17 ++--- 1 file changed, 10 insertions(+),

[Qemu-block] [PULL 00/33] Block layer patches

2016-09-22 Thread Kevin Wolf
The following changes since commit 430da7a81d356e368ccd88dcca60f38da9aa5b9a: Merge remote-tracking branch 'remotes/riku/tags/pull-linux-user-20160915' into staging (2016-09-22 15:39:54 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for

[Qemu-block] [PULL 26/33] qemu-iotests/087: Avoid blockdev-add with id

2016-09-22 Thread Kevin Wolf
We want to remove the 'id' option for blockdev-add. This removes one user of the option and makes it use only node names. The test cases that test conflicts between the 'id' option to blockdev-add and existing block devices or the 'node-name' of the same command can be removed because it won't be

[Qemu-block] [PULL 20/33] block: Accept device model name for block_set_io_throttle

2016-09-22 Thread Kevin Wolf
In order to remove the need for BlockBackend names in the external API, we want to allow qdev device names in all device related commands. This converts block_set_io_throttle to accept a qdev device name. Signed-off-by: Kevin Wolf --- blockdev.c| 12 +++-

[Qemu-block] [PULL 23/33] qemu-iotests/067: Avoid blockdev-add with id

2016-09-22 Thread Kevin Wolf
We want to remove the 'id' option for blockdev-add. This removes one user of the option and makes it use only node names. In order to keep the test meaningful, some instances of query-block that want to check whether the node still exists and would now turn up empty must be converted to

[Qemu-block] [PULL 12/33] block: Add blk_by_dev()

2016-09-22 Thread Kevin Wolf
This finds a BlockBackend given the device model that is attached to it. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block/block-backend.c | 19 +++ include/sysemu/block-backend.h | 1 + 2 files changed, 20 insertions(+)

[Qemu-block] [PULL 16/33] block: Accept device model name for x-blockdev-insert-medium

2016-09-22 Thread Kevin Wolf
In order to remove the need for BlockBackend names in the external API, we want to allow qdev device names in all device related commands. This converts x-blockdev-insert-medium to accept a qdev device name. As the command is experimental, we can still remove the 'device' option that uses the

[Qemu-block] [PULL 10/33] block: rename "read-only" to BDRV_OPT_READ_ONLY

2016-09-22 Thread Kevin Wolf
From: Alberto Garcia There were a few instances left. After this patch we're using the macro in all places. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- blockdev.c | 10 +-

[Qemu-block] [PULL 07/33] block: Add "read-only" to the options QDict

2016-09-22 Thread Kevin Wolf
From: Alberto Garcia This adds the "read-only" option to the QDict. One important effect of this change is that when a child inherits options from its parent, the existing "read-only" mode can be preserved if it was explicitly set previously. This addresses scenarios like

[Qemu-block] [PULL 09/33] commit: Add 'base' to the reopen queue before 'overlay_bs'

2016-09-22 Thread Kevin Wolf
From: Alberto Garcia Now that we're checking for duplicates in the reopen queue, there's no need to force a specific order in which the queue is constructed so we can revert 3db2bd5508c86a1605258bc77c9672d93b5c350e. Since both ways of constructing the queue are now valid, this

[Qemu-block] [PULL 08/33] block: Don't queue the same BDS twice in bdrv_reopen_queue_child()

2016-09-22 Thread Kevin Wolf
From: Alberto Garcia bdrv_reopen_queue_child() assumes that a BlockDriverState is never added twice to BlockReopenQueue. That's however not the case: commit_start() adds 'base' (and its children) to a new reopen queue, and then 'overlay_bs' (and its children, which include

[Qemu-block] [PULL 01/33] qcow2: fix encryption during cow of sectors

2016-09-22 Thread Kevin Wolf
From: "Daniel P. Berrange" Broken in previous commit: commit aaa4d20b4972bb1a811ce929502e6741835d584e Author: Kevin Wolf Date: Wed Jun 1 15:21:05 2016 +0200 qcow2: Make copy_sectors() byte based The copy_sectors() code was originally using

[Qemu-block] [PULL 33/33] block: Remove BB interface from blockdev-add/del

2016-09-22 Thread Kevin Wolf
With this patch, blockdev-add always works on a node level, i.e. it creates a BDS, but no BB. Consequently, x-blockdev-del doesn't need the 'device' option any more, but 'node-name' becomes mandatory. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake ---

[Qemu-block] [PULL 27/33] qemu-iotests/117: Avoid blockdev-add with id

2016-09-22 Thread Kevin Wolf
We want to remove the 'id' option for blockdev-add. This removes one user of the option and makes it use only node names. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- tests/qemu-iotests/117 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[Qemu-block] [PULL 25/33] qemu-iotests/081: Avoid blockdev-add with id

2016-09-22 Thread Kevin Wolf
We want to remove the 'id' option for blockdev-add. This removes one user of the option and makes it use only node names. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- tests/qemu-iotests/081 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[Qemu-block] [PULL 28/33] qemu-iotests/118: Avoid blockdev-add with id

2016-09-22 Thread Kevin Wolf
We want to remove the 'id' option for blockdev-add. This removes one user of the option and makes it use only node names. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- tests/qemu-iotests/118 | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-)

[Qemu-block] [PULL 02/33] hmp: Remove dead code in hmp_qemu_io()

2016-09-22 Thread Kevin Wolf
blk can never be NULL, drop the check. This fixes a Coverity warning. Signed-off-by: Kevin Wolf Reviewed-by: Marc-André Lureau --- hmp.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/hmp.c b/hmp.c index

[Qemu-block] [PULL 03/33] tests: allow to specify list of formats to test for check-block.sh

2016-09-22 Thread Kevin Wolf
From: "Denis V. Lunev" This would make code better and allow to test specific format. Signed-off-by: Denis V. Lunev CC: Stefan Hajnoczi CC: Kevin Wolf CC: Paolo Bonzini Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 18/33] block: Accept device model name for eject

2016-09-22 Thread Kevin Wolf
In order to remove the need for BlockBackend names in the external API, we want to allow qdev device names in all device related commands. This converts eject to accept a qdev device name. Signed-off-by: Kevin Wolf --- blockdev.c| 10 +++---

[Qemu-block] [PULL 15/33] block: Accept device model name for blockdev-open/close-tray

2016-09-22 Thread Kevin Wolf
In order to remove the need for BlockBackend names in the external API, we want to allow qdev device names in all device related commands. This converts blockdev-open/close-tray to accept a qdev device name. Signed-off-by: Kevin Wolf --- blockdev.c| 61

[Qemu-block] [PULL 14/33] qdev-monitor: Add blk_by_qdev_id()

2016-09-22 Thread Kevin Wolf
This finds the BlockBackend attached to the device model identified by its qdev ID. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- include/sysemu/block-backend.h | 1 + qdev-monitor.c | 18 ++ 2 files changed, 19

[Qemu-block] [PULL 11/33] block: Fix 'since' for compressed Drive/BlockdevBackup

2016-09-22 Thread Kevin Wolf
These patches missed 2.7, update the QAPI documentation. Reported-by: Eric Blake Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- qapi/block-core.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[Qemu-block] [PATCH 2/3] doc: Document generic -blockdev options

2016-09-22 Thread Kevin Wolf
This adds documentation for the -blockdev options that apply to all nodes independent of the block driver used. All options that are shared by -blockdev and -drive are now explained in the section for -blockdev. The documentation of -drive mentions that all -blockdev options are accepted as well.

[Qemu-block] [PULL 05/33] block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags

2016-09-22 Thread Kevin Wolf
From: Alberto Garcia If an image is opened with snapshot=on, its flags are modified by bdrv_backing_options() and then bs->open_flags is updated accordingly. This last step is unnecessary if we calculate the new flags before setting bs->open_flags. Soon we'll introduce the

[Qemu-block] [PULL 04/33] block: Remove bdrv_is_snapshot

2016-09-22 Thread Kevin Wolf
From: Alberto Garcia This is unnecessary and has been unused since 5433c24f0f9306c82ad9bcc. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf ---

[Qemu-block] [PATCH 1/3] block: Add '-blockdev' command line option

2016-09-22 Thread Kevin Wolf
This is an option that is directly mapped to the blockdev-add QMP command. It works more or less like -drive, except that it doesn't create a BlockBackend and doesn't support legacy options. This patch adds minimal documentation, the next patches will improve it. Signed-off-by: Kevin Wolf

[Qemu-block] [PATCH 0/3] Add -blockdev command line option

2016-09-22 Thread Kevin Wolf
This series adds an option that is directly mapped to the blockdev-add QMP command. It works more or less like -drive, except that it doesn't create a BlockBackend (creating just a BDS without a BB is impossible with -drive) and doesn't support legacy options. Depends on Dan's "[PATCH v13 0/6]

[Qemu-block] [PATCH 3/3] doc: Document driver-specific -blockdev options

2016-09-22 Thread Kevin Wolf
This documents the driver-specific options for the raw, qcow2 and file block drivers for the man page. For everything else, we refer to the QAPI documentation. Signed-off-by: Kevin Wolf --- qemu-options.hx | 62 + 1 file

Re: [Qemu-block] [Qemu-devel] [PATCH v7 02/20] qapi: Add lock-mode in blockdev-add options

2016-09-22 Thread Eric Blake
On 08/08/2016 08:13 AM, Fam Zheng wrote: > To allow overriding the default locking behavior when opening the image. > > Signed-off-by: Fam Zheng > --- > qapi/block-core.json | 19 ++- > 1 file changed, 18 insertions(+), 1 deletion(-) > > diff --git

Re: [Qemu-block] [PATCH 3/7] block/qapi: Move 'aio' option to file driver

2016-09-22 Thread Eric Blake
On 09/22/2016 05:25 AM, Kevin Wolf wrote: >>> >>> +static bool get_aio_option(QemuOpts *opts, int flags, Error **errp) >>> +{ >>> +const char *aio = qemu_opt_get(opts, "aio"); >>> +if (!aio) { >>> +return !!(flags & BDRV_O_NATIVE_AIO); >>> +} else if (!strcmp(aio, "native"))

Re: [Qemu-block] [PULL v4 0/8] Block layer patches

2016-09-22 Thread Peter Maydell
On 20 September 2016 at 21:43, Max Reitz wrote: > The following changes since commit a008535b9fa396226ff9cf78b8ac5f3584bda58e: > > build-sys: fix make install regression (2016-09-20 11:32:43 +0100) > > are available in the git repository at: > >

Re: [Qemu-block] [PATCH 3/7] block/qapi: Move 'aio' option to file driver

2016-09-22 Thread Kevin Wolf
Am 21.09.2016 um 00:27 hat Eric Blake geschrieben: > On 09/20/2016 04:08 PM, Kevin Wolf wrote: > > The option whether or not to use a native AIO interface really isn't a > > generic option for all drivers, but only applies to the native file > > protocols. This patch moves the option in