Re: [Qemu-block] [PATCH v3 2/6] block: Add VFIO based NVMe driver

2017-07-11 Thread Fam Zheng
On Mon, 07/10 15:55, Stefan Hajnoczi wrote: > On Wed, Jul 05, 2017 at 09:36:31PM +0800, Fam Zheng wrote: > > +static bool nvme_identify(BlockDriverState *bs, int namespace, Error > > **errp) > > +{ > > +BDRVNVMeState *s = bs->opaque; > > +uint8_t *resp; > > +int r; > > +uint64_t

Re: [Qemu-block] [PATCH v3 3/6] block: Introduce bdrv_dma_map and bdrv_dma_unmap

2017-07-11 Thread Fam Zheng
On Tue, 07/11 12:28, Paolo Bonzini wrote: > On 11/07/2017 12:05, Stefan Hajnoczi wrote: > > On Mon, Jul 10, 2017 at 05:08:56PM +0200, Paolo Bonzini wrote: > >> On 10/07/2017 17:07, Stefan Hajnoczi wrote: > >>> On Wed, Jul 05, 2017 at 09:36:32PM +0800, Fam Zheng wrote: > Allow block driver to

Re: [Qemu-block] [Qemu-devel] [PATCH v4 0/4] Add shrink image for qcow2

2017-07-11 Thread Fam Zheng
On Tue, 07/11 16:35, Pavel Butsykin wrote: > On 11.07.2017 16:14, no-re...@patchew.org wrote: > > Hi, > > > > This series failed build test on s390x host. Please find the details below. > > > > Type: series > > Subject: [Qemu-devel] [PATCH v4 0/4] Add shrink image for qcow2 > > Message-id:

Re: [Qemu-block] [PATCH 15/35] backup: mark coroutine_fn

2017-07-11 Thread Stefan Hajnoczi
On Wed, Jul 05, 2017 at 12:03:26AM +0200, Marc-André Lureau wrote: > Signed-off-by: Marc-André Lureau > --- > include/block/block_backup.h | 4 ++-- > block/backup.c | 9 ++--- > 2 files changed, 8 insertions(+), 5 deletions(-) Reviewed-by: Stefan

Re: [Qemu-block] [PATCH v2] block: fix leaks in bdrv_open_driver()

2017-07-11 Thread Manos Pitsidianakis
On Tue, Jul 11, 2017 at 05:16:17PM +0200, Kevin Wolf wrote: Am 01.07.2017 um 17:39 hat Manos Pitsidianakis geschrieben: bdrv_open_driver() is called in two places, bdrv_new_open_driver() and bdrv_open_common(). In the latter, failure cleanup in is in its caller, bdrv_open_inherit(), which

Re: [Qemu-block] [PATCH v4 3/4] block: remove bdrv_truncate callback in blkdebug

2017-07-11 Thread Eric Blake
On 07/11/2017 11:37 AM, Manos Pitsidianakis wrote: > Now that bdrv_truncate is passed to bs->file by default, remove the > callback from block/blkdebug.c and set is_filter to true. This also automatically gives blkdebug access to bdrv_probe_blocksizes bdrv_probe_geometry bdrv_has_zero_init

Re: [Qemu-block] [PATCH v4 0/4] Add shrink image for qcow2

2017-07-11 Thread Max Reitz
On 2017-07-11 14:40, Pavel Butsykin wrote: > This patch add shrinking of the image file for qcow2. As a result, this allows > us to reduce the virtual image size and free up space on the disk without > copying the image. Image can be fragmented and shrink is done by punching > holes > in the

Re: [Qemu-block] [PATCH v4 4/4] qemu-iotests: add shrinking image test

2017-07-11 Thread Max Reitz
On 2017-07-11 14:40, Pavel Butsykin wrote: > Signed-off-by: Pavel Butsykin > --- > tests/qemu-iotests/163 | 170 > + > tests/qemu-iotests/163.out | 5 ++ > tests/qemu-iotests/group | 1 + > 3 files changed, 176

Re: [Qemu-block] [PATCH v4 3/4] qcow2: add shrink image support

2017-07-11 Thread Max Reitz
On 2017-07-11 14:40, Pavel Butsykin wrote: > This patch add shrinking of the image file for qcow2. As a result, this allows > us to reduce the virtual image size and free up space on the disk without > copying the image. Image can be fragmented and shrink is done by punching > holes > in the

[Qemu-block] [PATCH] block: check BlockDriverState object before dereference

2017-07-11 Thread P J P
From: Prasad J Pandit When processing ATA_CACHE_FLUSH ide controller command, BlockDriverState object could be null. Add check to avoid null pointer dereference. Reported-by: Kieron Shorrock Signed-off-by: Prasad J Pandit

Re: [Qemu-block] [PATCH v4 2/4] block: remove bdrv_media_changed

2017-07-11 Thread Eric Blake
On 07/11/2017 11:37 AM, Manos Pitsidianakis wrote: > This function is not used anywhere, so remove it. > Might be interesting to figure out when it WAS last used. If I grepped correctly, it was commit 21fcf360 back in May 2012? > Signed-off-by: Manos Pitsidianakis > ---

Re: [Qemu-block] [PATCH v4 1/4] block: pass bdrv_* methods to bs->file by default in block filters

2017-07-11 Thread Eric Blake
On 07/11/2017 11:37 AM, Manos Pitsidianakis wrote: > The following functions fail if bs->drv is a filter and does not > implement them: > > bdrv_probe_blocksizes > bdrv_probe_geometry > bdrv_truncate > bdrv_has_zero_init > bdrv_get_info > > Instead, the call should be passed to bs->file if it

[Qemu-block] [PATCH v4 1/4] block: pass bdrv_* methods to bs->file by default in block filters

2017-07-11 Thread Manos Pitsidianakis
The following functions fail if bs->drv is a filter and does not implement them: bdrv_probe_blocksizes bdrv_probe_geometry bdrv_truncate bdrv_has_zero_init bdrv_get_info Instead, the call should be passed to bs->file if it exists, to allow filter drivers to support those methods without

Re: [Qemu-block] [Qemu-devel] [PATCH v4 09/17] dirty-bitmap: Change bdrv_dirty_iter_next() to report byte offset

2017-07-11 Thread Eric Blake
On 07/03/2017 10:10 AM, Eric Blake wrote: > Thanks to recent cleanups, most callers were scaling a return value > of sectors into bytes (the exception, in qcow2-bitmap, will be > converted to byte-based iteration later). Update the interface to > do the scaling internally instead. > >

[Qemu-block] [PATCH v4 2/4] block: remove bdrv_media_changed

2017-07-11 Thread Manos Pitsidianakis
This function is not used anywhere, so remove it. Signed-off-by: Manos Pitsidianakis --- block.c | 14 -- block/raw-format.c| 6 -- include/block/block.h | 1 - include/block/block_int.h | 1 - 4 files changed, 22

[Qemu-block] [PATCH v4 4/4] block: add default implementations for bdrv_co_get_block_status()

2017-07-11 Thread Manos Pitsidianakis
bdrv_co_get_block_status_from_file() and bdrv_co_get_block_status_from_backing() set *file to bs->file and bs->backing respectively, so that bdrv_co_get_block_status() can recurse to them. Future block drivers won't have to duplicate code to implement this. Reviewed-by: Fam Zheng

[Qemu-block] [PATCH v4 0/4] block: Block driver callbacks fixes

2017-07-11 Thread Manos Pitsidianakis
This series makes implementing some of the bdrv_* callbacks easier for block filters by passing requests to bs->file if bs->drv doesn't implement it instead of failing, and adding default bdrv_co_get_block_status() implementations. This is based against Kevin Wolf's block branch, commit

[Qemu-block] [PATCH v4 3/4] block: remove bdrv_truncate callback in blkdebug

2017-07-11 Thread Manos Pitsidianakis
Now that bdrv_truncate is passed to bs->file by default, remove the callback from block/blkdebug.c and set is_filter to true. Signed-off-by: Manos Pitsidianakis --- block/blkdebug.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/block/blkdebug.c

[Qemu-block] [PULL 83/85] block/qcow2: falloc/full preallocating growth

2017-07-11 Thread Max Reitz
Implement the preallocation modes falloc and full for growing qcow2 images. Signed-off-by: Max Reitz Message-id: 20170613202107.10125-15-mre...@redhat.com Reviewed-by: Stefan Hajnoczi Signed-off-by: Max Reitz --- block/qcow2.h

[Qemu-block] [PULL 79/85] block/qcow2: Lock s->lock in preallocate()

2017-07-11 Thread Max Reitz
preallocate() is and will be called only from places that do not otherwise need to lock s->lock: Currently that is qcow2_create2(), as of a future patch it will be called from qcow2_truncate(), too. It therefore makes sense to move locking that mutex into preallocate() itself. Signed-off-by: Max

[Qemu-block] [PULL 80/85] block/qcow2: Metadata preallocation for truncate

2017-07-11 Thread Max Reitz
We can support PREALLOC_MODE_METADATA by invoking preallocate() in qcow2_truncate(). Signed-off-by: Max Reitz Message-id: 20170613202107.10125-12-mre...@redhat.com Reviewed-by: Stefan Hajnoczi Signed-off-by: Max Reitz ---

[Qemu-block] [PULL 74/85] block/file-posix: Small fixes in raw_create()

2017-07-11 Thread Max Reitz
Variables should be declared at the start of a block, and if a certain parameter value is not supported it may be better to return -ENOTSUP instead of -EINVAL. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé

[Qemu-block] [PULL 85/85] iotests: Add preallocated growth test for qcow2

2017-07-11 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 20170613202107.10125-17-mre...@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/125 | 130 +++ tests/qemu-iotests/125.out | 386

[Qemu-block] [PULL 84/85] iotests: Add preallocated resize test for raw

2017-07-11 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 20170613202107.10125-16-mre...@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/106 | 92 ++

[Qemu-block] [PULL 75/85] block/file-posix: Extract raw_regular_truncate()

2017-07-11 Thread Max Reitz
This functionality is part of raw_create() which we will be able to reuse nicely in raw_truncate(). Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Message-id:

[Qemu-block] [PULL 73/85] qemu-img: Expose PreallocMode for resizing

2017-07-11 Thread Max Reitz
Add a --preallocation command line option to qemu-img resize which can be used to set the PreallocMode parameter of blk_truncate(). While touching this code, fix the fact that we did not handle errors returned by blk_getlength(). Signed-off-by: Max Reitz Message-id:

[Qemu-block] [PULL 82/85] block/qcow2: Rename "fail_block" to just "fail"

2017-07-11 Thread Max Reitz
Now alloc_refcount_block() only contains a single fail label, so it makes more sense to just name it "fail" instead of "fail_block". Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 20170613202107.10125-14-mre...@redhat.com Signed-off-by:

[Qemu-block] [PULL 81/85] block/qcow2: Add qcow2_refcount_area()

2017-07-11 Thread Max Reitz
This function creates a collection of self-describing refcount structures (including a new refcount table) at the end of a qcow2 image file. Optionally, these structures can also describe a number of additional clusters beyond themselves; this will be important for preallocated truncation, which

[Qemu-block] [PULL 69/85] iotests: add test 178 for qemu-img measure

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id: 20170705125738.8777-10-stefa...@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/178 | 170

[Qemu-block] [PULL 72/85] block: Add PreallocMode to blk_truncate()

2017-07-11 Thread Max Reitz
blk_truncate() itself will pass that value to bdrv_truncate(), and all callers of blk_truncate() just set the parameter to PREALLOC_MODE_OFF for now. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id:

[Qemu-block] [PULL 78/85] block/qcow2: Generalize preallocate()

2017-07-11 Thread Max Reitz
This patch adds two new parameters to the preallocate() function so we will be able to use it not just for preallocating a new image but also for preallocated image growth. The offset parameter allows the caller to specify a virtual offset from which to start preallocating. For newly created

[Qemu-block] [PULL 77/85] block/file-posix: Preallocation for truncate

2017-07-11 Thread Max Reitz
By using raw_regular_truncate() in raw_truncate(), we can now easily support preallocation. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 20170613202107.10125-9-mre...@redhat.com Signed-off-by: Max Reitz ---

[Qemu-block] [PULL 76/85] block/file-posix: Generalize raw_regular_truncate

2017-07-11 Thread Max Reitz
Currently, raw_regular_truncate() is intended for setting the size of a newly created file. However, we also want to use it for truncating an existing file in which case only the newly added space (when growing) should be preallocated. This also means that if resizing failed, we should try to

[Qemu-block] [PULL 68/85] qemu-iotests: support per-format golden output files

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi Some tests produce format-dependent output. Either the difference is filtered out and ignored, or the test case is format-specific so we don't need to worry about per-format output differences. There is a third case: the test script is the same for

[Qemu-block] [PULL 65/85] qcow2: extract image creation option parsing

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi The image creation options parsed by qcow2_create() are also needed to implement .bdrv_measure(). Extract the parsing code, including input validation. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia

[Qemu-block] [PULL 71/85] block: Add PreallocMode to bdrv_truncate()

2017-07-11 Thread Max Reitz
For block drivers that just pass a truncate request to the underlying protocol, we can now pass the preallocation mode instead of aborting if it is not PREALLOC_MODE_OFF. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id:

[Qemu-block] [PULL 66/85] qcow2: add bdrv_measure() support

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi Use qcow2_calc_prealloc_size() to get the required file size. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id: 20170705125738.8777-7-stefa...@redhat.com Signed-off-by: Max Reitz

[Qemu-block] [PULL 64/85] qcow2: make refcount size calculation conservative

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi The refcount metadata size calculation is inaccurate and can produce numbers that are too small. This is bad because we should calculate a conservative number - one that is guaranteed to be large enough. This patch switches the approach to a fixed

[Qemu-block] [PULL 60/85] tests: Avoid non-portable 'echo -ARG'

2017-07-11 Thread Max Reitz
From: Eric Blake POSIX says that backslashes in the arguments to 'echo', as well as any use of 'echo -n' and 'echo -e', are non-portable; it recommends people should favor 'printf' instead. This is definitely true where we do not control which shell is running (such as in

[Qemu-block] [PULL 57/85] iotests: chown LUKS device before qemu-io launches

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" On some distros, whenever you close a block device file descriptor there is a udev rule that resets the file permissions. This can race with the test script when we run qemu-io multiple times against the same block device. Occasionally the second

[Qemu-block] [PULL 58/85] iotests: Use absolute paths for executables

2017-07-11 Thread Max Reitz
A user may specify a relative path for accessing qemu, qemu-img, etc. through environment variables ($QEMU_PROG and friends) or a symlink. If a test decides to change its working directory, relative paths will cease to work, however. Work around this by making all of the paths to programs that

[Qemu-block] [PULL 50/85] qcow2: add .bdrv_remove_persistent_dirty_bitmap

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Realize .bdrv_remove_persistent_dirty_bitmap interface. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow Message-id:

[Qemu-block] [PULL 49/85] block/dirty-bitmap: add bdrv_remove_persistent_dirty_bitmap

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Interface for removing persistent bitmap from its storage. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow Message-id:

[Qemu-block] [PULL 67/85] qemu-img: add measure subcommand

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi The measure subcommand calculates the size required by a new image file. This can be used by users or management tools that need to allocate space on an LVM volume, SAN LUN, etc before creating or converting an image file. Suggested-by: Maor Lipchuk

[Qemu-block] [PULL 70/85] block: Add PreallocMode to BD.bdrv_truncate()

2017-07-11 Thread Max Reitz
Add a PreallocMode parameter to the bdrv_truncate() function implemented by each block driver. Currently, we always pass PREALLOC_MODE_OFF and no driver accepts anything else. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id:

[Qemu-block] [PULL 45/85] qmp: add persistent flag to block-dirty-bitmap-add

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Add optional 'persistent' flag to qmp command block-dirty-bitmap-add. Default is false. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev Reviewed-by: Max Reitz

[Qemu-block] [PULL 41/85] qcow2: add persistent dirty bitmaps support

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Store persistent dirty bitmaps in qcow2 image. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20170628120530.31251-20-vsement...@virtuozzo.com [mreitz:

[Qemu-block] [PULL 43/85] block: add bdrv_can_store_new_dirty_bitmap

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy This will be needed to check some restrictions before making bitmap persistent in qmp-block-dirty-bitmap-add (this functionality will be added by future patch) Signed-off-by: Vladimir Sementsov-Ogievskiy

[Qemu-block] [PULL 42/85] qcow2: store bitmaps on reopening image as read-only

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Store bitmaps and mark them read-only on reopening image as read-only. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id:

[Qemu-block] [PULL 62/85] raw-format: add bdrv_measure() support

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi Maximum size calculation is trivial for the raw format: it's just the requested image size (because there is no metadata). Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id:

[Qemu-block] [PULL 61/85] block: add bdrv_measure() API

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi bdrv_measure() provides a conservative maximum for the size of a new image. This information is handy if storage needs to be allocated (e.g. a SAN or an LVM volume) ahead of time. Signed-off-by: Stefan Hajnoczi Reviewed-by:

[Qemu-block] [PULL 63/85] qcow2: extract preallocation calculation function

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi Calculating the preallocated image size will be needed to implement .bdrv_measure(). Extract the code out into a separate function. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id:

[Qemu-block] [PULL 59/85] iotests: Add test for colon handling

2017-07-11 Thread Max Reitz
Reviewed-by: Eric Blake Signed-off-by: Max Reitz Message-id: 20170702150510.23276-3-mre...@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/126 | 105 + tests/qemu-iotests/126.out

[Qemu-block] [PULL 56/85] iotests: add more LUKS hash combination tests

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" Add tests for sha224, sha512, sha384 and ripemd160 hash algorithms. Reviewed-by: Max Reitz Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrange Message-id:

[Qemu-block] [PULL 55/85] iotests: reduce PBKDF iterations when testing LUKS

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" By default the PBKDF algorithm used with LUKS is tuned based on the number of iterations to produce 1 second of running time. This makes running the I/O test with the LUKS format orders of magnitude slower than with qcow2/raw formats. When

[Qemu-block] [PULL 54/85] iotests: fix remainining tests to work with LUKS

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" The tests 033, 140, 145 and 157 were all broken when run with LUKS, since they did not correctly use the required image opts args syntax to specify the decryption secret. Further, the 120 test simply does not make sense to run with luks, as the

[Qemu-block] [PULL 46/85] qmp: add autoload parameter to block-dirty-bitmap-add

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Optional. Default is false. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev Reviewed-by: Max Reitz Reviewed-by: John Snow

[Qemu-block] [PULL 53/85] iotests: skip 159 & 170 with luks format

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" While the qemu-img dd command does accept --image-opts this is not sufficient to make it work with the LUKS image yet. This is because bdrv_create() still always requires the non-image-opts syntax. Thus we must skip 159/170 with luks for now

[Qemu-block] [PULL 33/85] qcow2: autoloading dirty bitmaps

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Auto loading bitmaps are bitmaps in Qcow2, with the AUTO flag set. They are loaded when the image is opened and become BdrvDirtyBitmaps for the corresponding drive. Extra data in bitmaps is not supported for now. Signed-off-by:

Re: [Qemu-block] [PATCH v6 1/2] bitmaps.md: Convert to rST; move it into 'interop' dir

2017-07-11 Thread John Snow
On 07/10/2017 10:36 PM, Eric Blake wrote: On 07/10/2017 03:15 AM, Kashyap Chamarthy wrote: This is part of the on-going effort to convert QEMU upstream documentation syntax to reStructuredText (rST). The conversion to rST was done using: $ pandoc -f markdown -t rst bitmaps.md -o

[Qemu-block] [PULL 51/85] qmp: block-dirty-bitmap-remove: remove persistent

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Remove persistent bitmap from the storage on block-dirty-bitmap-remove. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow

[Qemu-block] [PULL 44/85] qcow2: add .bdrv_can_store_new_dirty_bitmap

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Realize .bdrv_can_store_new_dirty_bitmap interface. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Reviewed-by: Max Reitz Message-id:

[Qemu-block] [PULL 52/85] block: release persistent bitmaps on inactivate

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy We should release them here to reload on invalidate cache. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20170628120530.31251-31-vsement...@virtuozzo.com

[Qemu-block] [PULL 32/85] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy It will be needed in following commits for persistent bitmaps. If bitmap is loaded from read-only storage (and we can't mark it "in use" in this storage) corresponding BdrvDirtyBitmap should be read-only. Signed-off-by: Vladimir

[Qemu-block] [PULL 48/85] iotests: test qcow2 persistent dirty bitmap

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20170628120530.31251-27-vsement...@virtuozzo.com Signed-off-by: Max Reitz ---

[Qemu-block] [PULL 47/85] qmp: add x-debug-block-dirty-bitmap-sha256

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20170628120530.31251-26-vsement...@virtuozzo.com Signed-off-by: Max Reitz --- tests/Makefile.include | 2 +-

[Qemu-block] [PULL 21/85] iotests: 181 does not work for all formats

2017-07-11 Thread Max Reitz
Test 181 only works for formats which support live migration (naturally, as it is a live migration test). Disable it for all formats which do not. Signed-off-by: Max Reitz Message-id: 20170621131157.16584-1-mre...@redhat.com Reviewed-by: John Snow

[Qemu-block] [PULL 34/85] block: refactor bdrv_reopen_commit

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Add bs local variable to simplify code. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Message-id: 20170628120530.31251-13-vsement...@virtuozzo.com Signed-off-by: Max

[Qemu-block] [PULL 37/85] block/dirty-bitmap: add autoload field to BdrvDirtyBitmap

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Mirror AUTO flag from Qcow2 bitmap in BdrvDirtyBitmap. This will be needed in future, to save this flag back to Qcow2 for persistent bitmaps. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id:

[Qemu-block] [PULL 39/85] block: introduce persistent dirty bitmaps

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy New field BdrvDirtyBitmap.persistent means, that bitmap should be saved by format driver in .bdrv_close and .bdrv_inactivate. No format driver supports it for now. Signed-off-by: Vladimir Sementsov-Ogievskiy

[Qemu-block] [PULL 38/85] block: bdrv_close: release bitmaps after drv->bdrv_close

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Release bitmaps after 'if (bs->drv) { ... }' block. This will allow format driver to save persistent bitmaps, which will appear in following commits. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by:

[Qemu-block] [PULL 35/85] block: new bdrv_reopen_bitmaps_rw interface

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Add format driver handler, which should mark loaded read-only bitmaps as 'IN_USE' in the image and unset read_only field in corresponding BdrvDirtyBitmap's. Signed-off-by: Vladimir Sementsov-Ogievskiy

[Qemu-block] [PULL 40/85] block/dirty-bitmap: add bdrv_dirty_bitmap_next()

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow Message-id: 20170628120530.31251-19-vsement...@virtuozzo.com Signed-off-by: Max

[Qemu-block] [PULL 36/85] qcow2: support .bdrv_reopen_bitmaps_rw

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Realize bdrv_reopen_bitmaps_rw interface. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Reviewed-by: Max Reitz Message-id:

[Qemu-block] [PULL 29/85] qcow2-refcount: rename inc_refcounts() and make it public

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy This is needed for the following patch, which will introduce refcounts checking for qcow2 bitmaps. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John

[Qemu-block] [PULL 28/85] block/dirty-bitmap: add deserialize_ones func

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Add bdrv_dirty_bitmap_deserialize_ones() function, which is needed for qcow2 bitmap loading, to handle unallocated bitmap parts, marked as all-ones. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by:

[Qemu-block] [PULL 27/85] block: fix bdrv_dirty_bitmap_granularity signature

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Make getter signature const-correct. This allows other functions with const dirty bitmap parameter use bdrv_dirty_bitmap_granularity(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake

[Qemu-block] [PULL 25/85] hbitmap: improve dirty iter

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Make dirty iter resistant to resetting bits in corresponding HBitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow

[Qemu-block] [PULL 26/85] tests: add hbitmap iter test

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Test that hbitmap iter is resistant to bitmap resetting. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev Reviewed-by: Max Reitz Reviewed-by:

[Qemu-block] [PULL 24/85] specs/qcow2: do not use wording 'bitmap header'

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy A bitmap directory entry is sometimes called a 'bitmap header'. This patch leaves only one name - 'bitmap directory entry'. The name 'bitmap header' creates misunderstandings with 'qcow2 header' and 'qcow2 bitmap header extension'

[Qemu-block] [PULL 16/85] block: rip out all traces of password prompting

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" Now that qcow & qcow2 are wired up to get encryption keys via the QCryptoSecret object, nothing is relying on the interactive prompting for passwords. All the code related to password prompting can thus be ripped out. Reviewed-by: Alberto Garcia

[Qemu-block] [PULL 31/85] block/dirty-bitmap: fix comment for BlockDirtyBitmap.disabled field

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Reviewed-by: Max Reitz Message-id: 20170628120530.31251-10-vsement...@virtuozzo.com Signed-off-by: Max

[Qemu-block] [PULL 20/85] docs: document encryption options for qcow, qcow2 and luks

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" Expand the image format docs to cover the new options for the qcow, qcow2 and luks disk image formats Reviewed-by: Alberto Garcia Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrange

[Qemu-block] [PULL 23/85] specs/qcow2: fix bitmap granularity qemu-specific note

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Message-id: 20170628120530.31251-2-vsement...@virtuozzo.com Signed-off-by: Max Reitz ---

[Qemu-block] [PULL 30/85] qcow2: add bitmaps extension

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Add bitmap extension as specified in docs/specs/qcow2.txt. For now, just mirror extension header into Qcow2 state and check constraints. Also, calculate refcounts for qcow2 bitmaps, to not break qemu-img check. For now, disable image

[Qemu-block] [PULL 17/85] block: remove all encryption handling APIs

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" Now that all encryption keys must be provided upfront via the QCryptoSecret API and associated block driver properties there is no need for any explicit encryption handling APIs in the block layer. Encryption can be handled transparently within the

[Qemu-block] [PULL 15/85] iotests: enable tests 134 and 158 to work with qcow (v1)

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" The 138 and 158 iotests exercise the legacy qcow2 aes encryption code path and they work fine with qcow v1 too. Reviewed-by: Alberto Garcia Reviewed-by: Max Reitz Signed-off-by: Daniel P. Berrange

[Qemu-block] [PULL 13/85] qcow2: add support for LUKS encryption format

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" This adds support for using LUKS as an encryption format with the qcow2 file, using the new encrypt.format parameter to request "luks" format. e.g. # qemu-img create --object secret,data=123456,id=sec0 \ -f qcow2 -o

[Qemu-block] [PULL 19/85] qcow2: report encryption specific image information

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" Currently 'qemu-img info' reports a simple "encrypted: yes" field. This is not very useful now that qcow2 can support multiple encryption formats. Users want to know which format is in use and some data related to it. Wire up usage of the

[Qemu-block] [PULL 22/85] mirror: Fix inconsistent backing AioContext for after mirroring

2017-07-11 Thread Max Reitz
From: "sochin.jiang" mirror_complete opens the backing chain, which should have the same AioContext as the top when using iothreads. Make the code guarantee this, which fixes a failed assertion in bdrv_attach_child. Signed-off-by: sochin.jiang

[Qemu-block] [PULL 14/85] qcow2: add iotests to cover LUKS encryption support

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" This extends the 087 iotest to cover LUKS encryption when doing blockdev-add. Two further tests are added to validate read/write of LUKS encrypted images with a single file and with a backing file. Reviewed-by: Alberto Garcia

[Qemu-block] [PULL 06/85] iotests: skip 048 with qcow which doesn't support resize

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" Test 048 is designed to verify data preservation during an image resize. The qcow (v1) format impl has never supported resize so always fails. Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Signed-off-by:

[Qemu-block] [PULL 18/85] block: pass option prefix down to crypto layer

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" While the crypto layer uses a fixed option name "key-secret", the upper block layer may have a prefix on the options. e.g. "encrypt.key-secret", in order to avoid clashes between crypto option names & other block option names. To ensure the crypto

[Qemu-block] [PULL 10/85] qcow2: make qcow2_encrypt_sectors encrypt in place

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" Instead of requiring separate input/output buffers for encrypting data, change qcow2_encrypt_sectors() to assume use of a single buffer, encrypting in place. The current callers all used the same buffer for input/output already. Signed-off-by:

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

2017-07-11 Thread Max Reitz
The following changes since commit 29741be341d50e4311e42ca3199f9b0bcfd4f5d2: Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20170710.0' into staging (2017-07-11 13:47:28 +0100) are available in the git repository at: git://github.com/XanClic/qemu.git

[Qemu-block] [PULL 01/85] block: expose crypto option names / defs to other drivers

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" The block/crypto.c defines a set of QemuOpts that provide parameters for encryption. This will also be needed by the qcow/qcow2 integration, so expose the relevant pieces in a new block/crypto.h header. Some helper methods taking QemuOpts are

[Qemu-block] [PULL 05/85] iotests: skip 042 with qcow which dosn't support zero sized images

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" Test 042 is designed to verify operation with zero sized images. Such images are not supported with qcow (v1), so this test has always failed. Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Signed-off-by:

[Qemu-block] [PULL 12/85] qcow2: extend specification to cover LUKS encryption

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" Update the qcow2 specification to describe how the LUKS header is placed inside a qcow2 file, when using LUKS encryption for the qcow2 payload instead of the legacy AES-CBC encryption Reviewed-by: Eric Blake Reviewed-by:

[Qemu-block] [PULL 11/85] qcow2: convert QCow2 to use QCryptoBlock for encryption

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" This converts the qcow2 driver to make use of the QCryptoBlock APIs for encrypting image content, using the legacy QCow2 AES scheme. With this change it is now required to use the QCryptoSecret object for providing passwords, instead of the

[Qemu-block] [PULL 09/85] qcow: convert QCow to use QCryptoBlock for encryption

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" This converts the qcow driver to make use of the QCryptoBlock APIs for encrypting image content. This is only wired up to permit use of the legacy QCow encryption format. Users who wish to have the strong LUKS format should switch to qcow2 instead.

  1   2   >