Re: [Qemu-block] [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP

2016-09-28 Thread Max Reitz
On 28.09.2016 09:04, Fam Zheng wrote: > Handling this is similar to what is done to the L2 entry in the case of > compressed clusters. > > Signed-off-by: Fam Zheng > --- > block/qcow2-cluster.c | 9 + > block/qcow2.c | 3 ++- > block/qcow2.h | 3 ++- > 3

Re: [Qemu-block] [PATCH v2 3/5] block: Introduce and make use of blk_new_with_root

2016-09-28 Thread Max Reitz
On 27.09.2016 08:37, Fam Zheng wrote: > The idiom of "blk_new() + blk_insert_bs()" is common. Use a new > BB interface that does both things to make the coming transition that > adds AioContext to BB easier. Indeed. It was called blk_new_with_bs() before and I dropped it. :-) (The difference and

Re: [Qemu-block] [PATCH v2 5/5] block: keep AioContext pointer in BlockBackend

2016-09-28 Thread Max Reitz
On 27.09.2016 08:37, Fam Zheng wrote: > From: Stefan Hajnoczi > > blk_get/set_aio_context() delegate to BlockDriverState without storing > the AioContext pointer in BlockBackend. > > There are two flaws: > > 1. BlockBackend falls back to the QEMU main loop AioContext when

Re: [Qemu-block] [PATCH v2 0/3] linux-aio: fix "Co-routine re-entered recursively" error

2016-09-28 Thread Stefan Hajnoczi
On Tue, Sep 27, 2016 at 04:18:33PM +0100, Stefan Hajnoczi wrote: > v2: > * Add missing backtrace in Patch 3 > > It's possible to hit the "Co-routine re-entered recursively" error with -drive > format=qcow2,aio=native. This is a regression introduced by a linux-aio.c > optimization. See Patch 3

Re: [Qemu-block] [PATCH v2 1/5] blockdev-mirror: Sanity check before moving target_bs AioContext

2016-09-28 Thread Max Reitz
On 27.09.2016 08:37, Fam Zheng wrote: > Similar to blockdev-backup, if the target was already moved to a > different AioContext, bad things can happen. This happens when the > target belongs to a data plane device. It's a very unlikely case, but > let's check it anyway. You didn't implement it

Re: [Qemu-block] [PATCH v2 4/5] migration: Set correct AioContext to BlockBackend

2016-09-28 Thread Max Reitz
On 27.09.2016 08:37, Fam Zheng wrote: > The BB is newly created and it should follow the BDS's current context. > > Signed-off-by: Fam Zheng > --- > migration/block.c | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Max Reitz signature.asc

[Qemu-block] Subject: [PATCH] qcow2 resize with snapshot

2016-09-28 Thread zhangzhiming
qcow2 resize with snapshot, i modify the code of shrink size. and some changes for stable and vm state l1 index. thanks for review. Signed-off-by: zhangzhiming > --- block.c| 19

[Qemu-block] [PATCH v4 1/3] qemu-nbd: Add --fork option

2016-09-28 Thread Max Reitz
Using the --fork option, one can make qemu-nbd fork the worker process. The original process will exit on error of the worker or once the worker enters the main loop. Suggested-by: Sascha Silbe Signed-off-by: Max Reitz --- qemu-nbd.c| 17

[Qemu-block] [PATCH v4 2/3] iotests: Remove raciness from 162

2016-09-28 Thread Max Reitz
With qemu-nbd's new --fork option, we no longer need to launch it the hacky way. Suggested-by: Sascha Silbe Signed-off-by: Max Reitz --- tests/qemu-iotests/162 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[Qemu-block] [PATCH v4 0/3] iotests: Fix test 162

2016-09-28 Thread Max Reitz
162 is potentially racy and makes some invalid assumptions about what should happen when connecting to a non-existing domain name. This series fixes both issues. v4: - Added documentation for the new --fork option [Kevin] git-backport-diff against v3: Key: [] : patches are identical

[Qemu-block] [PATCH v4 05/12] block/nbd: Add nbd_has_filename_options_conflict()

2016-09-28 Thread Max Reitz
Right now, we have four possible options that conflict with specifying an NBD filename, and a future patch will add another one ("address"). This future option is a nested QDict that is flattened at this point, requiring us to test each option whether its key has an "address." prefix. Therefore,

[Qemu-block] [PATCH v4 03/12] block/nbd: Default port in nbd_refresh_filename()

2016-09-28 Thread Max Reitz
Instead of not emitting the port in nbd_refresh_filename(), just set it to the default if the user did not specify it. This makes the logic a bit simpler. Signed-off-by: Max Reitz --- block/nbd.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff

[Qemu-block] [PATCH v4 12/12] iotests: Add test for NBD's blockdev-add interface

2016-09-28 Thread Max Reitz
Signed-off-by: Max Reitz --- tests/qemu-iotests/147 | 201 + tests/qemu-iotests/147.out | 5 ++ tests/qemu-iotests/group | 1 + 3 files changed, 207 insertions(+) create mode 100755 tests/qemu-iotests/147 create mode

[Qemu-block] [PATCH v4 04/12] block/nbd: Use qdict_put()

2016-09-28 Thread Max Reitz
Instead of inlining this nice macro (i.e. resorting to qdict_put_obj(..., QOBJECT(...))), use it. Signed-off-by: Max Reitz --- block/nbd.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index c77a969..c539fb5 100644

[Qemu-block] [PATCH v4 01/12] block/nbd: Drop trailing "." in error messages

2016-09-28 Thread Max Reitz
Signed-off-by: Max Reitz --- block/nbd.c | 4 ++-- tests/qemu-iotests/051.out| 4 ++-- tests/qemu-iotests/051.pc.out | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index 6bc06d6..ce7c14f 100644 ---

[Qemu-block] [PATCH v4 09/12] iotests.py: Add qemu_nbd function

2016-09-28 Thread Max Reitz
Signed-off-by: Max Reitz --- tests/qemu-iotests/iotests.py | 8 1 file changed, 8 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 3329bc1..5a2678f 100644 --- a/tests/qemu-iotests/iotests.py +++

[Qemu-block] [PATCH v4 02/12] block/nbd: Reject port parameter without host

2016-09-28 Thread Max Reitz
Currently, a port that is passed along with a UNIX socket path is silently ignored. That is not exactly ideal, it should be an error instead. Signed-off-by: Max Reitz --- block/nbd.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/block/nbd.c

[Qemu-block] [PATCH v4 00/12] qapi: Allow blockdev-add for NBD

2016-09-28 Thread Max Reitz
This series adds blockdev-add support for NBD clients. Good news in v4: The total diffstat changed from 443+/98- to 407+/106-. Bad news in v4: 10/12 patches have functional differences from v3. Patches 1, 2, 3, and 4 are minor patches with no functional relation to this series, other than the

[Qemu-block] [PATCH v4 06/12] block/nbd: Accept SocketAddress

2016-09-28 Thread Max Reitz
Add a new option "address" to the NBD block driver which accepts a SocketAddress. "path", "host" and "port" are still supported as legacy options and are mapped to their corresponding SocketAddress representation. Signed-off-by: Max Reitz --- block/nbd.c |

[Qemu-block] [PATCH v4 10/12] iotests.py: Allow concurrent qemu instances

2016-09-28 Thread Max Reitz
By adding an optional suffix to the files used for communication with a VM, we can launch multiple VM instances concurrently. Signed-off-by: Max Reitz --- tests/qemu-iotests/iotests.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[Qemu-block] [PATCH v4 11/12] socket_scm_helper: Accept fd directly

2016-09-28 Thread Max Reitz
This gives us more freedom about the fd that is passed to qemu, allowing us to e.g. pass sockets. Signed-off-by: Max Reitz --- tests/qemu-iotests/socket_scm_helper.c | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git

[Qemu-block] [PATCH v4 3/3] iotests: Do not rely on unavailable domains in 162

2016-09-28 Thread Max Reitz
There are some (mostly ISP-specific) name servers who will redirect non-existing domains to special hosts. In this case, we will get a different error message when trying to connect to such a host, which breaks test 162. 162 needed this specific error message so it can confirm that qemu was

[Qemu-block] [PATCH v4 08/12] qapi: Allow blockdev-add for NBD

2016-09-28 Thread Max Reitz
Signed-off-by: Max Reitz --- qapi/block-core.json | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 9d797b8..54e3a6a 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@

[Qemu-block] [PATCH v4 07/12] block/nbd: Use SocketAddress options

2016-09-28 Thread Max Reitz
Drop the use of legacy options in favor of the SocketAddress representation, even for internal use (i.e. for storing the result of the filename parsing). Signed-off-by: Max Reitz --- block/nbd.c | 26 -- 1 file changed, 16 insertions(+), 10

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

2016-09-28 Thread Peter Maydell
On 28 September 2016 at 02:37, Kevin Wolf wrote: > Am 27.09.2016 um 21:42 hat Peter Maydell geschrieben: >> On 27 September 2016 at 06:53, Kevin Wolf wrote: >> > The following changes since commit >> > 7cfdc02dae0d2ff58c897496cfdbbafc0eda0f3f: >> > >> >

Re: [Qemu-block] [PATCH v2 2/5] blockdev: Move BDS AioContext before inserting to BB

2016-09-28 Thread Max Reitz
On 27.09.2016 08:37, Fam Zheng wrote: > The callers made sure the BDS has no BB attached before, so blk is > becoming the sole owner. It is necessary to move the BDS to the right > AioContext before inserting it, to keep them in sync. Well, I'm not sure whether it's so simple, though, because you

Re: [Qemu-block] [PATCH v2 5/5] block: keep AioContext pointer in BlockBackend

2016-09-28 Thread Fam Zheng
On Wed, 09/28 19:47, Max Reitz wrote: > On 27.09.2016 08:37, Fam Zheng wrote: > > From: Stefan Hajnoczi > > > > blk_get/set_aio_context() delegate to BlockDriverState without storing > > the AioContext pointer in BlockBackend. > > > > There are two flaws: > > > > 1.

Re: [Qemu-block] [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP

2016-09-28 Thread Fam Zheng
On Wed, 09/28 18:11, Max Reitz wrote: > On 28.09.2016 09:04, Fam Zheng wrote: > > Handling this is similar to what is done to the L2 entry in the case of > > compressed clusters. > > > > Signed-off-by: Fam Zheng > > --- > > block/qcow2-cluster.c | 9 + > > block/qcow2.c

Re: [Qemu-block] [PATCH v2 1/5] blockdev-mirror: Sanity check before moving target_bs AioContext

2016-09-28 Thread Fam Zheng
On Wed, 09/28 18:37, Max Reitz wrote: > On 27.09.2016 08:37, Fam Zheng wrote: > > Similar to blockdev-backup, if the target was already moved to a > > different AioContext, bad things can happen. This happens when the > > target belongs to a data plane device. It's a very unlikely case, but > >

[Qemu-block] [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP

2016-09-28 Thread Fam Zheng
Handling this is similar to what is done to the L2 entry in the case of compressed clusters. Signed-off-by: Fam Zheng --- block/qcow2-cluster.c | 9 + block/qcow2.c | 3 ++- block/qcow2.h | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff

Re: [Qemu-block] [Qemu-devel][PATCH] block: modify top-id's comments

2016-09-28 Thread Stefan Hajnoczi
On Wed, Sep 28, 2016 at 01:30:39PM +0800, Wang WeiWei wrote: Please send a proper commit message and commit description. "modify top-id's comments" says almost nothing and there is no commit description. I don't know why you are making this change so I can't review and apply it. >

Re: [Qemu-block] [PATCH 0/5] blockjobs: Fix transactional race condition

2016-09-28 Thread Vladimir Sementsov-Ogievskiy
Ok, let's discuss it on list. On 27.09.2016 19:19, John Snow wrote: Replying off-list to follow your lead, but this might be a good discussion to have upstream where Stefan and Jeff can see it. On 09/26/2016 11:53 AM, Vladimir Sementsov-Ogievskiy wrote: Hi John! What about this series? If

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] linux-aio: fix re-entrant completion processing

2016-09-28 Thread Roman Penyaev
On Wed, Sep 28, 2016 at 11:34 AM, Fam Zheng wrote: > On Wed, 09/28 11:14, Roman Penyaev wrote: >> On Wed, Sep 28, 2016 at 5:01 AM, Fam Zheng wrote: >> > On Tue, 09/27 19:55, Roman Penyaev wrote: >> >> > The bug is 100% deterministic. Just boot up a guest with

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] linux-aio: fix re-entrant completion processing

2016-09-28 Thread Roman Penyaev
On Wed, Sep 28, 2016 at 5:01 AM, Fam Zheng wrote: > On Tue, 09/27 19:55, Roman Penyaev wrote: >> > The bug is 100% deterministic. Just boot up a guest with -drive >> > format=qcow2,aio=native. >> >> It turns out to be that everything is broken. I started all my >> tests with

Re: [Qemu-block] [PATCH] proto: add 'shift' extension.

2016-09-28 Thread Kevin Wolf
Am 27.09.2016 um 20:59 hat Denis V. Lunev geschrieben: > On 09/27/2016 08:04 PM, Paolo Bonzini wrote: > > > > On 27/09/2016 15:28, Denis V. Lunev wrote: > >> On 09/27/2016 03:07 PM, Paolo Bonzini wrote: > >>> - Original Message - > From: "Denis V. Lunev" >

Re: [Qemu-block] [PATCH v5 7/9] block: don't make snapshots for filters

2016-09-28 Thread Kevin Wolf
Am 28.09.2016 um 11:32 hat Pavel Dovgalyuk geschrieben: > > From: Kevin Wolf [mailto:kw...@redhat.com] > > Am 27.09.2016 um 16:06 hat Pavel Dovgalyuk geschrieben: > > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > > Am 26.09.2016 um 11:51 hat Pavel Dovgalyuk geschrieben: > > > > > > From:

Re: [Qemu-block] [Qemu-devel] [PATCH 1/3] coroutine: add qemu_coroutine_entered() function

2016-09-28 Thread Kevin Wolf
Am 27.09.2016 um 18:55 hat Paolo Bonzini geschrieben: > > > On 27/09/2016 18:29, Stefan Hajnoczi wrote: > > On Tue, Sep 27, 2016 at 5:20 PM, Paolo Bonzini wrote: > >> > >> > >> On 27/09/2016 16:06, Stefan Hajnoczi wrote: > >>> See the doc comments for a description of this

Re: [Qemu-block] [PATCH] proto: add 'shift' extension.

2016-09-28 Thread Denis V. Lunev
On 09/28/2016 11:34 AM, Kevin Wolf wrote: > Am 27.09.2016 um 20:59 hat Denis V. Lunev geschrieben: >> On 09/27/2016 08:04 PM, Paolo Bonzini wrote: >>> On 27/09/2016 15:28, Denis V. Lunev wrote: On 09/27/2016 03:07 PM, Paolo Bonzini wrote: > - Original Message - >> From: "Denis

Re: [Qemu-block] [Qemu-devel][PATCH] block: modify top-id's comments

2016-09-28 Thread Kevin Wolf
Am 28.09.2016 um 07:30 hat Wang WeiWei geschrieben: > Signed-off-by: Wen Congyang > Signed-off-by: Changlong Xie > Signed-off-by: Wang WeiWei > Signed-off-by: zhanghailiang >

Re: [Qemu-block] [PATCH v5 7/9] block: don't make snapshots for filters

2016-09-28 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 28.09.2016 um 11:32 hat Pavel Dovgalyuk geschrieben: > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > Am 27.09.2016 um 16:06 hat Pavel Dovgalyuk geschrieben: > > > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > > > Am 26.09.2016 um

Re: [Qemu-block] [Qemu-devel] [PATCH v14 03/19] option: allow qemu_opts_to_qdict to merge repeated options

2016-09-28 Thread Daniel P. Berrange
On Wed, Sep 28, 2016 at 10:35:05AM +0100, Daniel P. Berrange wrote: > On Tue, Sep 27, 2016 at 05:03:17PM -0500, Eric Blake wrote: > > On 09/27/2016 08:13 AM, Daniel P. Berrange wrote: > > > If given an option string such as > > > > > > size=1024,nodes=10,nodes=4-5,nodes=1-2,policy=bind > > > >

Re: [Qemu-block] [PATCH v5 7/9] block: don't make snapshots for filters

2016-09-28 Thread Kevin Wolf
Am 27.09.2016 um 16:06 hat Pavel Dovgalyuk geschrieben: > > From: Kevin Wolf [mailto:kw...@redhat.com] > > Am 26.09.2016 um 11:51 hat Pavel Dovgalyuk geschrieben: > > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > > Am 26.09.2016 um 10:08 hat Pavel Dovgalyuk geschrieben: > > > > > This patch

Re: [Qemu-block] [PATCH] proto: add 'shift' extension.

2016-09-28 Thread Kevin Wolf
Am 28.09.2016 um 10:37 hat Denis V. Lunev geschrieben: > On 09/28/2016 11:34 AM, Kevin Wolf wrote: > > Am 27.09.2016 um 20:59 hat Denis V. Lunev geschrieben: > >> On 09/27/2016 08:04 PM, Paolo Bonzini wrote: > >>> On 27/09/2016 15:28, Denis V. Lunev wrote: > On 09/27/2016 03:07 PM, Paolo

Re: [Qemu-block] [PATCH] proto: add 'shift' extension.

2016-09-28 Thread Vladimir Sementsov-Ogievskiy
On 28.09.2016 11:56, Kevin Wolf wrote: Am 28.09.2016 um 10:37 hat Denis V. Lunev geschrieben: On 09/28/2016 11:34 AM, Kevin Wolf wrote: Am 27.09.2016 um 20:59 hat Denis V. Lunev geschrieben: On 09/27/2016 08:04 PM, Paolo Bonzini wrote: On 27/09/2016 15:28, Denis V. Lunev wrote: On

Re: [Qemu-block] [PATCH] proto: add 'shift' extension.

2016-09-28 Thread Kevin Wolf
Am 28.09.2016 um 11:00 hat Vladimir Sementsov-Ogievskiy geschrieben: > On 28.09.2016 11:56, Kevin Wolf wrote: > >Am 28.09.2016 um 10:37 hat Denis V. Lunev geschrieben: > >>On 09/28/2016 11:34 AM, Kevin Wolf wrote: > >>>Am 27.09.2016 um 20:59 hat Denis V. Lunev geschrieben: > On 09/27/2016

Re: [Qemu-block] [PATCH v5 7/9] block: don't make snapshots for filters

2016-09-28 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 27.09.2016 um 16:06 hat Pavel Dovgalyuk geschrieben: > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > Am 26.09.2016 um 11:51 hat Pavel Dovgalyuk geschrieben: > > > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > > > Am 26.09.2016 um

Re: [Qemu-block] [Qemu-devel] [PATCH v14 03/19] option: allow qemu_opts_to_qdict to merge repeated options

2016-09-28 Thread Daniel P. Berrange
On Tue, Sep 27, 2016 at 05:03:17PM -0500, Eric Blake wrote: > On 09/27/2016 08:13 AM, Daniel P. Berrange wrote: > > If given an option string such as > > > > size=1024,nodes=10,nodes=4-5,nodes=1-2,policy=bind > > > > the qemu_opts_to_qdict() method will currently overwrite > > the values for

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] linux-aio: fix re-entrant completion processing

2016-09-28 Thread Fam Zheng
On Wed, 09/28 11:14, Roman Penyaev wrote: > On Wed, Sep 28, 2016 at 5:01 AM, Fam Zheng wrote: > > On Tue, 09/27 19:55, Roman Penyaev wrote: > >> > The bug is 100% deterministic. Just boot up a guest with -drive > >> > format=qcow2,aio=native. > >> > >> It turns out to be that

Re: [Qemu-block] [Qemu-devel] [PATCH v14 07/19] qapi: don't pass two copies of TestInputVisitorData to tests

2016-09-28 Thread Daniel P. Berrange
On Tue, Sep 27, 2016 at 05:12:04PM -0500, Eric Blake wrote: > On 09/27/2016 05:10 PM, Eric Blake wrote: > > On 09/27/2016 08:13 AM, Daniel P. Berrange wrote: > >> The input_visitor_test_add() method was accepting an instance > >> of 'TestInputVisitorData' and passing it as the 'user_data' > >>

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

2016-09-28 Thread Kevin Wolf
Am 27.09.2016 um 21:42 hat Peter Maydell geschrieben: > On 27 September 2016 at 06:53, Kevin Wolf wrote: > > The following changes since commit 7cfdc02dae0d2ff58c897496cfdbbafc0eda0f3f: > > > > Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging > >

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

2016-09-28 Thread Peter Maydell
On 28 September 2016 at 02:37, Kevin Wolf wrote: > [what clang config?] This is with Ubuntu Xenial's clang. configure args are '--cc=clang' '--cxx=clang++' '--enable-gtk' '--extra-cflags=-fsanitize=undefined -Werror' and the build is just 'make all -j8 && make check' in the