[Qemu-block] [PATCH v2] blockdev: clarify error on attempt to open locked tray

2016-06-08 Thread Colin Lord
When opening a device with a locked tray, gives an error explaining the device tray is locked and that the user should wait and try again. This is less confusing than the previous error, which simply stated that the tray was locked. Signed-off-by: Colin Lord --- Reworded commit

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

2016-06-08 Thread Peter Maydell
On 8 June 2016 at 10:16, Kevin Wolf wrote: > The following changes since commit 6ed5546fa7bf12c5b87ef76bafb86e1d77ed6e85: > > Merge remote-tracking branch > 'remotes/mjt/tags/pull-trivial-patches-2016-06-07' into staging (2016-06-07 > 16:34:45 +0100) > > are available in the

Re: [Qemu-block] [PATCH v2 2/3] block/mirror: Fix target backing BDS

2016-06-08 Thread Nir Soffer
On Wed, Jun 8, 2016 at 12:32 PM, Kevin Wolf wrote: > Am 06.06.2016 um 16:42 hat Max Reitz geschrieben: >> Currently, we are trying to move the backing BDS from the source to the >> target in bdrv_replace_in_backing_chain() which is called from >> mirror_exit(). However,

Re: [Qemu-block] [PATCH 6/6] block: Don't enforce 512 byte minimum alignment

2016-06-08 Thread Eric Blake
On 06/08/2016 08:10 AM, Kevin Wolf wrote: > If block drivers say that they can do an alignment < 512 bytes, let's > just suppose they mean it. raw-posix used to be an offender with respect > to this, but it can actually deal with byte-aligned requests now. > > The default is still 512 bytes for

Re: [Qemu-block] [PATCH 5/6] raw-posix: Implement .bdrv_co_preadv/pwritev

2016-06-08 Thread Eric Blake
On 06/08/2016 08:10 AM, Kevin Wolf wrote: > The raw-posix block driver actually supports byte-aligned requests now > on non-O_DIRECT images, like it already (and previously incorrectly) > claimed in bs->request_alignment. > > For some block drivers this means that a RMW cycle can be avoided when

Re: [Qemu-block] [Qemu-devel] coroutines: block: Co-routine re-entered recursively when migrating disk with iothreads

2016-06-08 Thread Stefan Hajnoczi
On Tue, Jun 7, 2016 at 1:42 PM, Jason J. Herne wrote: > On 06/06/2016 10:44 PM, Fam Zheng wrote: >> >> On Mon, 06/06 14:55, Jason J. Herne wrote: I'll see if I can reproduce it here. Fam >>> >>> Hi Fam, >>> Have you had any luck reproducing

Re: [Qemu-block] [PATCH 4/6] raw-posix: Switch to bdrv_co_* interfaces

2016-06-08 Thread Eric Blake
On 06/08/2016 08:10 AM, Kevin Wolf wrote: > In order to use the modern byte-based .bdrv_co_preadv/pwritev() > interface, this patch switches raw-posix to coroutine-based interfaces > as a first step. In terms of semantics and performance, it doesn't make > a difference with the existing code

Re: [Qemu-block] [Qemu-devel] [PATCH v5 00/11] Provide a QOM-based authorization API

2016-06-08 Thread Markus Armbruster
"Daniel P. Berrange" writes: > Ping, does anyone have any feedback on these first 3 patches > in particular. If we get agreement on those and get them merged, > then we can feed the rest of this series to the individual > subsystem maintainers that are affected, and also

Re: [Qemu-block] [PATCH v2 2/3] block/mirror: Fix target backing BDS

2016-06-08 Thread Max Reitz
On 08.06.2016 13:28, Paolo Bonzini wrote: > > > - Original Message - >> From: "Kevin Wolf" >> To: "Max Reitz" >> Cc: qemu-block@nongnu.org, qemu-de...@nongnu.org, "Fam Zheng" >> , nsof...@redhat.com, >> ebl...@redhat.com,

Re: [Qemu-block] [PATCH 3/6] block: Prepare bdrv_aligned_pwritev() for byte-aligned requests

2016-06-08 Thread Eric Blake
On 06/08/2016 08:10 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > block/io.c | 13 + > 1 file changed, 5 insertions(+), 8 deletions(-) > > diff --git a/block/io.c b/block/io.c > index 2fd88cb..4af9c59 100644 > --- a/block/io.c > +++ b/block/io.c > @@

Re: [Qemu-block] [PATCH] block: Don't emulate natively supported pwritev flags

2016-06-08 Thread Stefan Hajnoczi
On Tue, Jun 07, 2016 at 03:56:37PM +0200, Kevin Wolf wrote: > Drivers that implement .bdrv_co_pwritev() get the flags passed as an > argument to said function, but we also unconditionally emulate the flags > anyway. We shouldn't do that. > > Fix this by clearing all flags that the driver supports

[Qemu-block] [PATCH 3/6] block: Prepare bdrv_aligned_pwritev() for byte-aligned requests

2016-06-08 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- block/io.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/block/io.c b/block/io.c index 2fd88cb..4af9c59 100644 --- a/block/io.c +++ b/block/io.c @@ -1241,11 +1241,9 @@ static int coroutine_fn

[Qemu-block] [PATCH 2/6] block: Prepare bdrv_aligned_preadv() for byte-aligned requests

2016-06-08 Thread Kevin Wolf
This patch makes bdrv_aligned_preadv() ready to accept byte-aligned requests. Note that this doesn't mean that such requests are actually made. The caller still ensures that all requests are aligned to at least 512 bytes. Signed-off-by: Kevin Wolf --- block/io.c | 41

Re: [Qemu-block] [PATCH v2 2/3] block/mirror: Fix target backing BDS

2016-06-08 Thread Max Reitz
On 08.06.2016 16:40, Max Reitz wrote: > On 08.06.2016 13:28, Paolo Bonzini wrote: >> >> >> - Original Message - >>> From: "Kevin Wolf" >>> To: "Max Reitz" >>> Cc: qemu-block@nongnu.org, qemu-de...@nongnu.org, "Fam Zheng" >>> ,

Re: [Qemu-block] [PATCH 2/6] block: Prepare bdrv_aligned_preadv() for byte-aligned requests

2016-06-08 Thread Eric Blake
On 06/08/2016 08:10 AM, Kevin Wolf wrote: > This patch makes bdrv_aligned_preadv() ready to accept byte-aligned > requests. Note that this doesn't mean that such requests are actually > made. The caller still ensures that all requests are aligned to at least > 512 bytes. > > Signed-off-by: Kevin

Re: [Qemu-block] [PATCH 1/6] block: Byte-based bdrv_co_do_copy_on_readv()

2016-06-08 Thread Eric Blake
On 06/08/2016 08:10 AM, Kevin Wolf wrote: > In a first step to convert the common I/O path to work on bytes rather > than sectors, this converts the copy-on-read logic that is used by > bdrv_aligned_preadv(). > > Signed-off-by: Kevin Wolf > --- > block/io.c| 63 >

[Qemu-block] [PATCH 4/6] raw-posix: Switch to bdrv_co_* interfaces

2016-06-08 Thread Kevin Wolf
In order to use the modern byte-based .bdrv_co_preadv/pwritev() interface, this patch switches raw-posix to coroutine-based interfaces as a first step. In terms of semantics and performance, it doesn't make a difference with the existing code whether we go from a coroutine to a callback-based

[Qemu-block] [PATCH 5/6] raw-posix: Implement .bdrv_co_preadv/pwritev

2016-06-08 Thread Kevin Wolf
The raw-posix block driver actually supports byte-aligned requests now on non-O_DIRECT images, like it already (and previously incorrectly) claimed in bs->request_alignment. For some block drivers this means that a RMW cycle can be avoided when they write sub-sector metadata e.g. for cluster

[Qemu-block] [PATCH 0/6] block: Enable byte granularity I/O

2016-06-08 Thread Kevin Wolf
Previous series have already converted some block drivers to byte-based rather than sector-based interfaces. However, the common I/O path as well as raw-posix still enforced a minimum alignment of 512 bytes because some sector-based logic was involved. This patch series removes these limitations

Re: [Qemu-block] [PATCH v20 07/10] Introduce new APIs to do replication operation

2016-06-08 Thread Eric Blake
On 06/07/2016 07:11 PM, Changlong Xie wrote: > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > Signed-off-by: Changlong Xie No mention of the API

Re: [Qemu-block] [PATCH v20 00/10] Block replication for continuous checkpoints

2016-06-08 Thread Eric Blake
On 06/07/2016 07:11 PM, Changlong Xie wrote: > Block replication is a very important feature which is used for > continuous checkpoints(for example: COLO). > Side note: Including qemu-trivial in CC: on a patch series at v20 feels wrong. Obviously it is not trivial to be ten patches with this

Re: [Qemu-block] [PATCH v5 02/11] qapi: allow QmpInputVisitor to auto-cast types

2016-06-08 Thread Paolo Bonzini
On 02/06/2016 18:46, Daniel P. Berrange wrote: > Currently the QmpInputVisitor assumes that all scalar > values are directly represented as their final types. > ie it assumes an 'int' is using QInt, and a 'bool' is > using QBool. > > This extends it so that QString is optionally permitted > for

Re: [Qemu-block] [PATCH v5 00/11] Provide a QOM-based authorization API

2016-06-08 Thread Daniel P. Berrange
On Thu, Jun 02, 2016 at 05:46:16PM +0100, Daniel P. Berrange wrote: > This is a followup of previously posted work in 2.6 cycle: > > v1: https://lists.gnu.org/archive/html/qemu-devel/2016-02/msg04618.html > v2: https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg01454.html > v3:

Re: [Qemu-block] [PATCH v2 2/3] block/mirror: Fix target backing BDS

2016-06-08 Thread Kevin Wolf
Am 08.06.2016 um 13:28 hat Paolo Bonzini geschrieben: > > > - Original Message - > > From: "Kevin Wolf" > > To: "Max Reitz" > > Cc: qemu-block@nongnu.org, qemu-de...@nongnu.org, "Fam Zheng" > > , nsof...@redhat.com, > >

Re: [Qemu-block] [PATCH v2 2/3] block/mirror: Fix target backing BDS

2016-06-08 Thread Paolo Bonzini
- Original Message - > From: "Kevin Wolf" > To: "Max Reitz" > Cc: qemu-block@nongnu.org, qemu-de...@nongnu.org, "Fam Zheng" > , nsof...@redhat.com, > ebl...@redhat.com, pbonz...@redhat.com > Sent: Wednesday, June 8, 2016 11:32:29

[Qemu-block] [PULL 26/31] block: Don't emulate natively supported pwritev flags

2016-06-08 Thread Kevin Wolf
Drivers that implement .bdrv_co_pwritev() get the flags passed as an argument to said function, but we also unconditionally emulate the flags anyway. We shouldn't do that. Fix this by clearing all flags that the driver supports natively after it returns from .bdrv_co_pwritev(). Fixes: 4df863f3

[Qemu-block] [PULL 30/31] qemu-img bench: Implement -S (step size)

2016-06-08 Thread Kevin Wolf
With this new option, qemu-img bench can be told to advance the current offset after each request by a different value than the buffer size. This is useful for controlling the conditions for cluster allocation in image formats (e.g. qcow2 cluster allocation with COW in front of the request, or COW

[Qemu-block] [PULL 23/31] qcow2: avoid extra flushes in qcow2

2016-06-08 Thread Kevin Wolf
From: "Denis V. Lunev" The problem with excessive flushing was found by a couple of performance tests: - parallel directory tree creation (from 2 processes) - 32 cached writes + fsync at the end in a loop For the first one results improved from 2.6 loops/sec to 3.5

[Qemu-block] [PULL 29/31] qemu-img bench: Make start offset configurable

2016-06-08 Thread Kevin Wolf
This patch adds an option the specify the offset of the first request made by qemu-img bench. This allows to benchmark misaligned requests. Signed-off-by: Kevin Wolf Reviewed-by: Denis V. Lunev Reviewed-by: Stefan Hajnoczi ---

[Qemu-block] [PULL 14/31] qed: Convert to bdrv_co_pwrite_zeroes()

2016-06-08 Thread Kevin Wolf
From: Eric Blake Another step on our continuing quest to switch to byte-based interfaces. Kill an abuse of the comma operator while at it (fortunately, the semantics were still right). Also, the test for requests not aligned to clusters should be applied always, not just

[Qemu-block] [PULL 27/31] qemu-img bench

2016-06-08 Thread Kevin Wolf
This adds a qemu-img command that allows doing some simple benchmarks for the block layer without involving guest devices and a real VM. For the start, this implements only a test of sequential reads. Signed-off-by: Kevin Wolf Reviewed-by: Denis V. Lunev

[Qemu-block] [PULL 25/31] blockdev: clean up error handling in do_open_tray

2016-06-08 Thread Kevin Wolf
From: Colin Lord Returns negative error codes and accompanying error messages in cases where the device has no tray or the tray is locked and isn't forced open. This extra information should result in better flexibility in functions that call do_open_tray. Suggested by: Markus

[Qemu-block] [PULL 12/31] blkreplay: Convert to bdrv_co_pwrite_zeroes()

2016-06-08 Thread Kevin Wolf
From: Eric Blake Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/blkreplay.c | 10 -- 1 file

[Qemu-block] [PULL 18/31] block: Kill bdrv_co_write_zeroes()

2016-06-08 Thread Kevin Wolf
From: Eric Blake Now that all drivers have been converted to a byte interface, we no longer need a sector interface. Signed-off-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/io.c

[Qemu-block] [PULL 13/31] gluster: Convert to bdrv_co_pwrite_zeroes()

2016-06-08 Thread Kevin Wolf
From: Eric Blake Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/gluster.c | 14 ++ 1 file

[Qemu-block] [PULL 11/31] qcow2: Convert to bdrv_co_pwrite_zeroes()

2016-06-08 Thread Kevin Wolf
From: Eric Blake Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake Signed-off-by: Kevin Wolf --- block/qcow2.c | 37 +++-- trace-events | 4 ++-- 2 files

[Qemu-block] [PULL 05/31] qcow2: Catch more unaligned write_zero into zero cluster

2016-06-08 Thread Kevin Wolf
From: Eric Blake is_zero_cluster() and is_zero_cluster_top_locked() are used only by qcow2_co_write_zeroes(). The former is too broad (we don't care if the sectors we are about to overwrite are non-zero, only that all other sectors in the cluster are zero), so it needs to be

[Qemu-block] [PULL 03/31] qcow2: add tracepoints for qcow2_co_write_zeroes

2016-06-08 Thread Kevin Wolf
From: "Denis V. Lunev" This patch follows guidelines of all other tracepoints in qcow2, like ones in qcow2_co_writev. I think that they should dump values in the same quantities or be changed all together. Signed-off-by: Denis V. Lunev CC: Eric Blake

[Qemu-block] [PULL 04/31] qemu-iotests: Test one more spot for optimizing write_zeroes

2016-06-08 Thread Kevin Wolf
From: Eric Blake Add another test to 154, showing that we currently allocate a data cluster in the top layer if any sector of the backing file was allocated. The next patch will optimize this case. Signed-off-by: Eric Blake Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 16/31] raw_bsd: Convert to bdrv_co_pwrite_zeroes()

2016-06-08 Thread Kevin Wolf
From: Eric Blake Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/raw_bsd.c | 11 +-- 1 file

[Qemu-block] [PULL 08/31] block: Add .bdrv_co_pwrite_zeroes()

2016-06-08 Thread Kevin Wolf
From: Eric Blake Update bdrv_co_do_write_zeroes() to be byte-based, and select between the new byte-based bdrv_co_pwrite_zeroes() or the old bdrv_co_write_zeroes(). The next patches will convert drivers, then remove the old interface. Signed-off-by: Eric Blake

[Qemu-block] [PULL 17/31] vmdk: Convert to bdrv_co_pwrite_zeroes()

2016-06-08 Thread Kevin Wolf
From: Eric Blake Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/vmdk.c | 12 +--- 1 file changed,

[Qemu-block] [PULL 09/31] block: Switch bdrv_write_zeroes() to byte interface

2016-06-08 Thread Kevin Wolf
From: Eric Blake Rename to bdrv_pwrite_zeroes() to let the compiler ensure we cater to the updated semantics. Do the same for bdrv_co_write_zeroes(). Signed-off-by: Eric Blake Signed-off-by: Kevin Wolf --- block/blkreplay.c | 4

[Qemu-block] [PULL 10/31] iscsi: Convert to bdrv_co_pwrite_zeroes()

2016-06-08 Thread Kevin Wolf
From: Eric Blake Another step on our continuing quest to switch to byte-based interfaces. As this is the first byte-based iscsi interface, convert is_request_lun_aligned() into two versions, one for sectors and one for bytes. Also, change from outright -EINVAL failure on an

[Qemu-block] [PULL 01/31] block: split write_zeroes always

2016-06-08 Thread Kevin Wolf
From: "Denis V. Lunev" We should split requests even if they are less than write_zeroes_alignment. For example we can have the following request: offset 62k size 4k write_zeroes_alignment 64k The original code sent 1 request covering 2 qcow2 clusters, and resulted in

[Qemu-block] [PULL 07/31] block: Track write zero limits in bytes

2016-06-08 Thread Kevin Wolf
From: Eric Blake Another step towards removing sector-based interfaces: convert the maximum write and minimum alignment values from sectors to bytes. Rename the variables to let the compiler check that all users are converted to the new semantics. The maximum remains an int

[Qemu-block] [PULL 06/31] iscsi: Use block size as minimum zero/discard alignment

2016-06-08 Thread Kevin Wolf
From: Eric Blake If hardware does not advertise a minimum zero/discard alignment, we still want to guarantee that the block layer will align requests to our blocks, rather than the arbitrary 512-byte BDRV sector size. Signed-off-by: Eric Blake

[Qemu-block] [PULL 02/31] qcow2: simplify logic in qcow2_co_write_zeroes

2016-06-08 Thread Kevin Wolf
From: "Denis V. Lunev" Unaligned requests will occupy only one cluster. This is true since the previous commit. Simplify the code taking this consideration into account. In other words, the caller is now buggy if it ever passes us an unaligned request that crosses cluster

Re: [Qemu-block] [PATCH] Report error when opening device with locked tray

2016-06-08 Thread Kevin Wolf
Am 07.06.2016 um 22:00 hat John Snow geschrieben: > > > On 06/07/2016 06:28 AM, Kevin Wolf wrote: > > Am 06.06.2016 um 21:40 hat Colin Lord geschrieben: > >> This commit causes qmp_blockdev_change_medium to report an error if an > >> attempt is made to open a device with a locked tray. > > > >