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

2016-03-29 Thread Peter Maydell
On 29 March 2016 at 16:08, Kevin Wolf wrote: > The following changes since commit b68a80139e37e806f004237e55311ebc42151434: > > Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20160324' into > staging (2016-03-24 16:24:02 +) > > are available in the git repository

Re: [Qemu-block] [PULL 0/3] Block patches for 2.6

2016-03-29 Thread Peter Maydell
On 29 March 2016 at 03:49, Jeff Cody wrote: > The following changes since commit b68a80139e37e806f004237e55311ebc42151434: > > Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20160324' into > staging (2016-03-24 16:24:02 +) > > are available in the git repository

Re: [Qemu-block] [PATCH 9/9] block: Remove BlockDriverState.blk

2016-03-29 Thread Max Reitz
On 22.03.2016 20:36, Kevin Wolf wrote: > This patch removes the remaining users of bs->blk, which will allow us > to have multiple BBs on top of a single BDS. All checks that are > currently in place to prevent the user from creating such setups. I think this sentence is missing a word or two. >

Re: [Qemu-block] [PATCH 8/9] block: Don't return throttling info in query-named-block-nodes

2016-03-29 Thread Max Reitz
On 22.03.2016 20:36, Kevin Wolf wrote: > query-named-block-nodes should not return information that is related > to the attached BlockBackend rather than the node itself, so throttling > information needs to be removed from it. > > Signed-off-by: Kevin Wolf > --- >

Re: [Qemu-block] [PATCH 7/9] block: Avoid bs->blk in bdrv_next()

2016-03-29 Thread Max Reitz
On 22.03.2016 20:36, Kevin Wolf wrote: > We need to introduce a separate BdrvNextIterator struct that can keep > more state than just the current BDS in order to avoid using the bs->blk > pointer. > > Signed-off-by: Kevin Wolf > --- > block.c| 34

Re: [Qemu-block] [PATCH 6/9] block: Remove bdrv_move_feature_fields()

2016-03-29 Thread Max Reitz
On 22.03.2016 20:36, Kevin Wolf wrote: > bdrv_move_feature_fields() and swap_feature_fields() are empty now, they > can be removed. > > Signed-off-by: Kevin Wolf > --- > block.c | 30 -- > 1 file changed, 30 deletions(-) Nice. :-) Reviewed-by: Max

Re: [Qemu-block] [PATCH 5/9] block: Avoid BDS.blk in bdrv_next()

2016-03-29 Thread Max Reitz
On 22.03.2016 20:36, Kevin Wolf wrote: > We just want to know whether a BDS has at least one BB attached in order > to avoid enumerating it twice. This doesn't depend on the exact BB that > is attached and is still a valid question when more than one BB can be > attached, so just answer it by

Re: [Qemu-block] [PATCH 4/9] block: Remove bdrv_aio_multiwrite()

2016-03-29 Thread Max Reitz
On 22.03.2016 20:36, Kevin Wolf wrote: > Since virtio-blk implements request merging itself these days, the only > remaining users are test cases for the function. That doesn't make the > function exactly useful any more. > > Signed-off-by: Kevin Wolf > --- >

Re: [Qemu-block] [PATCH 2/9] block: User BdrvChild callback for device name

2016-03-29 Thread Max Reitz
On 22.03.2016 20:36, Kevin Wolf wrote: > In order to get rid of bs->blk for bdrv_get_device_name() and > bdrv_get_device_or_node_name(), ask all parents for their name and > simply pick the first one. > > Signed-off-by: Kevin Wolf > --- > block.c | 22

Re: [Qemu-block] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-29 Thread Dr. David Alan Gilbert
* Max Reitz (mre...@redhat.com) wrote: > On 29.03.2016 18:03, Dr. David Alan Gilbert wrote: > > * Max Reitz (mre...@redhat.com) wrote: > >> On 29.03.2016 17:54, Dr. David Alan Gilbert wrote: > >>> * Max Reitz (mre...@redhat.com) wrote: > On 29.03.2016 17:50, Dr. David Alan Gilbert wrote: >

[Qemu-block] [PATCH] iotests: Make 150 use qemu-img map instead of du

2016-03-29 Thread Max Reitz
The actual on-disk size of a file does not only depend on factors qemu can control. Thus, we should not depend on this to determine whether a file has indeed been fully allocated. Instead, use qemu-img map and hope that if an area is referenced, it is indeed allocated, too. Also, limit the

Re: [Qemu-block] [PATCH v2 0/4] qemu-img: Fix preallocation with -S 0 for convert

2016-03-29 Thread Kevin Wolf
Am 24.03.2016 um 23:33 hat Max Reitz geschrieben: > Using -S 0 is supposed to allocate everything in the output image; or at > least it is supposed to always explicitly write zeros even if the area > in question is known to only contain zeros. That doesn't always work > right now, so this series

Re: [Qemu-block] [RFC for-2.7 0/1] block/qapi: Add query-block-node-tree

2016-03-29 Thread Max Reitz
On 29.03.2016 18:09, Kevin Wolf wrote: > Am 29.03.2016 um 17:56 hat Max Reitz geschrieben: >> On 29.03.2016 17:51, Kevin Wolf wrote: >>> Am 24.03.2016 um 20:07 hat Max Reitz geschrieben: As I responded to: - http://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg04464.html -

Re: [Qemu-block] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-29 Thread Max Reitz
On 29.03.2016 18:03, Dr. David Alan Gilbert wrote: > * Max Reitz (mre...@redhat.com) wrote: >> On 29.03.2016 17:54, Dr. David Alan Gilbert wrote: >>> * Max Reitz (mre...@redhat.com) wrote: On 29.03.2016 17:50, Dr. David Alan Gilbert wrote: > * Eric Blake (ebl...@redhat.com) wrote: >>

Re: [Qemu-block] [RFC for-2.7 0/1] block/qapi: Add query-block-node-tree

2016-03-29 Thread Kevin Wolf
Am 29.03.2016 um 17:56 hat Max Reitz geschrieben: > On 29.03.2016 17:51, Kevin Wolf wrote: > > Am 24.03.2016 um 20:07 hat Max Reitz geschrieben: > >> As I responded to: > >> - http://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg04464.html > >> -

Re: [Qemu-block] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-29 Thread Dr. David Alan Gilbert
* Max Reitz (mre...@redhat.com) wrote: > On 29.03.2016 17:54, Dr. David Alan Gilbert wrote: > > * Max Reitz (mre...@redhat.com) wrote: > >> On 29.03.2016 17:50, Dr. David Alan Gilbert wrote: > >>> * Eric Blake (ebl...@redhat.com) wrote: > On 03/29/2016 09:38 AM, Max Reitz wrote: > > On

Re: [Qemu-block] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-29 Thread Max Reitz
On 29.03.2016 17:54, Dr. David Alan Gilbert wrote: > * Max Reitz (mre...@redhat.com) wrote: >> On 29.03.2016 17:50, Dr. David Alan Gilbert wrote: >>> * Eric Blake (ebl...@redhat.com) wrote: On 03/29/2016 09:38 AM, Max Reitz wrote: > On 17.03.2016 10:56, Wen Congyang wrote: >> On

Re: [Qemu-block] [RFC for-2.7 0/1] block/qapi: Add query-block-node-tree

2016-03-29 Thread Max Reitz
On 29.03.2016 17:51, Kevin Wolf wrote: > Am 24.03.2016 um 20:07 hat Max Reitz geschrieben: >> As I responded to: >> - http://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg04464.html >> - http://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg05680.html >> >> I think a general solution

Re: [Qemu-block] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-29 Thread Dr. David Alan Gilbert
* Max Reitz (mre...@redhat.com) wrote: > On 29.03.2016 17:50, Dr. David Alan Gilbert wrote: > > * Eric Blake (ebl...@redhat.com) wrote: > >> On 03/29/2016 09:38 AM, Max Reitz wrote: > >>> On 17.03.2016 10:56, Wen Congyang wrote: > On 03/17/2016 05:48 PM, Dr. David Alan Gilbert wrote: > >>> >

Re: [Qemu-block] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-29 Thread Max Reitz
On 29.03.2016 17:50, Dr. David Alan Gilbert wrote: > * Eric Blake (ebl...@redhat.com) wrote: >> On 03/29/2016 09:38 AM, Max Reitz wrote: >>> On 17.03.2016 10:56, Wen Congyang wrote: On 03/17/2016 05:48 PM, Dr. David Alan Gilbert wrote: >>> >>> [...] >>> > The children.0 notation is really

Re: [Qemu-block] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-29 Thread Max Reitz
On 29.03.2016 17:44, Eric Blake wrote: > On 03/29/2016 09:38 AM, Max Reitz wrote: >> On 17.03.2016 10:56, Wen Congyang wrote: >>> On 03/17/2016 05:48 PM, Dr. David Alan Gilbert wrote: >> >> [...] >> The children.0 notation is really confusing in the way that Berto describes; I hit this a

Re: [Qemu-block] [RFC for-2.7 0/1] block/qapi: Add query-block-node-tree

2016-03-29 Thread Kevin Wolf
Am 24.03.2016 um 20:07 hat Max Reitz geschrieben: > As I responded to: > - http://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg04464.html > - http://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg05680.html > > I think a general solution for querying the block node tree would be >

Re: [Qemu-block] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-29 Thread Dr. David Alan Gilbert
* Eric Blake (ebl...@redhat.com) wrote: > On 03/29/2016 09:38 AM, Max Reitz wrote: > > On 17.03.2016 10:56, Wen Congyang wrote: > >> On 03/17/2016 05:48 PM, Dr. David Alan Gilbert wrote: > > > > [...] > > > >>> The children.0 notation is really confusing in the way that Berto > >>> describes; I

Re: [Qemu-block] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-29 Thread Eric Blake
On 03/29/2016 09:38 AM, Max Reitz wrote: > On 17.03.2016 10:56, Wen Congyang wrote: >> On 03/17/2016 05:48 PM, Dr. David Alan Gilbert wrote: > > [...] > >>> The children.0 notation is really confusing in the way that Berto >>> describes; I hit this a couple of months ago and it really doesn't

Re: [Qemu-block] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree

2016-03-29 Thread Max Reitz
On 29.03.2016 17:39, Eric Blake wrote: > On 03/29/2016 09:29 AM, Max Reitz wrote: > >> >> In my opinion, the way the order is explicitly represented is through >> every child's role. For quorum, "children.${i}" comes before >> "children.${i+1}". >> >> The general block layer does not care about

Re: [Qemu-block] [PATCH v12 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-29 Thread Max Reitz
On 17.03.2016 10:56, Wen Congyang wrote: > On 03/17/2016 05:48 PM, Dr. David Alan Gilbert wrote: [...] >> The children.0 notation is really confusing in the way that Berto >> describes; I hit this a couple of months ago and it really doesn't >> make sense. > > Do you mean: read from children.1

Re: [Qemu-block] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree

2016-03-29 Thread Max Reitz
On 28.03.2016 17:25, Eric Blake wrote: > On 03/26/2016 10:33 AM, Max Reitz wrote: > >>> We insert the new child to the head, not the tail... >> >> Well, the idea is that the order of children doesn't really matter; The >> only thing that describes the behavior of a child is its role. For >>

Re: [Qemu-block] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree

2016-03-29 Thread Eric Blake
On 03/29/2016 09:29 AM, Max Reitz wrote: > > In my opinion, the way the order is explicitly represented is through > every child's role. For quorum, "children.${i}" comes before > "children.${i+1}". > > The general block layer does not care about these generic children, it > only cares about

[Qemu-block] [PULL 44/48] block: Remove bdrv_(set_)enable_write_cache()

2016-03-29 Thread Kevin Wolf
The only remaining users were block jobs (mirror and backup) which unconditionally enabled WCE on the BlockBackend of the target image. As these block jobs don't go through BlockBackend for their I/O requests, they aren't affected by this setting anyway but always get a writeback mode, so that

[Qemu-block] [PULL 38/48] nbd: Support BDRV_REQ_FUA

2016-03-29 Thread Kevin Wolf
The NBD server already used to send a FUA flag when the writethrough mode was set. This code was a remnant from the times where protocol drivers actually had to implement writethrough modes. Since nowadays the block layer sends flushes in writethrough mode and non-root nodes are always writeback,

[Qemu-block] [PULL 37/48] iscsi: Support BDRV_REQ_FUA

2016-03-29 Thread Kevin Wolf
This replaces the existing hack in the iscsi driver that sent the FUA bit in writethrough mode and ignored the following flush in order to optimise the number of roundtrips (see commit 73b5394e). Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz ---

[Qemu-block] [PULL 47/48] block/null-{co, aio}: Implement get_block_status()

2016-03-29 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Acked-by: Fam Zheng Signed-off-by: Kevin Wolf --- block/null.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/block/null.c b/block/null.c index

[Qemu-block] [PULL 30/48] xen_disk: Call blk_set_enable_write_cache() explicitly

2016-03-29 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Acked-by: Stefano Stabellini Reviewed-by: Max Reitz --- hw/block/xen_disk.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index

[Qemu-block] [PULL 33/48] block: Handle flush error in bdrv_pwrite_sync()

2016-03-29 Thread Kevin Wolf
We don't want to silently ignore a flush error. Also, there is little point in avoiding the flush for writethrough modes and once WCE is moved to the BB layer, we definitely need the flush here because bdrv_pwrite() won't involve one any more. Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 22/48] replay: bh scheduling fix

2016-03-29 Thread Kevin Wolf
From: Pavel Dovgalyuk This patch fixes scheduling of bottom halves when record/replay is enabled. Now BH are not added to replay queue when asynchronous events are disabled. This may happen in startup and loadvm/savevm phases of execution. Signed-off-by: Pavel

[Qemu-block] [PULL 45/48] qemu-img: Fix preallocation with -S 0 for convert

2016-03-29 Thread Kevin Wolf
From: Max Reitz When passing -S 0 to qemu-img convert, the target image is supposed to be fully allocated. Right now, this is not the case if the source image contains areas which bdrv_get_block_status() reports as being zero. This patch changes a zeroed area's status from

[Qemu-block] [PULL 26/48] qemu-nbd: Call blk_set_enable_write_cache() explicitly

2016-03-29 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qemu-nbd.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index f3528c8..b11bc41 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -507,6 +507,7 @@ int main(int

[Qemu-block] [PULL 42/48] block: Remove bdrv_parse_cache_flags()

2016-03-29 Thread Kevin Wolf
All users are converted to bdrv_parse_cache_mode() now. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block.c | 29 +++-- include/block/block.h | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff

[Qemu-block] [PULL 48/48] iotests: Test qemu-img convert -S 0 behavior

2016-03-29 Thread Kevin Wolf
From: Max Reitz Passing -S 0 to qemu-img convert should result in all source data being copied to the output, even if that source data is known to be 0. The output image should therefore have exactly the same size on disk as an image which we explicitly filled with data.

[Qemu-block] [PULL 46/48] block/null-{co, aio}: Allow reading zeroes

2016-03-29 Thread Kevin Wolf
From: Max Reitz This is optional so that it does not impede the null block driver's performance unless this behavior is desired. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Acked-by: Fam Zheng Signed-off-by: Kevin

[Qemu-block] [PULL 40/48] block: Use bdrv_parse_cache_mode() in drive_init()

2016-03-29 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- blockdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 27c9b59..c2dd584 100644 --- a/blockdev.c +++ b/blockdev.c @@ -897,8 +897,9 @@ DriveInfo

[Qemu-block] [PULL 36/48] block: Introduce bdrv_co_writev_flags()

2016-03-29 Thread Kevin Wolf
This function will allow drivers to implement BDRV_REQ_FUA natively instead of sending a separate flush after the write. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block/io.c| 9 - include/block/block_int.h | 5 + 2

[Qemu-block] [PULL 20/48] block: an interoperability test for luks vs dm-crypt/cryptsetup

2016-03-29 Thread Kevin Wolf
From: "Daniel P. Berrange" It is important that the QEMU luks implementation retains 100% compatibility with the reference implementation provided by the combination of the linux kernel dm-crypt module and cryptsetup userspace tools. There is a matrix of tests to be

[Qemu-block] [PULL 35/48] block/qapi: Use blk_enable_write_cache()

2016-03-29 Thread Kevin Wolf
Now that WCE is handled on the BlockBackend level, the flag is meaningless for BDSes. As the schema requires us to fill the field, we return an enabled write cache for them. Note that this means that querying the BlockBackend name may return writethrough as the cache information, whereas querying

[Qemu-block] [PULL 39/48] raw: Support BDRV_REQ_FUA

2016-03-29 Thread Kevin Wolf
Pass through the FUA flag to the lower layer so that the separate flush can be saved in practically relevant cases where a (raw) format driver sits on top of the protocol driver. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block/raw_bsd.c | 17

[Qemu-block] [PULL 28/48] qemu-img: Expand all BDRV_O_FLAGS uses

2016-03-29 Thread Kevin Wolf
It always only set the BDRV_O_CACHE_WB flag, which is going to go away. In order to make the next changes more local for better reviewability this patches expands the macro. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qemu-img.c | 23

[Qemu-block] [PULL 34/48] block: Move enable_write_cache to BB level

2016-03-29 Thread Kevin Wolf
Whether a write cache is used or not is a decision that concerns the user (e.g. the guest device) rather than the backend. It was already logically part of the BB level as bdrv_move_feature_fields() always kept it on top of the BDS tree; with this patch, the core of it (the actual flag and the

[Qemu-block] [PULL 24/48] replay: introduce block devices record/replay

2016-03-29 Thread Kevin Wolf
From: Pavel Dovgalyuk This patch introduces block driver that implement recording and replaying of block devices' operations. All block completion operations are added to the queue. Queue is flushed at checkpoints and information about processed requests is recorded to

[Qemu-block] [PULL 41/48] qemu-io: Use bdrv_parse_cache_mode() in reopen_f()

2016-03-29 Thread Kevin Wolf
We must forbid changing the WCE flag in bdrv_reopen() in the same patch, as otherwise the behaviour would change so that the flag takes precedence over the explicitly specified option. The correct value of the WCE flag depends on the BlockBackend user (e.g. guest device) and isn't a decision that

[Qemu-block] [PULL 27/48] qemu-io: Call blk_set_enable_write_cache() explicitly

2016-03-29 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qemu-io.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/qemu-io.c b/qemu-io.c index 1bd1158..21492d0 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -50,7 +50,7 @@

[Qemu-block] [PULL 21/48] block: add flush callback

2016-03-29 Thread Kevin Wolf
From: Pavel Dovgalyuk This patch adds callback for flush request. This callback is responsible for flushing whole block devices stack. bdrv_flush function does not proceed to underlying devices. It should be performed by this callback function, if needed.

[Qemu-block] [PULL 25/48] block: Add bdrv_parse_cache_mode()

2016-03-29 Thread Kevin Wolf
It's like bdrv_parse_cache_flags(), except that writethrough mode isn't included in the flags, but returned as a separate bool. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block.c | 17 + include/block/block.h | 1 +

[Qemu-block] [PULL 19/48] block: move encryption deprecation warning into qcow code

2016-03-29 Thread Kevin Wolf
From: "Daniel P. Berrange" For a couple of releases we have been warning Encrypted images are deprecated Support for them will be removed in a future release. You can use 'qemu-img convert' to convert your image to an unencrypted one. This warning was issued by

[Qemu-block] [PULL 16/48] tests: refactor python I/O tests helper main method

2016-03-29 Thread Kevin Wolf
From: "Daniel P. Berrange" The iotests.py helper provides a main() method for running tests via the python unit test framework. Not all tests will want to use this, so refactor it to split the testing of compatible formats and platforms into separate helper methods

[Qemu-block] [PULL 18/48] block: add generic full disk encryption driver

2016-03-29 Thread Kevin Wolf
From: "Daniel P. Berrange" Add a block driver that is capable of supporting any full disk encryption format. This utilizes the previously added block encryption code, and at this time supports the LUKS format. The driver code is capable of supporting any format supported by

[Qemu-block] [PULL 13/48] block: add flag to indicate that no I/O will be performed

2016-03-29 Thread Kevin Wolf
From: "Daniel P. Berrange" When opening an image it is useful to know whether the caller intends to perform I/O on the image or not. In the case of encrypted images this will allow the block driver to avoid having to prompt for decryption keys when we merely want to query

[Qemu-block] [PULL 14/48] qemu-img/qemu-io: don't prompt for passwords if not required

2016-03-29 Thread Kevin Wolf
From: "Daniel P. Berrange" The qemu-img/qemu-io tools prompt for disk encryption passwords regardless of whether any are actually required. Adding a check on bdrv_key_required() avoids this prompt for disk formats which have been converted to the QCryptoSecret APIs. This is

[Qemu-block] [PULL 08/48] block: Remove blk_set_bs()

2016-03-29 Thread Kevin Wolf
The function is unused since commit f21d96d0 ('block: Use BdrvChild in BlockBackend'). Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block/block-backend.c | 17 - include/block/block_int.h | 2 -- 2 files changed, 19

[Qemu-block] [PULL 12/48] block/qapi: Pass bdrv_query_blk_stats() s->stats

2016-03-29 Thread Kevin Wolf
From: Max Reitz bdrv_query_blk_stats() does not need access to all of BlockStats, BlockDeviceStats is enough and is what this function is actually supposed to fill. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- block/qapi.c |

[Qemu-block] [PULL 15/48] tests: redirect stderr to stdout for iotests

2016-03-29 Thread Kevin Wolf
From: "Daniel P. Berrange" The python I/O tests helper for running qemu-img/qemu-io setup stdout to be captured to a pipe, but left stderr untouched. As a result, if something failed in qemu-img/ qemu-io, data written to stderr would get output directly and not line up with

[Qemu-block] [PULL 23/48] replay: fix error message

2016-03-29 Thread Kevin Wolf
From: Pavel Dovgalyuk This patch fixes error message in saving loop of the asynchronous events queue. Signed-off-by: Pavel Dovgalyuk [ kwolf: Fixed format string to use PRId64 instead of %d ] Signed-off-by: Kevin Wolf ---

[Qemu-block] [PULL 17/48] tests: add output filter to python I/O tests helper

2016-03-29 Thread Kevin Wolf
From: "Daniel P. Berrange" Add a 'log' method to iotests.py which prints messages to stdout, with optional filtering of data. Port over some standard filters already present in the shell common.filter code to be usable in python too. Reviewed-by: Eric Blake

[Qemu-block] [PULL 06/48] block: Reject writethrough mode except at the root

2016-03-29 Thread Kevin Wolf
Writethrough mode is going to become a BlockBackend feature rather than a BDS one, so forbid it in places where we won't be able to support it when the code finally matches the envisioned design. We only allowed setting the cache mode of non-root nodes after the 2.5 release, so we're still free

[Qemu-block] [PULL 11/48] block/qapi: Set s->device in bdrv_query_stats()

2016-03-29 Thread Kevin Wolf
From: Max Reitz This is the only instance of bdrv_query_blk_stats() accessing anything in the BlockStats structure other than s->stats, so let us move it to its caller (where it makes just as much sense) allowing us to make bdrv_query_blk_stats() take a pointer to the

[Qemu-block] [PULL 10/48] block/qapi: fix unbounded stack for dump_qdict

2016-03-29 Thread Kevin Wolf
From: Peter Xu Using heap instead of stack for better safety. Signed-off-by: Peter Xu Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Kevin Wolf --- block/qapi.c | 3 ++- 1

[Qemu-block] [PULL 09/48] block/qapi: make two printf() formats literal

2016-03-29 Thread Kevin Wolf
From: Peter Xu Fix two places to use literal printf format when possible. Signed-off-by: Peter Xu Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Kevin Wolf --- block/qapi.c

[Qemu-block] [PULL 04/48] block: Remove cache.writeback from blockdev-add

2016-03-29 Thread Kevin Wolf
The WCE bit is a frontend property and should not be part of the backend configuration. This is especially important because the same BDS can be used by different users with different WCE requirements. Signed-off-by: Kevin Wolf --- qapi/block-core.json | 4 +--- 1 file

[Qemu-block] [PULL 02/48] block: Remove copy-on-read from bdrv_move_feature_fields()

2016-03-29 Thread Kevin Wolf
Ever since we first introduced bdrv_append() in commit 8802d1fd ('qapi: Introduce blockdev-group-snapshot-sync command'), the copy-on-read flag was moved to the new top layer when taking a snapshot. The only problem is that it doesn't make a whole lot of sense. The use case for manually enabled

[Qemu-block] [PULL 01/48] block: Remove bdrv_make_anon()

2016-03-29 Thread Kevin Wolf
The call in hmp_drive_del() is dead code because blk_remove_bs() is called a few lines above. The only other remaining user is bdrv_delete(), which only abuses bdrv_make_anon() to remove it from the named nodes list. This path inlines the list entry removal into bdrv_delete() and removes

[Qemu-block] [PULL 05/48] block: Make backing files always writeback

2016-03-29 Thread Kevin Wolf
First of all, we're generally not writing to backing files, but when we do, it's in the context of block jobs which know very well when to flush the image. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block.c| 5 +++--

[Qemu-block] [PULL 00/48] Block layer patches

2016-03-29 Thread Kevin Wolf
The following changes since commit b68a80139e37e806f004237e55311ebc42151434: Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20160324' into staging (2016-03-24 16:24:02 +) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to

[Qemu-block] [PULL 03/48] block: Remove dirty bitmaps from bdrv_move_feature_fields()

2016-03-29 Thread Kevin Wolf
This patch changes dirty bitmaps from following a BlockBackend in graph changes to sticking with the node they were created at. For the full discussion, read the following mailing list thread: [Qemu-block] block: Dirty bitmaps and COR in bdrv_move_feature_fields()

[Qemu-block] [PATCH v3 2/4] block/null-{co, aio}: Allow reading zeroes

2016-03-29 Thread Max Reitz
This is optional so that it does not impede the null block driver's performance unless this behavior is desired. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Acked-by: Fam Zheng --- block/null.c | 20 1 file

[Qemu-block] [PATCH v3 3/4] block/null-{co, aio}: Implement get_block_status()

2016-03-29 Thread Max Reitz
Signed-off-by: Max Reitz Acked-by: Fam Zheng --- block/null.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/block/null.c b/block/null.c index a7df386..f4b3bba 100644 --- a/block/null.c +++ b/block/null.c @@ -204,6 +204,24 @@

[Qemu-block] [PATCH v3 1/4] qemu-img: Fix preallocation with -S 0 for convert

2016-03-29 Thread Max Reitz
When passing -S 0 to qemu-img convert, the target image is supposed to be fully allocated. Right now, this is not the case if the source image contains areas which bdrv_get_block_status() reports as being zero. This patch changes a zeroed area's status from BLK_ZERO to BLK_DATA before invoking

[Qemu-block] [PATCH v3 0/4] qemu-img: Fix preallocation with -S 0 for convert

2016-03-29 Thread Max Reitz
Using -S 0 is supposed to allocate everything in the output image; or at least it is supposed to always explicitly write zeros even if the area in question is known to only contain zeros. That doesn't always work right now, so this series fixes it (patch 1, to be specific). I only noticed after I

[Qemu-block] [PATCH v3 4/4] iotests: Test qemu-img convert -S 0 behavior

2016-03-29 Thread Max Reitz
Passing -S 0 to qemu-img convert should result in all source data being copied to the output, even if that source data is known to be 0. Signed-off-by: Max Reitz --- tests/qemu-iotests/150 | 74 ++ tests/qemu-iotests/150.out |

Re: [Qemu-block] [PATCH 2/2] virtio-blk: use aio handler for data plane

2016-03-29 Thread Paolo Bonzini
On 29/03/2016 16:09, Michael S. Tsirkin wrote: >> > Another small comment, this can be written simply as >> > >> > if (s->dataplane) { >> > virtio_blk_data_plane_start(s->dataplane); > > True, it's best not to poke at dataplane_started. > > > } else { > >

Re: [Qemu-block] [PATCH 3/7] block: move restarting of throttled reqs to block/throttle-groups.c

2016-03-29 Thread Paolo Bonzini
On 29/03/2016 16:14, Alberto Garcia wrote: > On Thu 24 Mar 2016 05:39:22 PM CET, Paolo Bonzini wrote: >> @@ -335,6 +346,11 @@ void throttle_group_config(BlockDriverState *bs, >> ThrottleConfig *cfg) >> } >> throttle_config(ts, tt, cfg); >> qemu_mutex_unlock(>lock); >> + >> +

Re: [Qemu-block] [PATCH 3/7] block: move restarting of throttled reqs to block/throttle-groups.c

2016-03-29 Thread Alberto Garcia
On Thu 24 Mar 2016 05:39:22 PM CET, Paolo Bonzini wrote: > @@ -335,6 +346,11 @@ void throttle_group_config(BlockDriverState *bs, > ThrottleConfig *cfg) > } > throttle_config(ts, tt, cfg); > qemu_mutex_unlock(>lock); > + > +aio_context_acquire(bdrv_get_aio_context(bs)); > +

Re: [Qemu-block] [PATCH 2/2] virtio-blk: use aio handler for data plane

2016-03-29 Thread Paolo Bonzini
On 29/03/2016 15:42, Michael S. Tsirkin wrote: > +if (s->dataplane) { > +/* Some guests kick before setting VIRTIO_CONFIG_S_DRIVER_OK so start > + * dataplane here instead of waiting for .set_status(). > + */ > +if (!s->dataplane_started) { > +

Re: [Qemu-block] [PATCH 2/2] virtio-blk: use aio handler for data plane

2016-03-29 Thread Michael S. Tsirkin
On Tue, Mar 29, 2016 at 04:05:46PM +0200, Paolo Bonzini wrote: > > > On 29/03/2016 15:42, Michael S. Tsirkin wrote: > > +if (s->dataplane) { > > +/* Some guests kick before setting VIRTIO_CONFIG_S_DRIVER_OK so > > start > > + * dataplane here instead of waiting for

Re: [Qemu-block] [PATCH 2/7] block: make bdrv_start_throttled_reqs return void

2016-03-29 Thread Alberto Garcia
On Thu 24 Mar 2016 05:39:21 PM CET, Paolo Bonzini wrote: > The return value is unused and I am not sure why it would be useful. Yeah, this is not needed since 0b06ef3bdd177. Reviewed-by: Alberto Garcia > while (qemu_co_enter_next(>throttled_reqs[i])) { > -

Re: [Qemu-block] [PATCH 2/2] virtio-blk: use aio handler for data plane

2016-03-29 Thread Paolo Bonzini
On 29/03/2016 15:58, Michael S. Tsirkin wrote: > In that case, we'll have to also change scsi to use the new API. > A bit more work, to be sure. > Does scsi have the same problem as blk? Yes. The bug is in the virtio core. Paolo

Re: [Qemu-block] [PATCH 2/2] virtio-blk: use aio handler for data plane

2016-03-29 Thread Michael S. Tsirkin
On Tue, Mar 29, 2016 at 03:56:18PM +0200, Paolo Bonzini wrote: > > > On 29/03/2016 15:42, Michael S. Tsirkin wrote: > > @@ -262,6 +274,7 @@ void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s) > > > > /* Stop notifications for new requests from guest */ > >

Re: [Qemu-block] [PATCH v2 13/20] iscsi: Support BDRV_REQ_FUA

2016-03-29 Thread Max Reitz
On 29.03.2016 15:30, Kevin Wolf wrote: > This replaces the existing hack in the iscsi driver that sent the FUA > bit in writethrough mode and ignored the following flush in order to > optimise the number of roundtrips (see commit 73b5394e). > > Signed-off-by: Kevin Wolf > --- >

Re: [Qemu-block] [PATCH v2 15/20] raw: Support BDRV_REQ_FUA

2016-03-29 Thread Max Reitz
On 29.03.2016 15:30, Kevin Wolf wrote: > Pass through the FUA flag to the lower layer so that the separate flush > can be saved in practically relevant cases where a (raw) format driver > sits on top of the protocol driver. > > Signed-off-by: Kevin Wolf > --- > block/raw_bsd.c

Re: [Qemu-block] [PATCH v2 17/20] qemu-io: Use bdrv_parse_cache_mode() in reopen_f()

2016-03-29 Thread Max Reitz
On 29.03.2016 15:30, Kevin Wolf wrote: > We must forbid changing the WCE flag in bdrv_reopen() in the same patch, > as otherwise the behaviour would change so that the flag takes > precedence over the explicitly specified option. > > The correct value of the WCE flag depends on the BlockBackend

[Qemu-block] [PATCH 2/2] virtio-blk: use aio handler for data plane

2016-03-29 Thread Michael S. Tsirkin
In addition to handling IO in vcpu thread and in io thread, blk dataplane introduces yet another mode: handling it by aio. This reuses the same handler as previous modes, which triggers races as these were not designed to be reentrant. As a temporary fix, use a separate handler just for aio, and

Re: [Qemu-block] [PATCH v2 14/20] nbd: Support BDRV_REQ_FUA

2016-03-29 Thread Max Reitz
On 29.03.2016 15:30, Kevin Wolf wrote: > The NBD server already used to send a FUA flag when the writethrough > mode was set. This code was a remnant from the times where protocol > drivers actually had to implement writethrough modes. Since nowadays the > block layer sends flushes in writethrough

[Qemu-block] [PATCH v2 18/20] block: Remove bdrv_parse_cache_flags()

2016-03-29 Thread Kevin Wolf
All users are converted to bdrv_parse_cache_mode() now. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block.c | 29 +++-- include/block/block.h | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff

[Qemu-block] [PATCH v2 12/20] block: Introduce bdrv_co_writev_flags()

2016-03-29 Thread Kevin Wolf
This function will allow drivers to implement BDRV_REQ_FUA natively instead of sending a separate flush after the write. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block/io.c| 9 - include/block/block_int.h | 5 + 2

[Qemu-block] [PATCH v2 17/20] qemu-io: Use bdrv_parse_cache_mode() in reopen_f()

2016-03-29 Thread Kevin Wolf
We must forbid changing the WCE flag in bdrv_reopen() in the same patch, as otherwise the behaviour would change so that the flag takes precedence over the explicitly specified option. The correct value of the WCE flag depends on the BlockBackend user (e.g. guest device) and isn't a decision that

[Qemu-block] [PATCH v2 19/20] block: Remove BDRV_O_CACHE_WB

2016-03-29 Thread Kevin Wolf
The previous patches have successively made blk->enable_write_cache the true source for the information whether a writethrough mode must be implemented. The corresponding BDRV_O_CACHE_WB is only useless baggage we're carrying around, so now's the time to remove it. At the same time, we remove the

[Qemu-block] [PATCH v2 15/20] raw: Support BDRV_REQ_FUA

2016-03-29 Thread Kevin Wolf
Pass through the FUA flag to the lower layer so that the separate flush can be saved in practically relevant cases where a (raw) format driver sits on top of the protocol driver. Signed-off-by: Kevin Wolf --- block/raw_bsd.c | 17 ++--- 1 file changed, 14

[Qemu-block] [PATCH v2 16/20] block: Use bdrv_parse_cache_mode() in drive_init()

2016-03-29 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- blockdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 27c9b59..c2dd584 100644 --- a/blockdev.c +++ b/blockdev.c @@ -897,8 +897,9 @@ DriveInfo

[Qemu-block] [PATCH v2 06/20] xen_disk: Call blk_set_enable_write_cache() explicitly

2016-03-29 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Acked-by: Stefano Stabellini Reviewed-by: Max Reitz --- hw/block/xen_disk.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index

[Qemu-block] [PATCH v2 10/20] block: Move enable_write_cache to BB level

2016-03-29 Thread Kevin Wolf
Whether a write cache is used or not is a decision that concerns the user (e.g. the guest device) rather than the backend. It was already logically part of the BB level as bdrv_move_feature_fields() always kept it on top of the BDS tree; with this patch, the core of it (the actual flag and the

[Qemu-block] [PATCH v2 14/20] nbd: Support BDRV_REQ_FUA

2016-03-29 Thread Kevin Wolf
The NBD server already used to send a FUA flag when the writethrough mode was set. This code was a remnant from the times where protocol drivers actually had to implement writethrough modes. Since nowadays the block layer sends flushes in writethrough mode and non-root nodes are always writeback,

[Qemu-block] [PATCH v2 02/20] qemu-nbd: Call blk_set_enable_write_cache() explicitly

2016-03-29 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qemu-nbd.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index f3528c8..b11bc41 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -507,6 +507,7 @@ int main(int

  1   2   >