[Qemu-block] [PULL v2 14/17] nbd: BLOCK_STATUS for standard get_block_status function: client part

2018-03-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Minimal realization: only one extent in server answer is supported. Flag NBD_CMD_FLAG_REQ_ONE is used to force this behavior. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id:

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/8] nbd block status base:allocation

2018-03-13 Thread Eric Blake
On 03/12/2018 10:11 PM, Eric Blake wrote:    CC  block/nbd-client.o    CC  block/sheepdog.o /var/tmp/patchew-tester-tmp-erqpie2w/src/block/nbd-client.c: In function ‘nbd_client_co_block_status’: /var/tmp/patchew-tester-tmp-erqpie2w/src/block/nbd-client.c:890:15: error:

Re: [Qemu-block] [Qemu-devel] [PATCH v11 00/13] Dirty bitmaps postcopy migration

2018-03-13 Thread Dr. David Alan Gilbert
* Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: > It looks like a bug in a recent commit to checkpatch. It don't support do { } > while Yes, adding Su Hang and Eric in and trimming some others out. So yes, ignore this patchew failure for this case, but we need to fix that

Re: [Qemu-block] [Qemu-devel] [PATCH v11 00/13] Dirty bitmaps postcopy migration

2018-03-13 Thread Eric Blake
On 03/13/2018 03:01 PM, Vladimir Sementsov-Ogievskiy wrote: It looks like a bug in a recent commit to checkpatch. It don't support do { } while Checking PATCH 11/13: migration: add postcopy migration of dirty bitmaps... ERROR: braces {} are necessary for all arms of this statement #737:

Re: [Qemu-block] [Qemu-devel] [PATCH v11 00/13] Dirty bitmaps postcopy migration

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
It looks like a bug in a recent commit to checkpatch. It don't support do { } while Best regards, Vladimir. От: no-re...@patchew.org Отправлено: 13 марта 2018 г. 22:03:29 Кому: Vladimir Sementsov-Ogievskiy Копия: f...@redhat.com;

Re: [Qemu-block] [Qemu-devel] [PATCH v11 11/13] migration: add postcopy migration of dirty bitmaps

2018-03-13 Thread John Snow
On 03/13/2018 02:29 PM, Vladimir Sementsov-Ogievskiy wrote: > 13.03.2018 21:22, Dr. David Alan Gilbert wrote: >> * Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: >>> Postcopy migration of dirty bitmaps. Only named dirty bitmaps are >>> migrated. >>> >>> If destination qemu is

Re: [Qemu-block] [Qemu-devel] [PATCH v11 00/13] Dirty bitmaps postcopy migration

2018-03-13 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20180313180320.339796-1-vsement...@virtuozzo.com Subject: [Qemu-devel] [PATCH v11 00/13] Dirty bitmaps postcopy migration === TEST SCRIPT BEGIN === #!/bin/bash BASE=base

Re: [Qemu-block] [PATCH 1/2] qcow2: Give the refcount cache the minimum possible size by default

2018-03-13 Thread Alberto Garcia
On Tue 13 Mar 2018 07:23:36 PM CET, Eric Blake wrote: >> +*refcount_cache_size = >> +MIN(combined_cache_size, min_refcount_cache); > > but here, if combined_cache_size is smaller than min_refcount_cache, > >> +*l2_cache_size = combined_cache_size

Re: [Qemu-block] [PATCH 1/2] qcow2: Give the refcount cache the minimum possible size by default

2018-03-13 Thread Eric Blake
On 03/13/2018 01:48 PM, Alberto Garcia wrote: On Tue 13 Mar 2018 07:23:36 PM CET, Eric Blake wrote: +*refcount_cache_size = +MIN(combined_cache_size, min_refcount_cache); but here, if combined_cache_size is smaller than min_refcount_cache, +

Re: [Qemu-block] [PATCH v11 11/13] migration: add postcopy migration of dirty bitmaps

2018-03-13 Thread Dr. David Alan Gilbert
* Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: > Postcopy migration of dirty bitmaps. Only named dirty bitmaps are migrated. > > If destination qemu is already containing a dirty bitmap with the same name > as a migrated bitmap (for the same node), then, if their granularities

Re: [Qemu-block] [PATCH v11 11/13] migration: add postcopy migration of dirty bitmaps

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
13.03.2018 21:22, Dr. David Alan Gilbert wrote: * Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: Postcopy migration of dirty bitmaps. Only named dirty bitmaps are migrated. If destination qemu is already containing a dirty bitmap with the same name as a migrated bitmap (for the

Re: [Qemu-block] [PATCH 2/2] docs: Document the new default sizes of the qcow2 caches

2018-03-13 Thread Eric Blake
On 03/13/2018 10:02 AM, Alberto Garcia wrote: We have just reduced the refcount cache size to the minimum unless the user explicitly requests a larger one, so we have to update the documentation to reflect this change. Signed-off-by: Alberto Garcia --- docs/qcow2-cache.txt

Re: [Qemu-block] [Qemu-devel] [PULL 18/41] blockjobs: add block-job-finalize

2018-03-13 Thread Eric Blake
On 03/13/2018 11:17 AM, Kevin Wolf wrote: From: John Snow Instead of automatically transitioning from PENDING to CONCLUDED, gate the .prepare() and .commit() phases behind an explicit acknowledgement provided by the QMP monitor if auto_finalize = false has been requested.

Re: [Qemu-block] [PATCH 1/2] qcow2: Give the refcount cache the minimum possible size by default

2018-03-13 Thread Eric Blake
On 03/13/2018 10:02 AM, Alberto Garcia wrote: The L2 and refcount caches have default sizes that can be overriden using the l2-cache-size and refcount-cache-size (an additional parameter named cache-size sets the combined size of both caches). Unless forced by one of the aforementioned

[Qemu-block] [PATCH v11 07/13] migration: include migrate_dirty_bitmaps in migrate_postcopy

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
Enable postcopy if dirty bitmap migration is enabled. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela Reviewed-by: John Snow Reviewed-by: Fam Zheng --- migration/migration.c | 2 +- 1

[Qemu-block] [PATCH v11 01/13] block/dirty-bitmap: add bdrv_dirty_bitmap_enable_successor()

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
Enabling bitmap successor is necessary to enable successors of bitmaps being migrated before target vm start. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Reviewed-by: Fam Zheng Message-id:

Re: [Qemu-block] [PATCH v11 05/13] migration: introduce postcopy-only pending

2018-03-13 Thread Dr. David Alan Gilbert
* Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: > There would be savevm states (dirty-bitmap) which can migrate only in > postcopy stage. The corresponding pending is introduced here. > > Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Dr.

[Qemu-block] [PATCH v11 10/13] migration: allow qmp command migrate-start-postcopy for any postcopy

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
Allow migrate-start-postcopy for any postcopy type Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 094196c236..59b4fe6090

[Qemu-block] [PATCH v11 11/13] migration: add postcopy migration of dirty bitmaps

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
Postcopy migration of dirty bitmaps. Only named dirty bitmaps are migrated. If destination qemu is already containing a dirty bitmap with the same name as a migrated bitmap (for the same node), then, if their granularities are the same the migration will be done, otherwise the error will be

[Qemu-block] [PATCH v11 06/13] qapi: add dirty-bitmaps migration capability

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Juan Quintela Reviewed-by: Fam Zheng --- qapi/migration.json | 6 +-

[Qemu-block] [PATCH v11 04/13] dirty-bitmap: add locked state

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
Add special state, when qmp operations on the bitmap are disabled. It is needed during bitmap migration. "Frozen" state is not appropriate here, because it looks like bitmap is unchanged. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow

[Qemu-block] [PATCH v11 12/13] iotests: add dirty bitmap migration test

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
The test starts two vms (vm_a, vm_b), create dirty bitmap in the first one, do several writes to corresponding device and then migrate vm_a to vm_b. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/169 | 156

[Qemu-block] [PATCH v11 09/13] migration: add is_active_iterate handler

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
Only-postcopy savevm states (dirty-bitmap) don't need live iteration, so to disable them and stop transporting empty sections there is a new savevm handler. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela Reviewed-by: John

[Qemu-block] [PATCH v11 13/13] iotests: add dirty bitmap postcopy test

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
Test - start two vms (vm_a, vm_b) - in a - do writes from set A - do writes from set B - fix bitmap sha256 - clear bitmap - do writes from set A - start migration - than, in b - wait vm start (postcopy should start) - do writes from set B - check bitmap sha256

Re: [Qemu-block] [PATCH v10 10/12] migration: add postcopy migration of dirty bitmaps

2018-03-13 Thread Dr. David Alan Gilbert
* Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: > 12.03.2018 19:09, Dr. David Alan Gilbert wrote: > > * Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: > > > Postcopy migration of dirty bitmaps. Only named dirty bitmaps are > > > migrated. > > > > > > + > > > +

Re: [Qemu-block] [PATCH v11 10/13] migration: allow qmp command migrate-start-postcopy for any postcopy

2018-03-13 Thread Dr. David Alan Gilbert
* Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: > Allow migrate-start-postcopy for any postcopy type > > Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Dr. David Alan Gilbert > --- > migration/migration.c | 2 +- > 1

[Qemu-block] [PATCH v11 08/13] migration/qemu-file: add qemu_put_counted_string()

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
Add function opposite to qemu_get_counted_string. qemu_put_counted_string puts one-byte length of the string (string should not be longer than 255 characters), and then it puts the string, without last zero byte. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by:

[Qemu-block] [PATCH v11 05/13] migration: introduce postcopy-only pending

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
There would be savevm states (dirty-bitmap) which can migrate only in postcopy stage. The corresponding pending is introduced here. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/migration/register.h | 17 +++-- migration/savevm.h | 5

[Qemu-block] [PATCH v11 02/13] block/dirty-bitmap: fix locking in bdrv_reclaim_dirty_bitmap

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
Like other setters here these functions should take a lock. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fam Zheng Reviewed-by: John Snow Message-id: 20180207155837.92351-3-vsement...@virtuozzo.com Signed-off-by: John

[Qemu-block] [PATCH v11 03/13] block/dirty-bitmap: add _locked version of bdrv_reclaim_dirty_bitmap

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Message-id: 20180207155837.92351-4-vsement...@virtuozzo.com Signed-off-by: John Snow --- include/block/dirty-bitmap.h | 3 +++ block/dirty-bitmap.c | 28

[Qemu-block] [PATCH v11 00/13] Dirty bitmaps postcopy migration

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
Hi all! There is a new version of dirty bitmap postcopy migration series. Patches 01-04 are directly from John's branch https://github.com/jnsnow/qemu/tree/bitmaps , they are included only for patchew. v11 clone: tag postcopy-v11 from https://src.openvz.org/scm/~vsementsov/qemu.git online:

[Qemu-block] [PULL 11/17] nbd/server: add nbd_read_opt_name helper

2018-03-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Add helper to read name in format: uint32 len (<= NBD_MAX_NAME_SIZE) len bytes string (not 0-terminated) The helper will be reused in following patch. Signed-off-by: Vladimir Sementsov-Ogievskiy

[Qemu-block] [PULL 17/17] iotests: new test 209 for NBD BLOCK_STATUS

2018-03-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20180312152126.286890-9-vsement...@virtuozzo.com> Signed-off-by: Eric Blake --- tests/qemu-iotests/209 | 34

[Qemu-block] [PULL 15/17] iotests.py: tiny refactor: move system imports up

2018-03-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Message-Id: <20180312152126.286890-7-vsement...@virtuozzo.com> Signed-off-by: Eric Blake ---

[Qemu-block] [PULL 16/17] iotests: add file_path helper

2018-03-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Simple way to have auto generated filenames with auto cleanup. Like FilePath but without using 'with' statement and without additional indentation of the whole test. Signed-off-by: Vladimir Sementsov-Ogievskiy

[Qemu-block] [PULL 09/17] iotests: add 208 nbd-server + blockdev-snapshot-sync test case

2018-03-13 Thread Eric Blake
From: Stefan Hajnoczi This test case adds an NBD server export and then invokes blockdev-snapshot-sync, which changes the BlockDriverState node that the NBD server's BlockBackend points to. This is an interesting scenario to test and exercises the code path fixed by the

[Qemu-block] [PULL 02/17] nbd/server: move nbd_co_send_structured_error up

2018-03-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy To be reused in nbd_co_send_sparse_read() in the following patch. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20180308184636.178534-2-vsement...@virtuozzo.com> Reviewed-by: Eric Blake

[Qemu-block] [PULL 01/17] iotests: Fix stuck NBD process on 33

2018-03-13 Thread Eric Blake
Commit afe35cde6 added additional actions to test 33, but forgot to reset the image between tests. As a result, './check -nbd 33' fails because the qemu-nbd process from the first half is still occupying the port, preventing the second half from starting a new qemu-nbd process. Worse, the

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

2018-03-13 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20180313161803.1814-1-kw...@redhat.com Subject: [Qemu-devel] [PULL 00/41] Block layer patches === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1 total=$(git log --oneline

Re: [Qemu-block] [PATCH v10 05/12] migration: introduce postcopy-only pending

2018-03-13 Thread John Snow
On 03/13/2018 12:33 PM, Vladimir Sementsov-Ogievskiy wrote: > 13.03.2018 19:16, John Snow wrote: >> >> On 03/13/2018 12:14 PM, Vladimir Sementsov-Ogievskiy wrote: >>> Hmm, I agree, it is the simplest thing we can do for now, and I'll >>> rethink later, >>> how (and is it worth doing) to go to

[Qemu-block] [PULL 14/17] nbd: BLOCK_STATUS for standard get_block_status function: client part

2018-03-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Minimal realization: only one extent in server answer is supported. Flag NBD_CMD_FLAG_REQ_ONE is used to force this behavior. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id:

[Qemu-block] [PULL 12/17] nbd: BLOCK_STATUS for standard get_block_status function: server part

2018-03-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Minimal realization: only one extent in server answer is supported. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20180312152126.286890-4-vsement...@virtuozzo.com> Reviewed-by: Eric Blake

[Qemu-block] [PULL 13/17] block/nbd-client: save first fatal error in nbd_iter_error

2018-03-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy It is ok, that fatal error hides previous not fatal, but hiding first fatal error is a bad feature. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Message-Id:

[Qemu-block] [PULL 04/17] nbd/server: fix: check client->closing before sending reply

2018-03-13 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Since the unchanged code has just set client->recv_coroutine to NULL before calling nbd_client_receive_next_request(), we are spawning a new coroutine unconditionally, but the first thing that coroutine will do is check for

Re: [Qemu-block] [PATCH v10 10/12] migration: add postcopy migration of dirty bitmaps

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
12.03.2018 19:09, Dr. David Alan Gilbert wrote: * Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: Postcopy migration of dirty bitmaps. Only named dirty bitmaps are migrated. If destination qemu is already containing a dirty bitmap with the same name as a migrated bitmap (for the

[Qemu-block] [PULL 41/41] block/mirror: change the semantic of 'force' of block-job-cancel

2018-03-13 Thread Kevin Wolf
From: Liang Li When doing drive mirror to a low speed shared storage, if there was heavy BLK IO write workload in VM after the 'ready' event, drive mirror block job can't be canceled immediately, it would keep running until the heavy BLK IO workload stopped in the

[Qemu-block] [PULL 33/41] parallels: Support .bdrv_co_create

2018-03-13 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to parallels, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- qapi/block-core.json | 18 - block/parallels.c| 199

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Update output of 051 and 186 after commit 1454509726719e0933c

2018-03-13 Thread Kevin Wolf
Am 13.03.2018 um 17:22 hat Thomas Huth geschrieben: > On 13.03.2018 17:08, Kevin Wolf wrote: > > Am 06.03.2018 um 17:52 hat Thomas Huth geschrieben: > >> On 06.03.2018 17:45, Alberto Garcia wrote: > >>> Signed-off-by: Alberto Garcia > >>> --- > >>> tests/qemu-iotests/051.pc.out

[Qemu-block] [PULL 28/41] vdi: Pull option parsing from vdi_co_create

2018-03-13 Thread Kevin Wolf
From: Max Reitz In preparation of QAPI-fying VDI image creation, we have to create a BlockdevCreateOptionsVdi type which is received by a (future) vdi_co_create(). vdi_co_create_opts() now converts the QemuOpts object into such a BlockdevCreateOptionsVdi object. The

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Update output of 051 and 186 after commit 1454509726719e0933c

2018-03-13 Thread Thomas Huth
On 13.03.2018 17:08, Kevin Wolf wrote: > Am 06.03.2018 um 17:52 hat Thomas Huth geschrieben: >> On 06.03.2018 17:45, Alberto Garcia wrote: >>> Signed-off-by: Alberto Garcia >>> --- >>> tests/qemu-iotests/051.pc.out | 20 >>> tests/qemu-iotests/186.out|

[Qemu-block] [PULL 23/41] luks: Create block_crypto_co_create_generic()

2018-03-13 Thread Kevin Wolf
Everything that refers to the protocol layer or QemuOpts is moved out of block_crypto_create_generic(), so that the remaining function is suitable to be called by a .bdrv_co_create implementation. LUKS is the only driver that actually implements the old interface, and we don't intend to use it in

[Qemu-block] [PULL 40/41] vpc: Require aligned size in .bdrv_co_create

2018-03-13 Thread Kevin Wolf
Perform the rounding to match a CHS geometry only in the legacy code path in .bdrv_co_create_opts. QMP now requires that the user already passes a CHS aligned image size, unless force-size=true is given. CHS alignment is required to make the image compatible with Virtual PC, but not for use with

[Qemu-block] [PULL 34/41] qemu-iotests: Enable write tests for parallels

2018-03-13 Thread Kevin Wolf
Originally we added parallels as a read-only format to qemu-iotests where we did just some tests with a binary image. Since then, write and image creation support has been added to the driver, so we can now enable it in _supported_fmt generic. The driver doesn't support migration yet, though, so

[Qemu-block] [PULL 35/41] qcow: Support .bdrv_co_create

2018-03-13 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to qcow, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- qapi/block-core.json | 21 +- block/qcow.c | 196

Re: [Qemu-block] [PATCH v10 05/12] migration: introduce postcopy-only pending

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
13.03.2018 19:16, John Snow wrote: On 03/13/2018 12:14 PM, Vladimir Sementsov-Ogievskiy wrote: Hmm, I agree, it is the simplest thing we can do for now, and I'll rethink later, how (and is it worth doing) to go to postcopy automatically in case of only-dirty-bitmaps. Should I respin? Please

[Qemu-block] [PULL 12/41] blockjobs: ensure abort is called for cancelled jobs

2018-03-13 Thread Kevin Wolf
From: John Snow Presently, even if a job is canceled post-completion as a result of a failing peer in a transaction, it will still call .commit because nothing has updated or changed its return code. The reason why this does not cause problems currently is because backup's

[Qemu-block] [PULL 26/41] luks: Catch integer overflow for huge sizes

2018-03-13 Thread Kevin Wolf
When you request an image size close to UINT64_MAX, the addition of the crypto header may cause an integer overflow. Catch it instead of silently truncating the image size. Signed-off-by: Kevin Wolf Reviewed-by: Daniel P. Berrangé --- block/crypto.c | 5

[Qemu-block] [PULL 31/41] block: Fix flags in reopen queue

2018-03-13 Thread Kevin Wolf
From: Fam Zheng Reopen flags are not synchronized according to the bdrv_reopen_queue_child precedence until bdrv_reopen_prepare. It is a bit too late: we already check the consistency in bdrv_check_perm before that. This fixes the bug that when bdrv_reopen a RO node as RW, the

[Qemu-block] [PULL 27/41] qemu-iotests: Test luks QMP image creation

2018-03-13 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Daniel P. Berrangé --- tests/qemu-iotests/209 | 210 +++ tests/qemu-iotests/209.out | 136 tests/qemu-iotests/common.rc | 2 +-

[Qemu-block] [PULL 22/41] luks: Separate image file creation from formatting

2018-03-13 Thread Kevin Wolf
The crypto driver used to create the image file in a callback from the crypto subsystem. If we want to implement .bdrv_co_create, this needs to go away because that callback will get a reference to an already existing block node. Move the image file creation to block_crypto_create_generic().

[Qemu-block] [PULL 20/41] iotests: test manual job dismissal

2018-03-13 Thread Kevin Wolf
From: John Snow Signed-off-by: John Snow Signed-off-by: Kevin Wolf --- tests/qemu-iotests/056 | 187 + tests/qemu-iotests/056.out | 4 +- 2 files changed, 189 insertions(+), 2 deletions(-)

[Qemu-block] [PULL 25/41] luks: Turn invalid assertion into check

2018-03-13 Thread Kevin Wolf
The .bdrv_getlength implementation of the crypto block driver asserted that the payload offset isn't after EOF. This is an invalid assertion to make as the image file could be corrupted. Instead, check it and return -EIO if the file is too small for the payload offset. Zero length images are

[Qemu-block] [PULL 13/41] blockjobs: add commit, abort, clean helpers

2018-03-13 Thread Kevin Wolf
From: John Snow The completed_single function is getting a little mucked up with checking to see which callbacks exist, so let's factor them out. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf

[Qemu-block] [PULL 11/41] blockjobs: add block_job_dismiss

2018-03-13 Thread Kevin Wolf
From: John Snow For jobs that have reached their CONCLUDED state, prior to having their last reference put down (meaning jobs that have completed successfully, unsuccessfully, or have been canceled), allow the user to dismiss the job's lingering status report via

[Qemu-block] [PULL 39/41] vpc: Support .bdrv_co_create

2018-03-13 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to vpc, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qapi/block-core.json | 33 ++- block/vpc.c | 152

[Qemu-block] [PULL 17/41] blockjobs: add PENDING status and event

2018-03-13 Thread Kevin Wolf
From: John Snow For jobs utilizing the new manual workflow, we intend to prohibit them from modifying the block graph until the management layer provides an explicit ACK via block-job-finalize to move the process forward. To distinguish this runstate from "ready" or "waiting,"

[Qemu-block] [PULL 19/41] blockjobs: Expose manual property

2018-03-13 Thread Kevin Wolf
From: John Snow Expose the "manual" property via QAPI for the backup-related jobs. As of this commit, this allows the management API to request the "concluded" and "dismiss" semantics for backup jobs. Signed-off-by: John Snow Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 38/41] vhdx: Support .bdrv_co_create

2018-03-13 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to vhdx, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qapi/block-core.json | 40 +- block/vhdx.c | 216

[Qemu-block] [PULL 16/41] blockjobs: add waiting status

2018-03-13 Thread Kevin Wolf
From: John Snow For jobs that are stuck waiting on others in a transaction, it would be nice to know that they are no longer "running" in that sense, but instead are waiting on other jobs in the transaction. Jobs that are "waiting" in this sense cannot be meaningfully altered

[Qemu-block] [PULL 15/41] blockjobs: add prepare callback

2018-03-13 Thread Kevin Wolf
From: John Snow Some jobs upon finalization may need to perform some work that can still fail. If these jobs are part of a transaction, it's important that these callbacks fail the entire transaction. We allow for a new callback in addition to commit/abort/clean that allows us

[Qemu-block] [PULL 36/41] qed: Support .bdrv_co_create

2018-03-13 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to qed, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- qapi/block-core.json | 25 ++- block/qed.c | 204

[Qemu-block] [PULL 32/41] iotests: Add regression test for commit base locking

2018-03-13 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- tests/qemu-iotests/153 | 12 tests/qemu-iotests/153.out | 5 + 2 files changed, 17 insertions(+) diff

[Qemu-block] [PULL 29/41] vdi: Move file creation to vdi_co_create_opts

2018-03-13 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- block/vdi.c | 46 -- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index

[Qemu-block] [PULL 30/41] vdi: Implement .bdrv_co_create

2018-03-13 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- qapi/block-core.json | 2 +- block/vdi.c | 24 +++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/qapi/block-core.json

Re: [Qemu-block] [PATCH v2 0/8] nbd block status base:allocation

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
13.03.2018 18:55, Eric Blake wrote: On 03/12/2018 10:21 AM, Vladimir Sementsov-Ogievskiy wrote: Hi all. Here is minimal realization of base:allocation context of NBD block-status extension, which allows to get block status through NBD. v2 changes are in each patch after "---" line. Vladimir

[Qemu-block] [PULL 24/41] luks: Support .bdrv_co_create

2018-03-13 Thread Kevin Wolf
This adds the .bdrv_co_create driver callback to luks, which enables image creation over QMP. Signed-off-by: Kevin Wolf Reviewed-by: Daniel P. Berrangé --- qapi/block-core.json | 17 - block/crypto.c | 34

[Qemu-block] [PULL 10/41] blockjobs: add NULL state

2018-03-13 Thread Kevin Wolf
From: John Snow Add a new state that specifically demarcates when we begin to permanently demolish a job after it has performed all work. This makes the transition explicit in the STM table and highlights conditions under which a job may be demolished. Alongside this state,

[Qemu-block] [PULL 21/41] tests/test-blockjob: test cancellations

2018-03-13 Thread Kevin Wolf
From: John Snow Whatever the state a blockjob is in, it should be able to be canceled by the block layer. Signed-off-by: John Snow Signed-off-by: Kevin Wolf --- tests/test-blockjob.c | 233

[Qemu-block] [PULL 07/41] blockjobs: add block_job_verb permission table

2018-03-13 Thread Kevin Wolf
From: John Snow Which commands ("verbs") are appropriate for jobs in which state is also somewhat burdensome to keep track of. As of this commit, it looks rather useless, but begins to look more interesting the more states we add to the STM table. A recurring theme is that no

[Qemu-block] [PULL 04/41] blockjobs: add status enum

2018-03-13 Thread Kevin Wolf
From: John Snow We're about to add several new states, and booleans are becoming unwieldly and difficult to reason about. It would help to have a more explicit bookkeeping of the state of blockjobs. To this end, add a new "status" field and add our existing states in a

[Qemu-block] [PULL 18/41] blockjobs: add block-job-finalize

2018-03-13 Thread Kevin Wolf
From: John Snow Instead of automatically transitioning from PENDING to CONCLUDED, gate the .prepare() and .commit() phases behind an explicit acknowledgement provided by the QMP monitor if auto_finalize = false has been requested. This allows us to perform graph changes in

[Qemu-block] [PULL 14/41] blockjobs: add block_job_txn_apply function

2018-03-13 Thread Kevin Wolf
From: John Snow Simply apply a function transaction-wide. A few more uses of this in forthcoming patches. Signed-off-by: John Snow Signed-off-by: Kevin Wolf --- blockjob.c | 25 - 1 file changed, 16 insertions(+),

[Qemu-block] [PULL 05/41] blockjobs: add state transition table

2018-03-13 Thread Kevin Wolf
From: John Snow The state transition table has mostly been implied. We're about to make it a bit more complex, so let's make the STM explicit instead. Perform state transitions with a function that for now just asserts the transition is appropriate. Transitions: Undefined ->

[Qemu-block] [PULL 09/41] blockjobs: add CONCLUDED state

2018-03-13 Thread Kevin Wolf
From: John Snow add a new state "CONCLUDED" that identifies a job that has ceased all operations. The wording was chosen to avoid any phrasing that might imply success, error, or cancellation. The task has simply ceased all operation and can never again perform any work.

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

2018-03-13 Thread Kevin Wolf
The following changes since commit 22ef7ba8e8ce7fef297549b3defcac333742b804: Merge remote-tracking branch 'remotes/famz/tags/staging-pull-request' into staging (2018-03-13 11:42:45 +) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to

[Qemu-block] [PULL 08/41] blockjobs: add ABORTING state

2018-03-13 Thread Kevin Wolf
From: John Snow Add a new state ABORTING. This makes transitions from normative states to error states explicit in the STM, and serves as a disambiguation for which states may complete normally when normal end-states (CONCLUDED) are added in future commits. Notably,

[Qemu-block] [PULL 03/41] Blockjobs: documentation touchup

2018-03-13 Thread Kevin Wolf
From: John Snow Trivial; Document what the job creation flags do, and some general tidying. Signed-off-by: John Snow Signed-off-by: Kevin Wolf --- include/block/blockjob.h | 8 include/block/blockjob_int.h | 4 +++- 2 files

[Qemu-block] [PULL 06/41] iotests: add pause_wait

2018-03-13 Thread Kevin Wolf
From: John Snow Split out the pause command into the actual pause and the wait. Not every usage presently needs to resubmit a pause request. The intent with the next commit will be to explicitly disallow redundant or meaningless pause/resume requests, so the tests need to

[Qemu-block] [PULL 02/41] blockjobs: model single jobs as transactions

2018-03-13 Thread Kevin Wolf
From: John Snow model all independent jobs as single job transactions. It's one less case we have to worry about when we add more states to the transition machine. This way, we can just treat all job lifetimes exactly the same. This helps tighten assertions of the STM graph

Re: [Qemu-block] [PATCH v10 05/12] migration: introduce postcopy-only pending

2018-03-13 Thread John Snow
On 03/13/2018 12:14 PM, Vladimir Sementsov-Ogievskiy wrote: > > Hmm, I agree, it is the simplest thing we can do for now, and I'll > rethink later, > how (and is it worth doing) to go to postcopy automatically in case of > only-dirty-bitmaps. > Should I respin? Please do. I already staged

[Qemu-block] [PULL 01/41] blockjobs: fix set-speed kick

2018-03-13 Thread Kevin Wolf
From: John Snow If speed is '0' it's not actually "less than" the previous speed. Kick the job in this case too. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Update output of 051 and 186 after commit 1454509726719e0933c

2018-03-13 Thread Kevin Wolf
Am 06.03.2018 um 17:52 hat Thomas Huth geschrieben: > On 06.03.2018 17:45, Alberto Garcia wrote: > > Signed-off-by: Alberto Garcia > > --- > > tests/qemu-iotests/051.pc.out | 20 > > tests/qemu-iotests/186.out| 22 +++--- > > 2 files

Re: [Qemu-block] [PATCH v10 05/12] migration: introduce postcopy-only pending

2018-03-13 Thread Vladimir Sementsov-Ogievskiy
13.03.2018 18:35, Dr. David Alan Gilbert wrote: * Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: 13.03.2018 13:30, Dr. David Alan Gilbert wrote: * Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: 12.03.2018 18:30, Dr. David Alan Gilbert wrote: * Vladimir

Re: [Qemu-block] [PATCH v3 1/1] block/mirror: change the semantic of 'force' of block-job-cancel

2018-03-13 Thread Kevin Wolf
Am 13.03.2018 um 13:12 hat Jeff Cody geschrieben: > From: Liang Li > > When doing drive mirror to a low speed shared storage, if there was heavy > BLK IO write workload in VM after the 'ready' event, drive mirror block job > can't be canceled immediately, it would

Re: [Qemu-block] [PATCH v2 0/8] nbd block status base:allocation

2018-03-13 Thread Eric Blake
On 03/12/2018 10:21 AM, Vladimir Sementsov-Ogievskiy wrote: Hi all. Here is minimal realization of base:allocation context of NBD block-status extension, which allows to get block status through NBD. v2 changes are in each patch after "---" line. Vladimir Sementsov-Ogievskiy (8):

Re: [Qemu-block] [PATCH v2 8/8] iotests: new test 209 for NBD BLOCK_STATUS

2018-03-13 Thread Eric Blake
On 03/12/2018 10:21 AM, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy --- + +iotests.verify_image_format(supported_fmts=['qcow2']) Interesting that './check -nbd' doesn't run 209 (because that defaults to format -raw, but we

Re: [Qemu-block] [PATCH v10 05/12] migration: introduce postcopy-only pending

2018-03-13 Thread Dr. David Alan Gilbert
* Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: > 13.03.2018 13:30, Dr. David Alan Gilbert wrote: > > * Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: > > > 12.03.2018 18:30, Dr. David Alan Gilbert wrote: > > > > * Vladimir Sementsov-Ogievskiy

Re: [Qemu-block] [PATCH v2 5/8] nbd: BLOCK_STATUS for standard get_block_status function: client part

2018-03-13 Thread Eric Blake
On 03/12/2018 10:21 AM, Vladimir Sementsov-Ogievskiy wrote: Minimal realization: only one extent in server answer is supported. Flag NBD_CMD_FLAG_REQ_ONE is used to force this behavior. Signed-off-by: Vladimir Sementsov-Ogievskiy --- v2: - drop iotests changes, as

Re: [Qemu-block] [PATCH v2 7/8] iotests: add file_path helper

2018-03-13 Thread Eric Blake
On 03/12/2018 10:21 AM, Vladimir Sementsov-Ogievskiy wrote: Simple way to have auto generated filenames with auto cleanup. Like FilePath but without using 'with' statement and without additional indentation of the whole test. Signed-off-by: Vladimir Sementsov-Ogievskiy

Re: [Qemu-block] [PATCH v3 1/2] block: Fix flags in reopen queue

2018-03-13 Thread Kevin Wolf
Am 13.03.2018 um 15:20 hat Fam Zheng geschrieben: > Reopen flags are not synchronized according to the > bdrv_reopen_queue_child precedence until bdrv_reopen_prepare. It is a > bit too late: we already check the consistency in bdrv_check_perm before > that. > > This fixes the bug that when

  1   2   >