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

2018-01-29 Thread Fam Zheng
On Tue, Jan 30, 2018 at 12:01 AM, Max Reitz wrote: > On 2017-12-26 03:52, Fam Zheng wrote: >> Signed-off-by: Fam Zheng >> Reviewed-by: Stefan Hajnoczi >> Reviewed-by: Kashyap Chamarthy >> Signed-off-by: Kevin Wolf >> --- >> qemu-img.texi | 9 + >> 1 file changed, 9 insertions(+) >> >>

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

2018-01-29 Thread Fam Zheng
v6: Tweak wording ("concurrent writers"). [Max] Fam Zheng (2): qemu-img.texi: Clean up parameter list qemu-img: Document --force-share / -U qemu-img.texi | 73 +-- 1 file changed, 46 insertions(+), 27 deletions(-) -- 2.14.3

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

2018-01-29 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 Signed-off-by: Fam Zheng --- qemu-img.texi | 66 +++ 1 file changed, 39 insertions(+)

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

2018-01-29 Thread Fam Zheng
Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- qemu-img.texi | 7 +++ 1 file changed, 7 insertions(+) diff --git a/qemu-img.texi b/qemu-img.texi index 60a0e080c6..ec7e2f5d1e 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -86,6 +86,13 @@ exclusive with the @var{-O} parameters. It

[Qemu-block] [PATCH] iotests: Fix CID for VMDK afl image

2018-01-29 Thread Fam Zheng
This reverts commit 76bf133c4 which updated the reference output, and fixed the reference image, because the code path we want to exercise is actually the invalid image size. The descriptor block in the image, which includes the CID to verify, has been invalid since the reference image was added.

[Qemu-block] [RFC 2/4] qemu-socket: Allow custom socket options in socket_connect

2018-01-29 Thread Zihan Yang
Currently, socket_connect doesn't allow custom socket options, which is inconvenient when the caller wants a different kind of socket from that the socket_connect provides. This patch allows custom config in socket_connect by providing an extra parameter. Existing functions can just pass a NULL poi

Re: [Qemu-block] [Qemu-devel] [RFC v3 05/14] blockjobs: add block_job_dismiss

2018-01-29 Thread John Snow
On 01/29/2018 12:38 PM, Kevin Wolf wrote: > Am 27.01.2018 um 03:05 hat John Snow geschrieben: >> For jobs that have reached their terminal state, prior to having their >> last reference put down (meaning jobs that have completed successfully, >> unsuccessfully, or have been canceled), allow the u

Re: [Qemu-block] [PATCH v7 9/9] iotest 134: test cluster-misaligned encrypted write

2018-01-29 Thread Max Reitz
On 2018-01-18 18:49, Anton Nefedov wrote: > COW (even empty/zero) areas require encryption too > > Signed-off-by: Anton Nefedov > Reviewed-by: Eric Blake > --- > tests/qemu-iotests/134 | 9 + > tests/qemu-iotests/134.out | 10 ++ > 2 files changed, 19 insertions(+) Reviewe

Re: [Qemu-block] [PATCH v7 8/9] qcow2: skip writing zero buffers to empty COW areas

2018-01-29 Thread Max Reitz
On 2018-01-18 18:49, Anton Nefedov wrote: > If COW areas of the newly allocated clusters are zeroes on the backing image, > efficient bdrv_write_zeroes(flags=BDRV_REQ_ALLOCATE) can be used on the whole > cluster instead of writing explicit zero buffers later in perform_cow(). > > iotest 060: > wri

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

2018-01-29 Thread Eric Blake
ping On 01/05/2018 04:57 PM, Eric Blake wrote: > There are patches floating around to add NBD_CMD_BLOCK_STATUS, > but NBD wants to report status on byte granularity (even if the > reporting will probably be naturally aligned to sectors or even > much higher levels). I've therefore started the tas

Re: [Qemu-block] [PATCH v7 7/9] qcow2: move is_zero() up

2018-01-29 Thread Max Reitz
On 2018-01-18 18:49, Anton Nefedov wrote: > To be used in the following commit without a forward declaration. > > Signed-off-by: Anton Nefedov > Reviewed-by: Alberto Garcia > --- > block/qcow2.c | 35 +-- > 1 file changed, 17 insertions(+), 18 deletions(-) Revie

Re: [Qemu-block] [PATCH v7 6/9] block: support BDRV_REQ_ALLOCATE in passthrough drivers

2018-01-29 Thread Max Reitz
On 2018-01-18 18:49, Anton Nefedov wrote: > Support the flag if the underlying BDS supports it > > Signed-off-by: Anton Nefedov > Reviewed-by: Alberto Garcia > --- > block/blkdebug.c | 3 ++- > block/blkverify.c | 2 +- > block/mirror.c | 2 +- > block/raw-format.c | 3 ++- > 4 files cha

Re: [Qemu-block] [Qemu-devel] [RFC v3 03/14] blockjobs: add state transition table

2018-01-29 Thread Kevin Wolf
Am 29.01.2018 um 20:07 hat John Snow geschrieben: > > > On 01/29/2018 12:17 PM, Kevin Wolf wrote: > > Am 27.01.2018 um 03:05 hat John Snow geschrieben: > >> The state transition table has mostly been implied. We're about to make > >> it a bit more complex, so let's make the STM explicit instead.

Re: [Qemu-block] [PATCH v7 5/9] file-posix: support BDRV_REQ_ALLOCATE

2018-01-29 Thread Max Reitz
On 2018-01-18 18:49, Anton Nefedov wrote: > Current write_zeroes implementation is good enough to satisfy this flag too > > Signed-off-by: Anton Nefedov > Reviewed-by: Alberto Garcia > --- > block/file-posix.c | 8 > 1 file changed, 8 insertions(+) Reviewed-by: Max Reitz signature

Re: [Qemu-block] [PATCH v7 4/9] block: treat BDRV_REQ_ALLOCATE as serialising

2018-01-29 Thread Max Reitz
On 2018-01-18 18:49, Anton Nefedov wrote: > The idea is that ALLOCATE requests may overlap with other requests. > Reuse the existing block layer infrastructure for serialising requests. > Use the following approach: > - mark ALLOCATE serialising, so subsequent requests to the area wait > - ALLO

Re: [Qemu-block] [PATCH v7 3/9] block: introduce BDRV_REQ_ALLOCATE flag

2018-01-29 Thread Max Reitz
On 2018-01-18 18:49, Anton Nefedov wrote: > The flag is supposed to indicate that the region of the disk image has > to be sufficiently allocated so it reads as zeroes. > > The call with the flag set must return -ENOTSUP if allocation cannot > be done efficiently. > This has to be made sure of by

Re: [Qemu-block] [PATCH v7 1/9] mirror: inherit supported write/zero flags

2018-01-29 Thread Eric Blake
On 01/29/2018 01:21 PM, Max Reitz wrote: > On 2018-01-18 18:48, Anton Nefedov wrote: >> Signed-off-by: Anton Nefedov >> Reviewed-by: Eric Blake >> Reviewed-by: Alberto Garcia >> --- >> block/mirror.c | 5 + >> 1 file changed, 5 insertions(+) >> >> diff --git a/block/mirror.c b/block/mirror.

Re: [Qemu-block] [PATCH v7 2/9] blkverify: set supported write/zero flags

2018-01-29 Thread Max Reitz
On 2018-01-18 18:49, Anton Nefedov wrote: > Signed-off-by: Anton Nefedov > Reviewed-by: Alberto Garcia > --- > block/blkverify.c | 9 + > 1 file changed, 9 insertions(+) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v7 1/9] mirror: inherit supported write/zero flags

2018-01-29 Thread Max Reitz
On 2018-01-18 18:48, Anton Nefedov wrote: > Signed-off-by: Anton Nefedov > Reviewed-by: Eric Blake > Reviewed-by: Alberto Garcia > --- > block/mirror.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/block/mirror.c b/block/mirror.c > index c9badc1..d18ec65 100644 > --- a/block/mi

Re: [Qemu-block] [Qemu-devel] [RFC v3 03/14] blockjobs: add state transition table

2018-01-29 Thread John Snow
On 01/29/2018 12:17 PM, Kevin Wolf wrote: > Am 27.01.2018 um 03:05 hat John Snow geschrieben: >> The state transition table has mostly been implied. We're about to make >> it a bit more complex, so let's make the STM explicit instead. >> >> Perform state transitions with a function that for now j

Re: [Qemu-block] [PATCH v2] block: maintain persistent disabled bitmaps

2018-01-29 Thread Max Reitz
On 2018-01-22 11:41, Vladimir Sementsov-Ogievskiy wrote: > To maintain load/store disabled bitmap there is new approach: > > - deprecate @autoload flag of block-dirty-bitmap-add, make it ignored > - store enabled bitmaps as "auto" to qcow2 > - store disabled bitmaps without "auto" flag to qcow2

Re: [Qemu-block] [RFC PATCH 04/10] qcow2: Pass BlockdevCreateOptions to qcow2_create2()

2018-01-29 Thread Kevin Wolf
Am 29.01.2018 um 18:12 hat Max Reitz geschrieben: > On 2018-01-11 20:52, Kevin Wolf wrote: > > All of the simple options are now passed to qcow2_create2() in a > > BlockdevCreateOptions object. Still missing: node-name and the > > encryption options. > > > > Signed-off-by: Kevin Wolf > > --- > >

Re: [Qemu-block] [RFC PATCH 00/10] x-blockdev-create for qcow2

2018-01-29 Thread Max Reitz
On 2018-01-11 20:52, Kevin Wolf wrote: > This series implements a minimal QMP command that allows to create an > image format on a given block node. The interface is still going to > change to some kind of an async command (possibly a block job), so I > prefixed x- for now. > > At this point, I'm

Re: [Qemu-block] [RFC PATCH 05/10] qcow2: Use BlockdevRef in qcow2_create2()

2018-01-29 Thread Kevin Wolf
Am 29.01.2018 um 18:30 hat Max Reitz geschrieben: > On 2018-01-11 20:52, Kevin Wolf wrote: > > Instead of passing a separate BlockDriverState* into qcow2_create2(), > > make use of the BlockdevRef that is included in BlockdevCreateOptions. > > > > Signed-off-by: Kevin Wolf > > --- > > include/bl

Re: [Qemu-block] [RFC PATCH 02/10] block/qapi: Add qcow2 create options to schema

2018-01-29 Thread Kevin Wolf
Am 29.01.2018 um 17:57 hat Max Reitz geschrieben: > On 2018-01-11 20:52, Kevin Wolf wrote: > > Signed-off-by: Kevin Wolf > > --- > > qapi/block-core.json | 33 - > > 1 file changed, 32 insertions(+), 1 deletion(-) > > > > diff --git a/qapi/block-core.json b/qapi/b

Re: [Qemu-block] [RFC PATCH 04/10] qcow2: Pass BlockdevCreateOptions to qcow2_create2()

2018-01-29 Thread Max Reitz
On 2018-01-29 19:10, Kevin Wolf wrote: > Am 29.01.2018 um 18:12 hat Max Reitz geschrieben: >> On 2018-01-11 20:52, Kevin Wolf wrote: >>> All of the simple options are now passed to qcow2_create2() in a >>> BlockdevCreateOptions object. Still missing: node-name and the >>> encryption options. >>> >>

Re: [Qemu-block] [RFC PATCH 02/10] block/qapi: Add qcow2 create options to schema

2018-01-29 Thread Max Reitz
On 2018-01-29 19:06, Kevin Wolf wrote: > Am 29.01.2018 um 17:57 hat Max Reitz geschrieben: >> On 2018-01-11 20:52, Kevin Wolf wrote: >>> Signed-off-by: Kevin Wolf >>> --- >>> qapi/block-core.json | 33 - >>> 1 file changed, 32 insertions(+), 1 deletion(-) >>> >>> d

Re: [Qemu-block] [Qemu-devel] [RFC v3 01/14] blockjobs: add manual property

2018-01-29 Thread John Snow
On 01/29/2018 12:46 PM, Kevin Wolf wrote: > Am 29.01.2018 um 18:34 hat John Snow geschrieben: >> On 01/29/2018 11:59 AM, Kevin Wolf wrote: >>> Am 27.01.2018 um 03:05 hat John Snow geschrieben: This property will be used to opt-in to the new BlockJobs workflow that allows a tighter, more

Re: [Qemu-block] [Qemu-devel] [RFC v3 01/14] blockjobs: add manual property

2018-01-29 Thread Kevin Wolf
Am 29.01.2018 um 18:34 hat John Snow geschrieben: > On 01/29/2018 11:59 AM, Kevin Wolf wrote: > > Am 27.01.2018 um 03:05 hat John Snow geschrieben: > >> This property will be used to opt-in to the new BlockJobs workflow > >> that allows a tighter, more explicit control over transitions from > >> on

Re: [Qemu-block] [RFC v3 02/14] blockjobs: Add status enum

2018-01-29 Thread John Snow
On 01/29/2018 12:04 PM, Kevin Wolf wrote: > Am 27.01.2018 um 03:05 hat John Snow geschrieben: >> We're about to add several new states, and booleans are becoming >> unwieldly and difficult to reason about. To this end, add a new "status" >> field and add our existing states in a redundant manner

Re: [Qemu-block] [RFC v3 05/14] blockjobs: add block_job_dismiss

2018-01-29 Thread Kevin Wolf
Am 27.01.2018 um 03:05 hat John Snow geschrieben: > For jobs that have reached their terminal state, prior to having their > last reference put down (meaning jobs that have completed successfully, > unsuccessfully, or have been canceled), allow the user to dismiss the > job's lingering status repor

Re: [Qemu-block] [Qemu-devel] [RFC v3 01/14] blockjobs: add manual property

2018-01-29 Thread John Snow
On 01/29/2018 11:59 AM, Kevin Wolf wrote: > Am 27.01.2018 um 03:05 hat John Snow geschrieben: >> This property will be used to opt-in to the new BlockJobs workflow >> that allows a tighter, more explicit control over transitions from >> one runstate to another. >> >> Signed-off-by: John Snow >

Re: [Qemu-block] [RFC PATCH 05/10] qcow2: Use BlockdevRef in qcow2_create2()

2018-01-29 Thread Max Reitz
On 2018-01-11 20:52, Kevin Wolf wrote: > Instead of passing a separate BlockDriverState* into qcow2_create2(), > make use of the BlockdevRef that is included in BlockdevCreateOptions. > > Signed-off-by: Kevin Wolf > --- > include/block/block.h | 1 + > block.c | 39 +++

Re: [Qemu-block] [RFC v3 03/14] blockjobs: add state transition table

2018-01-29 Thread Kevin Wolf
Am 27.01.2018 um 03:05 hat John Snow geschrieben: > The state transition table has mostly been implied. We're about to make > it a bit more complex, so let's make the STM explicit instead. > > Perform state transitions with a function that for now just asserts the > transition is appropriate. > >

Re: [Qemu-block] [RFC PATCH 04/10] qcow2: Pass BlockdevCreateOptions to qcow2_create2()

2018-01-29 Thread Max Reitz
On 2018-01-11 20:52, Kevin Wolf wrote: > All of the simple options are now passed to qcow2_create2() in a > BlockdevCreateOptions object. Still missing: node-name and the > encryption options. > > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 186 > ++

Re: [Qemu-block] [RFC v3 02/14] blockjobs: Add status enum

2018-01-29 Thread Kevin Wolf
Am 27.01.2018 um 03:05 hat John Snow geschrieben: > We're about to add several new states, and booleans are becoming > unwieldly and difficult to reason about. To this end, add a new "status" > field and add our existing states in a redundant manner alongside the > bools they are replacing: > > UN

Re: [Qemu-block] [RFC v3 01/14] blockjobs: add manual property

2018-01-29 Thread Kevin Wolf
Am 27.01.2018 um 03:05 hat John Snow geschrieben: > This property will be used to opt-in to the new BlockJobs workflow > that allows a tighter, more explicit control over transitions from > one runstate to another. > > Signed-off-by: John Snow > diff --git a/include/block/blockjob.h b/include/bl

Re: [Qemu-block] [RFC PATCH 02/10] block/qapi: Add qcow2 create options to schema

2018-01-29 Thread Max Reitz
On 2018-01-11 20:52, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > qapi/block-core.json | 33 - > 1 file changed, 32 insertions(+), 1 deletion(-) > > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 1749376c61..9341f6708d 100644 > --- a/qap

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

2018-01-29 Thread Kashyap Chamarthy
On Mon, Jan 29, 2018 at 05:01:41PM +0100, Max Reitz wrote: > On 2017-12-26 03:52, Fam Zheng wrote: [...] > So the previous patch makes the use of blank lines consistent and this > one breaks it again? :-) > > > +If specified, @code{qemu-img} will open the image with shared permissions, > > +whic

Re: [Qemu-block] [PATCH] virtio-blk: check for NULL BlockDriverState

2018-01-29 Thread Mark Kanda
On 1/29/2018 9:41 AM, Kevin Wolf wrote: Am 24.01.2018 um 12:31 hat Stefan Hajnoczi geschrieben: On Mon, Jan 22, 2018 at 09:01:49AM -0600, Mark Kanda wrote: Add a BlockDriverState NULL check to virtio_blk_handle_request() to prevent a segfault if the drive is forcibly removed using HMP 'drive_

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

2018-01-29 Thread Max Reitz
On 2017-12-26 03:52, Fam Zheng wrote: > Signed-off-by: Fam Zheng > Reviewed-by: Stefan Hajnoczi > Reviewed-by: Kashyap Chamarthy > Signed-off-by: Kevin Wolf > --- > qemu-img.texi | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/qemu-img.texi b/qemu-img.texi > index 60a0e080c6

qemu-block@nongnu.org

2018-01-29 Thread Stefan Hajnoczi
On Wed, Dec 13, 2017 at 03:33:01PM +, Fernando Casas Schössow wrote: > Maybe I’m missing something here but, if I recall correctly, the qemu process > for the guest is terminated when this problem happens. So how a debugger will > be attached to a process that is gone? Sorry, this got lost i

Re: [Qemu-block] [PATCH v2] block: Fix qemu crash when using scsi-block

2018-01-29 Thread Stefan Hajnoczi
On Fri, Dec 15, 2017 at 04:59:13PM -0800, Deepa Srinivasan wrote: > Starting qemu with the following arguments causes qemu to segfault: > ... -device lsi,id=lsi0 -drive file=iscsi:<...>,format=raw,if=none,node-name= > iscsi1 -device scsi-block,bus=lsi0.0,id=<...>,drive=iscsi1 > > This patch fixes

Re: [Qemu-block] [PATCH] virtio-blk: check for NULL BlockDriverState

2018-01-29 Thread Kevin Wolf
Am 24.01.2018 um 12:31 hat Stefan Hajnoczi geschrieben: > On Mon, Jan 22, 2018 at 09:01:49AM -0600, Mark Kanda wrote: > > Add a BlockDriverState NULL check to virtio_blk_handle_request() > > to prevent a segfault if the drive is forcibly removed using HMP > > 'drive_del' (without performing a hotpl

Re: [Qemu-block] [PATCH 1/2] qcow2: add overlap check for bitmap directory

2018-01-29 Thread Max Reitz
On 2017-11-30 17:47, Vladimir Sementsov-Ogievskiy wrote: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2.h | 7 +-- > block/qcow2-refcount.c | 12 > block/qcow2.c | 6 ++ > 3 files changed, 23 insertions(+), 2 deletions(-) > > diff --git

Re: [Qemu-block] [RFC] block-backend: fix double inc/dec inflight requests number

2018-01-29 Thread Kevin Wolf
Am 25.01.2018 um 12:37 hat Stefan Hajnoczi geschrieben: > On Mon, Jan 22, 2018 at 05:45:49PM +0300, Vladimir Sementsov-Ogievskiy wrote: > > Is it a bug or a feature? Why do we call inc/dec twice for read/write? > > We don't do this for flush and discard.. > > It's non-obvious and I asked Paolo the

Re: [Qemu-block] [PATCH] hmp: Add nbd_server_remove to mirror QMP command

2018-01-29 Thread Kevin Wolf
Am 25.01.2018 um 15:45 hat Eric Blake geschrieben: > Since everything else about the nbd-server-* QMP commands is > accessible from HMP, we might as well make removing an export > available as well. For now, I went with a bool flag rather > than a mode string for choosing between safe (default) an

Re: [Qemu-block] [PATCH 2/2] qemu-iotests: check socket_scm_helper is available

2018-01-29 Thread Max Reitz
On 2017-12-19 17:37, Philippe Mathieu-Daudé wrote: > This now throws a more helpful error message when not found: > > tests/qemu-iotests$ ./check 045 > QEMU -- "/qemu/build/x86_64-softmmu/qemu-system-x86_64" > -nodefaults -machine accel=qtest > QEMU_IMG -- "/qemu/build/qemu-im

Re: [Qemu-block] [PATCH 1/2] qemu-iotests: add missing rule to build socket_scm_helper

2018-01-29 Thread Max Reitz
On 2017-12-19 17:37, Philippe Mathieu-Daudé wrote: > 'make check-block' uses it on Linux. > > Signed-off-by: Philippe Mathieu-Daudé > --- > tests/Makefile.include | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/Makefile.include b/tests/Makefile.include > index b4b

Re: [Qemu-block] [PATCH v3 30/39] qcow2: Update expand_zero_clusters_in_l1() to support L2 slices

2018-01-29 Thread Alberto Garcia
On Fri 26 Jan 2018 08:46:19 PM CET, Eric Blake wrote: >> -ret = qcow2_cache_get(bs, s->l2_table_cache, l2_offset, >> - (void **)&l2_table); >> +ret = qcow2_cache_get(bs, s->l2_table_cache, slice_offset, >> +

Re: [Qemu-block] [PATCH] block: Simplify bdrv_can_write_zeroes_with_unmap()

2018-01-29 Thread Stefan Hajnoczi
On Fri, Jan 26, 2018 at 01:34:39PM -0600, Eric Blake wrote: > We don't need the can_write_zeroes_with_unmap field in > BlockDriverInfo, because it is redundant information with > supported_zero_flags & BDRV_REQ_MAY_UNMAP. Note that > BlockDriverInfo and supported_zero_flags are both per-device > s