Re: [Qemu-block] [Qemu-devel] [PATCH 0/1] block: Workaround for the iotests errors

2017-11-27 Thread Fam Zheng
On Fri, 11/24 17:39, Kevin Wolf wrote: > Maybe the backtraces would help me understand the problem if they were > actually there. :-) Ouch, looks like git-tag(1) doesn't like to store # lines in the message. Unfortunately I rebooted the laptop and didn't save the vim buffer, thinking it is

Re: [Qemu-block] [PATCH 0/1] block: Workaround for the iotests errors

2017-11-24 Thread Fam Zheng
On Fri, 11/24 01:12, Jeff Cody wrote: > On Fri, Nov 24, 2017 at 01:57:46AM +0800, Fam Zheng wrote: > > Jeff's block job patch made the latent drain bug visible, and I find this > > patch, which by itself also makes some sense, can hide it again. :) With it > > applied

[Qemu-block] [PATCH 0/1] block: Workaround for the iotests errors

2017-11-23 Thread Fam Zheng
me so I'm posting the patch anyway in case we could use it for -rc3. Note this doesn't fix the hanging 056, which I haven't debugged yet. Fam Fam Zheng (1): block: Don't poll for drain end block/io.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.14.3

[Qemu-block] [PATCH 1/1] block: Don't poll for drain end

2017-11-23 Thread Fam Zheng
Only drained_begin cares about in flight requests are processed, there is no need to do BDRV_POLL_WHILE() if begin==false, because all that need to be done is recursively invoking children's callbacks. Signed-off-by: Fam Zheng <f...@redhat.com> --- block/io.c | 8 +--- 1 file chan

Re: [Qemu-block] [PATCH 00/17] iotests: Fix iotests for weird formats/options

2017-11-22 Thread Fam Zheng
On Thu, 11/23 03:08, Max Reitz wrote: > (I hate to write Python tests because the boilerplate seems so large and > the debugging is so hard. But there is test 194 which shows that it is > possible to write simple bash-like tests as well--and that is how I > should probably write tests from now

Re: [Qemu-block] [PATCH for-2.11 0/2] Fix 'qemu-img info' on mirror target

2017-11-20 Thread Fam Zheng
les changed, 10 insertions(+), 5 deletions(-) > > -- > 2.13.6 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH 0/5] compressed block-stream

2017-11-15 Thread Fam Zheng
On Tue, 11/14 13:16, Anton Nefedov wrote: > It might be useful to compress images during block-stream; > this way the user can merge compressed images of a backing chain and > the result will remain compressed. I haven't looked at the patches yet so maybe the answer is obvious, but still: would

Re: [Qemu-block] [Qemu-devel] [PATCH] scripts/make-release: No need to delete pixman/.git anymore

2017-11-13 Thread Fam Zheng
On Mon, 11/13 10:48, Thomas Huth wrote: > > 077 - output mismatch (see 077.out.bad) > > --- /tmp/qemu-test/src/tests/qemu-iotests/077.out 2017-11-13 > > 09:38:59.0 + > > +++ /tmp/qemu-test/build/tests/qemu-iotests/077.out.bad 2017-11-13 > > 09:41:20.601278693 + > >

[Qemu-block] [PATCH] iotests: 077: Filter out 'resume' lines

2017-11-13 Thread Fam Zheng
lter out the "Resuming request" lines to make the output deterministic. Reported-by: Patchew <no-re...@patchew.org> Signed-off-by: Fam Zheng <f...@redhat.com> --- tests/qemu-iotests/077 | 3 ++- tests/qemu-iotests/077.out | 48 -

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.11] block: Keep strong reference when draining all BDS

2017-11-10 Thread Fam Zheng
On Fri, 11/10 16:23, Max Reitz wrote: > But bdrv_unref() is safe only in the main loop. Without having checked, > I'm not sure whether all callers of bdrv_next() are running in the main > loop. They must be. The reasoning is simple: 1) one needs to acquire the ctx of all the BDSes for safe

Re: [Qemu-block] segfault in parallel blockjobs (iotest 30)

2017-11-09 Thread Fam Zheng
On Thu, 11/09 17:26, Alberto Garcia wrote: > On Wed 08 Nov 2017 03:45:38 PM CET, Alberto Garcia wrote: > > > I'm thinking that perhaps we should add the pause point directly to > > block_job_defer_to_main_loop(), to prevent any block job from running > > the exit function when it's paused. > > I

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.11] block: Keep strong reference when draining all BDS

2017-11-09 Thread Fam Zheng
On Thu, 11/09 21:43, Max Reitz wrote: > Draining a BDS may lead to graph modifications, which in turn may result > in it and other BDS being stripped of their current references. If > bdrv_drain_all_begin() and bdrv_drain_all_end() do not keep strong > references themselves, the BDS they are

Re: [Qemu-block] [Qemu-devel] Intermittent hang of iotest 194 (bdrv_drain_all after non-shared storage migration)

2017-11-09 Thread Fam Zheng
On Thu, 11/09 20:31, Max Reitz wrote: > On 2017-11-09 16:30, Fam Zheng wrote: > > On Thu, 11/09 16:14, Max Reitz wrote: > >> On 2017-11-09 05:21, Fam Zheng wrote: > >>> On Thu, 11/09 01:48, Max Reitz wrote: > >>>> Hi, > >>>> > >>

Re: [Qemu-block] [Qemu-devel] Intermittent hang of iotest 194 (bdrv_drain_all after non-shared storage migration)

2017-11-09 Thread Fam Zheng
On Thu, 11/09 16:14, Max Reitz wrote: > On 2017-11-09 05:21, Fam Zheng wrote: > > On Thu, 11/09 01:48, Max Reitz wrote: > >> Hi, > >> > >> More exciting news from the bdrv_drain() front! > >> > >> I've noticed in the past that iotest 194 s

Re: [Qemu-block] [Qemu-devel] segfault in parallel blockjobs (iotest 30)

2017-11-08 Thread Fam Zheng
On Wed, 11/08 18:50, Anton Nefedov wrote: > > > On 8/11/2017 5:45 PM, Alberto Garcia wrote: > > On Tue 07 Nov 2017 05:19:41 PM CET, Anton Nefedov wrote: > > > BlockBackend gets deleted by another job's stream_complete(), deferred > > > to the main loop, so the fact that the job is put to sleep

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/7] various NBD fixes for 2.11

2017-11-08 Thread Fam Zheng
On Wed, 11/08 17:05, Eric Blake wrote: > But I'm not sure if there is an easy way to tell patchew to include a > fixup patch and re-test the series, short of sending a v3. Yeah, I don't know a way either. Fam

Re: [Qemu-block] [Qemu-devel] Intermittent hang of iotest 194 (bdrv_drain_all after non-shared storage migration)

2017-11-08 Thread Fam Zheng
On Thu, 11/09 01:48, Max Reitz wrote: > Hi, > > More exciting news from the bdrv_drain() front! > > I've noticed in the past that iotest 194 sometimes hangs. I usually run > the tests on tmpfs, but I've just now verified that it happens on my SSD > just as well. > > So the reproducer is a

Re: [Qemu-block] [PATCH v2] util/async: use atomic_mb_set in qemu_bh_cancel

2017-11-07 Thread Fam Zheng
Hi Sergio, On Tue, 11/07 23:54, Sergio Lopez wrote: > Commit b7a745d added a qemu_bh_cancel call to the completion function > as an optimization to prevent it from unnecessarily rescheduling itself. > > This completion function is scheduled from worker_thread, after setting > the state of a

Re: [Qemu-block] [Qemu-devel] [PATCH v3 0/4] Don't write headers if BDS is INACTIVE

2017-11-06 Thread Fam Zheng
On Mon, 11/06 21:31, Jeff Cody wrote: > Changes from v2->v3: > > Patch 2: Uh... fix that misspelling. Thanks Stefan :) > Patch 3: New patch to block migration in parallels Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] question: I found a qemu crash when attach virtio-scsi disk

2017-11-06 Thread Fam Zheng
On Mon, 11/06 17:33, Paolo Bonzini wrote: > On 06/11/2017 17:11, Kevin Wolf wrote: > > Am 03.11.2017 um 11:26 hat Stefan Hajnoczi geschrieben: > >> On Wed, Nov 01, 2017 at 06:42:33AM +, lizhengui wrote: > >>> Hi, when I attach virtio-scsi disk to VM, the qemu crash happened at very > >>> low

Re: [Qemu-block] [Qemu-devel] RFC: use case for adding QMP, block jobs & multiple exports to qemu-nbd ?

2017-11-03 Thread Fam Zheng
On Thu, 11/02 12:02, Daniel P. Berrange wrote: > One alternative approach to doing this would be to suggest that we should > instead just spawn qemu-system-x86_64 with '--machine none' and use that > as a replacement for qemu-nbd, since it already has a built-in NBD server > which can do many

Re: [Qemu-block] [Qemu-devel] [PATCH v9 0/8] Optimize VMDK I/O by allocating multiple clusters

2017-10-20 Thread Fam Zheng
On Mon, 10/09 22:12, Fam Zheng wrote: > On Mon, 10/09 18:29, Ashijeet Acharya wrote: > > Optimization test results: > > > > This patch series improves 128 KB sequential write performance to an > > empty VMDK file by 54% > > > > Benchmark command: ./qemu-im

Re: [Qemu-block] [PATCH RFC] file-posix: make lock_fd read-only

2017-10-18 Thread Fam Zheng
On Wed, 10/11 11:48, Kevin Wolf wrote: > Am 11.10.2017 um 11:38 hat Vladimir Sementsov-Ogievskiy geschrieben: > > 11.10.2017 12:22, Kevin Wolf wrote: > > > [ Cc: Fam ] Sorry for being slow, now finally getting my hands on email backlog after holiday and preparing for KVM Forum presentation. > >

Re: [Qemu-block] [Qemu-devel] [PATCH 00/31] Allow configuring the qcow2 L2 cache entry size

2017-10-12 Thread Fam Zheng
On Thu, 10/12 09:11, Eric Blake wrote: > Fam, > > On 10/12/2017 09:02 AM, no-re...@patchew.org wrote: > > Hi, > > > > This series failed automatic build test. Please find the testing commands > > and > > their output below. If you have docker installed, you can probably > > reproduce it > >

Re: [Qemu-block] [PATCH v9 0/8] Optimize VMDK I/O by allocating multiple clusters

2017-10-09 Thread Fam Zheng
On Mon, 10/09 18:29, Ashijeet Acharya wrote: > Optimization test results: > > This patch series improves 128 KB sequential write performance to an > empty VMDK file by 54% > > Benchmark command: ./qemu-img bench -w -c 1024 -s 128K -d 1 -t none -f > vmdk test.vmdk > > Changes in v9: > - rebase

Re: [Qemu-block] [Qemu-devel] [PATCH v8 0/8] Optimize VMDK I/O by allocating multiple clusters

2017-10-04 Thread Fam Zheng
On Wed, 10/04 13:47, Ashijeet Acharya wrote: > Fam: Ping? Hi Ashijeet, looks like this patch doesn't apply to current master, could you rebase and post another version? Fam

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/5] block: Avoid copy-on-read assertions

2017-10-03 Thread Fam Zheng
On Tue, 10/03 21:22, Eric Blake wrote: > On 10/03/2017 09:16 PM, no-re...@patchew.org wrote: > > Hi, > > > > This series failed automatic build test. Please find the testing commands > > and > > their output below. If you have docker installed, you can probably > > reproduce it > > locally. > >

Re: [Qemu-block] [PATCH v10 18/20] qcow2: Switch store_bitmap_data() to byte-based iteration

2017-09-25 Thread Fam Zheng
ed to the start of a cluster, which we can do by modifying the > test to write data that doesn't happen to fall in the first cluster > of the image. > > 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 v10 05/20] dirty-bitmap: Avoid size query failure during truncate

2017-09-25 Thread Fam Zheng
bs, > * Truncates _all_ bitmaps attached to a BDS. > * Called with BQL taken. > */ > -void bdrv_dirty_bitmap_truncate(BlockDriverState *bs) > +void bdrv_dirty_bitmap_truncate(BlockDriverState *bs, int64_t bytes) > { > BdrvDirtyBitmap *bitmap; > -uint64_t size = bdrv_nb_sectors(bs); > +int64_t size = DIV_ROUND_UP(bytes, BDRV_SECTOR_SIZE); > > bdrv_dirty_bitmaps_lock(bs); > QLIST_FOREACH(bitmap, >dirty_bitmaps, list) { > -- > 2.13.5 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v3 1/3] block: add bdrv_co_drain_end callback

2017-09-24 Thread Fam Zheng
rectly, thus bdrv_co_drain_end is needed. > > Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v2 1/6] qemu-io: Drop write permissions before read-only reopen

2017-09-22 Thread Fam Zheng
n not permitted > +Block node is read-only > wrote 65536/65536 bytes at offset 0 > 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > *** done > -- > 2.13.5 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/3] block: add bdrv_co_drain_end callback

2017-09-22 Thread Fam Zheng
On Fri, 09/22 13:03, Kevin Wolf wrote: > Am 22.09.2017 um 04:30 hat Fam Zheng geschrieben: > > On Thu, 09/21 18:39, Manos Pitsidianakis wrote: > > > On Thu, Sep 21, 2017 at 09:29:43PM +0800, Fam Zheng wrote: > > > > On Thu, 09/21 16:17, Manos Pitsidianakis wrote: &

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

2017-09-21 Thread Fam Zheng
On Wed, 09/20 08:47, Eric Blake wrote: > On 09/20/2017 04:57 AM, Fam Zheng wrote: > > On Thu, 09/14 09:40, Eric Blake wrote: > >> We are gradually moving away from sector-based interfaces, towards > >> byte-based. Update the file protocol driver accordingly.

Re: [Qemu-block] [PATCH v2 1/3] block: add bdrv_co_drain_end callback

2017-09-21 Thread Fam Zheng
On Thu, 09/21 18:39, Manos Pitsidianakis wrote: > On Thu, Sep 21, 2017 at 09:29:43PM +0800, Fam Zheng wrote: > > On Thu, 09/21 16:17, Manos Pitsidianakis wrote: > > > BlockDriverState has a bdrv_do_drain() callback but no equivalent for the > > > end > >

Re: [Qemu-block] [PATCH 17/18] qemu-io: Add background write

2017-09-21 Thread Fam Zheng
On Thu, 09/21 16:40, Max Reitz wrote: > On 2017-09-19 10:03, Fam Zheng wrote: > > On Mon, 09/18 19:53, Max Reitz wrote: > >> On 2017-09-18 08:46, Fam Zheng wrote: > >>> On Wed, 09/13 20:19, Max Reitz wrote: > >>>> Add a new parameter -B to

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/3] add bdrv_co_drain_begin/end BlockDriver callbacks

2017-09-21 Thread Fam Zheng
On Thu, 09/21 16:17, Manos Pitsidianakis wrote: > This patch series renames bdrv_co_drain to bdrv_co_drain_begin and adds a new > bdrv_co_drain_end callback to match bdrv_drained_begin/end and > drained_begin/end of BdrvChild. This is needed because the throttle driver > (block/throttle.c)

Re: [Qemu-block] [PATCH v2 3/3] block/throttle.c: add bdrv_co_drain_begin/end callbacks

2017-09-21 Thread Fam Zheng
On Thu, 09/21 16:17, Manos Pitsidianakis wrote: > Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> > Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v2 2/3] block: rename bdrv_co_drain to bdrv_co_drain_begin

2017-09-21 Thread Fam Zheng
On Thu, 09/21 16:17, Manos Pitsidianakis wrote: > Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> > Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v2 1/3] block: add bdrv_co_drain_end callback

2017-09-21 Thread Fam Zheng
tly, thus > bdrv_co_drain_end is needed. > > Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v2 1/3] block: add bdrv_co_drain_end callback

2017-09-21 Thread Fam Zheng
On Thu, 09/21 16:17, Manos Pitsidianakis wrote: > BlockDriverState has a bdrv_do_drain() callback but no equivalent for the end s/bdrv_do_drain/bdrv_co_drain/ > of the drain. The throttle driver (block/throttle.c) needs a way to mark the > end of the drain in order to toggle io_limits_disabled

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

2017-09-20 Thread Fam Zheng
On Thu, 09/14 09:40, Eric Blake wrote: > We are gradually moving away from sector-based interfaces, towards > byte-based. Update the file protocol driver accordingly. In mapping > mode, note that the entire file is reported as allocated, so we can > take a shortcut and skip lseek(). > >

Re: [Qemu-block] [Qemu-devel] [PATCH v9 05/20] dirty-bitmap: Avoid size query failure during truncate

2017-09-19 Thread Fam Zheng
On Tue, 09/19 19:00, John Snow wrote: > > > On 09/19/2017 04:18 PM, Eric Blake wrote: > > We've previously fixed several places where we failed to account > > for possible errors from bdrv_nb_sectors(). Fix another one by > > making bdrv_dirty_bitmap_truncate() take the new size from the > >

Re: [Qemu-block] [Qemu-devel] [PATCH v8 00/20] make dirty-bitmap byte-based

2017-09-19 Thread Fam Zheng
51b0a488) > part 2: dirty-bitmap (this series, v7 was here [1]) > part 3: bdrv_get_block_status (v4 is posted [2] and is mostly reviewed) > part 4: .bdrv_co_block_status (v3 is posted [3], but needs review) Patches 1-4, 6-20: Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v8 05/20] dirty-bitmap: Avoid size query failure during truncate

2017-09-19 Thread Fam Zheng
On Mon, 09/18 13:58, Eric Blake wrote: > We've previously fixed several places where we failed to account > for possible errors from bdrv_nb_sectors(). Fix another one by > making bdrv_dirty_bitmap_truncate() take the new size from the > caller instead of querying itself; then adjust the sole

Re: [Qemu-block] [PATCH 18/18] iotests: Add test for active mirroring

2017-09-19 Thread Fam Zheng
On Mon, 09/18 18:53, Max Reitz wrote: > >> + > >> +if sync_source_and_target: > >> +# If source and target should be in sync after the mirror, > >> +# we have to flush before completion > > > > Not sure I understand this requirements, does it apply to libvirt and

Re: [Qemu-block] [PATCH 17/18] qemu-io: Add background write

2017-09-19 Thread Fam Zheng
On Mon, 09/18 19:53, Max Reitz wrote: > On 2017-09-18 08:46, Fam Zheng wrote: > > On Wed, 09/13 20:19, Max Reitz wrote: > >> Add a new parameter -B to qemu-io's write command. When used, qemu-io > >> will not wait for the result of the operation and instead execut

Re: [Qemu-block] [Qemu-devel] [PATCH 0/6] block: Fix permissions after ro/rw reopen

2017-09-18 Thread Fam Zheng
On Mon, 09/18 14:11, Kevin Wolf wrote: > But how does it determine the desired new perms? Either you duplicate > the logic of the .bdrv_child_perm implementation into a new set of > functions that does the same thing, but based on the new state; or you > extend the existing function with a

Re: [Qemu-block] [Qemu-devel] [PATCH 0/6] block: Fix permissions after ro/rw reopen

2017-09-18 Thread Fam Zheng
On Mon, 09/18 10:11, Kevin Wolf wrote: > > 2) Don't change the prototypes at all, just change .bdrv_reopen_prepare > > contract > > so that after it returns, .bdrv_child_perm/.bdrv_check_perm should comply > > to the > > new state that would be commited once .bdrv_reopen_commit() is called, or >

Re: [Qemu-block] [PATCH 0/6] block: Fix permissions after ro/rw reopen

2017-09-18 Thread Fam Zheng
On Fri, 09/15 12:10, Kevin Wolf wrote: > bdrv_reopen() can switch nodes between read-only and read-write modes. > This has implications for the required permissions on their child nodes. > For example, a qcow2 node requests write permissions on bs->file only if > it is writable itself. > > This

Re: [Qemu-block] [PATCH 6/6] block: Fix permissions after bdrv_reopen()

2017-09-18 Thread Fam Zheng
On Fri, 09/15 12:10, Kevin Wolf wrote: > If we switch between read-only and read-write, the permissions that > image format drivers need on bs->file change, too. Make sure to update > the permissions during bdrv_reopen(). > > Signed-off-by: Kevin Wolf > --- >

Re: [Qemu-block] [PATCH 1/6] qemu-io: Reset qemuio_blk permissions before each command

2017-09-18 Thread Fam Zheng
KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > -write failed: Operation not permitted > +Block node is read-only > wrote 65536/65536 bytes at offset 0 > 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > *** done > -- > 2.13.5 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH 17/18] qemu-io: Add background write

2017-09-18 Thread Fam Zheng
On Wed, 09/13 20:19, Max Reitz wrote: > Add a new parameter -B to qemu-io's write command. When used, qemu-io > will not wait for the result of the operation and instead execute it in > the background. Cannot aio_write be used for this purpose? Fam

Re: [Qemu-block] [PATCH 18/18] iotests: Add test for active mirroring

2017-09-18 Thread Fam Zheng
On Wed, 09/13 20:19, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/151 | 111 > + > tests/qemu-iotests/151.out | 5 ++ > tests/qemu-iotests/group | 1 + > 3 files changed, 117 insertions(+) >

Re: [Qemu-block] [PATCH 05/18] block/mirror: Convert to coroutines

2017-09-18 Thread Fam Zheng
On Wed, 09/13 20:18, Max Reitz wrote: > In order to talk to the source BDS (and maybe in the future to the > target BDS as well) directly, we need to convert our existing AIO > requests into coroutine I/O requests. > > Signed-off-by: Max Reitz > --- > block/mirror.c | 134 >

Re: [Qemu-block] [PATCH 04/18] block/mirror: Pull out mirror_perform()

2017-09-17 Thread Fam Zheng
io_bytes; > @@ -650,8 +657,8 @@ static int coroutine_fn mirror_dirty_init(MirrorBlockJob > *s) > continue; > } > > -mirror_do_zero_or_discard(s, sector_num * BDRV_SECTOR_SIZE, > - nb_sectors * BDRV_SECTOR_SIZE, false); > +mirror_perform(s, sector_num * BDRV_SECTOR_SIZE, > + nb_sectors * BDRV_SECTOR_SIZE, > MIRROR_METHOD_ZERO); > sector_num += nb_sectors; > } > > -- > 2.13.5 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH 03/18] blockjob: Make drained_{begin, end} public

2017-09-17 Thread Fam Zheng
> + > static const BlockDevOps block_job_dev_ops = { > -.drained_begin = block_job_drained_begin, > -.drained_end = block_job_drained_end, > +.drained_begin = block_job_drained_begin_op, > +.drained_end = block_job_drained_end_op, > }; > > void block_job_remove_all_bdrv(BlockJob *job) > -- > 2.13.5 > > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH 02/18] block: BDS deletion during bdrv_drain_recurse

2017-09-17 Thread Fam Zheng
On Wed, 09/13 20:18, Max Reitz wrote: > Drainined a BDS child may lead to both the original BDS and/or its other > children being deleted (e.g. if the original BDS represents a block > job). We should prepare for this in both bdrv_drain_recurse() and > bdrv_drained_begin() by monitoring whether

Re: [Qemu-block] [PATCH] iotests: Print full path of bad output if mismatch

2017-09-15 Thread Fam Zheng
On Fri, 09/15 14:16, Kevin Wolf wrote: > Am 15.09.2017 um 07:45 hat Fam Zheng geschrieben: > > So it is easier to copy paste the path. > > > > Signed-off-by: Fam Zheng <f...@redhat.com> > > I don't think I ever tried to do anything with the diff that wo

[Qemu-block] [PATCH] iotests: Print full path of bad output if mismatch

2017-09-14 Thread Fam Zheng
So it is easier to copy paste the path. Signed-off-by: Fam Zheng <f...@redhat.com> --- tests/qemu-iotests/check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index d504b6e455..4583a0c269 100755 --- a/tests/qemu-i

Re: [Qemu-block] [Qemu-devel] [PATCH v2 00/10] cleanup qemu-iotests

2017-09-13 Thread Fam Zheng
On Wed, 09/13 08:47, Thomas Huth wrote: > Meta comment: Could we maybe also rename "tests/qemu-iotests" to > "tests/iotests" ? The "qemu" prefix sounds always very superfluous to me > here... Sounds good, and saves typing for when this path is manually entered. But maybe keep tests/qemu-iotests

[Qemu-block] [PATCH v3] file-posix: Clear out first sector in hdev_create

2017-09-08 Thread Fam Zheng
out the first sector to make sure the stale qcow2 header doesn't cause such confusion. Signed-off-by: Fam Zheng <f...@redhat.com> --- v3: Don't do anything if there were errors. [Kevin] v2: Use stack allocated buffer. [Eric] Fix return value. (Keep qemu_write_full instead of switchi

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] block: add block device shared field

2017-09-05 Thread Fam Zheng
On Tue, 09/05 10:56, Stefan Hajnoczi wrote: > On Fri, Sep 01, 2017 at 08:10:54PM +, Brian Steffens wrote: > > This adds a boolean option called 'shared' to block devices. It defaults > > to off/false. When enabled for a particular block device, the 'shared' > > option > > causes the block

Re: [Qemu-block] [Qemu-devel] Persistent bitmaps for non-qcow2 formats

2017-09-05 Thread Fam Zheng
On Tue, 09/05 15:27, Kevin Wolf wrote: > Am 05.09.2017 um 15:18 hat Fam Zheng geschrieben: > > On Tue, 09/05 15:01, Kevin Wolf wrote: > > > Am 28.08.2017 um 04:57 hat Fam Zheng geschrieben: > > > > On Fri, 08/25 15:44, Max Reitz wrote: > > > > > We

Re: [Qemu-block] [Qemu-devel] Persistent bitmaps for non-qcow2 formats

2017-09-05 Thread Fam Zheng
On Tue, 09/05 15:01, Kevin Wolf wrote: > Am 28.08.2017 um 04:57 hat Fam Zheng geschrieben: > > On Fri, 08/25 15:44, Max Reitz wrote: > > > Well, OK. The main argument against supporting anything but qcow2 is > > > "if you want features, use qcow2; and we are worki

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Cleanup BMDS in bdrv_close_all

2017-09-05 Thread Fam Zheng
On Tue, 09/05 10:44, Kevin Wolf wrote: > Am 30.08.2017 um 12:06 hat Fam Zheng geschrieben: > > This fixes the assertion due to op blockers added by BMDS: > > > > block.c:3248: bdrv_delete: Assertion `bdrv_op_blocker_is_empty(bs)' failed. > > > > Reproducer: simp

Re: [Qemu-block] [PATCH] block: Cleanup BMDS in bdrv_close_all

2017-09-04 Thread Fam Zheng
On Fri, 09/01 13:41, Juan Quintela wrote: > Fam Zheng <f...@redhat.com> wrote: > > This fixes the assertion due to op blockers added by BMDS: > > > > block.c:3248: bdrv_delete: Assertion `bdrv_op_blocker_is_empty(bs)' failed. > > > > Reproducer: simply sta

Re: [Qemu-block] [PATCH] qemu-iotests: Make test 192 use QMP; convert it to Python

2017-09-04 Thread Fam Zheng
gt; -_make_test_img $size > - > -{ > -echo "nbd_server_start unix:$TEST_DIR/nbd" > -echo "nbd_server_add -w drive0" > -echo "q" > -} | $QEMU -nodefaults -display none -monitor stdio \ > --drive format=$IMGFMT,file=$TEST_IMG,if=ide,id=drive0 \ > --inc

Re: [Qemu-block] [PATCH 0/2] Fix / skip recent iotests with LUKS driver

2017-09-01 Thread Fam Zheng
On Fri, 09/01 11:54, Daniel P. Berrange wrote: > Two recently added iotests are currently breaking 'check -luks', > fix the easy one and disable the hard one. I can add -luks to the test-block series with this, thanks for the quick fix! Tested-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.11 v2] file-posix: Clear out first sector in hdev_create

2017-08-31 Thread Fam Zheng
On Fri, 08/11 16:09, Fam Zheng wrote: > People get surprised when, after "qemu-img create -f raw /dev/sdX", they > still see qcow2 with "qemu-img info", if previously the bdev had a qcow2 > header. While this is natural because raw doesn't need to write any

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Cleanup BMDS in bdrv_close_all

2017-08-30 Thread Fam Zheng
On Wed, 08/30 13:49, Juan Quintela wrote: > Fam Zheng <f...@redhat.com> wrote: > > This fixes the assertion due to op blockers added by BMDS: > > > > block.c:3248: bdrv_delete: Assertion `bdrv_op_blocker_is_empty(bs)' failed. > > > > Reproducer: simply sta

[Qemu-block] [PATCH] block: Cleanup BMDS in bdrv_close_all

2017-08-30 Thread Fam Zheng
This fixes the assertion due to op blockers added by BMDS: block.c:3248: bdrv_delete: Assertion `bdrv_op_blocker_is_empty(bs)' failed. Reproducer: simply start block migration and quit QEMU before it ends. Cc: qemu-sta...@nongnu.org Signed-off-by: Fam Zheng <f...@redhat.com> --- b

Re: [Qemu-block] [Qemu-devel] Persistent bitmaps for non-qcow2 formats

2017-08-27 Thread Fam Zheng
On Fri, 08/25 15:44, Max Reitz wrote: > Well, OK. The main argument against supporting anything but qcow2 is > "if you want features, use qcow2; and we are working on making qcow2 as > fast as possible." I think that's a very good argument still. At some > point I (and probably others, too) had

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 2/4] block-backend: Allow more "can inactivate" cases

2017-08-23 Thread Fam Zheng
On Wed, 08/23 09:36, Eric Blake wrote: > On 08/23/2017 08:42 AM, Fam Zheng wrote: > > These two conditions corresponds to mirror job's source and target, > > s/corresponds to/correspond to a/ > > [can touch up on pull request] > > > which need to be allowed as t

[Qemu-block] [PATCH for-2.10 4/4] block: Update open_flags after ->inactivate() callback

2017-08-23 Thread Fam Zheng
ermission update failure. Reorder them so the flag is updated after calling the function. Note that this doesn't break the assert in bdrv_child_cb_inactivate() because for any specific BDS, we still update its flags first before calling ->inactivate() on it one level deeper in the recursion. Signed

[Qemu-block] [PATCH for-2.10 3/4] mirror: Mark target BB as "force allow inactivate"

2017-08-23 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- block/mirror.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index c9a6a3ca86..429751b9fe 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1134,6 +1134,7 @@ stati

[Qemu-block] [PATCH for-2.10 0/4] block: Fix non-shared storage migration

2017-08-23 Thread Fam Zheng
This fixes the issue reported as https://bugs.launchpad.net/bugs/1711602 Fam Zheng (3): block-backend: Refactor inactivate check block-backend: Allow more "can inactivate" cases mirror: Mark target BB as "force allow inactivate" Stefan Hajnoczi (1): block: Upd

[Qemu-block] [PATCH for-2.10 1/4] block-backend: Refactor inactivate check

2017-08-23 Thread Fam Zheng
The logic will be fixed (extended), move it to a separete function. Signed-off-by: Fam Zheng <f...@redhat.com> --- block/block-backend.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index e979

Re: [Qemu-block] [PATCH 07/10] io: add qio_channel_read/write_all

2017-08-22 Thread Fam Zheng
On Tue, 08/22 15:18, Paolo Bonzini wrote: > It is pretty common to read a fixed-size buffer from a socket. Add a > function that does this, either with multiple reads (on blocking sockets) > or by yielding if called from a coroutine. > > Cc: Daniel P. Berrange >

Re: [Qemu-block] [PATCH 09/10] scsi: add multipath support to qemu-pr-helper

2017-08-22 Thread Fam Zheng
On Tue, 08/22 15:18, Paolo Bonzini wrote: > Proper support of persistent reservation for multipath devices requires > communication with the multipath daemon, so that the reservation is > registered and applied when a path comes up. The device mapper > utilities provide a library to do so; this

Re: [Qemu-block] [PATCH 10/10] scsi: add persistent reservation manager using qemu-pr-helper

2017-08-22 Thread Fam Zheng
On Tue, 08/22 15:18, Paolo Bonzini wrote: > This adds a concrete subclass of pr-manager that talks to qemu-pr-helper. > > Signed-off-by: Paolo Bonzini > --- > scsi/Makefile.objs | 2 +- > scsi/pr-manager-helper.c | 288 >

Re: [Qemu-block] [PATCH 06/10] scsi, file-posix: add support for persistent reservation management

2017-08-22 Thread Fam Zheng
On Tue, 08/22 15:18, Paolo Bonzini wrote: > diff --git a/docs/pr-manager.rst b/docs/pr-manager.rst Is docs/interop/persistent-reservation-manager.rst better? (Move to interop/ and de-abbreviate) ... > new file mode 100644 > index 00..b6089fb57c > --- /dev/null > +++ b/docs/pr-manager.rst

Re: [Qemu-block] [Qemu-devel] [PATCH 5/6] block: Fix write/resize permissions for inactive images

2017-08-18 Thread Fam Zheng
On Fri, 08/18 18:06, Xie Changlong wrote: > The root casue is when we run replication in secondary, vmstate changes to > RUN_STATE_INMIGRATE, then blockdev_init() sets bdrv_flags |= > BDRV_O_INACTIVE. So the whole chain become readonly. I've tried on my side, > but it seems not easy to fix it. I

[Qemu-block] [PATCH for-2.10 v2 3/4] block-backend: Defer shared_perm tightening migration completion

2017-08-15 Thread Fam Zheng
As in the case of nbd_export_new(), bdrv_invalidate_cache() can be called when migration is still in progress. In this case we are not ready to tighten the shared permissions fenced by blk->disable_perm. Defer to a VM state change handler. Signed-off-by: Fam Zheng <f...@redhat.com> -

[Qemu-block] [PATCH for-2.10 v2 4/4] iotests: Add non-shared storage migration case 192

2017-08-15 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- tests/qemu-iotests/192 | 63 ++ tests/qemu-iotests/192.out | 7 ++ tests/qemu-iotests/group | 1 + 3 files changed, 71 insertions(+) create mode 100755 tests/qemu-iotests/192 creat

[Qemu-block] [PATCH for-2.10 v2 1/4] stubs: Add vm state change handler stubs

2017-08-15 Thread Fam Zheng
They will be used by BlockBackend code in block-obj-y, which doesn't always get linked with common-obj-y. Add stubs to keep ld happy. Signed-off-by: Fam Zheng <f...@redhat.com> --- stubs/Makefile.objs | 1 + stubs/change-state-handler.c | 14 ++ 2 files chang

[Qemu-block] [PATCH for-2.10 v2 2/4] nbd: Fix order of bdrv_set_perm and bdrv_invalidate_cache

2017-08-15 Thread Fam Zheng
From: Kevin Wolf <kw...@redhat.com> The "inactive" state of BDS affects whether the permissions can be granted, we must call bdrv_invalidate_cache before bdrv_set_perm to support "-incoming defer" case. Reported-by: Christian Ehrhardt <christian.ehrha...@canonical.

[Qemu-block] [PATCH for-2.10 v2 0/4] block: Fix non-shared storage migration

2017-08-15 Thread Fam Zheng
h, and add a regression iotest. Fam Zheng (3): stubs: Add vm state change handler stubs block-backend: Defer shared_perm tightening migration completion iotests: Add non-shared storage migration case 192 Kevin Wolf (1): nbd: Fix order of bdrv_set_perm and bdrv_invalidate_cache block/bloc

Re: [Qemu-block] [PATCH for-2.10 1/4] stubs: Add vm state change handler stubs

2017-08-15 Thread Fam Zheng
On Tue, 08/15 07:26, Eric Blake wrote: > On 08/14/2017 11:04 PM, Fam Zheng wrote: > > Signed-off-by: Fam Zheng <f...@redhat.com> > > A bit sparse on the 'why' - presumably, upcoming patches will fail to > compile if the stub is not present, but mentioning what dependency t

[Qemu-block] [PATCH for-2.10 3/4] block-backend: Defer shared_perm tightening migration completion

2017-08-14 Thread Fam Zheng
As in the case of nbd_export_new(), bdrv_invalidate_cache() can be called when migration is still in progress. In this case we are not ready to tighten the shared permissions fenced by blk->disable_perm. Defer to a VM state change handler. Signed-off-by: Fam Zheng <f...@redhat.com> -

[Qemu-block] [PATCH for-2.10 4/4] iotests: Add non-shared storage migration case 192

2017-08-14 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- tests/qemu-iotests/192 | 63 ++ tests/qemu-iotests/192.out | 7 ++ tests/qemu-iotests/group | 1 + 3 files changed, 71 insertions(+) create mode 100755 tests/qemu-iotests/192 creat

[Qemu-block] [PATCH for-2.10 2/4] nbd: Fix order of bdrv_set_perm and bdrv_invalidate_cache

2017-08-14 Thread Fam Zheng
From: Kevin Wolf <kw...@redhat.com> The "inactive" state of BDS affects whether the permissions can be granted, we must call bdrv_invalidate_cache before bdrv_set_perm to support "-incoming defer" case. Reported-by: Christian Ehrhardt <christian.ehrha...@canonical.

[Qemu-block] [PATCH for-2.10 0/4] block: Fix non-shared storage migration

2017-08-14 Thread Fam Zheng
ev permission (which are temporarily masked by BlockBackend.disable_perm during INMIGRATE) too early. Fix both, and add a regression iotest. Fam Zheng (3): stubs: Add vm state change handler stubs block-backend: Defer shared_perm tightening migration completion iotests: Add non-shared st

[Qemu-block] [PATCH for-2.10 1/4] stubs: Add vm state change handler stubs

2017-08-14 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- stubs/Makefile.objs | 1 + stubs/change-state-handler.c | 14 ++ 2 files changed, 15 insertions(+) create mode 100644 stubs/change-state-handler.c diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index f5b4

Re: [Qemu-block] [Qemu-devel] migration issue with qemu 2.10-rc2: QEMU command 'nbd-server-add': Block node is read-only

2017-08-14 Thread Fam Zheng
On Fri, 08/11 18:48, Kevin Wolf wrote: > The patch below implements what I was thinking of, and it seems to fix > this problem. However, you'll immediately run into the next one, which > is a message like 'Conflicts with use by ide0-hd0 as 'root', which does > not allow 'write' on #block172'. > >

Re: [Qemu-block] [PATCH for-2.11 v2] file-posix: Clear out first sector in hdev_create

2017-08-11 Thread Fam Zheng
On Fri, 08/11 09:42, Eric Blake wrote: > On 08/11/2017 03:09 AM, Fam Zheng wrote: > > People get surprised when, after "qemu-img create -f raw /dev/sdX", they > > still see qcow2 with "qemu-img info", if previously the bdev had a qcow2 > > header. While

Re: [Qemu-block] [Qemu-devel] migration issue with qemu 2.10-rc2: QEMU command 'nbd-server-add': Block node is read-only

2017-08-11 Thread Fam Zheng
et these are inactive, so the inquiry works (content is the same > anyway). > All files are there and the backing chain looks correct. > > I'm not sure if being unable to qemu-img while running is considered an > issue of its own, but this could be related to: > (

[Qemu-block] [PATCH for-2.10? v3 2/2] file-posix: Do runtime check for ofd lock API

2017-08-11 Thread Fam Zheng
e <ebl...@redhat.com> Signed-off-by: Fam Zheng <f...@redhat.com> --- block/file-posix.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index f4de022ae0..cb3bfce147 100644 --- a/block/file-posix.c +++ b/

[Qemu-block] [PATCH for-2.10? v3 0/2] block: Do OFD lock check at runtime

2017-08-11 Thread Fam Zheng
This is also a practical problem for Linux considering it's possible to run QEMU which is built against a new glibc on an old kernel that doesn't have OFD API. Convert to runtime check to cope with that. Fam Zheng (2): osdep: Add runtime OFD lock detection file-posix: Do runtime check f

[Qemu-block] [PATCH for-2.10? v3 1/2] osdep: Add runtime OFD lock detection

2017-08-11 Thread Fam Zheng
Build time check of OFD lock is not sufficient and can cause image open errors when the runtime environment doesn't support it. Add a helper function to probe it at runtime, additionally. Also provide a qemu_has_ofd_lock() for callers to check the status. Signed-off-by: Fam Zheng &l

[Qemu-block] [PATCH for-2.10? v2 1/2] osdep: Add runtime OFD lock detection

2017-08-11 Thread Fam Zheng
Build time check of OFD lock is not sufficient and can cause image open errors when the runtime environment doesn't support it. Add a helper function to probe it at runtime, additionally. Also provide a qemu_has_ofd_lock() for callers to check the status. Signed-off-by: Fam Zheng &l

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