Re: [Qemu-block] [Qemu-devel] [PATCH v4 09/13] qobject: Use simpler QDict/QList scalar insertion macros

2017-04-11 Thread Philippe Mathieu-Daudé
On 04/11/2017 03:50 PM, Eric Blake wrote: We now have macros in place to make it less verbose to add a scalar to QDict and QList, so use them. To make this patch smaller to review, a couple of subdirectories were done in earlier patches. Patch created mechanically via: spatch --sp-file

Re: [Qemu-block] [PATCH v4] migration/block: use blk_pwrite_zeroes for each zero cluster

2017-04-11 Thread 858585 jemmy
On Wed, Apr 12, 2017 at 9:27 AM, 858585 jemmy wrote: > On Tue, Apr 11, 2017 at 11:59 PM, Stefan Hajnoczi wrote: >> On Tue, Apr 11, 2017 at 08:05:12PM +0800, jemmy858...@gmail.com wrote: >>> From: Lidong Chen >>> >>> BLOCK_SIZE

Re: [Qemu-block] [PATCH v4] migration/block: use blk_pwrite_zeroes for each zero cluster

2017-04-11 Thread 858585 jemmy
On Tue, Apr 11, 2017 at 11:59 PM, Stefan Hajnoczi wrote: > On Tue, Apr 11, 2017 at 08:05:12PM +0800, jemmy858...@gmail.com wrote: >> From: Lidong Chen >> >> BLOCK_SIZE is (1 << 20), qcow2 cluster size is 65536 by default, >> this maybe cause the qcow2

[Qemu-block] [PATCH 13/17] backup: Switch block_backup.h to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Continue by converting the public interface to backup jobs (no semantic change), including a change to CowRequest to track by bytes instead of cluster indices. Signed-off-by: Eric Blake

[Qemu-block] [PATCH 17/17] block: Make bdrv_is_allocated_above() byte-based

2017-04-11 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. In the common case, allocation is unlikely to ever use values that are not naturally sector-aligned, but it is possible that byte-based values will let us be more precise about allocation at the end of an unaligned

[Qemu-block] [PATCH 11/17] mirror: Switch mirror_iteration() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Change the internal loop iteration of mirroring to track by bytes instead of sectors (although we are still guaranteed that we iterate by steps that are both sector-aligned and multiples of

[Qemu-block] [PATCH 10/17] mirror: Switch mirror_do_read() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Convert another internal function (no semantic change). Signed-off-by: Eric Blake --- block/mirror.c | 75 ++ 1

[Qemu-block] [PATCH 14/17] backup: Switch backup_do_cow() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Convert another internal function (no semantic change). Signed-off-by: Eric Blake --- block/backup.c | 62 -- 1

[Qemu-block] [PATCH 15/17] backup: Switch backup_run() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Change the internal loop iteration of backups to track by bytes instead of sectors (although we are still guaranteed that we iterate by steps that are cluster-aligned). Signed-off-by: Eric

[Qemu-block] [PATCH 07/17] mirror: Switch MirrorBlockJob to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Continue by converting an internal structure (no semantic change), and all references to the buffer size. [checkpatch has a false positive on use of MIN() in this patch] Signed-off-by:

[Qemu-block] [PATCH 12/17] backup: Switch BackupBlockJob to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Continue by converting an internal structure (no semantic change), and all references to tracking progress. Drop a redundant local variable bytes_per_cluster. Signed-off-by: Eric Blake

[Qemu-block] [PATCH 16/17] block: Make bdrv_is_allocated() byte-based

2017-04-11 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. In the common case, allocation is unlikely to ever use values that are not naturally sector-aligned, but it is possible that byte-based values will let us be more precise about allocation at the end of an unaligned

[Qemu-block] [PATCH 09/17] mirror: Switch mirror_cow_align() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Convert another internal function (no semantic change), and add mirror_clip_bytes() as a counterpart to mirror_clip_sectors(). Some of the conversion is a bit tricky, requiring temporaries

[Qemu-block] [PATCH 06/17] commit: Switch commit_run() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Change the internal loop iteration of committing to track by bytes instead of sectors (although we are still guaranteed that we iterate by steps that are sector-aligned). Signed-off-by:

[Qemu-block] [PATCH 01/17] blockjob: Track job ratelimits via bytes, not sectors

2017-04-11 Thread Eric Blake
The user interface specifies job rate limits in bytes/second. It's pointless to have our internal representation track things in sectors/second, particularly since we want to move away from sector-based interfaces. Fix up a doc typo found while verifying that the ratelimit code handles the

[Qemu-block] [PATCH 00/17] make bdrv_is_allocated[_above] byte-based

2017-04-11 Thread Eric Blake
There are patches floating around to add NBD_CMD_BLOCK_STATUS, but NBD wants to report status on byte granularity (even if the reporting will probably be naturally aligned to sectors or even much higher levels). I've therefore started the task of converting our block status code to report at a

[Qemu-block] [PATCH 04/17] stream: Switch stream_run() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Change the internal loop iteration of streaming to track by bytes instead of sectors (although we are still guaranteed that we iterate by steps that are sector-aligned). Signed-off-by:

[Qemu-block] [PATCH 02/17] trace: Show blockjob actions via bytes, not sectors

2017-04-11 Thread Eric Blake
Upcoming patches are going to switch to byte-based interfaces instead of sector-based. Even worse, trace_backup_do_cow_enter() had a weird mix of cluster and sector indices. Make the tracing uniformly use bytes. Signed-off-by: Eric Blake --- block/backup.c | 16

[Qemu-block] [PATCH 05/17] commit: Switch commit_populate() to byte-based

2017-04-11 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Start by converting an internal function (no semantic change). Signed-off-by: Eric Blake --- block/commit.c | 15 --- 1 file changed, 8 insertions(+), 7

[Qemu-block] [PATCH v9.5 07/13] fixup! qcow2: Discard/zero clusters by byte count

2017-04-11 Thread Eric Blake
Squash this to keep iotest 154 happy. Signed-off-by: Eric Blake --- v9.5: fixup v9: rebase to earlier changes, drop R-b v7, v8: only earlier half of series submitted for 2.9 v6: rebase due to context v5: s/count/byte/ to make the units obvious, and rework the math to ensure

Re: [Qemu-block] [Qemu-devel] [PATCH v9 07/13] qcow2: Discard/zero clusters by byte count

2017-04-11 Thread Eric Blake
On 04/10/2017 08:17 PM, Eric Blake wrote: > Passing a byte offset, but sector count, when we ultimately > want to operate on cluster granularity, is madness. Clean up > the external interfaces to take both offset and count as bytes, > while still keeping the assertion added previously that the >

Re: [Qemu-block] [Qemu-devel] [PATCH v4 12/13] fdc-test: Avoid deprecated 'change' command

2017-04-11 Thread John Snow
On 04/11/2017 02:50 PM, Eric Blake wrote: > Use the preferred blockdev-change-medium command instead. > > Also, use of 'device' is deprecated; adding an explicit id on > the command line lets us use 'id' for both blockdev-change-medium > and eject. > > Signed-off-by: Eric Blake

[Qemu-block] [PATCH v4 12/13] fdc-test: Avoid deprecated 'change' command

2017-04-11 Thread Eric Blake
Use the preferred blockdev-change-medium command instead. Also, use of 'device' is deprecated; adding an explicit id on the command line lets us use 'id' for both blockdev-change-medium and eject. Signed-off-by: Eric Blake --- v4: use 'id' rather than 'device' [thanks to

[Qemu-block] [PATCH v4 10/13] block: Simplify bdrv_append_temp_snapshot() logic

2017-04-11 Thread Eric Blake
Noticed while checking Coccinelle results. Naming a label 'out:' when it is only used on error paths is weird. Also, we had some dead stores to 'ret'. Meanwhile we know that snapshot_options is NULL on success and that QDECREF(NULL) is safe. So merge the two exit paths into one by careful

[Qemu-block] [PATCH v4 09/13] qobject: Use simpler QDict/QList scalar insertion macros

2017-04-11 Thread Eric Blake
We now have macros in place to make it less verbose to add a scalar to QDict and QList, so use them. To make this patch smaller to review, a couple of subdirectories were done in earlier patches. Patch created mechanically via: spatch --sp-file scripts/coccinelle/qobject.cocci \

[Qemu-block] [PATCH v4 05/13] qobject: Drop useless QObject casts

2017-04-11 Thread Eric Blake
We have macros in place to make it less verbose to add a subtype of QObject to both QDict and QList. While we have made cleanups like this in the past (see commit fcfcd8ffc, for example), having it be automated by Coccinelle makes it easier to maintain. Patch created mechanically via: spatch

[Qemu-block] [PATCH v4 07/13] block: Use simpler QDict/QList scalar insertion macros

2017-04-11 Thread Eric Blake
We now have macros in place to make it less verbose to add a scalar to QDict and QList, so use them. Patch created mechanically via: spatch --sp-file scripts/coccinelle/qobject.cocci \ --macro-file scripts/cocci-macro-file.h --dir block --in-place then touched up manually to fix a couple of

Re: [Qemu-block] [Qemu-devel] [PATCH v3 09/13] qobject: Use simpler QDict/QList scalar insertion macros

2017-04-11 Thread Eric Blake
On 04/11/2017 12:12 PM, Markus Armbruster wrote: > Eric Blake writes: > >> We now have macros in place to make it less verbose to add a scalar >> to QDict and QList, so use them. To make this patch smaller to >> review, a couple of subdirectories were done in earlier patches.

Re: [Qemu-block] [Qemu-devel] [PATCH v3 09/13] qobject: Use simpler QDict/QList scalar insertion macros

2017-04-11 Thread Markus Armbruster
Eric Blake writes: > We now have macros in place to make it less verbose to add a scalar > to QDict and QList, so use them. To make this patch smaller to > review, a couple of subdirectories were done in earlier patches. > > Patch created mechanically via: > spatch

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10] Revert "block/io: Comment out permission assertions"

2017-04-11 Thread Fam Zheng
On Tue, 04/11 17:52, Max Reitz wrote: > This reverts commit e3e0003a8f6570aba1421ef99a0b383a43371a74. > > This commit was necessary for the 2.9 release because we were unable to > fix the underlying issue(s) in time. However, we will be for 2.10. > > Signed-off-by: Max Reitz

Re: [Qemu-block] [Qemu-devel] [PATCH 15/17] iotests: add default node-name

2017-04-11 Thread John Snow
On 04/11/2017 09:02 AM, Eric Blake wrote: > On 02/17/2017 08:05 AM, Fam Zheng wrote: >> On Fri, 02/17 16:36, Vladimir Sementsov-Ogievskiy wrote: >>> 17.02.2017 15:21, Fam Zheng wrote: On Fri, 02/17 13:20, Vladimir Sementsov-Ogievskiy wrote: > 16.02.2017 16:48, Fam Zheng wrote: >> On

Re: [Qemu-block] [PATCH v4] migration/block: use blk_pwrite_zeroes for each zero cluster

2017-04-11 Thread Stefan Hajnoczi
On Tue, Apr 11, 2017 at 08:05:12PM +0800, jemmy858...@gmail.com wrote: > From: Lidong Chen > > BLOCK_SIZE is (1 << 20), qcow2 cluster size is 65536 by default, > this maybe cause the qcow2 file size is bigger after migration. > This patch check each cluster, use

[Qemu-block] [PATCH for-2.10] Revert "block/io: Comment out permission assertions"

2017-04-11 Thread Max Reitz
This reverts commit e3e0003a8f6570aba1421ef99a0b383a43371a74. This commit was necessary for the 2.9 release because we were unable to fix the underlying issue(s) in time. However, we will be for 2.10. Signed-off-by: Max Reitz --- block.c| 6 +- block/io.c | 12

Re: [Qemu-block] [PATCH for-2.9] sheepdog: Fix crash in co_read_response()

2017-04-11 Thread Peter Maydell
On 11 April 2017 at 15:08, Kevin Wolf wrote: > This fixes a regression introduced in commit 9d456654. > > aio_co_wake() can only be used to reenter a coroutine that was already > previously entered, otherwise co->ctx is uninitialised and we access > garbage. Using it immediately

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.9?] block/io: Comment out permission assertions

2017-04-11 Thread Peter Maydell
On 11 April 2017 at 15:50, Max Reitz wrote: > In case of block migration, there may be writes to BlockBackends that do > not have the write permission taken. Before this issue is fixed (which > is not going to happen in 2.9), we therefore cannot assert that this is > the case.

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

2017-04-11 Thread Peter Maydell
On 11 April 2017 at 14:44, Max Reitz wrote: > The following changes since commit aa388ddc36e8032f41cd17bef88cc3ebaeba77c9: > > Merge remote-tracking branch 'remotes/famz/tags/block-pull-request' into > staging (2017-04-11 13:27:05 +0100) > > are available in the git

Re: [Qemu-block] [Qemu-devel] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-11 Thread Max Reitz
On 11.04.2017 17:30, Eric Blake wrote: > On 04/11/2017 10:18 AM, Max Reitz wrote: > >> Hm, yeah, although you have to keep in mind that the padding is almost >> pretty much the same as the the data bits we need, effectively doubling >> the size of the L2 tables: >> >> padding = 2^{n+2} - 2^{n+1}

Re: [Qemu-block] [PATCH v3] migration/block:limit the time used for block migration

2017-04-11 Thread Stefan Hajnoczi
On Tue, Apr 11, 2017 at 09:06:37PM +0800, 858585 jemmy wrote: > On Tue, Apr 11, 2017 at 8:19 PM, 858585 jemmy wrote: > > On Mon, Apr 10, 2017 at 9:52 PM, Stefan Hajnoczi wrote: > >> On Sat, Apr 08, 2017 at 09:17:58PM +0800, 858585 jemmy wrote: > >>> On

Re: [Qemu-block] [Qemu-devel] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-11 Thread Eric Blake
On 04/11/2017 10:18 AM, Max Reitz wrote: > Hm, yeah, although you have to keep in mind that the padding is almost > pretty much the same as the the data bits we need, effectively doubling > the size of the L2 tables: > > padding = 2^{n+2} - 2^{n+1} - 64 (=2^6) > = 2^{n+1} - 64 > > So

Re: [Qemu-block] [Qemu-devel] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-11 Thread Max Reitz
On 11.04.2017 17:29, Kevin Wolf wrote: > Am 11.04.2017 um 17:18 hat Max Reitz geschrieben: >> On 11.04.2017 17:08, Eric Blake wrote: >>> On 04/11/2017 09:59 AM, Max Reitz wrote: >>> Good point, but that also means that (with (2)) you can only use subcluster configurations where the

Re: [Qemu-block] [Qemu-devel] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-11 Thread Eric Blake
On 04/11/2017 09:59 AM, Max Reitz wrote: > > Good point, but that also means that (with (2)) you can only use > subcluster configurations where the L2 entry size increases by a power > of two. Unfortunately, only one of those configurations itself is a > power of two, and that is 32. > > (With

Re: [Qemu-block] [PATCH for-2.9?] block/io: Comment out permission assertions

2017-04-11 Thread Laurent Vivier
On 11/04/2017 16:58, Kevin Wolf wrote: > Am 11.04.2017 um 16:50 hat Max Reitz geschrieben: >> In case of block migration, there may be writes to BlockBackends that do >> not have the write permission taken. Before this issue is fixed (which >> is not going to happen in 2.9), we therefore cannot

Re: [Qemu-block] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-11 Thread Max Reitz
On 11.04.2017 16:49, Kevin Wolf wrote: [...] > By the way, if you'd only allow multiple of 1s overhead > (i.e. multiples of 32 subclusters), I think (3) would be pretty much > the same as (2) if you just always write the subcluster information > adjacent to the L2 table. Should

Re: [Qemu-block] [PATCH for-2.9?] block/io: Comment out permission assertions

2017-04-11 Thread Kevin Wolf
Am 11.04.2017 um 16:50 hat Max Reitz geschrieben: > In case of block migration, there may be writes to BlockBackends that do > not have the write permission taken. Before this issue is fixed (which > is not going to happen in 2.9), we therefore cannot assert that this is > the case. > >

Re: [Qemu-block] [Qemu-devel] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-11 Thread Eric Blake
On 04/11/2017 09:49 AM, Kevin Wolf wrote: Then (3) is effectively the same as (2), just that the subcluster bitmaps are at the end of the L2 cluster, and not next to each entry. >>> >>> Exactly. But it's a difference in implementation, as you won't have to >>> worry about having changed

Re: [Qemu-block] [PATCH for-2.9?] block/io: Comment out permission assertions

2017-04-11 Thread Max Reitz
On 11.04.2017 16:50, Max Reitz wrote: > In case of block migration, there may be writes to BlockBackends that do > not have the write permission taken. Before this issue is fixed (which > is not going to happen in 2.9), we therefore cannot assert that this is > the case. > > Suggested-by: Kevin

[Qemu-block] [PATCH for-2.9?] block/io: Comment out permission assertions

2017-04-11 Thread Max Reitz
In case of block migration, there may be writes to BlockBackends that do not have the write permission taken. Before this issue is fixed (which is not going to happen in 2.9), we therefore cannot assert that this is the case. Suggested-by: Kevin Wolf Signed-off-by: Max Reitz

Re: [Qemu-block] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-11 Thread Kevin Wolf
Am 11.04.2017 um 16:31 hat Alberto Garcia geschrieben: > On Tue 11 Apr 2017 04:04:53 PM CEST, Max Reitz wrote: > >>> (We could even get one more bit if we had a subcluster-flag, because I > >>> guess we can always assume subclustered clusters to have OFLAG_COPIED > >>> and be uncompressed. But

Re: [Qemu-block] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-11 Thread Eric Blake
On 04/11/2017 09:31 AM, Alberto Garcia wrote: > On Tue 11 Apr 2017 04:04:53 PM CEST, Max Reitz wrote: (We could even get one more bit if we had a subcluster-flag, because I guess we can always assume subclustered clusters to have OFLAG_COPIED and be uncompressed. But still, three

Re: [Qemu-block] [PATCH for-2.9] sheepdog: Fix crash in co_read_response()

2017-04-11 Thread Kashyap Chamarthy
On Tue, Apr 11, 2017 at 04:08:53PM +0200, Kevin Wolf wrote: > This fixes a regression introduced in commit 9d456654. > > aio_co_wake() can only be used to reenter a coroutine that was already > previously entered, otherwise co->ctx is uninitialised and we access > garbage. Using it immediately

Re: [Qemu-block] [PATCH for-2.9] sheepdog: Fix crash in co_read_response()

2017-04-11 Thread Max Reitz
On 11.04.2017 16:08, Kevin Wolf wrote: > This fixes a regression introduced in commit 9d456654. > > aio_co_wake() can only be used to reenter a coroutine that was already > previously entered, otherwise co->ctx is uninitialised and we access > garbage. Using it immediately after

[Qemu-block] [PATCH for-2.9] sheepdog: Fix crash in co_read_response()

2017-04-11 Thread Kevin Wolf
This fixes a regression introduced in commit 9d456654. aio_co_wake() can only be used to reenter a coroutine that was already previously entered, otherwise co->ctx is uninitialised and we access garbage. Using it immediately after qemu_coroutine_create() like in co_read_response() is wrong and

Re: [Qemu-block] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-11 Thread Max Reitz
On 11.04.2017 14:56, Alberto Garcia wrote: > On Fri 07 Apr 2017 07:10:46 PM CEST, Max Reitz wrote: >>> === Changes to the on-disk format === >>> >>> The qcow2 on-disk format needs to change so each L2 entry has a bitmap >>> indicating the allocation status of each subcluster. There are three >>>

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.9?] block/nfs: Do not strcmp() with NULL

2017-04-11 Thread Max Reitz
On 11.04.2017 15:58, Markus Armbruster wrote: > Max Reitz writes: > >> Parsing the URI is not required to give us a scheme; uri->scheme may be >> NULL. >> >> Signed-off-by: Max Reitz >> --- >> block/nfs.c | 2 +- >> 1 file changed, 1 insertion(+), 1

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.9?] block/nfs: Do not strcmp() with NULL

2017-04-11 Thread Markus Armbruster
Max Reitz writes: > Parsing the URI is not required to give us a scheme; uri->scheme may be > NULL. > > Signed-off-by: Max Reitz > --- > block/nfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/nfs.c b/block/nfs.c > index

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.9?] block/nfs: Do not strcmp() with NULL

2017-04-11 Thread Max Reitz
On 11.04.2017 15:30, Peter Maydell wrote: > On 11 April 2017 at 14:13, Max Reitz wrote: >> Parsing the URI is not required to give us a scheme; uri->scheme may be >> NULL. >> >> Signed-off-by: Max Reitz >> --- >> block/nfs.c | 2 +- >> 1 file changed, 1

[Qemu-block] [PULL 3/3] iscsi: Fix iscsi_create

2017-04-11 Thread Max Reitz
From: Fam Zheng Since d5895fcb (iscsi: Split URL into individual options), creating qcow2 image on an iscsi LUN fails: qemu-img create -f qcow2 iscsi://$SERVER/$IQN/0 1G qemu-img: iscsi://$SERVER/$IQN/0: Could not create image: Invalid argument The problem is

[Qemu-block] [PULL 0/3] Block patches for 2.9.0-rc4

2017-04-11 Thread Max Reitz
The following changes since commit aa388ddc36e8032f41cd17bef88cc3ebaeba77c9: Merge remote-tracking branch 'remotes/famz/tags/block-pull-request' into staging (2017-04-11 13:27:05 +0100) are available in the git repository at: git://github.com/XanClic/qemu.git tags/pull-block-2017-04-11

[Qemu-block] [PULL 1/3] block: pass the right options for BlockDriver.bdrv_open()

2017-04-11 Thread Max Reitz
From: Dong Jia Shi raw_open() expects the caller always passing in the right actual @options parameter. But when trying to applying snapshot on a RBD image, bdrv_snapshot_goto() calls raw_open() (by calling the bdrv_open callback on the BlockDriver) with a NULL

[Qemu-block] [PULL 2/3] throttle: Remove block from group on hot-unplug

2017-04-11 Thread Max Reitz
From: Eric Blake When a block device that is part of a throttle group is hot-unplugged, we forgot to remove it from the throttle group. This leaves stale memory around, and causes an easily reproducible crash: $ ./x86_64-softmmu/qemu-system-x86_64 -nodefaults -nographic -qmp

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.9?] block/nfs: Do not strcmp() with NULL

2017-04-11 Thread Peter Maydell
On 11 April 2017 at 14:13, Max Reitz wrote: > Parsing the URI is not required to give us a scheme; uri->scheme may be > NULL. > > Signed-off-by: Max Reitz > --- > block/nfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [Qemu-block] Making QMP 'block-job-cancel' transactionable

2017-04-11 Thread Kevin Wolf
Am 11.04.2017 um 15:14 hat Eric Blake geschrieben: > On 04/11/2017 07:05 AM, Kevin Wolf wrote: > > Note that job completion/cancellation aren't synchronous QMP commands. > > The job works something like this, where '...' means that the VM can run > > and submit new writes etc.: > > > > 1. Start

Re: [Qemu-block] [PATCH for-2.9?] block/nfs: Do not strcmp() with NULL

2017-04-11 Thread Kevin Wolf
Am 11.04.2017 um 15:13 hat Max Reitz geschrieben: > Parsing the URI is not required to give us a scheme; uri->scheme may be > NULL. > > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH for-2.9] iscsi: Fix iscsi_create

2017-04-11 Thread Max Reitz
On 10.04.2017 09:54, Fam Zheng wrote: > Since d5895fcb (iscsi: Split URL into individual options), creating > qcow2 image on an iscsi LUN fails: > > qemu-img create -f qcow2 iscsi://$SERVER/$IQN/0 1G > qemu-img: iscsi://$SERVER/$IQN/0: Could not create image: Invalid > argument >

Re: [Qemu-block] Making QMP 'block-job-cancel' transactionable

2017-04-11 Thread Eric Blake
On 04/11/2017 07:05 AM, Kevin Wolf wrote: > > Note that job completion/cancellation aren't synchronous QMP commands. > The job works something like this, where '...' means that the VM can run > and submit new writes etc.: > > 1. Start job: mirror_start > ... > 2. Bulk has completed:

[Qemu-block] [PATCH for-2.9?] block/nfs: Do not strcmp() with NULL

2017-04-11 Thread Max Reitz
Parsing the URI is not required to give us a scheme; uri->scheme may be NULL. Signed-off-by: Max Reitz --- block/nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nfs.c b/block/nfs.c index 0816678307..0c7d5619fe 100644 --- a/block/nfs.c +++

Re: [Qemu-block] [PATCH v3] migration/block:limit the time used for block migration

2017-04-11 Thread 858585 jemmy
On Tue, Apr 11, 2017 at 8:19 PM, 858585 jemmy wrote: > On Mon, Apr 10, 2017 at 9:52 PM, Stefan Hajnoczi wrote: >> On Sat, Apr 08, 2017 at 09:17:58PM +0800, 858585 jemmy wrote: >>> On Fri, Apr 7, 2017 at 7:34 PM, Stefan Hajnoczi

Re: [Qemu-block] [PATCH for-2.9] iscsi: Fix iscsi_create

2017-04-11 Thread Fam Zheng
On Mon, 04/10 17:17, Max Reitz wrote: > > bs_options = qdict_new(); > > qdict_put(bs_options, "filename", qstring_from_str(filename)); > > Doesn't the below change make this qdict_put() superfluous? You are right, bdrv_iscsi.bdrv_needs_filename is false. Fam

Re: [Qemu-block] [Qemu-devel] [PATCH 15/17] iotests: add default node-name

2017-04-11 Thread Eric Blake
On 02/17/2017 08:05 AM, Fam Zheng wrote: > On Fri, 02/17 16:36, Vladimir Sementsov-Ogievskiy wrote: >> 17.02.2017 15:21, Fam Zheng wrote: >>> On Fri, 02/17 13:20, Vladimir Sementsov-Ogievskiy wrote: 16.02.2017 16:48, Fam Zheng wrote: > On Mon, 02/13 12:54, Vladimir Sementsov-Ogievskiy

Re: [Qemu-block] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-11 Thread Alberto Garcia
On Fri 07 Apr 2017 07:10:46 PM CEST, Max Reitz wrote: >> === Changes to the on-disk format === >> >> The qcow2 on-disk format needs to change so each L2 entry has a bitmap >> indicating the allocation status of each subcluster. There are three >> possible states (unallocated, allocated, all

Re: [Qemu-block] [PATCH v3] migration/block:limit the time used for block migration

2017-04-11 Thread 858585 jemmy
On Mon, Apr 10, 2017 at 9:52 PM, Stefan Hajnoczi wrote: > On Sat, Apr 08, 2017 at 09:17:58PM +0800, 858585 jemmy wrote: >> On Fri, Apr 7, 2017 at 7:34 PM, Stefan Hajnoczi wrote: >> > On Fri, Apr 07, 2017 at 09:30:33AM +0800, 858585 jemmy wrote: >> >> On

Re: [Qemu-block] [Qemu-devel] [PATCH v9 03/13] qemu-io: Switch 'alloc' command to byte-based length

2017-04-11 Thread Eric Blake
On 04/10/2017 09:37 PM, Philippe Mathieu-Daudé wrote: > Hi Eric, > > On 04/10/2017 10:17 PM, Eric Blake wrote: >> For the 'alloc' command, accepting an offset in bytes but a length >> in sectors, and reporting output in sectors, is confusing. Do >> everything in bytes, and adjust the expected

[Qemu-block] [PATCH v4] migration/block: use blk_pwrite_zeroes for each zero cluster

2017-04-11 Thread jemmy858585
From: Lidong Chen BLOCK_SIZE is (1 << 20), qcow2 cluster size is 65536 by default, this maybe cause the qcow2 file size is bigger after migration. This patch check each cluster, use blk_pwrite_zeroes for each zero cluster. Signed-off-by: Lidong Chen

Re: [Qemu-block] Making QMP 'block-job-cancel' transactionable

2017-04-11 Thread Kevin Wolf
Am 03.04.2017 um 22:29 hat John Snow geschrieben: > On 03/24/2017 08:34 AM, Kashyap Chamarthy wrote: > > While debugging some other issue, I happened to stumble across an old > > libvirt commit[*] that adds support for pivot (whether QEMU should > > switch to a target copy or not) operation as a

Re: [Qemu-block] [PATCH for 2.9 v3 00/10] block: Fixes regarding dataplane and management operations

2017-04-11 Thread Fam Zheng
On Tue, 04/11 13:05, Kevin Wolf wrote: > Am 10.04.2017 um 17:05 hat Fam Zheng geschrieben: > > v3: Respin the unmerged changes from v2 and include one new fix: > > > > (Yes, it is a big series for the last -rc, and I personally prefer the > > v2 > > approach for the 4-9 part of the

Re: [Qemu-block] [PATCH for 2.9 v3 09/10] block: Use bdrv_coroutine_enter to start I/O coroutines

2017-04-11 Thread Paolo Bonzini
> So I think we should have another look at Sheepdog, the rest seems to be > fine. Sheepdog currently SEGVs and this might be the cause. I can look at it on Thursday. Paolo

Re: [Qemu-block] [Qemu-devel] [PATCH for 2.9 v3 09/10] block: Use bdrv_coroutine_enter to start I/O coroutines

2017-04-11 Thread Fam Zheng
On Tue, 04/11 12:06, Kevin Wolf wrote: > > tests/qemu-iotests/109.out | 10 +- > > This one is curious. Why do we copy more data depending on how the job > coroutine is reentered? I did trace it and think the difference is not very important: on master, the second iteration of the

[Qemu-block] [PATCH for 2.9 v3 11/10] block, async: Remove unused *_enter_if_inactive()

2017-04-11 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- block.c | 5 - include/block/aio.h | 9 - include/block/block.h | 6 -- util/async.c | 7 --- 4 files changed, 27 deletions(-) diff --git a/block.c b/block.c index e65b906..086a12d 100644 --- a/block.c

Re: [Qemu-block] [PATCH for 2.9 v3 05/10] async: Introduce aio_co_enter and aio_co_enter_if_inactive

2017-04-11 Thread Fam Zheng
On Tue, 04/11 11:28, Kevin Wolf wrote: > Am 10.04.2017 um 17:05 hat Fam Zheng geschrieben: > > They start the coroutine on the specified context. > > > > Signed-off-by: Fam Zheng > > --- > > include/block/aio.h | 18 ++ > > util/async.c| 14

Re: [Qemu-block] [PATCH for 2.9 v3 00/10] block: Fixes regarding dataplane and management operations

2017-04-11 Thread Kevin Wolf
Am 10.04.2017 um 17:05 hat Fam Zheng geschrieben: > v3: Respin the unmerged changes from v2 and include one new fix: > > (Yes, it is a big series for the last -rc, and I personally prefer the v2 > approach for the 4-9 part of the problem, which is much more mechanical.) > > - 1, 2

Re: [Qemu-block] [PATCH for 2.9 v3 00/10] block: Fixes regarding dataplane and management operations

2017-04-11 Thread Stefan Hajnoczi
On Mon, Apr 10, 2017 at 11:05:32PM +0800, Fam Zheng wrote: > v3: Respin the unmerged changes from v2 and include one new fix: > > (Yes, it is a big series for the last -rc, and I personally prefer the v2 > approach for the 4-9 part of the problem, which is much more mechanical.) > >

Re: [Qemu-block] [Qemu-devel] Making QMP 'block-job-cancel' transactionable

2017-04-11 Thread Kashyap Chamarthy
On Tue, Apr 11, 2017 at 11:42:28AM +0200, Markus Armbruster wrote: > Eric Blake writes: > > > On 04/04/2017 08:28 AM, Kashyap Chamarthy wrote: > > > >>> Minor or not, it is a useful viewpoint. Either way, as long as the new > >>> way of getting a transactional non-pivot

Re: [Qemu-block] [PATCH for 2.9 v3 02/10] block: Quiesce old aio context during bdrv_set_aio_context

2017-04-11 Thread Stefan Hajnoczi
On Mon, Apr 10, 2017 at 11:05:34PM +0800, Fam Zheng wrote: > The fact that the bs->aio_context is changing can confuse the dataplane > iothread, because of the now fine granularity aio context lock. > bdrv_drain should rather be a bdrv_drained_begin/end pair, but since > bs->aio_context is

Re: [Qemu-block] [PATCH for 2.9 v3 01/10] block: Make bdrv_parent_drained_begin/end public

2017-04-11 Thread Stefan Hajnoczi
On Mon, Apr 10, 2017 at 11:05:33PM +0800, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > block/io.c| 4 ++-- > include/block/block.h | 16 > 2 files changed, 18 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [PATCH for 2.9 v3 09/10] block: Use bdrv_coroutine_enter to start I/O coroutines

2017-04-11 Thread Kevin Wolf
Am 10.04.2017 um 17:05 hat Fam Zheng geschrieben: > BDRV_POLL_WHILE waits for the started I/O by releasing bs's ctx then polling > the main context, which relies on the yielded the coroutine would continue on > bs->ctx and notify qemu_aio_context with bdrv_wakeup(). Thus, using >

Re: [Qemu-block] [Qemu-devel] Making QMP 'block-job-cancel' transactionable

2017-04-11 Thread Markus Armbruster
Eric Blake writes: > On 04/04/2017 08:28 AM, Kashyap Chamarthy wrote: > >>> Minor or not, it is a useful viewpoint. Either way, as long as the new >>> way of getting a transactional non-pivot successful completion is >>> something that libvirt can learn via introspection, >>

Re: [Qemu-block] [PATCH for 2.9 v3 05/10] async: Introduce aio_co_enter and aio_co_enter_if_inactive

2017-04-11 Thread Kevin Wolf
Am 10.04.2017 um 17:05 hat Fam Zheng geschrieben: > They start the coroutine on the specified context. > > Signed-off-by: Fam Zheng > --- > include/block/aio.h | 18 ++ > util/async.c| 14 +- > 2 files changed, 31 insertions(+), 1 deletion(-)

Re: [Qemu-block] [PATCH for 2.9 v3 10/10] block: Fix bdrv_co_flush early return

2017-04-11 Thread Paolo Bonzini
On 10/04/2017 23:05, Fam Zheng wrote: > bdrv_inc_in_flight and bdrv_dec_in_flight are mandatory for > BDRV_POLL_WHILE to work, even for the shortcut case where flush is > unnecessary. Move the if block to below bdrv_dec_in_flight, and BTW fix > the variable declaration position. > >

Re: [Qemu-block] [PATCH for 2.9 v3 03/10] tests/block-job-txn: Don't start block job before adding to txn

2017-04-11 Thread Kevin Wolf
Am 10.04.2017 um 17:05 hat Fam Zheng geschrieben: > Previously, before test_block_job_start returns, the job can already > complete, as a result, the transactional state of other jobs added to > the same txn later cannot be handled correctly. > > Move the block_job_start() calls to callers after

Re: [Qemu-block] [PATCH for 2.9 v3 02/10] block: Quiesce old aio context during bdrv_set_aio_context

2017-04-11 Thread Kevin Wolf
Am 10.04.2017 um 17:05 hat Fam Zheng geschrieben: > The fact that the bs->aio_context is changing can confuse the dataplane > iothread, because of the now fine granularity aio context lock. > bdrv_drain should rather be a bdrv_drained_begin/end pair, but since > bs->aio_context is changing, we can

Re: [Qemu-block] [PATCH for 2.9 v3 01/10] block: Make bdrv_parent_drained_begin/end public

2017-04-11 Thread Kevin Wolf
Am 10.04.2017 um 17:05 hat Fam Zheng geschrieben: > Signed-off-by: Fam Zheng Reviewed-by: Kevin Wolf

Re: [Qemu-block] [Qemu-devel] [PATCH v2 4/6] fdc-test: Avoid deprecated 'change' command

2017-04-11 Thread Kevin Wolf
Am 11.04.2017 um 10:49 hat Markus Armbruster geschrieben: > Eric Blake writes: > > > On 01/19/2017 08:39 AM, Eric Blake wrote: > >> On 01/19/2017 03:30 AM, Markus Armbruster wrote: > >>> Eric Blake writes: > >>> > Use the preferred

Re: [Qemu-block] [Qemu-devel] [PATCH v2 4/6] fdc-test: Avoid deprecated 'change' command

2017-04-11 Thread Markus Armbruster
Eric Blake writes: > On 01/19/2017 08:39 AM, Eric Blake wrote: >> On 01/19/2017 03:30 AM, Markus Armbruster wrote: >>> Eric Blake writes: >>> Use the preferred blockdev-change-medium command instead. Signed-off-by: Eric Blake