[Qemu-block] [PULL 2/5] tests: Fix test 049 fallout from improved HMP error messages

2015-10-02 Thread Kevin Wolf
From: Eric Blake Commit 50b7b000 improved HMP error messages, but forgot to update qemu-iotests to match. Reported-by: Kevin Wolf Signed-off-by: Eric Blake Reviewed-by: John Snow Reviewed-by: Alberto Garcia

[Qemu-block] [PULL 0/5] Block layer patches

2015-10-02 Thread Kevin Wolf
The following changes since commit ff770b07f34d28b79013a83989bd6c85f8f16b2f: Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging (2015-10-02 11:01:18 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to

[Qemu-block] [PULL 3/5] iotests: Fix test 128 for password-less sudo

2015-10-02 Thread Kevin Wolf
From: Max Reitz As of 934659c460d46c948cf348822fda1d38556ed9a4, $QEMU_IO is generally no longer a program name, and therefore "sudo -n $QEMU_IO" will no longer work. Fix this by copying the qemu-io invocation function from common.config, making it use $sudo for invoking

[Qemu-block] [PULL 4/5] block: disable I/O limits at the beginning of bdrv_close()

2015-10-02 Thread Kevin Wolf
From: Alberto Garcia Disabling I/O limits from a BDS also drains all pending throttled requests, so it should be done at the beginning of bdrv_close() with the rest of the bdrv_drain() calls before the BlockDriver is closed. Signed-off-by: Alberto Garcia

[Qemu-block] [PULL 5/5] block/raw-posix: Open file descriptor O_RDWR to work around glibc posix_fallocate emulation issue.

2015-10-02 Thread Kevin Wolf
From: "Richard W.M. Jones" https://bugzilla.redhat.com/show_bug.cgi?id=1265196 The following command fails on an NFS mountpoint: $ qemu-img create -f qcow2 -o preallocation=falloc disk.img 262144 Formatting 'disk.img', fmt=qcow2 size=262144 encryption=off

Re: [Qemu-block] [PULL 0/1] Block job patches

2015-10-02 Thread Peter Maydell
On 1 October 2015 at 20:05, Jeff Cody wrote: > The following changes since commit fa500928ad9da6dd570918e3dfca13c029af07a8: > > Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20150930' > into staging (2015-10-01 10:49:38 +0100) > > are available in the git

Re: [Qemu-block] [PATCH] gluster: allocate GlusterAIOCBs on the stack

2015-10-02 Thread Kevin Wolf
Am 01.10.2015 um 13:04 hat Paolo Bonzini geschrieben: > This is simpler now that the driver has been converted to coroutines. > > Signed-off-by: Paolo Bonzini Reviewed-by: Kevin Wolf

[Qemu-block] [PATCH v2 10/22] block: Add average I/O queue depth to BlockDeviceTimedStats

2015-10-02 Thread Alberto Garcia
This patch adds two new fields to BlockDeviceTimedStats that track the average number of pending read and write requests for a block device. The values are calculated for the period of time defined for that interval. Signed-off-by: Alberto Garcia --- block/accounting.c

[Qemu-block] [PATCH v2 21/22] scsi-disk: Account for failed operations

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- hw/scsi/scsi-disk.c | 46 +++--- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index bada9a7..20a31a7 100644 --- a/hw/scsi/scsi-disk.c +++

[Qemu-block] [PATCH v2 20/22] macio: Account for failed operations

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- hw/ide/macio.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/ide/macio.c b/hw/ide/macio.c index 66ac2ba..176e331 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -286,7 +286,11 @@ static void

[Qemu-block] [PATCH v2 13/22] block: Use QEMU_CLOCK_VIRTUAL for the accounting code in qtest mode

2015-10-02 Thread Alberto Garcia
This patch switches to QEMU_CLOCK_VIRTUAL for the accounting code in qtest mode, and makes the latency of the operation constant. This way we can perform tests on the accounting code with reproducible results. Signed-off-by: Alberto Garcia --- block/accounting.c | 14

[Qemu-block] [PATCH v2 05/22] block: Add idle_time_ns to BlockDeviceStats

2015-10-02 Thread Alberto Garcia
This patch adds the new field 'idle_time_ns' to the BlockDeviceStats structure, indicating the time that has passed since the previous I/O operation. It also adds the block_acct_idle_time_ns() call, to ensure that all references to the clock type used for accounting are in the same place. This

[Qemu-block] [PATCH v2 18/22] atapi: Account for failed and invalid operations

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- hw/ide/atapi.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 747f466..cf0b78e 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -108,27 +108,30 @@

[Qemu-block] [PATCH v2 17/22] xen_disk: Account for failed and invalid operations

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- hw/block/xen_disk.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 4869518..02eda6e 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@

[Qemu-block] [PATCH v2 22/22] block: Update copyright of the accounting code

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- block/accounting.c | 1 + include/block/accounting.h | 1 + 2 files changed, 2 insertions(+) diff --git a/block/accounting.c b/block/accounting.c index 8eb59fc..ebe5ad6 100644 --- a/block/accounting.c +++ b/block/accounting.c @@ -2,6

Re: [Qemu-block] [Qemu-devel] [PATCH] block/raw-posix: Open file descriptor O_RDWR to work around glibc posix_fallocate emulation issue.

2015-10-02 Thread Peter Maydell
On 29 September 2015 at 16:54, Richard W.M. Jones wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1265196 > > The following command fails on an NFS mountpoint: > > $ qemu-img create -f qcow2 -o preallocation=falloc disk.img 262144 > Formatting 'disk.img', fmt=qcow2

[Qemu-block] [PATCH v2 16/22] virtio-blk: Account for failed and invalid operations

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- hw/block/virtio-blk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index f9301ae..9c5cb67 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -76,7 +76,7 @@

[Qemu-block] [PATCH v2 19/22] ide: Account for failed and invalid operations

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- hw/ide/core.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index b559f1b..dd7e9c5 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -574,7 +574,6 @@ static void

[Qemu-block] [PATCH v2 14/22] iotests: Add test for the block device statistics

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- tests/qemu-iotests/136 | 349 + tests/qemu-iotests/136.out | 5 + tests/qemu-iotests/group | 1 + 3 files changed, 355 insertions(+) create mode 100644 tests/qemu-iotests/136 create mode

[Qemu-block] [PATCH v2 12/22] qemu-io: Account for failed, invalid and flush operations

2015-10-02 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- qemu-io-cmds.c | 9 + 1 file changed, 9 insertions(+) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index d6572a8..f8f02ab 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -1364,6 +1364,7 @@ static void aio_write_done(void *opaque,

Re: [Qemu-block] [Qemu-devel] [PATCH] block/raw-posix: Open file descriptor O_RDWR to work around glibc posix_fallocate emulation issue.

2015-10-02 Thread Richard W.M. Jones
On Fri, Oct 02, 2015 at 03:36:04PM +0100, Peter Maydell wrote: > On 29 September 2015 at 16:54, Richard W.M. Jones wrote: > > https://bugzilla.redhat.com/show_bug.cgi?id=1265196 > > > > The following command fails on an NFS mountpoint: > > > > $ qemu-img create -f qcow2 -o

[Qemu-block] [PATCH v2 06/22] block: Add "supports_stats" field to BlockStats

2015-10-02 Thread Alberto Garcia
query-blockstats always returns a BlockDeviceStats structure for each BDS, regardless of whether it implements accounting or not. Since the field is mandatory there's no way to tell that from the values alone. This field solves that problem by indicating which BDSs support I/O accounting.

[Qemu-block] [PATCH v2 01/22] xen_disk: Account for flush operations

2015-10-02 Thread Alberto Garcia
Currently both BLKIF_OP_WRITE and BLKIF_OP_FLUSH_DISKCACHE are being accounted as write operations. Signed-off-by: Alberto Garcia --- hw/block/xen_disk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index

[Qemu-block] [PATCH v2 08/22] block: Allow configuring whether to account failed and invalid ops

2015-10-02 Thread Alberto Garcia
This patch adds two options, "stats-account-invalid" and "stats-account-failed", that can be used to decide whether invalid and failed I/O operations must be used when collecting statistics for latency and last access time. Signed-off-by: Alberto Garcia --- block/accounting.c

Re: [Qemu-block] [Qemu-devel] [PATCH] qtest/ide-test: ppc64be correction for ATAPI tests

2015-10-02 Thread John Snow
On 10/02/2015 06:55 AM, Kevin Wolf wrote: > Am 28.09.2015 um 19:38 hat John Snow geschrieben: >> the 16bit ide data register is LE by definition. >> >> Signed-off-by: John Snow >> --- >> tests/ide-test.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff

Re: [Qemu-block] [PATCH] qtest/ide-test: ppc64be correction for ATAPI tests

2015-10-02 Thread Kevin Wolf
Am 28.09.2015 um 19:38 hat John Snow geschrieben: > the 16bit ide data register is LE by definition. > > Signed-off-by: John Snow Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v2 11/16] block-backend: Add blk_set_bs()

2015-10-02 Thread Max Reitz
On 01.10.2015 15:13, Kevin Wolf wrote: > It allows changing the BlockDriverState that a BlockBackend points to. > > Signed-off-by: Kevin Wolf > --- > block/block-backend.c | 17 + > include/block/block_int.h | 2 ++ > 2 files changed, 19 insertions(+)

Re: [Qemu-block] [PATCH v2 13/16] block: Implement bdrv_append() without bdrv_swap()

2015-10-02 Thread Max Reitz
On 01.10.2015 15:13, Kevin Wolf wrote: > Remember all parent nodes and just change the pointers there instead of > swapping the contents of the BlockDriverState. > > Handling of snapshot=on must be moved further down in bdrv_open() > because *pbs (which is the bs pointer in the BlockBackend) must

Re: [Qemu-block] [Qemu-devel] [PATCH 1/3] block: prohibit migration during BlockJobs

2015-10-02 Thread John Snow
On 10/01/2015 02:03 PM, Paolo Bonzini wrote: > > > On 01/10/2015 18:34, John Snow wrote: >> Unless we can prove this to be safe for specific cases, >> the default should be to prohibit migration during BlockJobs. > > Block jobs do not affect the current block, only other block device, > hence

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] block: prohibit migration during transactions

2015-10-02 Thread John Snow
On 10/01/2015 02:01 PM, Paolo Bonzini wrote: > > > On 01/10/2015 18:34, John Snow wrote: >> + >> +error_setg(, "Block device(s) are in use by a Block >> Transaction"); > > s/Block Transaction/transaction command/ > > But how can migration start during a transaction? > Well, it

Re: [Qemu-block] [PATCH v2 07/16] block: Convert bs->backing_hd to BdrvChild

2015-10-02 Thread Max Reitz
On 01.10.2015 15:13, Kevin Wolf wrote: > This is the final step in converting all of the BlockDriverState > pointers that block drivers use to BdrvChild. > > After this patch, bs->children contains the full list of child nodes > that are referenced by a given BDS, and these children are only >

Re: [Qemu-block] [PATCH v2 14/16] blockjob: Store device name at job creation

2015-10-02 Thread Max Reitz
On 01.10.2015 15:13, Kevin Wolf wrote: > Some block jobs change the block device graph on completion. This means > that the device that owns the job and originally was addressed with its > device name may no longer be what the corresponding BlockBackend points > to. > > Previously, the effects of

Re: [Qemu-block] [PATCH v2 08/16] block: Manage backing file references in bdrv_set_backing_hd()

2015-10-02 Thread Max Reitz
On 01.10.2015 15:13, Kevin Wolf wrote: > This simplifies the code somewhat, especially when dropping whole > backing file subchains. > > The exception is the mirroring code that does adventurous things with > bdrv_swap() and in order to keep it working, I had to duplicate most of >

Re: [Qemu-block] [PATCH v2 05/16] block: Convert bs->file to BdrvChild

2015-10-02 Thread Max Reitz
On 01.10.2015 15:13, Kevin Wolf wrote: > This patch removes the temporary duplication between bs->file and > bs->file_child by converting everything to BdrvChild. > > Signed-off-by: Kevin Wolf > --- > block.c | 63 >

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

2015-10-02 Thread John Snow
On 09/21/2015 08:25 AM, Peter Lieven wrote: > PIO read requests on the ATAPI interface used to be sync blk requests. > This has to siginificant 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