[Qemu-block] [PATCH v2 1/2] qcow2: Make size_to_clusters() return uint64_t

2015-09-09 Thread Max Reitz
). Cc: qemu-stable <qemu-sta...@nongnu.org> Signed-off-by: Max Reitz <mre...@redhat.com> --- block/qcow2-cluster.c | 30 +++--- block/qcow2-refcount.c | 10 +++--- block/qcow2.h | 6 +++--- 3 files changed, 29 insertions(+), 17 deletions(-) diff -

[Qemu-block] [PATCH v3 1/2] qcow2: Make size_to_clusters() return uint64_t

2015-09-14 Thread Max Reitz
). Cc: qemu-stable <qemu-sta...@nongnu.org> Signed-off-by: Max Reitz <mre...@redhat.com> --- block/qcow2-cluster.c | 30 +++--- block/qcow2-refcount.c | 12 block/qcow2.h | 6 +++--- 3 files changed, 30 insertions(+), 18 deletions(-) diff -

[Qemu-block] [PATCH v3 0/2] qcow2: Make size_to_clusters() return uint64_t

2015-09-14 Thread Max Reitz
eam/downstream patch [down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively 001/2:[0002] [FC] 'qcow2: Make size_to_clusters() return uint64_t' 002/2:[] [--] 'iotests: Add test for checking large image files' Max Reitz (2): qcow2: M

[Qemu-block] [PATCH v3 2/2] iotests: Add test for checking large image files

2015-09-14 Thread Max Reitz
Add a test for checking a qcow2 file with a multiple of 2^32 clusters. Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> --- tests/qemu-iotests/138 | 73 ++ tests/qemu-iotests/138.out | 9 ++

Re: [Qemu-block] [PATCH v3 1/4] block: rename BlockdevSnapshot to BlockdevSnapshotSync

2015-09-11 Thread Max Reitz
ewed-by: Eric Blake <ebl...@redhat.com> > --- > blockdev.c | 2 +- > qapi-schema.json | 2 +- > qapi/block-core.json | 8 > 3 files changed, 6 insertions(+), 6 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [Qemu-devel] [PATCH v4 29/38] blockdev: Add blockdev-insert-medium

2015-09-11 Thread Max Reitz
On 11.09.2015 09:30, Wen Congyang wrote: > On 09/11/2015 03:09 AM, Max Reitz wrote: >> On 10.09.2015 03:12, Wen Congyang wrote: >>> On 09/09/2015 08:59 PM, Max Reitz wrote: >>>> On 09.09.2015 12:01, Wen Congyang wrote: >>>>> On 09/09/2015 05:20 AM, Max

Re: [Qemu-block] [PATCH v3 2/4] block: Add 'ignore-backing' field to BlockdevOptionsGenericCOWFormat

2015-09-11 Thread Max Reitz
On 10.09.2015 15:39, Alberto Garcia wrote: > If set to true, the image will be opened with the BDRV_O_NO_BACKING > flag. This is useful for creating snapshots using images opened with > blockdev-add, since they are not supposed to have a backing image > before the operation. > > Signed-off-by:

Re: [Qemu-block] [PATCH v3 2/4] block: Add 'ignore-backing' field to BlockdevOptionsGenericCOWFormat

2015-09-11 Thread Max Reitz
On 11.09.2015 19:28, Kevin Wolf wrote: > Am 11.09.2015 um 19:21 hat Max Reitz geschrieben: >> On 10.09.2015 15:39, Alberto Garcia wrote: >>> If set to true, the image will be opened with the BDRV_O_NO_BACKING >>> flag. This is useful for creating snapshots using images o

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

2015-09-11 Thread Max Reitz
gt; Signed-off-by: Alberto Garcia <be...@igalia.com> > --- > blockdev.c | 163 > --- > qapi-schema.json | 2 + > qapi/block-core.json | 26 > qmp-commands.hx | 29 +++++ > 4 files changed,

Re: [Qemu-block] [Qemu-devel] [PATCH v4 29/38] blockdev: Add blockdev-insert-medium

2015-09-10 Thread Max Reitz
On 10.09.2015 03:12, Wen Congyang wrote: > On 09/09/2015 08:59 PM, Max Reitz wrote: >> On 09.09.2015 12:01, Wen Congyang wrote: >>> On 09/09/2015 05:20 AM, Max Reitz wrote: >>>> On 08.09.2015 11:13, Wen Congyang wrote: >>>>> On 07/21/2015 01:45 AM,

Re: [Qemu-block] [Qemu-devel] [PATCH v4 29/38] blockdev: Add blockdev-insert-medium

2015-09-10 Thread Max Reitz
On 10.09.2015 05:22, Wen Congyang wrote: > On 09/09/2015 08:59 PM, Max Reitz wrote: >> On 09.09.2015 12:01, Wen Congyang wrote: >>> On 09/09/2015 05:20 AM, Max Reitz wrote: >>>> On 08.09.2015 11:13, Wen Congyang wrote: >>>>> On 07/21/2015 01:45 AM,

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

2015-09-28 Thread Max Reitz
qemu-iotests/061 | 8 > tests/qemu-iotests/061.out | 4 ++-- > 2 files changed, 6 insertions(+), 6 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

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

2015-10-01 Thread Max Reitz
> block.c | 12 > 1 file changed, 12 insertions(+) Reviewed-by: Max Reitz <mre...@redhat.com> (and an ACK to "Op blockers are a mess.") signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH 15/16] block: Add and use bdrv_replace_in_backing_chain()

2015-10-01 Thread Max Reitz
+ > 4 files changed, 49 insertions(+), 26 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH 13/16] block: Implement bdrv_append() without bdrv_swap()

2015-10-01 Thread Max Reitz
On 29.09.2015 15:51, Kevin Wolf wrote: > Am 23.09.2015 um 18:36 hat Max Reitz geschrieben: >> On 17.09.2015 15:48, Kevin Wolf wrote: >>> Remember all parent nodes and just change the pointers there instead of >>> swapping the contents of the BlockDriverState. >>&

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

2015-10-01 Thread Max Reitz
On 29.09.2015 11:15, Alberto Garcia wrote: > On Fri 18 Sep 2015 05:22:42 PM CEST, Max Reitz wrote: >> If bdrv_is_inserted() is called on the top level BDS, it should make >> sure all nodes in the BDS tree are actually inserted. >> >> Signed-off-by: Max Reitz <mre...@

Re: [Qemu-block] [PATCH 15/16] block: Add and use bdrv_replace_in_backing_chain()

2015-10-01 Thread Max Reitz
On 29.09.2015 17:22, Kevin Wolf wrote: > Am 23.09.2015 um 19:08 hat Max Reitz geschrieben: >> On 17.09.2015 15:48, Kevin Wolf wrote: >>> This cleans up the mess we left behind in the mirror code after the >>> previous patch. Instead of using bdrv_swap(), just change poin

Re: [Qemu-block] [PATCH v2 11/16] block-backend: Add blk_set_bs()

2015-10-02 Thread Max Reitz
iles changed, 19 insertions(+) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v2 13/16] block: Implement bdrv_append() without bdrv_swap()

2015-10-02 Thread Max Reitz
> blockdev.c | 2 +- > 2 files changed, 85 insertions(+), 29 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

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

2015-10-02 Thread Max Reitz
12 ++--- > block/stream.c| 8 ++-- > block/vmdk.c | 21 + > block/vvfat.c | 6 +-- > blockdev.c| 4 +- > include/block/block_int.h | 12 +++-- > qemu-img.c | 4 +- > 14 files changed, 125 inser

Re: [Qemu-block] [PATCH v2 14/16] blockjob: Store device name at job creation

2015-10-02 Thread Max Reitz
gt; include/block/blockjob.h | 8 > 3 files changed, 17 insertions(+), 9 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

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

2015-10-02 Thread Max Reitz
> block/stream.c| 30 +- > block/vvfat.c | 6 +- > include/block/block.h | 1 + > 5 files changed, 33 insertions(+), 55 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

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

2015-10-02 Thread Max Reitz
++- > block/vhdx.c | 36 ++- > block/vmdk.c | 27 ++-- > block/vpc.c | 34 + > include/block/block.h | 8 +- > include/block/block_int.h | 3 +-- > 26

Re: [Qemu-block] [PATCH 2/3] block: mirror - split out part of mirror_run()

2015-09-28 Thread Max Reitz
t; block/mirror.c | 206 > ++--- > 1 file changed, 110 insertions(+), 96 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH 1/3] block: allow creation of detached dirty bitmaps

2015-09-28 Thread Max Reitz
include/block/block.h | 1 + > migration/block.c | 2 +- > 5 files changed, 25 insertions(+), 9 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH 3/3] block: mirror - zero unallocated target sectors when zero init not present

2015-09-28 Thread Max Reitz
On 28.09.2015 05:29, Jeff Cody wrote: > During mirror, if the target device does not have support zero > initialization, a mirror may result in a corrupt image. > > For instance, on mirror to a host device with format = raw, whatever > random data is on the target device will still be there for

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

2015-09-23 Thread Max Reitz
On 17.09.2015 15:48, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block/io.c| 2 +- > include/block/block_int.h | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Max Reitz <mre...@redhat.com> In addition

Re: [Qemu-block] [PATCH 14/16] blockjob: Store device name at job creation

2015-09-23 Thread Max Reitz
On 17.09.2015 15:48, Kevin Wolf wrote: > Some block jobs change the block device graph on completion. This means > that the device that owns the job and originally was addressed with its > device name may no longer be what the corresponding BlockBackend points > to. > > Previously, the effects of

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

2015-09-23 Thread Max Reitz
> > --- > block.c | 155 > +- > block/qed.c | 7 --- > block/vvfat.c | 7 --- > include/block/block_int.h | 1 - > include/qemu/queue.h | 6 -- > 5 files changed, 1 in

Re: [Qemu-block] [PATCH 11/16] block-backend: Add blk_set_bs()

2015-09-23 Thread Max Reitz
On 17.09.2015 15:48, Kevin Wolf wrote: > It allows changing the BlockDriverState that a BlockBackend points to. > > Signed-off-by: Kevin Wolf > --- > block/block-backend.c | 16 > include/block/block_int.h | 2 ++ > 2 files changed, 18 insertions(+) > >

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

2015-09-23 Thread Max Reitz
On 17.09.2015 15:48, 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 logically be

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

2015-09-23 Thread Max Reitz
On 17.09.2015 15:48, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block.c | 3 +++ > include/block/block_int.h | 2 ++ > 2 files changed, 5 insertions(+) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc D

Re: [Qemu-block] [PATCH 13/16] block: Implement bdrv_append() without bdrv_swap()

2015-09-23 Thread Max Reitz
On 17.09.2015 15:48, Kevin Wolf wrote: > Remember all parent nodes and just change the pointers there instead of > swapping the contents of the BlockDriverState. > > Handling of snapshot=on must be moved further down in bdrv_open() > because *pbs (which is the bs pointer in the BlockBackend) must

Re: [Qemu-block] [PATCH 15/16] block: Add and use bdrv_replace_in_backing_chain()

2015-09-23 Thread Max Reitz
On 17.09.2015 15:48, Kevin Wolf wrote: > This cleans up the mess we left behind in the mirror code after the > previous patch. Instead of using bdrv_swap(), just change pointers. > > The interface change of the mirror job that callers must consider is > that after job completion, their local BDS

Re: [Qemu-block] [PATCH 02/16] vmdk: Use BdrvChild instead of BDS for references to extents

2015-09-22 Thread Max Reitz
On 17.09.2015 15:48, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block/vmdk.c | 99 > +++- > 1 file changed, 51 insertions(+), 48 deletions(-) Reviewed-by: Max Reitz <mre...@redh

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

2015-09-22 Thread Max Reitz
On 17.09.2015 15:48, Kevin Wolf wrote: > It is unused now. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block.c | 34 -- > include/block/block.h | 4 > 2 files changed, 38 deletions(-) Reviewed-by: M

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

2015-09-22 Thread Max Reitz
On 17.09.2015 15:48, 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] [PATCH 05/16] block: Convert bs->file to BdrvChild

2015-09-22 Thread Max Reitz
25 ++- > block/vhdx.c | 36 ++- > block/vmdk.c | 27 +++-- > block/vpc.c | 34 ++ > include/block/block.h | 8 +- > include/block/block_int.h | 3 +-- >

Re: [Qemu-block] [PATCH 03/16] blkverify: Convert s->test_file to BdrvChild

2015-09-22 Thread Max Reitz
On 17.09.2015 15:48, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block/blkverify.c | 41 + > 1 file changed, 21 insertions(+), 20 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.

Re: [Qemu-block] [PATCH 01/16] block: Introduce BDS.file_child

2015-09-22 Thread Max Reitz
On 22.09.2015 19:14, Max Reitz wrote: > On 17.09.2015 15:48, Kevin Wolf wrote: >> Store the BdrvChild for bs->file. At this point, bs->file_child->bs just >> duplicates the bs->file pointer. Later, it will completely replace it. >> >> Signed-off-by: Kevin Wol

Re: [Qemu-block] [PATCH 01/16] block: Introduce BDS.file_child

2015-09-22 Thread Max Reitz
> block.c | 12 +--- > include/block/block_int.h | 1 + > 2 files changed, 10 insertions(+), 3 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> Although I have a small comment below: > > diff --git a/block.c b/block.c > index 6268e37..2e9e5e2 100644 > --

Re: [Qemu-block] [PATCH v5 19/38] block: Fail requests to empty BlockBackend

2015-09-22 Thread Max Reitz
On 22.09.2015 16:30, Kevin Wolf wrote: > Am 18.09.2015 um 17:22 hat Max Reitz geschrieben: >> If there is no BlockDriverState in a BlockBackend or if the tray of the >> guest device is open, fail all requests (where that is possible) with >> -ENOMEDIUM. >> >> T

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

2015-09-22 Thread Max Reitz
On 22.09.2015 16:17, Kevin Wolf wrote: > Am 18.09.2015 um 17:22 hat Max Reitz geschrieben: >> 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. > > This is mag

Re: [Qemu-block] [PATCH v5 21/38] block: Add blk_insert_bs()

2015-09-22 Thread Max Reitz
On 22.09.2015 16:42, Kevin Wolf wrote: > Am 18.09.2015 um 17:22 hat Max Reitz geschrieben: >> This function associates the given BlockDriverState with the given >> BlockBackend. >> >> Signed-off-by: Max Reitz <mre...@redhat.com> >> Reviewed-by: Eri

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

2015-09-18 Thread Max Reitz
gt; Signed-off-by: Alberto Garcia <be...@igalia.com> > Reviewed-by: Eric Blake <ebl...@redhat.com> > Cc: Max Reitz <mre...@redhat.com> > --- > blockdev.c | 163 > --- > qapi-schema.json | 2 + > qapi/blo

Re: [Qemu-block] [PATCH v4 4/4] block: add tests for the 'blockdev-snapshot' command

2015-09-18 Thread Max Reitz
On 14.09.2015 18:01, Alberto Garcia wrote: > Signed-off-by: Alberto Garcia > --- > tests/qemu-iotests/085 | 102 > ++--- > tests/qemu-iotests/085.out | 34 ++- > 2 files changed, 128 insertions(+), 8 deletions(-) Looks

[Qemu-block] [PATCH v5 19/38] block: Fail requests to empty BlockBackend

2015-09-18 Thread Max Reitz
BlockBackend as the guest uses should fail. If the BDS tree is supposed to be usable even after ejecting it from the guest, a different BlockBackend must be used. Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> --- block/block-ba

Re: [Qemu-block] [PATCH v5 2/4] block: support passing 'backing': '' to 'blockdev-add'

2015-09-18 Thread Max Reitz
> blockdev-add, since they are not supposed to have a backing image > before the operation. > > Signed-off-by: Alberto Garcia <be...@igalia.com> > --- > block.c | 7 +++ > 1 file changed, 7 insertions(+) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

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

2015-09-18 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 <mre...@redhat.com> --- blockdev.c

[Qemu-block] [PATCH v5 25/38] blockdev: Allow more options for BB-less BDS tree

2015-09-18 Thread Max Reitz
Most of the options which blockdev_init() parses for both the BlockBackend and the root BDS are valid for just the root BDS as well (e.g. read-only). This patch allows specifying these options even if not creating a BlockBackend. Signed-off-by: Max Reitz <mre...@redhat.com> --- blockdev.c

[Qemu-block] [PATCH v5 27/38] blockdev: Add blockdev-open-tray

2015-09-18 Thread Max Reitz
Signed-off-by: Max Reitz <mre...@redhat.com> --- blockdev.c | 49 + qapi/block-core.json | 23 +++ qmp-commands.hx | 39 +++ 3 files changed, 111 insertions(+) diff

[Qemu-block] [PATCH v5 36/38] blockdev: read-only-mode for blockdev-change-medium

2015-09-18 Thread Max Reitz
find it useful to be able to therefore change the read-only status of a block device when changing the medium. Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> --- blockdev.c | 25 - hmp.c| 2 +-

[Qemu-block] [PATCH v5 22/38] block: Prepare for NULL BDS

2015-09-18 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 <mre...@redhat.com> --- b

[Qemu-block] [PATCH v5 26/38] block: Add blk_remove_bs()

2015-09-18 Thread Max Reitz
This function removes the BlockDriverState associated with the given BlockBackend from that BB and sets the BDS pointer in the BB to NULL. Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> --- block/block-backend.c

[Qemu-block] [PATCH v5 33/38] block: Inquire tray state before tray-moved events

2015-09-18 Thread Max Reitz
should be sent whenever the status changed). Checking @load is now superfluous; it was necessary because it was possible to change a medium without having explicitly opened the tray and closed it again (or it might have been possible, at least). This is no longer possible, though. Signed-off-by: Max

Re: [Qemu-block] [PATCH] throttle: test that snapshots move the throttling configuration

2015-09-18 Thread Max Reitz
met, I'll have to send a new version of that series anyway... So, since 096 is not a magic number I'm extremely keen on keeping in my greedy claws: Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

[Qemu-block] [PATCH v5 29/38] blockdev: Add blockdev-remove-medium

2015-09-18 Thread Max Reitz
Signed-off-by: Max Reitz <mre...@redhat.com> --- blockdev.c | 30 ++ qapi/block-core.json | 15 +++ qmp-commands.hx | 45 + 3 files changed, 90 insertions(+) diff --git a/blockdev.c b/bloc

[Qemu-block] [PATCH v5 35/38] hmp: Use blockdev-change-medium for change command

2015-09-18 Thread Max Reitz
Use separate code paths for the two overloaded functions of the 'change' HMP command, and invoke the 'blockdev-change-medium' QMP command if used on a block device (by calling qmp_blockdev_change_medium()). Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@r

[Qemu-block] [PATCH v5 34/38] qmp: Introduce blockdev-change-medium

2015-09-18 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 <mre...@redhat.com> --- bloc

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

2015-09-18 Thread Max Reitz
Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> --- tests/qemu-iotests/118 | 638 + tests/qemu-iotests/118.out | 5 + tests/qemu-iotests/group | 1 + 3 files changed, 644 insertions(+)

[Qemu-block] [PATCH v5 30/38] blockdev: Add blockdev-insert-medium

2015-09-18 Thread Max Reitz
And a helper function for that, which directly takes a pointer to the BDS to be inserted instead of its node-name (which will be used for implementing 'change' using blockdev-insert-medium). Signed-off-by: Max Reitz <mre...@redhat.com> --- blockdev.c

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

2015-09-18 Thread Max Reitz
S options which are not parsed by bdrv_open() (like caching) cannot be specified for these BB-less BDS trees yet. A future patch will remove this limitation. Signed-off-by: Max Reitz <mre...@redhat.com> --- blockdev.c | 44 +++--

Re: [Qemu-block] [PATCH v5 4/4] block: add tests for the 'blockdev-snapshot' command

2015-09-18 Thread Max Reitz
sertions(+), 8 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

[Qemu-block] [PATCH v5 23/38] blockdev: Do not create BDS for empty drive

2015-09-18 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 <mre...@redhat.com> ---

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

2015-09-18 Thread Max Reitz
Make bdrv_is_inserted(), blk_is_inserted(), and the callback BlockDriver.bdrv_is_inserted() return a bool. Suggested-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Alberto Garcia

[Qemu-block] [PATCH v5 06/38] block: Add blk_is_available()

2015-09-18 Thread Max Reitz
blk_is_available() returns true iff the BDS is inserted (which means blk_bs() is not NULL and bdrv_is_inserted() returns true) and if the tray of the guest device is closed. blk_is_inserted() is changed to return true only if blk_bs() is not NULL. Signed-off-by: Max Reitz <mre...@redhat.

[Qemu-block] [PATCH v5 04/38] iotests: Only create BB if necessary

2015-09-18 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 v5 11/38] hw/usb-storage: Check whether BB is inserted

2015-09-18 Thread Max Reitz
Only call bdrv_add_key() on the BlockDriverState if it is not NULL. Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> --- hw/usb/dev-storage.c | 30 -- 1 file chan

[Qemu-block] [PATCH v5 12/38] block: Fix BB AIOCB AioContext without BDS

2015-09-18 Thread Max Reitz
makes blk_get_aio_context() fall back to the main loop context if the BDS pointer is NULL and implements AIOCBInfo::get_aio_context() (blk_aiocb_get_aio_context()) which invokes blk_get_aio_context(). Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com&

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

2015-09-18 Thread Max Reitz
If bdrv_is_inserted() is called on the top level BDS, it should make sure all nodes in the BDS tree are actually inserted. Signed-off-by: Max Reitz <mre...@redhat.com> --- block.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index 4

[Qemu-block] [PATCH v5 14/38] block: Remove wr_highest_sector from BlockAcctStats

2015-09-18 Thread Max Reitz
calculate the volume usage by (wr_highest_offset + 512) / volume_size, after this patch they will just assume the volume to be full slightly earlier than before. Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Alberto Garcia <be.

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

2015-09-18 Thread Max Reitz
This flag should not be set for the root BDS only, but for any BDS that is being created while incoming migration is pending, so setting it is moved from blockdev_init() to bdrv_fill_options(). Signed-off-by: Max Reitz <mre...@redhat.com> --- block.c| 4 blockdev.c | 4 2

[Qemu-block] [PATCH v5 15/38] block: Move BlockAcctStats into BlockBackend

2015-09-18 Thread Max Reitz
As the comment above bdrv_get_stats() says, BlockAcctStats is something which belongs to the device instead of each BlockDriverState. This patch therefore moves it into the BlockBackend. Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed

[Qemu-block] [PATCH v5 18/38] block: Make some BB functions fall back to BBRS

2015-09-18 Thread Max Reitz
If there is no BDS tree attached to a BlockBackend, functions that can do so should fall back to the BlockBackendRootState structure (which are blk_is_read_only() and blk_get_flags(), because the read-only status and the "open flags" are part of the BBRS). Signed-off-by: Max

[Qemu-block] [PATCH v5 20/38] block: Prepare remaining BB functions for NULL BDS

2015-09-18 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 v5 17/38] block: Add BlockBackendRootState

2015-09-18 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 <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> --- block/block-backend.c

[Qemu-block] [PATCH v5 10/38] hw/block/fdc: Implement tray status

2015-09-18 Thread Max Reitz
The tray of an FDD is open iff there is no medium inserted (there are only two states for an FDD: "medium inserted" or "no medium inserted"). Signed-off-by: Max Reitz <mre...@redhat.com> --- hw/block/fdc.c | 20 tests/fdc-test.c | 4 +--- 2 fi

[Qemu-block] [PATCH v5 16/38] block: Move I/O status and error actions into BB

2015-09-18 Thread Max Reitz
These options are only relevant for the user of a whole BDS tree (like a guest device or a block job) and should thus be moved into the BlockBackend. Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> --- block.c

[Qemu-block] [PATCH v5 13/38] block: Move guest_block_size into BlockBackend

2015-09-18 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 <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Alberto Garcia <b

[Qemu-block] [PATCH v5 28/38] blockdev: Add blockdev-close-tray

2015-09-18 Thread Max Reitz
Signed-off-by: Max Reitz <mre...@redhat.com> --- 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 6

[Qemu-block] [PATCH v5 21/38] block: Add blk_insert_bs()

2015-09-18 Thread Max Reitz
This function associates the given BlockDriverState with the given BlockBackend. Signed-off-by: Max Reitz <mre...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Alberto Garcia <be...@igalia.com> --- block/block-backend.c | 16 in

Re: [Qemu-block] [PATCH v2 06/21] block: Exclude nested options only for children in append_open_options()

2015-11-27 Thread Max Reitz
K so append_open_options() will never have to handle anything but "file" and "backing". 3. Fix bdrv_refresh_filename() so that it handles all children and not just "file" and "backing". Since we are shooting for 2.6 anyway (I assume ;-)), I think we should go for option 3. This means that this patch is fine, and I'll see to fixing bdrv_refresh_filename() (because I'm working on that anyway). Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v2 14/21] blockdev: Set 'format' indicates non-empty drive

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > Creating an empty drive while specifying 'format' doesn't make sense. > The specified format driver would simply be ignored. > > Make a set 'format' option an indication that a non-empty drive should > be created. This makes 'format' consistent with

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

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > Just reopening the children (as block.c does now) is enough. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block/blkdebug.c | 7 +++ > 1 file changed, 7 insertions(+) Reviewed-by: Max Reitz <mre...@redhat.com>

Re: [Qemu-block] [PATCH v2 17/21] block: Move cache options into options QDict

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > This adds the cache mode options to the QDict, so that they can be > specified for child nodes (e.g. backing.cache.direct=off). > > The cache modes are not removed from the flags at this point; instead, > options and flags are kept in sync. If the user

Re: [Qemu-block] [PATCH v2 13/21] block: Introduce bs->explicit_options

2015-11-27 Thread Max Reitz
ude/block/block.h | 1 + > include/block/block_int.h | 1 + > 3 files changed, 24 insertions(+), 2 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v2 06/21] block: Exclude nested options only for children in append_open_options()

2015-11-27 Thread Max Reitz
On 27.11.2015 18:58, Max Reitz wrote: > On 23.11.2015 16:59, Kevin Wolf wrote: >> Some drivers have nested options (e.g. blkdebug rule arrays), which >> don't belong to a child node and shouldn't be removed. Don't remove all >> options with "." in their name, but

Re: [Qemu-block] [PATCH v2 12/21] block: Split out parse_json_protocol()

2015-11-27 Thread Max Reitz
gt; In preparation for the distinction, move json: parse to a separate > function. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block.c | 50 -- > 1 file changed, 32 insertions(+), 18 deletions(-) Reviewed-by: Max

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

2015-11-27 Thread Max Reitz
> @@ -724,6 +737,21 @@ static void mirror_start_job(BlockDriverState *bs, > BlockDriverState *target, > buf_size = DEFAULT_MIRROR_BUF_SIZE; > } > > +/* We can't support this case as long as the block layer can't handle > + * multple BlockBa

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

2015-11-27 Thread Max Reitz
+++- > 1 file changed, 15 insertions(+), 1 deletion(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v2 04/21] block: Allow references for backing files

2015-11-27 Thread Max Reitz
qdict_put(options, "driver", qstring_from_str(bs->backing_format)); > } > > assert(bs->backing == NULL); This assert() can be dropped along with the bdrv_new() call (they are related: originally, the bdrv_open_inherit() call below took >backing_hd

Re: [Qemu-block] [PATCH v2 11/21] block: Add infrastructure for option inheritance

2015-11-27 Thread Max Reitz
c | 52 > --- > include/block/block_int.h | 3 ++- > 2 files changed, 33 insertions(+), 22 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v7 14/24] nbd: Switch from close to eject notifier

2015-12-02 Thread Max Reitz
On 01.12.2015 14:16, Kevin Wolf wrote: > Am 30.11.2015 um 18:22 hat Max Reitz geschrieben: >> On 30.11.2015 16:36, Kevin Wolf wrote: >>> Am 09.11.2015 um 23:39 hat Max Reitz geschrieben: >>>> The NBD code uses the BDS close notifier to determine when a medium

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

2015-12-02 Thread Max Reitz
On 01.12.2015 15:44, Alberto Garcia wrote: > On Tue 10 Nov 2015 04:44:22 AM CET, Max Reitz wrote: >> @@ -1398,32 +1397,21 @@ static int bdrv_open_inherit(BlockDriverState **pbs, >> const char *filename, >> bool options_non_empty = options ? qdict_

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

2015-12-02 Thread Max Reitz
On 01.12.2015 15:35, Alberto Garcia wrote: > On Tue 10 Nov 2015 04:44:18 AM CET, Max Reitz wrote: >> -int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp) >> +static BlockDriverState *bdrv_append_temp_snapshot(Block

Re: [Qemu-block] [PATCH v2 7/8] block: Move some bdrv_*_all() functions to BB

2015-12-04 Thread Max Reitz
On 01.12.2015 17:01, Kevin Wolf wrote: > Am 10.11.2015 um 04:27 hat Max Reitz geschrieben: >> Move bdrv_drain_all(), bdrv_commit_all(), bdrv_flush_all() and >> bdrv_invalidate_cache_all() to BB. >> >> The only operation left is bdrv_close_all(), which cannot be moved to

Re: [Qemu-block] [PATCH v3 06/21] block: Exclude nested options only for children in append_open_options()

2015-12-04 Thread Max Reitz
y existing child nodes. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block.c | 20 > include/block/block_int.h | 1 + > 2 files changed, 17 insertions(+), 4 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v3 17/21] block: Move cache options into options QDict

2015-12-04 Thread Max Reitz
evin Wolf <kw...@redhat.com> > --- > block.c| 100 > ++--- > blockdev.c | 52 ++-- > 2 files changed, 111 insertions(+), 41 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v3 14/21] blockdev: Set 'format' indicates non-empty drive

2015-12-04 Thread Max Reitz
sts/qemu-iotests/iotests.py | 2 +- > 3 files changed, 4 insertions(+), 7 deletions(-) Reviewed-by: Max Reitz <mre...@redhat.com> signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.5?] qcow2: always initialize specific image info

2015-12-07 Thread Max Reitz
On 07.12.2015 19:11, Denis V. Lunev wrote: > On 12/07/2015 08:54 PM, Eric Blake wrote: >> On 12/07/2015 10:51 AM, Eric Blake wrote: >>> [adding qemu-devel - ALL patches should go to qemu-devel, even if they >>> are also going to a sub-list like qemu-block] >>> >>> On 12/07/2015 10:07 AM, Roman

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