Re: [Qemu-block] [PATCH v4 3/3] aio: Introduce aio-epoll.c

2015-11-02 Thread Fam Zheng
On Mon, 11/02 13:19, Stefan Hajnoczi wrote: > On Mon, Nov 02, 2015 at 10:32:54AM +0800, Fam Zheng wrote: > > On Fri, 10/30 10:07, Stefan Hajnoczi wrote: > > > On Fri, Oct 30, 2015 at 12:06:29PM +0800, Fam Zheng wrote: > > > > To comply with aio_{disable,enable}_external, we always use ppoll when >

Re: [Qemu-block] [Qemu-devel] [PATCH] blockdev: acquire AioContext in hmp_commit()

2015-11-02 Thread Stefan Hajnoczi
On Sun, Nov 01, 2015 at 08:50:36PM +0300, Denis V. Lunev wrote: > On 10/30/2015 06:57 PM, Stefan Hajnoczi wrote: > >This one slipped through. Although we acquire AioContext when > >committing all devices we don't for just a single device. > > > >AioContext must be acquired before calling bdrv_*()

[Qemu-block] [PATCH v4 3/4] block: Add 'x-blockdev-del' QMP command

2015-11-02 Thread Alberto Garcia
This command is still experimental, hence the name. This is the companion to 'blockdev-add'. It allows deleting a BlockBackend with its associated BlockDriverState tree, or a BlockDriverState that is not attached to any backend. In either case, the command fails if the reference count is greater

[Qemu-block] [PATCH v4 1/4] mirror: block all operations on the target image during the job

2015-11-02 Thread Alberto Garcia
There's nothing preventing the target image from being used by other operations during the 'drive-mirror' job, so we should block them all until the job is done. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/mirror.c | 4 1 file

[Qemu-block] [PATCH v4 2/4] block: Add blk_get_refcnt()

2015-11-02 Thread Alberto Garcia
This function returns the reference count of a given BlockBackend. For convenience, it returns 0 if the BlockBackend pointer is NULL. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/block-backend.c | 5 +

[Qemu-block] [PATCH v4 0/4] Add 'x-blockdev-del' command

2015-11-02 Thread Alberto Garcia
This version has only documentation and test fixes. Most are cosmetic changes, but there were two missing wait_ready() and wait_until_completed() calls that could break one of the tests. Regards, Berto v4: - patch 3: s/being used/in use/ [Max] - patch 3: add 'blockdev-add' command to the

Re: [Qemu-block] [PATCH v4 3/3] aio: Introduce aio-epoll.c

2015-11-02 Thread Stefan Hajnoczi
On Mon, Nov 02, 2015 at 10:32:54AM +0800, Fam Zheng wrote: > On Fri, 10/30 10:07, Stefan Hajnoczi wrote: > > On Fri, Oct 30, 2015 at 12:06:29PM +0800, Fam Zheng wrote: > > > To comply with aio_{disable,enable}_external, we always use ppoll when > > > aio_external_disabled() is true. > > > > All

Re: [Qemu-block] [PATCH v2 2/2] block: test 'blockdev-snapshot' using a file BDS as the overlay

2015-11-02 Thread Max Reitz
On 02.11.2015 13:15, Alberto Garcia wrote: > This test checks that it is not possible to create a snapshot using as > the overlay node a BDS that does not support backing images. I don't think that works in English. I may be wrong, of course. "a snapshot using a BDS that does not support backing

Re: [Qemu-block] [PATCH 1/2] dataplane: simplify indirect descriptor read

2015-11-02 Thread Stefan Hajnoczi
On Wed, Oct 28, 2015 at 05:48:02PM +0200, Michael S. Tsirkin wrote: > Use address_space_read to make sure we handle the case of an indirect > descriptor crossing DIMM boundary correctly. > > Signed-off-by: Michael S. Tsirkin > --- > > Warning: compile-tested only. Test (with

Re: [Qemu-block] [PATCH 1/2] dataplane: simplify indirect descriptor read

2015-11-02 Thread Stefan Hajnoczi
On Wed, Oct 28, 2015 at 05:48:02PM +0200, Michael S. Tsirkin wrote: > Use address_space_read to make sure we handle the case of an indirect > descriptor crossing DIMM boundary correctly. > > Signed-off-by: Michael S. Tsirkin > --- > > Warning: compile-tested only. > >

Re: [Qemu-block] [Qemu-devel] [PATCH 1/4] ide/atapi: make PIO read requests async

2015-11-02 Thread Peter Lieven
Am 03.11.2015 um 01:48 schrieb John Snow: On 10/12/2015 08:27 AM, Peter Lieven wrote: PIO read requests on the ATAPI interface used to be sync blk requests. This has two significant drawbacks. First the main loop hangs util an I/O request is completed and secondly if the I/O request does not

[Qemu-block] [PATCH 2/2] iotests: Add tests for "json-file:" pseudo protocol

2015-11-02 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/089 | 27 +++ tests/qemu-iotests/089.out | 15 +++ 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/089 b/tests/qemu-iotests/089 index 3e0038d..6115563

[Qemu-block] [PATCH 0/2] block: Introduce "json-file:" protocol

2015-11-02 Thread Fam Zheng
This would be a safer channel when we want to provide block options that contain sensitive information, such as fields for authentication. Fam Zheng (2): block: Add "json-file:" pseudo protocol iotests: Add tests for "json-file:" pseudo protocol block.c| 58

[Qemu-block] [PATCH 1/2] block: Add "json-file:" pseudo protocol

2015-11-02 Thread Fam Zheng
When opening the image, "json-file:/path/to/json/file" has the same as "json-file:$(cat /path/to/json/file)". The advantage is that sensitive information that would be exposed in /proc/$PID/cmdline or log files, is no longer visible this way. Signed-off-by: Fam Zheng ---

Re: [Qemu-block] [Qemu-devel] [PATCH 0/2] block: Introduce "json-file:" protocol

2015-11-02 Thread Daniel P. Berrange
On Tue, Nov 03, 2015 at 03:01:16PM +0800, Fam Zheng wrote: > This would be a safer channel when we want to provide block options that > contain sensitive information, such as fields for authentication. If passing of security sensitive data is the motivation for this, then I don't think we want it

Re: [Qemu-block] [PATCH v3 0/2] qemu-iotests: fix cleanup of background processes

2015-11-02 Thread Max Reitz
On 02.11.2015 21:31, Max Reitz wrote: > On 30.10.2015 20:25, Jeff Cody wrote: >> Changes from v2: >> >> * Pulled patch 2 into this series >> >> * Patch 1: Moved non-empty test conditionals inside >>pid file existance check (thanks Max) >> >>Added a fix in for patch 058, for

Re: [Qemu-block] [Qemu-devel] [PATCH] ide: remove hardcoded 2GiB transactional limit

2015-11-02 Thread John Snow
On 10/27/2015 12:50 PM, Stefan Hajnoczi wrote: > On Mon, Oct 26, 2015 at 07:38:02PM -0400, John Snow wrote: >> Not that you can request a >2GiB transaction, but that's why checking >> for it makes no sense anymore. >> >> With the newer 'limit' parameter to prepare_buf, we no longer need a >>

Re: [Qemu-block] [PATCH v3 0/2] qemu-iotests: fix cleanup of background processes

2015-11-02 Thread Max Reitz
On 30.10.2015 20:25, Jeff Cody wrote: > Changes from v2: > > * Pulled patch 2 into this series > > * Patch 1: Moved non-empty test conditionals inside >pid file existance check (thanks Max) > >Added a fix in for patch 058, for its >self-launched qemu-nbd

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/2] qemu-iotests: fix cleanup of background processes

2015-11-02 Thread Eric Blake
On 11/02/2015 09:03 AM, Max Reitz wrote: +++ b/tests/qemu-iotests/058 @@ -32,11 +32,17 @@ status=1 # failure is the default! nbd_unix_socket=$TEST_DIR/test_qemu_nbd_socket nbd_snapshot_img="nbd:unix:$nbd_unix_socket" +rm -f "${TEST_DIR}/qemu-nbd.pid"

Re: [Qemu-block] [PATCH v2 1/2] block: Disallow snapshots if the overlay doesn't support backing files

2015-11-02 Thread Max Reitz
On 02.11.2015 13:15, Alberto Garcia wrote: > This addresses scenarios like this one: > > { 'execute': 'blockdev-add', 'arguments': > { 'options': { 'driver': 'qcow2', >'node-name': 'new0', >'file': { 'driver': 'file', >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/2] block: test 'blockdev-snapshot' using a file BDS as the overlay

2015-11-02 Thread Eric Blake
On 11/02/2015 10:07 AM, Max Reitz wrote: > On 02.11.2015 13:15, Alberto Garcia wrote: >> This test checks that it is not possible to create a snapshot using as >> the overlay node a BDS that does not support backing images. > > I don't think that works in English. I may be wrong, of course. > >

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/2] qemu-iotests: fix cleanup of background processes

2015-11-02 Thread Max Reitz
On 02.11.2015 08:37, Markus Armbruster wrote: > Max Reitz writes: > >> On 30.10.2015 20:25, Jeff Cody wrote: >>> Commit 934659c switched the iotests to run qemu and qemu-nbd from a bash >>> subshell, in order to catch segfaults. Unfortunately, this means the >>> process PID

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/2] block: Disallow snapshots if the overlay doesn't support backing files

2015-11-02 Thread Eric Blake
On 11/02/2015 05:15 AM, Alberto Garcia wrote: > This addresses scenarios like this one: > > { 'execute': 'blockdev-add', 'arguments': > { 'options': { 'driver': 'qcow2', >'node-name': 'new0', >'file': { 'driver': 'file', >

Re: [Qemu-block] [Qemu-devel] [PATCH v10 00/14] block: incremental backup transactions using BlockJobTxn

2015-11-02 Thread John Snow
Ping! To clarify, I *do* intend this series to be for-2.5, and I think it does qualify as such. If this *doesn't* go in, we have to revise our documentation just a pinch to undo some of Kashyap's changes that have already been merged in. Patches 5, 10, 11 and 12 are awaiting review. --js On

Re: [Qemu-block] [Qemu-devel] [PATCH] qemu-img: add check for zero-length job len

2015-11-02 Thread Eric Blake
On 11/02/2015 04:28 PM, John Snow wrote: > The mirror job doesn't update its total length until > it has already started running, so we should translate > a zero-length job-len as meaning 0%. > > Otherwise, we may get divide-by-zero faults. > > Signed-off-by: John Snow > --- >

Re: [Qemu-block] [Qemu-devel] [PATCH] qcow2: avoid misaligned 64bit bswap

2015-11-02 Thread Eric Blake
On 11/02/2015 04:32 PM, John Snow wrote: > If we create a buffer directly on the stack by using 12 bytes, there's > no guarantee the 64bit value we want to swap will be aligned, which > could cause errors with undefined behavior. > > Spotted with clang -fsanitize=undefined and observed in iotests

[Qemu-block] [PATCH] qcow2: avoid misaligned 64bit bswap

2015-11-02 Thread John Snow
If we create a buffer directly on the stack by using 12 bytes, there's no guarantee the 64bit value we want to swap will be aligned, which could cause errors with undefined behavior. Spotted with clang -fsanitize=undefined and observed in iotests 15, 26, 44, 115 and 121. Signed-off-by: John Snow

Re: [Qemu-block] [Qemu-devel] [PATCH 1/4] ide/atapi: make PIO read requests async

2015-11-02 Thread John Snow
On 10/12/2015 08:27 AM, Peter Lieven wrote: > PIO read requests on the ATAPI interface used to be sync blk requests. > This has two significant drawbacks. First the main loop hangs util an > I/O request is completed and secondly if the I/O request does not > complete (e.g. due to an unresponsive

Re: [Qemu-block] [PATCH] qemu-img: add check for zero-length job len

2015-11-02 Thread Jeff Cody
On Mon, Nov 02, 2015 at 06:28:20PM -0500, John Snow wrote: > The mirror job doesn't update its total length until > it has already started running, so we should translate > a zero-length job-len as meaning 0%. > > Otherwise, we may get divide-by-zero faults. > > Signed-off-by: John Snow

[Qemu-block] [PATCH v2 2/2] block: test 'blockdev-snapshot' using a file BDS as the overlay

2015-11-02 Thread Alberto Garcia
This test checks that it is not possible to create a snapshot using as the overlay node a BDS that does not support backing images. Signed-off-by: Alberto Garcia --- tests/qemu-iotests/085 | 12 +++- tests/qemu-iotests/085.out | 4 2 files changed, 15

[Qemu-block] [PATCH v2 0/2] Disallow snapshots if the overlay doesn't support backing files

2015-11-02 Thread Alberto Garcia
We are currently allowing snapshots in cases like this one: { 'execute': 'blockdev-add', 'arguments': { 'options': { 'driver': 'qcow2', 'node-name': 'new0', 'file': { 'driver': 'file', 'filename':

[Qemu-block] [PATCH v2 1/2] block: Disallow snapshots if the overlay doesn't support backing files

2015-11-02 Thread Alberto Garcia
This addresses scenarios like this one: { 'execute': 'blockdev-add', 'arguments': { 'options': { 'driver': 'qcow2', 'node-name': 'new0', 'file': { 'driver': 'file', 'filename': 'new.qcow2',