[Qemu-block] interesting blog post about asynchronous execution

2015-11-23 Thread Paolo Bonzini
This is about the experience with asynchronous execution in Midori (a research OS written at Microsoft in a C#-like language, which was later turned into a playground for features to be added to C#): http://joeduffyblog.com/2015/11/19/asynchronous-everything/ Some parts will definitely ring a

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.6 1/3] backup: Use Bitmap to replace "s->bitmap"

2015-11-23 Thread Wen Congyang
On 11/23/2015 05:19 PM, Fam Zheng wrote: > On Mon, 11/23 17:01, Wen Congyang wrote: >> On 11/20/2015 05:59 PM, Fam Zheng wrote: >>> "s->bitmap" tracks done sectors, we only check bit states without using any >>> iterator which HBitmap is good for. Switch to "Bitmap" which is simpler and >>> more

Re: [Qemu-block] [PATCH for-2.5 v2 0/4] block: replace IOV_MAX with BlockLimits.max_iov

2015-11-23 Thread Stefan Hajnoczi
On Thu, Jul 09, 2015 at 10:56:43AM +0100, Stefan Hajnoczi wrote: > v2: > * Default to IOV_MAX instead of INT_MAX [Peter Lieven] > > This series depends on "[PATCH] block/mirror: limit qiov to IOV_MAX elements". > > IOV_MAX has been hardcoded in several places since preadv()/pwritev()/etc >

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.6 1/3] backup: Use Bitmap to replace "s->bitmap"

2015-11-23 Thread Wen Congyang
On 11/20/2015 05:59 PM, Fam Zheng wrote: > "s->bitmap" tracks done sectors, we only check bit states without using any > iterator which HBitmap is good for. Switch to "Bitmap" which is simpler and > more memory efficient. > > Meanwhile, rename it to done_bitmap, to reflect the intention. > >

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.6 1/3] backup: Use Bitmap to replace "s->bitmap"

2015-11-23 Thread Fam Zheng
On Mon, 11/23 17:01, Wen Congyang wrote: > On 11/20/2015 05:59 PM, Fam Zheng wrote: > > "s->bitmap" tracks done sectors, we only check bit states without using any > > iterator which HBitmap is good for. Switch to "Bitmap" which is simpler and > > more memory efficient. > > > > Meanwhile, rename

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.6 1/3] backup: Use Bitmap to replace "s->bitmap"

2015-11-23 Thread Fam Zheng
On Mon, 11/23 17:24, Wen Congyang wrote: > On 11/23/2015 05:19 PM, Fam Zheng wrote: > > On Mon, 11/23 17:01, Wen Congyang wrote: > >> On 11/20/2015 05:59 PM, Fam Zheng wrote: > >>> "s->bitmap" tracks done sectors, we only check bit states without using > >>> any > >>> iterator which HBitmap is

Re: [Qemu-block] [Qemu-devel] [PATCH WIP 01/30] crypto: add QCryptoSecret object class for password/key handling

2015-11-23 Thread Daniel P. Berrange
On Fri, Nov 20, 2015 at 03:09:25PM -0700, Eric Blake wrote: > On 11/20/2015 11:04 AM, Daniel P. Berrange wrote: > > + > > +static const char *base64_valid_chars = > > +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; > > + > > +static int > >

Re: [Qemu-block] [Qemu-devel] [PATCH WIP 04/30] qcow2: add a 'keyid' parameter to qcow2 options

2015-11-23 Thread Daniel P. Berrange
On Fri, Nov 20, 2015 at 03:15:27PM -0700, Eric Blake wrote: > On 11/20/2015 11:04 AM, Daniel P. Berrange wrote: > > Add a 'keyid' parameter that refers to the ID of a > > QCryptoSecret instance that provides the encryption key. > > > > $QEMU \ > > -object

Re: [Qemu-block] [Qemu-devel] [PATCH] qemu-iotests: Add -nographic when starting QEMU in 119 and 120

2015-11-23 Thread Fam Zheng
On Mon, 11/23 08:33, Markus Armbruster wrote: > Fam Zheng writes: > > > Otherwise, a window flashes on my desktop (built with SDL). Add this as > > other cases have it. > > > > Signed-off-by: Fam Zheng > > > > --- > > v2: Fix 119 too. [Max] > > --- > >

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.6 1/3] backup: Use Bitmap to replace "s->bitmap"

2015-11-23 Thread Wen Congyang
On 11/23/2015 05:55 PM, Fam Zheng wrote: > On Mon, 11/23 17:24, Wen Congyang wrote: >> On 11/23/2015 05:19 PM, Fam Zheng wrote: >>> On Mon, 11/23 17:01, Wen Congyang wrote: On 11/20/2015 05:59 PM, Fam Zheng wrote: > "s->bitmap" tracks done sectors, we only check bit states without using

Re: [Qemu-block] [PATCH for-2.5 v2 0/4] block: replace IOV_MAX with BlockLimits.max_iov

2015-11-23 Thread Stefan Hajnoczi
On Wed, Nov 18, 2015 at 03:51:29PM +0100, Kevin Wolf wrote: > Am 09.07.2015 um 11:56 hat Stefan Hajnoczi geschrieben: > > v2: > > * Default to IOV_MAX instead of INT_MAX [Peter Lieven] > > > > This series depends on "[PATCH] block/mirror: limit qiov to IOV_MAX > > elements". > > > > IOV_MAX

Re: [Qemu-block] [Qemu-devel] [PATCH WIP 01/30] crypto: add QCryptoSecret object class for password/key handling

2015-11-23 Thread Markus Armbruster
"Daniel P. Berrange" writes: > On Fri, Nov 20, 2015 at 03:09:25PM -0700, Eric Blake wrote: >> On 11/20/2015 11:04 AM, Daniel P. Berrange wrote: >> > + >> > +static const char *base64_valid_chars = >> > +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

Re: [Qemu-block] [PATCH] virtio-blk: Move resetting of req->mr_next to virtio_blk_handle_rw_error

2015-11-23 Thread Paolo Bonzini
On 23/11/2015 01:41, Fam Zheng wrote: > "werror=report" would free the req in virtio_blk_handle_rw_error, we > mustn't write to it in that case. > > Reported-by: Paolo Bonzini > Signed-off-by: Fam Zheng > --- > hw/block/virtio-blk.c | 7 +++ > 1 file

Re: [Qemu-block] [Qemu-devel] [PATCH WIP 01/30] crypto: add QCryptoSecret object class for password/key handling

2015-11-23 Thread Daniel P. Berrange
On Mon, Nov 23, 2015 at 02:39:27PM +0100, Markus Armbruster wrote: > "Daniel P. Berrange" writes: > > > On Fri, Nov 20, 2015 at 03:09:25PM -0700, Eric Blake wrote: > >> On 11/20/2015 11:04 AM, Daniel P. Berrange wrote: > >> > + > >> > +static const char *base64_valid_chars =

[Qemu-block] [PATCH for-2.6 14/14] iotests: Add "qemu-img map" test for VMDK extents

2015-11-23 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/059 | 10 ++ tests/qemu-iotests/059.out | 38 ++ 2 files changed, 48 insertions(+) diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059 index 0ded0c3..261d8b0 100755 ---

[Qemu-block] [PATCH for-2.6 02/14] qcow: Assign bs->file->bs to file in qcow_co_get_block_status

2015-11-23 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/qcow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow.c b/block/qcow.c index 558f443..b59383f 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -509,6 +509,7 @@ static int64_t coroutine_fn

Re: [Qemu-block] [PATCH for-2.5] block-migration: limit the memory usage

2015-11-23 Thread Stefan Hajnoczi
On Mon, Nov 23, 2015 at 05:31:33PM +0100, Juan Quintela wrote: > Wen Congyang wrote: > > If we set migration speed in a very large value, block-migration will try > > to read > > all data to the memory. Because > > (block_mig_state.submitted + block_mig_state.read_done)

[Qemu-block] [PATCH for-2.6 08/14] sheepdog: Assign bs to file in sd_co_get_block_status

2015-11-23 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/sheepdog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/sheepdog.c b/block/sheepdog.c index 0f6789e..d5e7ff8 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -2740,6 +2740,9 @@ sd_co_get_block_status(BlockDriverState *bs,

[Qemu-block] [PATCH for-2.6 04/14] raw: Assign bs to file in raw_co_get_block_status

2015-11-23 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/raw-posix.c | 1 + block/raw_bsd.c | 1 + 2 files changed, 2 insertions(+) diff --git a/block/raw-posix.c b/block/raw-posix.c index 2cd7d68..9988aa4 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -1873,6 +1873,7 @@ static int64_t

[Qemu-block] [PATCH for-2.6 10/14] vpc: Assign bs->file->bs to file in vpc_co_get_block_status

2015-11-23 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/vpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/vpc.c b/block/vpc.c index 912f5d0..412ff41 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -588,6 +588,7 @@ static int64_t coroutine_fn vpc_co_get_block_status(BlockDriverState

[Qemu-block] [PATCH for-2.6 01/14] block: Add "file" output parameter to block status query functions

2015-11-23 Thread Fam Zheng
The added parameter can be used to return the BDS pointer which the valid offset is refering to. It's value should be ignored unless BDRV_BLOCK_OFFSET_VALID in ret is set. Until block drivers fill in the right value, let's clear it explicitly right before calling .bdrv_get_block_status.

[Qemu-block] [PATCH for-2.6 00/14] qemu-img map: Allow driver to return file of the allocated block

2015-11-23 Thread Fam Zheng
I stumbled upon this when looking at external bitmap formats. Current "qemu-img map" command only displays filename if the data is allocated in bs (bs->file) itself, or in the backing chain. Otherwise, it displays an unfriendly error message: $ qemu-img create -f vmdk -o

[Qemu-block] [PATCH for-2.6 06/14] parallels: Assign bs->file->bs to file in parallels_co_get_block_status

2015-11-23 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/parallels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels.c b/block/parallels.c index 04f0e87..d1406b1 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -273,6 +273,7 @@ static int64_t coroutine_fn

[Qemu-block] [PATCH for-2.6 07/14] qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_status

2015-11-23 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/qed.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/qed.c b/block/qed.c index a6bbd8b..03af9c1 100644 --- a/block/qed.c +++ b/block/qed.c @@ -692,6 +692,7 @@ typedef struct { uint64_t pos; int64_t status; int

[Qemu-block] [PATCH for-2.6 09/14] vdi: Assign bs->file->bs to file in vdi_co_get_block_status

2015-11-23 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/vdi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/vdi.c b/block/vdi.c index 2199fd3..6b1a57b 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -550,6 +550,7 @@ static int64_t coroutine_fn vdi_co_get_block_status(BlockDriverState *bs,

[Qemu-block] [PATCH for-2.6 12/14] qemu-img: In 'map', use QDict to generate JSON output

2015-11-23 Thread Fam Zheng
Switch json output generation from hand-written to QDict encoder, so that the coming str field will be properly escaped. Iotest 122 output is updated accordingly. Signed-off-by: Fam Zheng --- qemu-img.c | 30 +++ tests/qemu-iotests/122.out | 96

[Qemu-block] [PATCH for-2.6 11/14] vmdk: Return extent's file in bdrv_get_block_status

2015-11-23 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/vmdk.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index f5a56fd..b60a5af 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1265,6 +1265,7 @@ static int64_t coroutine_fn

[Qemu-block] [PATCH for-2.6 13/14] qemu-img: In "map" output, support external file name

2015-11-23 Thread Fam Zheng
The new "file" output parameter of bdrv_get_block_status tells which file the valid offset is referring to, we can use the information and output the filename. The iotest 122 reference output is updated accordingly. Signed-off-by: Fam Zheng --- qemu-img.c | 12

[Qemu-block] [PATCH v2 2/3] block: Hide HBitmap in block dirty bitmap interface

2015-11-23 Thread Fam Zheng
HBitmap is an implementation detail of block dirty bitmap that should be hidden from users. Introduce a BdrvDirtyBitmapIter to encapsulate the underlying HBitmapIter. A small difference in the interface is, before, an HBitmapIter is initialized in place, now the new BdrvDirtyBitmapIter must be

[Qemu-block] [PATCH v2 3/3] hbitmap: Drop "granularity"

2015-11-23 Thread Fam Zheng
Sometimes confused with the granularity with coarse levels in HBitmap, the granularity in the hbitmap_alloc is not an essential concept of a bitmap. Now that all callers except the test code use zero, it's possible to drop the parameter to make the interface cleaner and more intuitive. Test code

[Qemu-block] [PATCH v2 0/3] Bitmap clean-up patches for 2.6

2015-11-23 Thread Fam Zheng
v2: bitmap_set -> set_bit. [Congyang, Paolo, John] Add John Snow's rev-by with that change. This makes a cleaner base for more dirty bitmap work. "granularity" appearing with different representations have always been mind twisting, remove it from HBitmap to make the interface and

[Qemu-block] [PATCH v2 1/3] backup: Use Bitmap to replace "s->bitmap"

2015-11-23 Thread Fam Zheng
"s->bitmap" tracks done sectors, we only check bit states without using any iterator which HBitmap is good for. Switch to "Bitmap" which is simpler and more memory efficient. Meanwhile, rename it to done_bitmap, to reflect the intention. Signed-off-by: Fam Zheng Reviewed-by:

Re: [Qemu-block] [PATCH] nand: fix flash erase when oob is in memory

2015-11-23 Thread Rabin Vincent
(to: Kevin and cc: qemu-block) On Fri, Nov 13, 2015 at 02:17:28PM +0100, Ricard Wanderlöf wrote: > > For the "main area on file, oob in memory" case, fix the shifts so that > we erase the correct number of pages. > > Signed-off-by: Ricard Wanderlöf > --- > hw/block/nand.c |

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.6 01/14] block: Add "file" output parameter to block status query functions

2015-11-23 Thread Fam Zheng
On Mon, 11/23 22:30, Eric Blake wrote: > On 11/23/2015 10:21 PM, Fam Zheng wrote: > > The added parameter can be used to return the BDS pointer which the > > valid offset is refering to. It's value should be ignored unless > > s/refering/referring/ > > > BDRV_BLOCK_OFFSET_VALID in ret is set. >

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.6 12/14] qemu-img: In 'map', use QDict to generate JSON output

2015-11-23 Thread Eric Blake
On 11/23/2015 10:22 PM, Fam Zheng wrote: > Switch json output generation from hand-written to QDict encoder, so > that the coming str field will be properly escaped. > > Iotest 122 output is updated accordingly. > > Signed-off-by: Fam Zheng > --- > qemu-img.c |

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.6 12/14] qemu-img: In 'map', use QDict to generate JSON output

2015-11-23 Thread Fam Zheng
On Mon, 11/23 22:42, Eric Blake wrote: > On 11/23/2015 10:22 PM, Fam Zheng wrote: > > +++ b/tests/qemu-iotests/122.out > > @@ -49,12 +49,13 @@ read 65536/65536 bytes at offset 4194304 > > 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > > read 65536/65536 bytes at offset 8388608 > > 64

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

2015-11-23 Thread Wen Congyang
On 11/23/2015 11:59 PM, 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 check for the complete prefixes of > actually existing child nodes. > >

Re: [Qemu-block] [PATCH] virtio-blk: Move resetting of req->mr_next to virtio_blk_handle_rw_error

2015-11-23 Thread Stefan Hajnoczi
On Mon, Nov 23, 2015 at 08:41:20AM +0800, Fam Zheng wrote: > "werror=report" would free the req in virtio_blk_handle_rw_error, we > mustn't write to it in that case. > > Reported-by: Paolo Bonzini > Signed-off-by: Fam Zheng > --- > hw/block/virtio-blk.c |

Re: [Qemu-block] [Patch v7 3/3] qmp: add monitor command to add/remove a child

2015-11-23 Thread Wen Congyang
On 11/24/2015 12:30 AM, Eric Blake wrote: > On 11/22/2015 11:23 PM, Wen Congyang wrote: >> The new QMP command name is x-blockdev-change. It justs for adding/removing > > s/It justs/It's just/ > >> quorum's child now, and don't support all kinds of children, all kinds of > > s/don't/doesn't/ >

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.6 2/3] block: Hide HBitmap in block dirty bitmap interface

2015-11-23 Thread Fam Zheng
On Mon, 11/23 16:34, John Snow wrote: > Hmm, what's the idea, here? > > This patch does a lot more than just hide hbitmap details from callers > of block_dirty_bitmap functions. > > So we're changing the backing hbitmap to always be one where g=0 and the > number of physical bits directly is

Re: [Qemu-block] interesting blog post about asynchronous execution

2015-11-23 Thread Stefan Hajnoczi
On Mon, Nov 23, 2015 at 08:34:44PM +0100, Paolo Bonzini wrote: > This is about the experience with asynchronous execution in Midori (a > research OS written at Microsoft in a C#-like language, which was later > turned into a playground for features to be added to C#): > >

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

2015-11-23 Thread Kevin Wolf
Just reopening the children (as block.c does now) is enough. Signed-off-by: Kevin Wolf --- block/blkdebug.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block/blkdebug.c b/block/blkdebug.c index bc0f041..459a3d9 100644 --- a/block/blkdebug.c +++

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.6 1/3] backup: Use Bitmap to replace "s->bitmap"

2015-11-23 Thread Paolo Bonzini
On 23/11/2015 10:55, Fam Zheng wrote: >>> Why? I think bitmap_set is a better match with bitmap_new below. >> >> set_bit() is quicker than bitmap_set() if you only set one bit. > > How much quicker is it? This doesn't sound convincing enough for me to lose > the > readability. Substantially.

[Qemu-block] [PATCH v2 16/21] block: reopen: Extract QemuOpts for generic block layer options

2015-11-23 Thread Kevin Wolf
This patch adds a QemuOpts for generic block layer options to bdrv_reopen_prepare(). The only two options that currently exist (node-name and driver) cannot be changed, so the only thing we do is putting them right back into the QDict so that we check at the end that they are indeed unchanged. We

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

2015-11-23 Thread Kevin Wolf
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 'driver' and allows using it with a block driver that

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

2015-11-23 Thread Kevin Wolf
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 specifies both flags and options, the options take

[Qemu-block] [PATCH v2 21/21] qemu-iotests: Test reopen with node-name/driver options

2015-11-23 Thread Kevin Wolf
'node-name' and 'driver' should not be changed during a reopen operation. It is, however, valid to specify them with the same value as they already had. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- tests/qemu-iotests/133 | 90

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

2015-11-23 Thread Kevin Wolf
Options are not actually inherited from the parent node yet, but this commit lays the grounds for doing so. Signed-off-by: Kevin Wolf --- block.c | 52 --- include/block/block_int.h | 3 ++- 2 files changed, 33

[Qemu-block] [PATCH v2 00/21] block: Cache mode for children etc.

2015-11-23 Thread Kevin Wolf
This is part three (or four, depending on whether you count the bdrv_swap removal) of what I had sent earlier as "[PATCH 00/34] block: Cache mode for children, reopen overhaul and more". Most of the patches were actually already reviewed in v1. This part contains the remaining functional changes

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

2015-11-23 Thread Kevin Wolf
If the child was defined in the same context (-drive argument or blockdev-add QMP command) as its parent, a reopen of the parent should work the same and allow changing options of the child. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block.c | 12

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

2015-11-23 Thread Kevin Wolf
This fixes bdrv_reopen() calls like the following one: qemu-io -c 'open -o overlap-check.template=all /tmp/test.qcow2' \ -c 'reopen -o overlap-check=none' The approach taken so far would result in an options QDict that has both "overlap-check.template=all" and "overlap-check=none", which

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

2015-11-23 Thread Kevin Wolf
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 check for the complete prefixes of actually existing child nodes. Signed-off-by: Kevin Wolf ---

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

2015-11-23 Thread Kevin Wolf
bdrv_replace_in_backing_chain() asserts that not both old and new BlockDdriverState have a BlockBackend attached to them because both would have to end up pointing to the new BDS and we don't support more than one BB per BDS yet. Before we can safely allow references to existing nodes as backing

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

2015-11-23 Thread Kevin Wolf
The next patch distinguishes options that were explicitly set and options that were derived. bdrv_fill_option() added options of both types: Options given by json: syntax should be counted as explicit, but the rest is derived. In preparation for the distinction, move json: parse to a separate

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

2015-11-23 Thread Kevin Wolf
bs->options doesn't only contain options that the user explicitly requested, but also option that were derived from flags, the filename or inherited from the parent node. For reopen, it is important to know the difference because reopening the parent can change inherited values in child nodes,

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

2015-11-23 Thread Kevin Wolf
For bs->file, using references to existing BDSes has been possible for a while already. This patch enables the same for bs->backing_hd. Signed-off-by: Kevin Wolf --- block.c | 47 +-- block/mirror.c| 2 +-

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

2015-11-23 Thread Kevin Wolf
qcow2 accepts a few driver-specific options that overlap semantically (e.g. "overlap-check" is an alias of "overlap-check.template", and any missing cache size option is derived from the given ones). When bdrv_reopen() merges the set of updated options with left out options that should be kept at

[Qemu-block] [PATCH v2 20/21] qemu-iotests: Test cache mode option inheritance

2015-11-23 Thread Kevin Wolf
This is doing a more complete test on setting cache modes both while opening an image (i.e. in a -drive command line) and in reopen situations. It checks that reopen can specify options for child nodes and that cache modes are correctly inherited from parent nodes where they are not specified.

Re: [Qemu-block] [Patch v7 3/3] qmp: add monitor command to add/remove a child

2015-11-23 Thread Eric Blake
On 11/22/2015 11:23 PM, Wen Congyang wrote: > The new QMP command name is x-blockdev-change. It justs for adding/removing s/It justs/It's just/ > quorum's child now, and don't support all kinds of children, all kinds of s/don't/doesn't/ > operations, nor all block drivers. So it is

Re: [Qemu-block] [Qemu-devel] [PATCH] qemu-iotests: Add -nographic when starting QEMU in 120

2015-11-23 Thread Max Reitz
On 23.11.2015 04:12, tu bo wrote: > Hi Fam, Max: > > On 11/23/2015 10:33 AM, Fam Zheng wrote: >> On Mon, 11/23 10:29, tu bo wrote: >>> Hi Max: >>> >>> On 11/21/2015 12:17 AM, Max Reitz wrote: On 20.11.2015 10:35, Fam Zheng wrote: > Otherwise, a window flashes on my desktop (built with

[Qemu-block] [PATCH v2 08/21] block: Keep "driver" in bs->options

2015-11-23 Thread Kevin Wolf
Instead of passing a separate drv argument to bdrv_open_common(), just make sure that a "driver" option is set in the QDict. This also means that a "driver" entry is consistently present in bs->options now. This is another step towards keeping all options in the QDict (which is the represenation

[Qemu-block] [PATCH v2 19/21] qemu-iotests: Try setting cache mode for children

2015-11-23 Thread Kevin Wolf
This is a basic test for specifying cache modes for child nodes on the command line. It doesn't take much time and works without O_DIRECT support. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- tests/qemu-iotests/051 | 10 +++-

[Qemu-block] [PATCH v2 15/21] qemu-iotests: Remove cache mode test without medium

2015-11-23 Thread Kevin Wolf
Specifying the cache mode for a driver without a medium is not a useful thing to do: As long as there is no medium, the cache mode doesn't make a difference, and once the 'change' command is used to insert a medium, it ignores the old cache mode and makes the new medium use cache=writethrough.

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.6 1/3] backup: Use Bitmap to replace "s->bitmap"

2015-11-23 Thread John Snow
On 11/20/2015 04:59 AM, Fam Zheng wrote: > "s->bitmap" tracks done sectors, we only check bit states without using any > iterator which HBitmap is good for. Switch to "Bitmap" which is simpler and > more memory efficient. > > Meanwhile, rename it to done_bitmap, to reflect the intention. > >

Re: [Qemu-block] [PATCH] qemu-iotests: Add -nographic when starting QEMU in 119 and 120

2015-11-23 Thread Max Reitz
On 23.11.2015 03:32, Fam Zheng wrote: > Otherwise, a window flashes on my desktop (built with SDL). Add this as > other cases have it. > > Signed-off-by: Fam Zheng > > --- > v2: Fix 119 too. [Max] > --- > tests/qemu-iotests/119 | 2 +- > tests/qemu-iotests/120 | 2 +- > 2

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.6 2/3] block: Hide HBitmap in block dirty bitmap interface

2015-11-23 Thread John Snow
On 11/20/2015 04:59 AM, Fam Zheng wrote: > HBitmap is an implementation detail of block dirty bitmap that should be > hidden > from users. Introduce a BdrvDirtyBitmapIter to encapsulate the underlying > HBitmapIter. > > A small difference in the interface is, before, an HBitmapIter is