Re: [Qemu-block] [Qemu-devel] [PATCH v3 2/9] raw: Implement copy offloading

2018-05-10 Thread Fam Zheng
On Wed, 05/09 10:17, Eric Blake wrote: > On 05/09/2018 09:58 AM, Fam Zheng wrote: > > Just pass down to ->file. > > > > Signed-off-by: Fam Zheng > > Reviewed-by: Stefan Hajnoczi > > --- > > block/raw-format.c | 20 > > 1 file changed, 20 insertions(+) > > > > diff --git

Re: [Qemu-block] [PATCH 08/13] tests: Add qdict_stringify_for_keyval() test

2018-05-10 Thread Eric Blake
On 05/09/2018 11:55 AM, Max Reitz wrote: Signed-off-by: Max Reitz --- tests/check-qdict.c | 54 + 1 file changed, 54 insertions(+) +static void qdict_stringify_for_keyval_test(void) +{ +QDict *dict = qdict_new(); + +/* + * Te

Re: [Qemu-block] [Qemu-devel] [PATCH] qcow2: fix preallocation with metadata on bare block device

2018-05-10 Thread Eric Blake
On 05/08/2018 07:27 AM, Ivan Ren wrote: Create a qcow2 directly on bare block device with "-o preallocation=metadata" option. When read this qcow2, it will return dirty data of block device. Yes, reading garbage is expected. This patch add QCOW_OFLAG_ZERO for all preallocated l2 entry if the

Re: [Qemu-block] [PATCH] qcow2: fix preallocation with metadata on bare block device

2018-05-10 Thread Ivan Ren
ping for review On Tue, May 8, 2018 at 8:27 PM Ivan Ren wrote: > Create a qcow2 directly on bare block device with > "-o preallocation=metadata" option. When read this qcow2, it will > return dirty data of block device. This patch add QCOW_OFLAG_ZERO > for all preallocated l2 entry if the underl

Re: [Qemu-block] [PATCH 06/13] block: Add block-specific QDict header

2018-05-10 Thread Eric Blake
On 05/09/2018 11:55 AM, Max Reitz wrote: There are numerous QDict functions that have been introduced for and are used only by the block layer. Move their declarations into an own s/an own/their own/ header file to reflect that. While qdict_extract_subqdict() is in fact used outside of the

Re: [Qemu-block] [PATCH v3 3/9] qcow2: Implement copy offloading

2018-05-10 Thread Fam Zheng
On Thu, 05/10 10:25, Stefan Hajnoczi wrote: > On Wed, May 09, 2018 at 10:58:09PM +0800, Fam Zheng wrote: > > +static int qcow2_co_copy_range_from(BlockDriverState *bs, > > +BdrvChild *src, uint64_t src_offset, > > +BdrvChild *d

Re: [Qemu-block] [Qemu-devel] [PATCH 05/13] qapi: Formalize qcow encryption probing

2018-05-10 Thread Daniel P . Berrangé
On Thu, May 10, 2018 at 09:24:24AM -0500, Eric Blake wrote: > On 05/09/2018 11:55 AM, Max Reitz wrote: > > Currently, you can give no encryption format for a qcow file while still > > passing a key-secret. That does not conform to the schema, so this > > patch changes the schema to allow it. > >

Re: [Qemu-block] [PATCH 05/13] qapi: Formalize qcow encryption probing

2018-05-10 Thread Eric Blake
On 05/09/2018 11:55 AM, Max Reitz wrote: Currently, you can give no encryption format for a qcow file while still passing a key-secret. That does not conform to the schema, so this patch changes the schema to allow it. Signed-off-by: Max Reitz --- ## # @BlockdevQcowEncryptionFormat: #

Re: [Qemu-block] [Qemu-devel] [PATCH 04/13] qapi: Formalize qcow2 encryption probing

2018-05-10 Thread Eric Blake
On 05/10/2018 02:58 AM, Daniel P. Berrangé wrote: On Wed, May 09, 2018 at 06:55:21PM +0200, Max Reitz wrote: Currently, you can give no encryption format for a qcow2 file while still passing a key-secret. That does not conform to the schema, so this patch changes the schema to allow it. Signed

Re: [Qemu-block] [PATCH 03/13] tests: Add QAPI optional discriminator tests

2018-05-10 Thread Eric Blake
On 05/09/2018 11:55 AM, Max Reitz wrote: There already is an optional discriminator test, although it also noted the discriminator name itself as optional. Changing that, and adding a default-variant field, makes that test pass instead of failing. I'm not sure I agree with that one. I think t

Re: [Qemu-block] [PATCH v2 1/2] qemu-iotests: reduce chance of races in 185

2018-05-10 Thread Vladimir Sementsov-Ogievskiy
08.05.2018 16:54, Stefan Hajnoczi wrote: Commit 8565c3ab537e78f3e69977ec2c609dc9417a806e ("qemu-iotests: fix 185") identified a race condition in a sub-test. Similar issues also affect the other sub-tests. If disk I/O completes quickly, it races with the QMP 'quit' command. This causes spuriou

Re: [Qemu-block] [PATCH] iscsi: Avoid potential for get_status overflow

2018-05-10 Thread Paolo Bonzini
On 08/05/2018 23:27, Eric Blake wrote: > Detected by Coverity: Multiplying two 32-bit int and assigning > the result to a 64-bit number is a risk of overflow. Prior to > the conversion to byte-based interfaces, the block layer took > care of ensuring that a status request never exceeded 2G in > th

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/2] qemu-iotests: reduce chance of races in 185

2018-05-10 Thread Eric Blake
On 05/10/2018 05:05 AM, Stefan Hajnoczi wrote: Add sleep 0.5 to reduce the chance of races. This is not a real fix but appears to reduce spurious failures in practice. Cc: Vladimir Sementsov-Ogievskiy Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/185 | 12 1 file ch

Re: [Qemu-block] [PATCH 01/13] qapi: Add default-variant for flat unions

2018-05-10 Thread Eric Blake
On 05/10/2018 08:12 AM, Eric Blake wrote: Oh, I just had a thought: +++ b/scripts/qapi/visit.py @@ -40,10 +40,20 @@ def gen_visit_object_members(name, base, members,   if variants: +    if variants.default_tag_value is None: +    ret += mcgen(''' +    %(c_name)s = obj->%(c_n

Re: [Qemu-block] [PATCH 01/13] qapi: Add default-variant for flat unions

2018-05-10 Thread Eric Blake
On 05/09/2018 11:55 AM, Max Reitz wrote: This patch allows specifying a discriminator that is an optional member of the base struct. In such a case, a default value must be provided that is used when no value is given. Signed-off-by: Max Reitz --- qapi/introspect.json | 8 ++

Re: [Qemu-block] [PATCH 02/13] docs/qapi: Document optional discriminators

2018-05-10 Thread Eric Blake
On 05/09/2018 11:55 AM, Max Reitz wrote: Signed-off-by: Max Reitz --- docs/devel/qapi-code-gen.txt | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) I might have squashed this in with patch 1, but I can live with it separate. @@ -502,6 +502,23 @@ the enum). In

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/2] qemu-iotests: reduce chance of races in 185

2018-05-10 Thread Stefan Hajnoczi
On Tue, May 08, 2018 at 09:26:03AM -0500, Eric Blake wrote: > On 05/08/2018 08:54 AM, Stefan Hajnoczi wrote: > > Commit 8565c3ab537e78f3e69977ec2c609dc9417a806e ("qemu-iotests: fix > > 185") identified a race condition in a sub-test. > > > > Similar issues also affect the other sub-tests. If disk

Re: [Qemu-block] [PATCH v3 3/9] qcow2: Implement copy offloading

2018-05-10 Thread Stefan Hajnoczi
On Wed, May 09, 2018 at 10:58:09PM +0800, Fam Zheng wrote: > +static int qcow2_co_copy_range_from(BlockDriverState *bs, > +BdrvChild *src, uint64_t src_offset, > +BdrvChild *dst, uint64_t dst_offset, > +

Re: [Qemu-block] [PATCH v3 9/9] qemu-img: Convert with copy offloading

2018-05-10 Thread Stefan Hajnoczi
On Wed, May 09, 2018 at 10:58:15PM +0800, Fam Zheng wrote: > The new blk_co_copy_range interface offers a more efficient way in the > case of network based storage. Make use of it to allow faster convert > operation. > > Since copy offloading cannot do zero detection ('-S') and compression > (-c),

Re: [Qemu-block] [PATCH v3 8/9] block-backend: Add blk_co_copy_range

2018-05-10 Thread Stefan Hajnoczi
On Wed, May 09, 2018 at 10:58:14PM +0800, Fam Zheng wrote: > It's a BlockBackend wrapper of the BDS interface. > > Signed-off-by: Fam Zheng > --- > block/block-backend.c | 18 ++ > include/sysemu/block-backend.h | 4 > 2 files changed, 22 insertions(+) Reviewed-by:

Re: [Qemu-block] [PATCH v3 7/9] iscsi: Implement copy offloading

2018-05-10 Thread Stefan Hajnoczi
On Wed, May 09, 2018 at 10:58:13PM +0800, Fam Zheng wrote: > +static int iscsi_populate_target_desc(unsigned char *desc, IscsiLun *lun) The return values of these iscsi_populate_*() functions are unused and don't make sense since the caller must already know the size ahead of time. I suggest remo

Re: [Qemu-block] [PATCH v3 6/9] iscsi: Create and use iscsi_co_wait_for_task

2018-05-10 Thread Stefan Hajnoczi
On Wed, May 09, 2018 at 10:58:12PM +0800, Fam Zheng wrote: > This loop is repeated a growing number times. Make a helper. > > Signed-off-by: Fam Zheng > --- > block/iscsi.c | 54 +- > 1 file changed, 17 insertions(+), 37 deletions(-) Reviewed-

Re: [Qemu-block] [PATCH v3 5/9] iscsi: Query and save device designator when opening

2018-05-10 Thread Stefan Hajnoczi
On Wed, May 09, 2018 at 10:58:11PM +0800, Fam Zheng wrote: > The device designator data returned in INQUIRY command will be useful to > fill in source/target fields during copy offloading. Do this when > connecting to the target and save the data for later use. > > Signed-off-by: Fam Zheng > ---

Re: [Qemu-block] [PATCH v3 4/9] file-posix: Implement bdrv_co_copy_range

2018-05-10 Thread Stefan Hajnoczi
On Wed, May 09, 2018 at 10:58:10PM +0800, Fam Zheng wrote: > +static off_t copy_file_range(int in_fd, off_t *in_off, int out_fd, > + off_t *out_off, size_t len, unsigned int flags) > +{ > +#ifdef __NR_copy_file_range > +return syscall(__NR_copy_file_range, in_fd, in_

Re: [Qemu-block] [PATCH v3 1/9] block: Introduce API for copy offloading

2018-05-10 Thread Stefan Hajnoczi
On Wed, May 09, 2018 at 10:58:07PM +0800, Fam Zheng wrote: Please include a commit description: Introduce the bdrv_co_copy_range() API for copy offloading. Block drivers implementing this API support efficient copy operations that avoid reading each block from the source device and writing

Re: [Qemu-block] [Qemu-devel] Some question about savem/qcow2 incremental snapshot

2018-05-10 Thread Stefan Hajnoczi
On Wed, May 09, 2018 at 07:54:31PM +0200, Max Reitz wrote: > On 2018-05-09 12:16, Stefan Hajnoczi wrote: > > On Tue, May 08, 2018 at 05:03:09PM +0200, Kevin Wolf wrote: > >> Am 08.05.2018 um 16:41 hat Eric Blake geschrieben: > >>> On 12/25/2017 01:33 AM, He Junyan wrote: > >> 2. Make the nvdimm dev

Re: [Qemu-block] [Qemu-devel] [PATCH 04/13] qapi: Formalize qcow2 encryption probing

2018-05-10 Thread Daniel P . Berrangé
On Wed, May 09, 2018 at 06:55:21PM +0200, Max Reitz wrote: > Currently, you can give no encryption format for a qcow2 file while > still passing a key-secret. That does not conform to the schema, so > this patch changes the schema to allow it. > > Signed-off-by: Max Reitz > --- > qapi/block-cor