Re: [Qemu-block] [Qemu-devel] [PATCH v7 09/20] parallels: Switch to .bdrv_co_block_status()

2018-01-08 Thread Fam Zheng
ed functions; but that's okay > because request_alignment is 512 as a result of those functions. > For now, no optimizations are added based on the mapping hint. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozz

[Qemu-block] [PATCH v2 1/2] qemu-img: Move img_open error reporting to callers

2018-01-08 Thread Fam Zheng
In the next patch one caller will have a special error handling logic rather than reporting it. Add "Error **" parameters to functions and give control back to callers, to make that possible. Update iotests output accordingly. Reviewed-by: Eric Blake <ebl...@redhat.com> Signed-o

[Qemu-block] [PATCH v2 2/2] qemu-img: info: try -U automatically

2018-01-08 Thread Fam Zheng
the image is used is to raise the awareness about what could be wrong. A warning would do just fine, especially since it is a little more informative. The test case reference output is updated accordingly. Reviewed-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Fam Zheng <f...@redhat.co

[Qemu-block] [PATCH v2 0/2] qemu-img: Let "info" warn and go ahead without -U

2018-01-08 Thread Fam Zheng
is broken with no knob to workaround this. This series changes that error to a warning so that it doesn't get in the way. Fam Fam Zheng (2): qemu-img: Move img_open error reporting to callers qemu-img: info: try -U automatically qemu-img.c

Re: [Qemu-block] [Qemu-devel] [PATCH v7 00/20] add byte-based block_status driver callbacks

2018-01-07 Thread Fam Zheng
On Mon, 01/08 10:56, Fam Zheng wrote: > On Sat, 01/06 22:03, no-re...@patchew.org wrote: > > /var/tmp/patchew-tester-tmp-zu_flv2_/src/block/iscsi.c: In function > > ‘iscsi_co_block_status’: > > /var/tmp/patchew-tester-tmp-zu_flv2_/src/block/iscsi.c:755:14: error: > &g

[Qemu-block] [PATCH] scsi: Don't check uninitialized local variable

2018-01-07 Thread Fam Zheng
After the out label there is a check on iTask.task but it is not initialized yet. Fixes: e38bc23454ef763deb4405ebdee6a1081aa00bc8 Signed-off-by: Fam Zheng <f...@redhat.com> --- block/iscsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/iscsi.c b/block/iscsi.c

Re: [Qemu-block] [Qemu-devel] [PATCH v7 00/20] add byte-based block_status driver callbacks

2018-01-07 Thread Fam Zheng
On Sat, 01/06 22:03, no-re...@patchew.org wrote: > /var/tmp/patchew-tester-tmp-zu_flv2_/src/block/iscsi.c: In function > ‘iscsi_co_block_status’: > /var/tmp/patchew-tester-tmp-zu_flv2_/src/block/iscsi.c:755:14: error: > ‘iTask.task’ may be used uninitialized in this function >

[Qemu-block] [PATCH 1/2] qemu-img: Move img_open error reporting to callers

2018-01-04 Thread Fam Zheng
In the next patch one caller will have a special error handling logic than reporting it, add "Error **" parameters to functions and give control back to callers, to make that possible. Update iotests output accordingly. Signed-off-by: Fam Zheng <f...@redhat.com>

[Qemu-block] [PATCH 2/2] qemu-img: info: try -U automatically

2018-01-04 Thread Fam Zheng
the image is used is to raise the awareness about what could be wrong. A warning would do just fine, especially since it is a little more informative. The test case reference output is updated accordingly. Signed-off-by: Fam Zheng <f...@redhat.com> --- qemu-img.c | 14 +++

[Qemu-block] [PATCH 0/2] qemu-img: Let "info" warn and go ahead without -U

2018-01-04 Thread Fam Zheng
oesn't get in the way. Fam Fam Zheng (2): qemu-img: Move img_open error reporting to callers qemu-img: info: try -U automatically qemu-img.c | 129 + tests/qemu-iotests/043.out | 6 +-- tests/qemu-iotests/153.out | 3 +- 3 files c

Re: [Qemu-block] [Qemu-devel] [PATCH] scsi: Don't deference in_buf if NULL

2018-01-04 Thread Fam Zheng
On Thu, 01/04 11:41, Eric Blake wrote: > On 01/03/2018 08:42 PM, Fam Zheng wrote: > > scsi_disk_emulate_command passes in_buf=NULL and in_len=0 in the > > REQUEST_SENSE branch. Inline the fixed_in evaluation and put it after > > the in_len test. > > > > Signed-o

[Qemu-block] [PATCH] scsi: Don't deference in_buf if NULL

2018-01-03 Thread Fam Zheng
scsi_disk_emulate_command passes in_buf=NULL and in_len=0 in the REQUEST_SENSE branch. Inline the fixed_in evaluation and put it after the in_len test. Signed-off-by: Fam Zheng <f...@redhat.com> --- scsi/utils.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scsi/u

Re: [Qemu-block] [Qemu-devel] [PATCH] osdep: Retry SETLK upon EINTR

2018-01-03 Thread Fam Zheng
On Wed, 01/03 16:57, Eric Blake wrote: > On 12/26/2017 12:53 AM, Fam Zheng wrote: > > We could hit lock failure if there is a signal that makes fcntl return > > -1 and errno set to EINTR. In this case we should retry. > > Did you hit this in practice? In 'man fcntl

Re: [Qemu-block] [PATCH v6 20/20] block: Drop unused .bdrv_co_get_block_status()

2017-12-28 Thread Fam Zheng
y: Eric Blake <ebl...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v6 19/20] vvfat: Switch to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
; > Signed-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v6 06/20] iscsi: Switch iscsi_allocmap_update() to byte-based

2017-12-28 Thread Fam Zheng
at now scale to bytes will be > easier to switch to byte-based in the future. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Acked-by: Paolo Bonzini <pbonz...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v6 07/20] iscsi: Switch to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
by: Eric Blake <ebl...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v6 16/20] vdi: Switch to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
now-unused s->block_sectors. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v6 15/20] vdi: Avoid bitrot of debugging code

2017-12-28 Thread Fam Zheng
Mathieu-Daudé <f4...@amsat.org> > Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v6 14/20] sheepdog: Switch to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
virtuozzo.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v6 13/20] raw: Switch to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
On Thu, 12/07 14:30, Eric Blake wrote: > We are gradually moving away from sector-based interfaces, towards > byte-based. Update the raw driver accordingly. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozz

Re: [Qemu-block] [PATCH v6 12/20] qed: Switch to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
switched qed to coroutines). There is > no intent to optimize based on the want_zero flag for this format. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v6 11/20] qcow2: Switch to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
e hint as a way to return > larger *pnum values when we have consecutive clusters with the same > data/zero status but which differ only in having non-consecutive > mappings. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...

Re: [Qemu-block] [PATCH v6 10/20] qcow: Switch to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
;ebl...@redhat.com> > Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v6 18/20] vpc: Switch to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
On Thu, 12/07 14:30, Eric Blake wrote: > We are gradually moving away from sector-based interfaces, towards > byte-based. Update the vpc driver accordingly. Drop the now-unused > get_sector_offset(). No get_sector_offset change in the patch any more, it was removed by

Re: [Qemu-block] [PATCH v6 08/20] null: Switch to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
tuozzo.com> > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v6 05/20] iscsi: Switch cluster_sectors to byte-based

2017-12-28 Thread Fam Zheng
prove some comment grammar while in the area. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Acked-by: Paolo Bonzini <pbonz...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v6 04/20] gluster: Switch to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
> the shortcut of skipping find_allocation(), and merely state that > all bytes are allocated. > > We can also drop redundant bounds checks that are already > guaranteed by the block layer. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v6 03/20] file-posix: Switch to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
> the shortcut of skipping lseek(), and merely state that all bytes > are allocated. > > We can also drop redundant bounds checks that are already > guaranteed by the block layer. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v6 02/20] block: Switch passthrough drivers to .bdrv_co_block_status()

2017-12-28 Thread Fam Zheng
at.com> > Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> > > --- > v5: rebase to master Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v9 03/13] block/dirty-bitmap: add _locked version of bdrv_reclaim_dirty_bitmap

2017-12-28 Thread Fam Zheng
On Thu, 12/28 14:16, Vladimir Sementsov-Ogievskiy wrote: > 28.12.2017 08:24, Fam Zheng wrote: > > On Wed, 12/20 18:49, Vladimir Sementsov-Ogievskiy wrote: > > > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> > > > --- > >

Re: [Qemu-block] [Qemu-devel] [PATCH v9 13/13] iotests: add dirty bitmap postcopy test

2017-12-27 Thread Fam Zheng
wait("STOP"), None) > +self.assertNotEqual(self.vm_b.event_wait("RESUME"), None) > + > +s = 0x8000 > +while s < write_size: > +self.vm_b.hmp_qemu_io('drive0', 'write %d %d' % (s, chunk)) > +s += 0x1 > + > +result = self.vm_b.qmp('query-block'); > +while len(result['return'][0]['dirty-bitmaps']) > 1: > +time.sleep(2) > +result = self.vm_b.qmp('query-block'); > + > +result = self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256', > + node='drive0', name='bitmap') > + > +self.assert_qmp(result, 'return/sha256', sha256); > + Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v9 12/13] iotests: add dirty bitmap migration test

2017-12-27 Thread Fam Zheng
e' > + > +inject_test_case(TestDirtyBitmapMigration, name, 'do_test_migration', > *cmb) Personally I'd just spell out the 16 method names and call do_test_migration. It's much easier to read and modify. Either way, Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v9 11/13] iotests: add default node-name

2017-12-27 Thread Fam Zheng
ptions.append('cache=%s' % cachemode) > +if 'node-name' not in opts: > +options.append('node-name=drivenode%d' % self._num_drives) > > if opts: > options.append(opts) > -- > 2.11.1 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v9 10/13] migration: add postcopy migration of dirty bitmaps

2017-12-27 Thread Fam Zheng
On Wed, 12/20 18:49, Vladimir Sementsov-Ogievskiy wrote: > Postcopy migration of dirty bitmaps. Only named dirty bitmaps, > associated with root nodes and non-root named nodes are migrated. > > If destination qemu is already containing a dirty bitmap with the same name > as a migrated bitmap (for

Re: [Qemu-block] [Qemu-devel] [PATCH v9 09/13] migration: add is_active_iterate handler

2017-12-27 Thread Fam Zheng
t...@virtuozzo.com> > Reviewed-by: Juan Quintela <quint...@redhat.com> > Reviewed-by: John Snow <js...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v9 08/13] migration/qemu-file: add qemu_put_counted_string()

2017-12-27 Thread Fam Zheng
; > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> > Reviewed-by: John Snow <js...@redhat.com> > Reviewed-by: Juan Quintela <quint...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v9 07/13] migration: include migrate_dirty_bitmaps in migrate_postcopy

2017-12-27 Thread Fam Zheng
.c > @@ -1487,7 +1487,7 @@ bool migrate_postcopy_ram(void) > > bool migrate_postcopy(void) > { > -return migrate_postcopy_ram(); > +return migrate_postcopy_ram() || migrate_dirty_bitmaps(); > } > > bool migrate_auto_converge(void) > -- > 2.11.1 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v9 06/13] qapi: add dirty-bitmaps migration capability

2017-12-27 Thread Fam Zheng
But it should be fine to keep all r-b lines when you update that, and add one more: Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v9 04/13] dirty-bitmap: add locked state

2017-12-27 Thread Fam Zheng
On Wed, 12/20 18:49, Vladimir Sementsov-Ogievskiy wrote: > diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c > index fe27ddfb83..6218740c95 100644 > --- a/block/dirty-bitmap.c > +++ b/block/dirty-bitmap.c > @@ -40,6 +40,8 @@ struct BdrvDirtyBitmap { > QemuMutex *mutex; > HBitmap

Re: [Qemu-block] [PATCH v9 03/13] block/dirty-bitmap: add _locked version of bdrv_reclaim_dirty_bitmap

2017-12-27 Thread Fam Zheng
On Wed, 12/20 18:49, Vladimir Sementsov-Ogievskiy wrote: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > include/block/dirty-bitmap.h | 3 +++ > block/dirty-bitmap.c | 25 - > 2 files changed, 19 insertions(+), 9 deletions(-) > >

Re: [Qemu-block] [Qemu-devel] [PATCH v9 02/13] block/dirty-bitmap: fix locking in bdrv_reclaim_dirty_bitmap

2017-12-27 Thread Fam Zheng
On Wed, 12/20 18:49, Vladimir Sementsov-Ogievskiy wrote: > Like other setters here these functions should take a lock. > > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v9 01/13] block/dirty-bitmap: add bdrv_dirty_bitmap_enable_successor()

2017-12-27 Thread Fam Zheng
> +} > + > /** > * For a bitmap with a successor, yield our name to the successor, > * delete the old bitmap, and return a handle to the new bitmap. > -- > 2.11.1 > > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.12 0/4] qmp dirty bitmap API

2017-12-26 Thread Fam Zheng
On Tue, 12/26 11:57, Vladimir Sementsov-Ogievskiy wrote: > 26.12.2017 10:07, Fam Zheng wrote: > > On Wed, 12/20 11:20, Vladimir Sementsov-Ogievskiy wrote: > > > external backup: > > > > > > 0. we have active_disk and attached to it dirty bitmap bitmap0 > &g

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.12 0/4] qmp dirty bitmap API

2017-12-25 Thread Fam Zheng
On Wed, 12/20 11:20, Vladimir Sementsov-Ogievskiy wrote: > external backup: > > 0. we have active_disk and attached to it dirty bitmap bitmap0 > 1. qmp blockdev-add tmp_disk (backing=active_disk) > 2. guest fsfreeze > 3. qmp transaction: >     - block-dirty-bitmap-add node=active_disk

[Qemu-block] [PATCH] osdep: Retry SETLK upon EINTR

2017-12-25 Thread Fam Zheng
We could hit lock failure if there is a signal that makes fcntl return -1 and errno set to EINTR. In this case we should retry. Cc: qemu-sta...@nongnu.org Signed-off-by: Fam Zheng <f...@redhat.com> --- util/osdep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[Qemu-block] [PATCH v5 0/2] qemu-img: Document --force-share / -U

2017-12-25 Thread Fam Zheng
v5: Clean up the @table @var section first. [Kevin, Peter] Fam Zheng (2): qemu-img.texi: Clean up parameter list qemu-img: Document --force-share / -U qemu-img.texi | 75 ++- 1 file changed, 48 insertions(+), 27 deletions

[Qemu-block] [PATCH v5 2/2] qemu-img: Document --force-share / -U

2017-12-25 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Reviewed-by: Kashyap Chamarthy <kcham...@redhat.com> Signed-off-by: Kevin Wolf <kw...@redhat.com> --- qemu-img.texi | 9 + 1 file changed, 9 insertions(+) diff --gi

Re: [Qemu-block] [Qemu-devel] [PULL v2 00/13] Block layer patches

2017-12-25 Thread Fam Zheng
On Fri, 12/22 14:31, Kevin Wolf wrote: > Am 21.12.2017 um 23:47 hat Peter Maydell geschrieben: > > On 21 December 2017 at 15:26, Kevin Wolf wrote: > > > The following changes since commit > > > 4da5c51cac8363f86ec92dc99c38f9382d617647: > > > > > > Merge remote-tracking branch

[Qemu-block] [PATCH v5 1/2] qemu-img.texi: Clean up parameter list

2017-12-25 Thread Fam Zheng
Split options out of the "@table @var" section and create a "@table @option", then use whitespaces and blank lines consistently. Suggested-by: Kevin Wolf <kw...@redhat.com> Signed-off-by: Fam Zheng <f...@redhat

[Qemu-block] [PATCH v2] iotests: Test creating overlay when guest running

2017-12-24 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- v2: Actually test the thing. [Kevin] --- tests/qemu-iotests/153 | 8 +--- tests/qemu-iotests/153.out | 7 --- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153

Re: [Qemu-block] [PATCH 19/19] block: Keep nodes drained between reopen_queue/multiple

2017-12-20 Thread Fam Zheng
> static void backup_job_cleanup(BlockDriverState *bs) > diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c > index de8e3de726..a6a70fc3dc 100644 > --- a/qemu-io-cmds.c > +++ b/qemu-io-cmds.c > @@ -2013,8 +2013,11 @@ static int reopen_f(BlockBackend *blk, int argc, char > **argv) > opts = qopts ? qemu_opts_to_qdict(qopts, NULL) : NULL; > qemu_opts_reset(_opts); > > +bdrv_subtree_drained_begin(bs); > brq = bdrv_reopen_queue(NULL, bs, opts, flags); > bdrv_reopen_multiple(bdrv_get_aio_context(bs), brq, _err); > +bdrv_subtree_drained_end(bs); > + > if (local_err) { > error_report_err(local_err); > } else { > -- > 2.13.6 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH 18/19] commit: Simplify reopen of base

2017-12-20 Thread Fam Zheng
base_flags | BDRV_O_RDWR, _err); > if (local_err != NULL) { > error_propagate(errp, local_err); > goto fail; > -- > 2.13.6 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH 03/19] block: Make bdrv_drain() driver callbacks non-recursive

2017-12-20 Thread Fam Zheng
On Wed, 12/20 14:24, Kevin Wolf wrote: > Am 20.12.2017 um 14:16 hat Fam Zheng geschrieben: > > On Wed, 12/20 11:33, Kevin Wolf wrote: > > > bdrv_drain_begin() doesn't increase bs->quiesce_counter recursively, > > > > Pretty trivial but: > > > > s/

Re: [Qemu-block] [PATCH 03/19] block: Make bdrv_drain() driver callbacks non-recursive

2017-12-20 Thread Fam Zheng
On Wed, 12/20 11:33, Kevin Wolf wrote: > bdrv_drain_begin() doesn't increase bs->quiesce_counter recursively, Pretty trivial but: s/bdrv_drain_begin/bdrv_drained_begin/ > which means that the child nodes are not actually drained. To keep this > consistent, we also shouldn't call the block

Re: [Qemu-block] [PATCH 02/19] block: Assert drain_all is only called from main AioContext

2017-12-20 Thread Fam Zheng
V_POLL_WHILE() on > + * nodes in several different AioContexts, so make sure we're in the main > + * context. */ > +assert(qemu_get_current_aio_context() == qemu_get_aio_context()); > + > block_job_pause_all(); > > for (bs = bdrv_first(); bs; bs = bdrv_next()) { > -- > 2.13.6 > Reviewed-by: Fam Zheng <f...@redhat.com>

[Qemu-block] [PATCH 2/2] iotests: Test creating overlay when guest running

2017-12-15 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- tests/qemu-iotests/153 | 4 tests/qemu-iotests/153.out | 3 +++ 2 files changed, 7 insertions(+) diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153 index fa25eb24bd..22cb9c69a7 100755 --- a/tests/qemu-iotests/153 +++ b/test

[Qemu-block] [PATCH 0/2] block: Fix qemu-img creating overlay when guest running

2017-12-15 Thread Fam Zheng
Shared write lock is not strictly necessary for creating the overlay image, if all what we want is to probe the size. Fam Zheng (2): block: Open backing image in force share mode for size probe iotests: Test creating overlay when guest running block.c| 3 ++- tests/qemu

[Qemu-block] [PATCH 1/2] block: Open backing image in force share mode for size probe

2017-12-15 Thread Fam Zheng
cess using the image? Could not open backing image to determine size. Use the force share option to allow this use case again. Cc: qemu-sta...@nongnu.org Signed-off-by: Fam Zheng <f...@redhat.com> --- block.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block.c

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.12 0/4] qmp dirty bitmap API

2017-12-12 Thread Fam Zheng
On Mon, 11/13 19:20, Vladimir Sementsov-Ogievskiy wrote: > Hi all. > > There are three qmp commands, needed to implement external backup API. > > Using these three commands, client may do all needed bitmap management by > hand: > > on backup start we need to do a transaction: > {disable old

[Qemu-block] [PATCH v4] qemu-img: Document --force-share / -U

2017-12-11 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- v4: "images". [Kevin] v3: Document that the option is not allowed for read-write. [Stefan] v2: - "code{qemu-img}". [Kashyap, Eric] - "etc.." -> "etc.". --- qemu-img.texi | 9 + 1

Re: [Qemu-block] [Qemu-devel] [PATCH v3] qemu-img: Document --force-share / -U

2017-12-11 Thread Fam Zheng
On Mon, 12/11 10:50, Kevin Wolf wrote: > Am 11.12.2017 um 10:33 hat Fam Zheng geschrieben: > > Signed-off-by: Fam Zheng <f...@redhat.com> > > > > --- > > > > v3: Document that the option is not allowed for read-write. [Stefan] > > > > v2:

Re: [Qemu-block] [Qemu-devel] QEMU not honouring bootorder

2017-12-11 Thread Fam Zheng
On Thu, 12/07 13:10, Michal Privoznik wrote: > Dear list, > > I've encountered the following problem. I have two disks: > > /var/lib/libvirt/images/fedora.qcow2 (which contains OS) > /dev/sde (iSCSI dummy disk just for testing) > > Now, when I configure QEMU to start with both of them,

[Qemu-block] [PATCH v3] qemu-img: Document --force-share / -U

2017-12-11 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- v3: Document that the option is not allowed for read-write. [Stefan] v2: - "code{qemu-img}". [Kashyap, Eric] - "etc.." -> "etc.". --- qemu-img.texi | 9 + 1 file changed, 9 insertions(+) dif

Re: [Qemu-block] [Qemu-devel] [PATCH v2] qemu-img: Document --force-share / -U

2017-12-11 Thread Fam Zheng
On Fri, 12/08 09:54, Stefan Hajnoczi wrote: > On Fri, Dec 08, 2017 at 09:44:56AM +0800, Fam Zheng wrote: > > +@item --force-share (-U) > > + > > +If specified, @code{qemu-img} will open the image with shared permissions, > > +which makes it less likely to conf

Re: [Qemu-block] [Qemu-devel] [PATCH] qemu-img: Document --force-share / -U

2017-12-07 Thread Fam Zheng
On Fri, 12/08 08:42, Markus Armbruster wrote: > Fam Zheng <f...@redhat.com> writes: > > > On Thu, 12/07 10:53, Eric Blake wrote: > >> On 12/07/2017 04:58 AM, Kashyap Chamarthy wrote: > >> > On Thu, Dec 07, 2017 at 04:44:53PM +0800, Fam Zheng wrote: >

[Qemu-block] [PATCH v2] qemu-img: Document --force-share / -U

2017-12-07 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- v2: - "code{qemu-img}". [Kashyap, Eric] - "etc.." -> "etc.". --- qemu-img.texi | 9 + 1 file changed, 9 insertions(+) diff --git a/qemu-img.texi b/qemu-img.texi index fdcf120f36..6b9f9adfc8 100644

Re: [Qemu-block] [Qemu-devel] [PATCH] qemu-img: Document --force-share / -U

2017-12-07 Thread Fam Zheng
On Thu, 12/07 10:53, Eric Blake wrote: > On 12/07/2017 04:58 AM, Kashyap Chamarthy wrote: > > On Thu, Dec 07, 2017 at 04:44:53PM +0800, Fam Zheng wrote: > >> Signed-off-by: Fam Zheng <f...@redhat.com> > >> --- > >> qemu-img.texi | 8 > >&

[Qemu-block] [PATCH] qemu-img: Document --force-share / -U

2017-12-07 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- qemu-img.texi | 8 1 file changed, 8 insertions(+) diff --git a/qemu-img.texi b/qemu-img.texi index fdcf120f36..3aa63aad55 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -57,6 +57,14 @@ exclusive with the @var{-O} para

Re: [Qemu-block] [Qemu-devel] Block layer complexity: what to do to keep it under control?

2017-12-01 Thread Fam Zheng
On Thu, 11/30 14:19, Stefan Hajnoczi wrote: > On Thu, Nov 30, 2017 at 05:47:09PM +0800, Fam Zheng wrote: > > On Wed, 11/29 12:00, Stefan Hajnoczi wrote: > > > On Wed, Nov 29, 2017 at 11:55:02AM +0800, Fam Zheng wrote: > > > > > > Event loops and coroutines

Re: [Qemu-block] [PATCH RFC 0/9] block: Rewrite block drain begin/end

2017-12-01 Thread Fam Zheng
On Thu, 11/30 17:04, Paolo Bonzini wrote: > On 30/11/2017 16:10, Kevin Wolf wrote: > >> Yes, I agree, but that (using CoMutex around graph change) requires > >> everything, especially the defer_to_main_loop_bh, runs in a coroutine > >> context, which is exactly what I mean by "introducing

Re: [Qemu-block] [Qemu-devel] [PATCH 06/17] iotests: Drop format-specific in _filter_img_info

2017-12-01 Thread Fam Zheng
On Thu, 11/30 09:42, Eric Blake wrote: > On 11/29/2017 09:16 PM, Fam Zheng wrote: > > On Thu, 11/23 03:08, Max Reitz wrote: > > > _filter_img_info should remove format-specific information, too. We > > > already have such a filter in _img_info, and it is very useful

Re: [Qemu-block] [Qemu-devel] Block layer complexity: what to do to keep it under control?

2017-12-01 Thread Fam Zheng
On Fri, 12/01 14:08, Stefan Hajnoczi wrote: > What I'm getting at is that the essential complexity of a parallel I/O > engine with a runtime reconfigurable graph, background operations, and > non-trivial disk image file formats sets a certain floor (minimum) > complexity. The consequence is that

Re: [Qemu-block] [PATCH RFC 0/9] block: Rewrite block drain begin/end

2017-11-30 Thread Fam Zheng
On Thu, 11/30 11:31, Kevin Wolf wrote: > What you really mean is probably connected components in the graph, but > do we really want to manage merging and splitting object representing > connected components when a node is added or removed from the graph? > Especially when that graph change occurs

Re: [Qemu-block] [Qemu-devel] Block layer complexity: what to do to keep it under control?

2017-11-30 Thread Fam Zheng
On Wed, 11/29 12:00, Stefan Hajnoczi wrote: > On Wed, Nov 29, 2017 at 11:55:02AM +0800, Fam Zheng wrote: > > As we move forwards with new features in the block layer, the chances of > > tricky > > bugs happening have been increasing alongside - block jobs, coroutines, >

Re: [Qemu-block] [PATCH 08/17] iotests: Skip 103 for refcount_bits=1

2017-11-29 Thread Fam Zheng
On Thu, 11/23 03:08, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/103 | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tests/qemu-iotests/103 b/tests/qemu-iotests/103 > index ecbd8ebd71..d0cfab8844 100755 > --- a/tests/qemu-iotests/103 >

Re: [Qemu-block] [PATCH 06/17] iotests: Drop format-specific in _filter_img_info

2017-11-29 Thread Fam Zheng
On Thu, 11/23 03:08, Max Reitz wrote: > _filter_img_info should remove format-specific information, too. We > already have such a filter in _img_info, and it is very useful for > query-block-named-block-nodes (etc.), too. > > However, in 198 we need that information (but we still want the rest

Re: [Qemu-block] [PATCH 05/17] iotests: Fix _img_info for backslashes

2017-11-29 Thread Fam Zheng
-e "/actual-size/ D" | \ > -while IFS='' read line; do > +while IFS='' read -r line; do > if [[ $format_specific == 1 ]]; then > discard=0 > elif [[ $line == "Format specific information:" ]]; then > -- > 2.13.6 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH 04/17] block/vmdk: Add blkdebug events

2017-11-29 Thread Fam Zheng
On Thu, 11/23 03:08, Max Reitz wrote: > This is certainly not complete, but it includes at least write_aio and > read_aio. "and more" :) Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH 07/17] iotests: Forbid 020 for non-file protocols

2017-11-29 Thread Fam Zheng
support bdrv_reopen_prepare thus qemu-img commit fails. > -if [ "$IMGPROTO" = "nfs" ]; then > -_notrun "image protocol $IMGPROTO does not support bdrv_commit" > -fi > - > TEST_OFFSETS="0 4294967296" > > TEST_IMG_SAVE="$TEST_IMG" > -- > 2.13.6 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH 18/17] iotests: Make 059 pass on machines with little RAM

2017-11-29 Thread Fam Zheng
ho > echo "=== Testing afl image with a very large capacity ===" > _use_sample_img afl9.vmdk.bz2 > -_img_info > +# The sed makes this test pass on machines with little RAM > +# (and also with 32 bit builds) > +_img_info | sed -e 's/Cannot allocate memory/Invalid argument/' >

Re: [Qemu-block] [PATCH 10/17] iotests: Fix 020 for vmdk

2017-11-29 Thread Fam Zheng
'driver': 'null-co' > + 'driver': 'file',, > + 'filename': 'TEST_DIR/t.IMGFMT.base' > }}} > wrote 65536/65536 bytes at offset 0 > 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > -- > 2.13.6 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH 01/17] block/vmdk: Fix , instead of ; at end of line

2017-11-29 Thread Fam Zheng
ffset = cluster_offset + offset_in_cluster; > ret = bdrv_co_pwritev(extent->file, write_offset, n_bytes, > _qiov, 0); > > -- > 2.13.6 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH 12/17] iotests: Fix 059's reference output

2017-11-29 Thread Fam Zheng
T_DIR/afl9.IMGFMT': Invalid argument > *** done > -- > 2.13.6 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH RFC 0/9] block: Rewrite block drain begin/end

2017-11-29 Thread Fam Zheng
On Wed, 11/29 18:25, Kevin Wolf wrote: > Am 29.11.2017 um 15:49 hat Fam Zheng geschrieben: > > While we look at the fixes for 2.11, I briefly prototyped this series > > to see if it makes sense as a simplification of the drain API for > > 2.12. > > > > The idea is

[Qemu-block] [PATCH RFC 8/9] block: Drop old drained_{begin, end} callbacks

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- block.c| 24 block/block-backend.c | 22 -- blockjob.c | 6 -- include/block/block.h | 16 include/block/block

[Qemu-block] [PATCH RFC 7/9] block: Switch to use AIO drained begin/end API

2017-11-29 Thread Fam Zheng
rained end can just get away with that. The other half of drained begin is to wait for requests, which we can do with BDRV_POLL_WHILE() in a loop. Signed-off-by: Fam Zheng <f...@redhat.com> --- block/io.c | 116 ++--- 1 file change

[Qemu-block] [PATCH RFC 6/9] block: Use aio_context_drained_begin in bdrv_set_aio_context

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- block.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index 9a1a0d1e73..949f0dec11 100644 --- a/block.c +++ b/block.c @@ -4745,8 +4745,7 @@ void bdrv_set_aio_context(BlockDriverState *bs, AioC

[Qemu-block] [PATCH RFC 9/9] blockjob: Drop unused functions

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- blockjob.c | 24 include/block/blockjob_int.h | 14 -- 2 files changed, 38 deletions(-) diff --git a/blockjob.c b/blockjob.c index 809111bf24..bfeb7c4ace 100644 --- a/blockjob.c +++ b/bloc

[Qemu-block] [PATCH RFC 5/9] qed: Implement AioContext drain ops

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- block/qed.c | 34 +- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/block/qed.c b/block/qed.c index 821dcaa055..8ddaa31e7c 100644 --- a/block/qed.c +++ b/block/qed.c @@ -337,12 +337,33 @@ stati

[Qemu-block] [PATCH RFC 2/9] aio: Add drain begin/end API to AioContext

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- include/block/aio.h | 27 +--- util/async.c| 73 + 2 files changed, 97 insertions(+), 3 deletions(-) diff --git a/include/block/aio.h b/include/block/aio.h index e9ae

[Qemu-block] [PATCH RFC 1/9] block: Remove unused bdrv_requests_pending

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- block/io.c| 18 -- include/block/block_int.h | 1 - 2 files changed, 19 deletions(-) diff --git a/block/io.c b/block/io.c index 4fdf93a014..7f07972489 100644 --- a/block/io.c +++ b/block/io.c @@ -134,24

[Qemu-block] [PATCH RFC 3/9] blockjob: Implement AioContext drain ops

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- blockjob.c | 47 ++- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/blockjob.c b/blockjob.c index ff9a614531..86d060c89c 100644 --- a/blockjob.c +++ b/blockjob.c @@ -148,6 +148,23 @@

[Qemu-block] [PATCH RFC 4/9] throttle: Implement AioContext drain ops

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- block/throttle.c | 34 +++--- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/block/throttle.c b/block/throttle.c index 833175ac77..35b740e3de 100644 --- a/block/throttle.c +++ b/block/throttle.c @@

[Qemu-block] [PATCH RFC 0/9] block: Rewrite block drain begin/end

2017-11-29 Thread Fam Zheng
of the callback recursion (both up and down). Many commit logs and code comments are definitely missing, but it would be good to get high level review and maybe some testing already. Fam Fam Zheng (9): block: Remove unused bdrv_requests_pending aio: Add drain begin/end API to AioContext blockjob

Re: [Qemu-block] [PATCH 0/4] blockjob: reinstate busy=false/busy=true in block_job_sleep_ns

2017-11-29 Thread Fam Zheng
sues with block jobs, without reverting > the new checks that Jeff added. Reviewed-by: Fam Zheng <f...@redhat.com>

[Qemu-block] Block layer complexity: what to do to keep it under control?

2017-11-28 Thread Fam Zheng
Hi all, As we move forwards with new features in the block layer, the chances of tricky bugs happening have been increasing alongside - block jobs, coroutines, throttling, AioContext, op blockers and image locking combined together make a large and complex picture that is hard to fully understand

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/5] backup improvements part 1

2017-11-28 Thread Fam Zheng
On Tue, 11/28 14:44, Jeff Cody wrote: > > Yes, I can bring in through my tree, unless Fam prefers to have it - I'll > > pull it in via my block-next branch. > > > > Rather than keep this on my email queue: > > Applied to my block-next branch: > > git://github.com/codyprime/qemu-kvm-jtc

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/5] backup improvements part 1

2017-11-28 Thread Fam Zheng
On Mon, 11/13 17:41, John Snow wrote: > Jeff, I think this ought to go through your tree, but I'll sign off on it. > > Fam: Do you agree? Sounds good. Fam

Re: [Qemu-block] [PATCH for-2.11 3/4] coroutine: Cancel aio_co_schedule() on direct entry

2017-11-28 Thread Fam Zheng
On Tue, 11/28 16:43, Kevin Wolf wrote: > If a coroutine can be reentered from multiple possible sources, we need > to be careful in the case that two sources try to reenter it at the same > time. > > There are two different cases where this can happen: > > 1. A coroutine spawns multiple

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