Re: [Qemu-block] [Qemu-devel] [PATCH v5 3/4] qmp: add monitor command to add/remove a child

2015-10-12 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Max Reitz (mre...@redhat.com) wrote: >> On 08.10.2015 08:15, Markus Armbruster wrote: >> > Max Reitz writes: >> > >> >> On 22.09.2015 09:44, Wen Congyang wrote: >> >>> The new QMP command name is x-blockdev-child-add,

Re: [Qemu-block] [Qemu-devel] [PATCH v5 3/4] qmp: add monitor command to add/remove a child

2015-10-12 Thread Markus Armbruster
Max Reitz writes: > On 08.10.2015 08:15, Markus Armbruster wrote: >> Max Reitz writes: >> >>> On 22.09.2015 09:44, Wen Congyang wrote: The new QMP command name is x-blockdev-child-add, and x-blockdev-child-del. It justs for adding/removing

Re: [Qemu-block] [Qemu-devel] [PATCH v5 3/4] qmp: add monitor command to add/remove a child

2015-10-12 Thread Dr. David Alan Gilbert
* Max Reitz (mre...@redhat.com) wrote: > On 09.10.2015 18:42, Dr. David Alan Gilbert wrote: > > * Max Reitz (mre...@redhat.com) wrote: > >> On 08.10.2015 08:15, Markus Armbruster wrote: > >>> Max Reitz writes: > >>> > On 22.09.2015 09:44, Wen Congyang wrote: > > The

[Qemu-block] [PATCH v7 4/5] block: add a 'blockdev-snapshot' QMP command

2015-10-12 Thread Alberto Garcia
One of the limitations of the 'blockdev-snapshot-sync' command is that it does not allow passing BlockdevOptions to the newly created snapshots, so they are always opened using the default values. Extending the command to allow passing options is not a practical solution because there is overlap

[Qemu-block] [PATCH v7 0/5] Add 'blockdev-snapshot' command

2015-10-12 Thread Alberto Garcia
This series adds a new 'blockdev-snapshot' command, that is similar to 'blockdev-snapshot-sync' but takes references to two existing block devices. This depends on Max's "BlockBackend and media" series: https://lists.gnu.org/archive/html/qemu-block/2015-09/msg00497.html v7: - Rebase on top of

[Qemu-block] [PATCH 3/3] aio: Introduce aio-epoll.c

2015-10-12 Thread Fam Zheng
To minimize code duplication, epoll is hooked into aio-posix's aio_poll() instead of rolling its own. This approach also has the advantage that both compile time and run time ability to switch from between the two: 1) If configure script didn't find epoll, the libqemustub.a nop functions will be

Re: [Qemu-block] [PATCH 3/3] aio: Introduce aio-epoll.c

2015-10-12 Thread Paolo Bonzini
On 12/10/2015 11:55, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > Makefile.objs| 1 + > aio-epoll.c | 150 > +++ > aio-posix.c | 16 - > include/block/aio-internal.h | 15

[Qemu-block] [PATCH v7 1/5] block: check for existing device IDs in external_snapshot_prepare()

2015-10-12 Thread Alberto Garcia
The 'snapshot-node-name' parameter of blockdev-snapshot-sync allows setting the node name of the image that is going to be created. Before creating the image, external_snapshot_prepare() checks that the name is not already being used. The check is however incomplete since it only considers

Re: [Qemu-block] [PATCH 05/12] aio: introduce aio_{disable, enable}_clients

2015-10-12 Thread Kevin Wolf
Am 09.10.2015 um 18:27 hat Fam Zheng geschrieben: > On Fri, 10/09 16:31, Kevin Wolf wrote: > > Am 09.10.2015 um 07:45 hat Fam Zheng geschrieben: > > > Signed-off-by: Fam Zheng > > > --- > > > aio-posix.c | 3 ++- > > > aio-win32.c | 3 ++- > > > async.c

[Qemu-block] [PATCH v7 5/5] block: add tests for the 'blockdev-snapshot' command

2015-10-12 Thread Alberto Garcia
Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- tests/qemu-iotests/085 | 102 ++--- tests/qemu-iotests/085.out | 34 ++- 2 files changed, 128 insertions(+), 8 deletions(-) diff --git

[Qemu-block] [PATCH v7 2/5] block: rename BlockdevSnapshot to BlockdevSnapshotSync

2015-10-12 Thread Alberto Garcia
We will introduce the 'blockdev-snapshot' command that will require its own struct for the parameters, so we need to rename this one in order to avoid name clashes. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake Reviewed-by: Max Reitz

Re: [Qemu-block] [Qemu-devel] [PATCH v5 3/4] qmp: add monitor command to add/remove a child

2015-10-12 Thread Kevin Wolf
Am 09.10.2015 um 20:24 hat Max Reitz geschrieben: > On 09.10.2015 18:42, Dr. David Alan Gilbert wrote: > > * Max Reitz (mre...@redhat.com) wrote: > >> On 08.10.2015 08:15, Markus Armbruster wrote: > >>> Max Reitz writes: > >>> > On 22.09.2015 09:44, Wen Congyang wrote: >

[Qemu-block] [PATCH 0/3] aio: Use epoll in aio_poll()

2015-10-12 Thread Fam Zheng
This series adds the ability to use epoll in aio_poll() on Linux. It's switched on in a dynamic way rather than static for two reasons: 1) when the number of fds is not high enough, using epoll has little advantage; 2) when an epoll incompatible fd needs to be handled, we need to fall back. The

[Qemu-block] [PATCH 2/3] aio: Introduce aio_context_setup

2015-10-12 Thread Fam Zheng
This is the place to initialize platform specific bits of AioContext. Signed-off-by: Fam Zheng --- aio-posix.c | 4 aio-win32.c | 4 async.c | 14 -- include/block/aio-internal.h | 2 ++ 4 files

[Qemu-block] [PATCH 1/3] aio: Move AioHandler struct to header

2015-10-12 Thread Fam Zheng
AioHandler for win32 is a superset of the counterpart in aio-posix, move that to a new header "aio-internal.h" and drop the posix variation. Signed-off-by: Fam Zheng --- aio-posix.c | 11 +-- aio-win32.c | 12 +---

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-12 Thread Stefan Hajnoczi
On Fri, Sep 25, 2015 at 02:17:36PM +0800, Wen Congyang wrote: > +/* start backup job now */ > +bdrv_op_unblock(s->hidden_disk, BLOCK_OP_TYPE_BACKUP_TARGET, > +s->active_disk->backing_blocker); > +bdrv_op_unblock(s->secondary_disk,

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-12 Thread Stefan Hajnoczi
On Fri, Sep 25, 2015 at 02:17:36PM +0800, Wen Congyang wrote: > +static void backup_job_completed(void *opaque, int ret) > +{ > +BDRVReplicationState *s = opaque; > + > +if (s->replication_state != BLOCK_REPLICATION_DONE) { > +/* The backup job is cancelled unexpectedly */ > +

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-12 Thread Stefan Hajnoczi
On Fri, Sep 25, 2015 at 02:17:36PM +0800, Wen Congyang wrote: > +static void replication_start(BlockDriverState *bs, ReplicationMode mode, > + Error **errp) > +{ > +BDRVReplicationState *s = bs->opaque; > +int64_t active_length, hidden_length, disk_length; > +

[Qemu-block] [PATCH v2 01/12] aio: Add "is_external" flag for event handlers

2015-10-12 Thread Fam Zheng
All callers pass in false, and the real external ones will switch to true in coming patches. Signed-off-by: Fam Zheng --- aio-posix.c | 6 - aio-win32.c | 5 async.c | 3 ++- block/curl.c

[Qemu-block] [PATCH v2 00/12] block: bdrv_drained_begin/end for transactions on dataplane devices

2015-10-12 Thread Fam Zheng
v2: Use "bool" for external/internal instead of bit mask in the interface, so I didn't pick up Kevin's rev-by due to patches change. Add a unit test in tests/test-aio.c. External I/O requests mustn't come in while we're in the middle of a QMP transaction. This series adds

[Qemu-block] [PATCH v2 02/12] nbd: Mark fd handlers client type as "external"

2015-10-12 Thread Fam Zheng
So we could distinguish it from internal used fds, thus avoid handling unwanted events in nested aio polls. Signed-off-by: Fam Zheng --- nbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nbd.c b/nbd.c index 32a1f66..b599e62 100644 --- a/nbd.c +++

Re: [Qemu-block] [PATCH v5 2/4] quorum: implement bdrv_add_child() and bdrv_del_child()

2015-10-12 Thread Alberto Garcia
On Fri 09 Oct 2015 05:51:55 PM CEST, Max Reitz wrote: +s->bs = g_renew(BlockDriverState *, s->bs, s->max_children + 1); +s->bs[s->num_children] = NULL; +s->max_children++; +} >>> >>> Just a suggestion, please feel free to ignore

[Qemu-block] [PATCH 4/4] ide/atapi: enable cancelable requests

2015-10-12 Thread Peter Lieven
Signed-off-by: Peter Lieven --- hw/ide/atapi.c | 4 ++-- hw/ide/core.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index e0cf066..8d38b1d 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -187,7 +187,7 @@ static int

Re: [Qemu-block] [Qemu-devel] [PATCH 05/12] aio: introduce aio_{disable, enable}_clients

2015-10-12 Thread Fam Zheng
On Mon, 10/12 10:31, Kevin Wolf wrote: > Am 09.10.2015 um 18:27 hat Fam Zheng geschrieben: > > On Fri, 10/09 16:31, Kevin Wolf wrote: > > > Am 09.10.2015 um 07:45 hat Fam Zheng geschrieben: > > > > Signed-off-by: Fam Zheng > > > > --- > > > > aio-posix.c | 3 ++- > > > >

[Qemu-block] [PATCH v2 07/12] block: Add "drained begin/end" for transactional backup

2015-10-12 Thread Fam Zheng
This ensures the atomicity of the transaction by avoiding processing of external requests such as those from ioeventfd. Move the assignment to state->bs up right after bdrv_drained_begin, so that we can use it in the clean callback. The abort callback will still check bs->job and state->job, so

[Qemu-block] [PATCH v2 06/12] block: Add "drained begin/end" for transactional external snapshot

2015-10-12 Thread Fam Zheng
This ensures the atomicity of the transaction by avoiding processing of external requests such as those from ioeventfd. Signed-off-by: Fam Zheng --- blockdev.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] aio: Introduce aio-epoll.c

2015-10-12 Thread Fam Zheng
On Mon, 10/12 12:06, Paolo Bonzini wrote: > > > On 12/10/2015 11:55, Fam Zheng wrote: > > Signed-off-by: Fam Zheng > > --- > > Makefile.objs| 1 + > > aio-epoll.c | 150 > > +++ > > aio-posix.c

[Qemu-block] [PATCH v2 03/12] dataplane: Mark host notifiers' client type as "external"

2015-10-12 Thread Fam Zheng
They will be excluded by type in the nested event loops in block layer, so that unwanted events won't be processed there. Signed-off-by: Fam Zheng --- hw/block/dataplane/virtio-blk.c | 5 ++--- hw/scsi/virtio-scsi-dataplane.c | 18 -- 2 files changed, 10

[Qemu-block] [PATCH 1/4] ide/atapi: make PIO read requests async

2015-10-12 Thread Peter Lieven
PIO read requests on the ATAPI interface used to be sync blk requests. This has two significant drawbacks. First the main loop hangs util an I/O request is completed and secondly if the I/O request does not complete (e.g. due to an unresponsive storage) Qemu hangs completely. Signed-off-by: Peter

[Qemu-block] [PATCH 2/4] ide/atapi: blk_aio_readv may return NULL

2015-10-12 Thread Peter Lieven
Signed-off-by: Peter Lieven --- hw/ide/atapi.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 2271ea2..e0cf066 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -429,6 +429,10 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque,

[Qemu-block] [PATCH v2 08/12] block: Add "drained begin/end" for transactional blockdev-backup

2015-10-12 Thread Fam Zheng
Similar to the previous patch, make sure that external events are not dispatched during transaction operations. Signed-off-by: Fam Zheng --- blockdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index 232bc21..015afbf 100644

[Qemu-block] [PATCH v2 05/12] block: Introduce "drained begin/end" API

2015-10-12 Thread Fam Zheng
The semantics is that after bdrv_drained_begin(bs), bs will not get new external requests until the matching bdrv_drained_end(bs). Signed-off-by: Fam Zheng --- block.c | 2 ++ block/io.c| 18 ++ include/block/block.h | 19

Re: [Qemu-block] [PATCH v3 07/16] block: Convert bs->backing_hd to BdrvChild

2015-10-12 Thread Alberto Garcia
On Fri 09 Oct 2015 02:15:32 PM CEST, Kevin Wolf wrote: > This is the final step in converting all of the BlockDriverState > pointers that block drivers use to BdrvChild. > > After this patch, bs->children contains the full list of child nodes > that are referenced by a given BDS, and these

Re: [Qemu-block] [PATCH v2 11/12] qed: Implement .bdrv_drain

2015-10-12 Thread Kevin Wolf
Am 12.10.2015 um 13:50 hat Fam Zheng geschrieben: > The "need_check_timer" is used to clear the "NEED_CHECK" flag in the > image header after a grace period once metadata update has finished. In > compliance to the bdrv_drain semantics we should make sure it remains > deleted once .bdrv_drain is

Re: [Qemu-block] [PATCH v3 09/16] block: Split bdrv_move_feature_fields()

2015-10-12 Thread Alberto Garcia
On Fri 09 Oct 2015 02:15:34 PM CEST, Kevin Wolf wrote: > After bdrv_swap(), some fields must be moved back to their original BDS > to compensate for the effects that a swap of the contents of the objects > has while keeping the old addresses. Other fields must be moved back > because they should

Re: [Qemu-block] [PATCH v2 05/12] block: Introduce "drained begin/end" API

2015-10-12 Thread Kevin Wolf
Am 12.10.2015 um 13:50 hat Fam Zheng geschrieben: > The semantics is that after bdrv_drained_begin(bs), bs will not get new > external > requests until the matching bdrv_drained_end(bs). > > Signed-off-by: Fam Zheng > --- > block.c | 2 ++ > block/io.c

Re: [Qemu-block] [PATCH v10 02/10] Backup: clear all bitmap when doing block checkpoint

2015-10-12 Thread Stefan Hajnoczi
On Fri, Sep 25, 2015 at 02:17:30PM +0800, Wen Congyang wrote: > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > Reviewed-by: Jeff Cody > --- > block/backup.c

Re: [Qemu-block] [PATCH v3 07/16] block: Convert bs->backing_hd to BdrvChild

2015-10-12 Thread Max Reitz
On 09.10.2015 14:15, Kevin Wolf wrote: > This is the final step in converting all of the BlockDriverState > pointers that block drivers use to BdrvChild. > > After this patch, bs->children contains the full list of child nodes > that are referenced by a given BDS, and these children are only >

Re: [Qemu-block] [Qemu-devel] [RFC] transactions: add transaction-wide property

2015-10-12 Thread John Snow
Ping -- any consensus on how we should implement the "do-or-die" argument for transactions that start block jobs? :) This patch may look a little hokey in how it boxes arguments, but I can re-do it on top of Eric Blake's very official way of boxing arguments, when the QAPI dust settles. --js On

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

2015-10-12 Thread Max Reitz
On 09.10.2015 14:15, Kevin Wolf wrote: > This simplifies the code somewhat, especially when dropping whole > backing file subchains. > > The exception is the mirroring code that does adventurous things with > bdrv_swap() and in order to keep it working, I had to duplicate most of >

[Qemu-block] [PATCH v6 08/39] block/raw_bsd: Drop raw_is_inserted()

2015-10-12 Thread Max Reitz
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 Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf

[Qemu-block] [PATCH v6 23/39] block: Prepare for NULL BDS

2015-10-12 Thread Max Reitz
blk_bs() will not necessarily return a non-NULL value any more (unless blk_is_available() is true or it can be assumed to otherwise, e.g. because it is called immediately after a successful blk_new_with_bs() or blk_new_open()). Signed-off-by: Max Reitz --- block.c

[Qemu-block] [PATCH v6 11/39] hw/usb-storage: Check whether BB is inserted

2015-10-12 Thread Max Reitz
Only call bdrv_add_key() on the BlockDriverState if it is not NULL. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf --- hw/usb/dev-storage.c | 30

[Qemu-block] [PATCH v6 21/39] block: Prepare remaining BB functions for NULL BDS

2015-10-12 Thread Max Reitz
There are several BlockBackend functions which, in theory, cannot fail. This patch makes them cope with the BlockDriverState pointer being NULL by making them fall back to some default action like ignoring the value in setters and returning the default in getters. Signed-off-by: Max Reitz

[Qemu-block] [PATCH v6 18/39] block: Add BlockBackendRootState

2015-10-12 Thread Max Reitz
This structure will store some of the state of the root BDS if the BDS tree is removed, so that state can be restored once a new BDS tree is inserted. Signed-off-by: Max Reitz --- block/block-backend.c | 40

[Qemu-block] [PATCH v6 22/39] block: Add blk_insert_bs()

2015-10-12 Thread Max Reitz
This function associates the given BlockDriverState with the given BlockBackend. Signed-off-by: Max Reitz --- block/block-backend.c | 11 +++ include/sysemu/block-backend.h | 1 + 2 files changed, 12 insertions(+) diff --git a/block/block-backend.c

[Qemu-block] [PATCH v6 34/39] block: Inquire tray state before tray-moved events

2015-10-12 Thread Max Reitz
blk_dev_change_media_cb() is called for all potential tray movements; however, it is possible to request closing the tray but nothing actually happening (on a floppy disk drive without a medium). Thus, the actual tray status should be inquired before sending a tray-moved event (and an event

[Qemu-block] [PATCH v6 29/39] blockdev: Add blockdev-close-tray

2015-10-12 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 23 +++ qapi/block-core.json | 16 qmp-commands.hx | 35 +++ 3 files changed, 74 insertions(+) diff --git a/blockdev.c b/blockdev.c index

[Qemu-block] [PATCH v6 32/39] blockdev: Implement eject with basic operations

2015-10-12 Thread Max Reitz
Implement 'eject' by calling blockdev-open-tray and blockdev-remove-medium. Signed-off-by: Max Reitz --- blockdev.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/blockdev.c b/blockdev.c index 706e7e1..ff3b353 100644 --- a/blockdev.c +++

[Qemu-block] [PATCH v6 25/39] blockdev: Pull out blockdev option extraction

2015-10-12 Thread Max Reitz
Extract some of the blockdev option extraction code from blockdev_init() into its own function. This simplifies blockdev_init() and will allow reusing the code in a different function added in a follow-up patch. Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia

[Qemu-block] [PATCH v6 37/39] blockdev: read-only-mode for blockdev-change-medium

2015-10-12 Thread Max Reitz
Add an option to qmp_blockdev_change_medium() which allows changing the read-only status of the block device whose medium is changed. Some drives do not have a inherently fixed read-only status; for instance, floppy disks can be set read-only or writable independently of the drive. Some users may

[Qemu-block] [PATCH v6 38/39] hmp: Add read-only-mode option to change command

2015-10-12 Thread Max Reitz
Expose the new read-only-mode option of 'blockdev-change-medium' for the 'change' HMP command. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- hmp-commands.hx | 20 +--- hmp.c | 22 +- 2 files changed, 38

[Qemu-block] [PATCH v6 28/39] blockdev: Add blockdev-open-tray

2015-10-12 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 49 + qapi/block-core.json | 23 +++ qmp-commands.hx | 39 +++ 3 files changed, 111 insertions(+) diff --git

Re: [Qemu-block] [PATCH v7 1/5] block: check for existing device IDs in external_snapshot_prepare()

2015-10-12 Thread Max Reitz
On 12.10.2015 11:16, Alberto Garcia wrote: > The 'snapshot-node-name' parameter of blockdev-snapshot-sync allows > setting the node name of the image that is going to be created. > > Before creating the image, external_snapshot_prepare() checks that the > name is not already being used. The check

[Qemu-block] [PATCH v6 39/39] iotests: Add test for change-related QMP commands

2015-10-12 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/118 | 638 + tests/qemu-iotests/118.out | 5 + tests/qemu-iotests/group | 1 + 3 files changed, 644 insertions(+) create mode

Re: [Qemu-block] [PATCH v7 4/5] block: add a 'blockdev-snapshot' QMP command

2015-10-12 Thread Max Reitz
On 12.10.2015 11:16, Alberto Garcia wrote: > One of the limitations of the 'blockdev-snapshot-sync' command is that > it does not allow passing BlockdevOptions to the newly created > snapshots, so they are always opened using the default values. > > Extending the command to allow passing options

[Qemu-block] [PATCH v6 04/39] iotests: Only create BB if necessary

2015-10-12 Thread Max Reitz
Tests 071 and 081 test giving references in blockdev-add. It is not necessary to create a BlockBackend here, so omit it. While at it, fix up some blockdev-add invocations in the vicinity (s/raw/$IMGFMT/ in 081, drop the format BDS for blkverify's raw child in 071). Signed-off-by: Max Reitz

[Qemu-block] [PATCH v6 03/39] blockdev: Allow creation of BDS trees without BB

2015-10-12 Thread Max Reitz
If the "id" field is missing from the options given to blockdev-add, just omit the BlockBackend and create the BlockDriverState tree alone. However, if "id" is missing, "node-name" must be specified; otherwise, the BDS tree would no longer be accessible. Many BDS options which are not parsed by

[Qemu-block] [PATCH v6 05/39] block: Make bdrv_is_inserted() return a bool

2015-10-12 Thread Max Reitz
Make bdrv_is_inserted(), blk_is_inserted(), and the callback BlockDriver.bdrv_is_inserted() return a bool. Suggested-by: Eric Blake Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia

[Qemu-block] [PATCH v6 13/39] block: Move guest_block_size into BlockBackend

2015-10-12 Thread Max Reitz
guest_block_size is a guest device property so it should be moved into the interface between block layer and guest devices, which is the BlockBackend. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia

[Qemu-block] [PATCH v6 24/39] blockdev: Do not create BDS for empty drive

2015-10-12 Thread Max Reitz
Do not use "rudimentary" BDSs for empty drives any longer (for freshly created drives). After a follow-up patch, empty drives will generally use a NULL BDS, not only the freshly created drives. Signed-off-by: Max Reitz --- blockdev.c | 72

[Qemu-block] [PATCH v6 35/39] qmp: Introduce blockdev-change-medium

2015-10-12 Thread Max Reitz
Introduce a new QMP command 'blockdev-change-medium' which is intended to replace the 'change' command for block devices. The existing function qmp_change_blockdev() is accordingly renamed to qmp_blockdev_change_medium(). Signed-off-by: Max Reitz --- blockdev.c

[Qemu-block] [PATCH v3 1/4] util - add automated ID generation utility

2015-10-12 Thread Jeff Cody
Multiple sub-systems in QEMU may find it useful to generate IDs for objects that a user may reference via QMP or HMP. This patch presents a standardized way to do it, so that automatic ID generation follows the same rules. This patch enforces the following rules when generating an ID: 1.)

[Qemu-block] [PATCH v3 2/4] block: auto-generated node-names

2015-10-12 Thread Jeff Cody
If a node-name is not specified, automatically generate the node-name. Generated node-names will use the "block" sub-system identifier. Reviewed-by: Eric Blake Reviewed-by: John Snow Signed-off-by: Jeff Cody --- block.c | 19

[Qemu-block] [PATCH v3 0/4]

2015-10-12 Thread Jeff Cody
Changes from v2: Patch 1: Fixed prototype for id_generate() (thanks Alberto) Used *const instead of * const (thanks Eric, Markus) Updated function comment (thanks Markus) Made random in range 0-99 instead of 0-98 (thanks, Marksu) Patch 2:

[Qemu-block] [PATCH v3 3/4] block: add filter for generated node-names

2015-10-12 Thread Jeff Cody
Signed-off-by: Jeff Cody --- tests/qemu-iotests/common.filter | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter index d6d05de..cfdb633 100644 --- a/tests/qemu-iotests/common.filter +++

Re: [Qemu-block] [PATCH v3 06/16] block: Remove bdrv_open_image()

2015-10-12 Thread Jeff Cody
On Fri, Oct 09, 2015 at 02:15:31PM +0200, Kevin Wolf wrote: > It is unused now. > > Signed-off-by: Kevin Wolf > Reviewed-by: Max Reitz > Reviewed-by: Alberto Garcia > Reviewed-by: Fam Zheng > --- > block.c

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

2015-10-12 Thread Jeff Cody
On Fri, Oct 09, 2015 at 02:15:30PM +0200, Kevin Wolf wrote: > This patch removes the temporary duplication between bs->file and > bs->file_child by converting everything to BdrvChild. > > Signed-off-by: Kevin Wolf > Reviewed-by: Max Reitz > Reviewed-by:

Re: [Qemu-block] [PATCH v3 07/16] block: Convert bs->backing_hd to BdrvChild

2015-10-12 Thread Jeff Cody
On Fri, Oct 09, 2015 at 02:15:32PM +0200, Kevin Wolf wrote: > This is the final step in converting all of the BlockDriverState > pointers that block drivers use to BdrvChild. > > After this patch, bs->children contains the full list of child nodes > that are referenced by a given BDS, and these

[Qemu-block] [PATCH v3 4/4] qemu-iotests: update tests for generated node-names

2015-10-12 Thread Jeff Cody
Signed-off-by: Jeff Cody --- tests/qemu-iotests/041 | 4 ++-- tests/qemu-iotests/051 | 3 ++- tests/qemu-iotests/051.out | 2 +- tests/qemu-iotests/067 | 3 ++- tests/qemu-iotests/067.out | 5 + tests/qemu-iotests/081 | 3 ++- tests/qemu-iotests/081.out | 2

Re: [Qemu-block] [PATCH v7 4/5] block: add a 'blockdev-snapshot' QMP command

2015-10-12 Thread Alberto Garcia
On Mon 12 Oct 2015 10:29:35 PM CEST, Max Reitz wrote: >> -if (has_snapshot_node_name && >> -bdrv_lookup_bs(snapshot_node_name, snapshot_node_name, NULL)) { >> -error_setg(errp, "New snapshot node name already in use"); > > There's a difference from v6