aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-07-11block: Add PreallocMode to BD.bdrv_truncate()Max Reitz14-15/+98
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 <mreitz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20170613202107.10125-2-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11iotests: add test 178 for qemu-img measureStefan Hajnoczi4-0/+615
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-id: 20170705125738.8777-10-stefanha@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qemu-iotests: support per-format golden output filesStefan Hajnoczi1-0/+5
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 all image formats and the format-dependent output is relevant. An ugly workaround is to copy-paste the test into multiple per-format test cases. This duplicates code and is not maintainable. This patch allows test cases to add per-format golden output files so a single test case can work correctly when format-dependent output must be checked: 123.out.qcow2 123.out.raw 123.out.vmdk ... This naming scheme is not composable with 123.out.nocache or 123.pc.out, two other scenarios where output files are split. I don't think it matters since few test cases need these features. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-id: 20170705125738.8777-9-stefanha@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qemu-img: add measure subcommandStefan Hajnoczi3-0/+270
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 <mlipchuk@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-id: 20170705125738.8777-8-stefanha@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qcow2: add bdrv_measure() supportStefan Hajnoczi1-0/+137
Use qcow2_calc_prealloc_size() to get the required file size. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-id: 20170705125738.8777-7-stefanha@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qcow2: extract image creation option parsingStefan Hajnoczi1-36/+73
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 <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-id: 20170705125738.8777-6-stefanha@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qcow2: make refcount size calculation conservativeStefan Hajnoczi1-41/+42
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 point calculation because the existing equation is hard to solve when inaccuracies are taken care of. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-id: 20170705125738.8777-5-stefanha@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qcow2: extract preallocation calculation functionStefan Hajnoczi1-59/+77
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 <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-id: 20170705125738.8777-4-stefanha@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11raw-format: add bdrv_measure() supportStefan Hajnoczi1-0/+26
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 <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-id: 20170705125738.8777-3-stefanha@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block: add bdrv_measure() APIStefan Hajnoczi4-0/+64
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 <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-id: 20170705125738.8777-2-stefanha@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11tests: Avoid non-portable 'echo -ARG'Eric Blake9-60/+61
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 makefile snippets or in documentation examples). But even for scripts where we require bash (and therefore, where echo does what we want by default), it is still possible to use 'shopt -s xpg_echo' to change bash's behavior of echo. And setting a good example never hurts when we are not sure if a snippet will be copied from a bash-only script to a general shell script (although I don't change the use of non-portable \e for ESC when we know the running shell is bash). Replace 'echo -n "..."' with 'printf %s "..."', and 'echo -e "..."' with 'printf %b "...\n"', with the optimization that the %s/%b argument can be omitted if the string being printed is a strict literal with no '%', '$', or '`' (we could technically also make this optimization when there are $ or `` substitutions but where we can prove their results will not be problematic, but proving that such substitutions are safe makes the patch less trivial compared to just being consistent). In the qemu-iotests check script, fix unusual shell quoting that would result in word-splitting if 'date' outputs a space. In test 051, take an opportunity to shorten the line. In test 068, get rid of a pointless second invocation of bash. CC: qemu-trivial@nongnu.org Signed-off-by: Eric Blake <eblake@redhat.com> Message-id: 20170703180950.9895-1-eblake@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11iotests: Add test for colon handlingMax Reitz3-0/+129
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20170702150510.23276-3-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11iotests: Use absolute paths for executablesMax Reitz1-0/+11
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 should undergo testing absolute. Besides "realpath", we also have to use "type -p" to support programs in $PATH. As a side effect, this fixes specifying these programs as symlinks for out-of-tree builds: Before, you would have to create two symlinks, one in the build and one in the source tree (the first one for common.config to find, the second one for the iotest to use). Now it is sufficient to create one in the build tree because common.config will resolve it. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20170702150510.23276-2-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11iotests: chown LUKS device before qemu-io launchesDaniel P. Berrange2-179/+177
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-io invocation will find udev has reset the permissions causing failure. Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170626123510.20134-6-berrange@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11iotests: add more LUKS hash combination testsDaniel P. Berrange2-8/+484
Add tests for sha224, sha512, sha384 and ripemd160 hash algorithms. Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170626123510.20134-5-berrange@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11iotests: reduce PBKDF iterations when testing LUKSDaniel P. Berrange4-60/+67
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 creating LUKS images, set the iteration time to a 10ms to reduce the time overhead for LUKS, since security does not matter in I/O tests. Previously a full 'check -luks' would take $ time ./check -luks Passed all 22 tests real 23m9.988s user 21m46.223s sys 0m22.841s Now it takes $ time ./check -luks Passed all 22 tests real 4m39.235s user 3m29.590s sys 0m24.234s Still slow compared to qcow2/raw, but much improved none the less. Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170626123510.20134-4-berrange@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11iotests: fix remainining tests to work with LUKSDaniel P. Berrange9-24/+82
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 scenario exercised is not relevant. The test 181 was broken when run with LUKS because it didn't take account of fact that $TEST_IMG was already in image opts syntax. The launch_qemu helper also didn't register the secret object providing the LUKS password. Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170626123510.20134-3-berrange@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11iotests: skip 159 & 170 with luks formatDaniel P. Berrange2-0/+2
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 Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170626123510.20134-2-berrange@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block: release persistent bitmaps on inactivateVladimir Sementsov-Ogievskiy3-6/+28
We should release them here to reload on invalidate cache. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20170628120530.31251-31-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qmp: block-dirty-bitmap-remove: remove persistentVladimir Sementsov-Ogievskiy2-1/+12
Remove persistent bitmap from the storage on block-dirty-bitmap-remove. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-30-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qcow2: add .bdrv_remove_persistent_dirty_bitmapVladimir Sementsov-Ogievskiy3-0/+45
Realize .bdrv_remove_persistent_dirty_bitmap interface. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-29-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block/dirty-bitmap: add bdrv_remove_persistent_dirty_bitmapVladimir Sementsov-Ogievskiy3-0/+24
Interface for removing persistent bitmap from its storage. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-28-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11iotests: test qcow2 persistent dirty bitmapVladimir Sementsov-Ogievskiy3-0/+111
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20170628120530.31251-27-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qmp: add x-debug-block-dirty-bitmap-sha256Vladimir Sementsov-Ogievskiy7-1/+78
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20170628120530.31251-26-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qmp: add autoload parameter to block-dirty-bitmap-addVladimir Sementsov-Ogievskiy2-3/+21
Optional. Default is false. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-25-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qmp: add persistent flag to block-dirty-bitmap-addVladimir Sementsov-Ogievskiy2-2/+24
Add optional 'persistent' flag to qmp command block-dirty-bitmap-add. Default is false. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-24-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qcow2: add .bdrv_can_store_new_dirty_bitmapVladimir Sementsov-Ogievskiy3-0/+56
Realize .bdrv_can_store_new_dirty_bitmap interface. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20170628120530.31251-23-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block: add bdrv_can_store_new_dirty_bitmapVladimir Sementsov-Ogievskiy3-0/+29
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 <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-22-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qcow2: store bitmaps on reopening image as read-onlyVladimir Sementsov-Ogievskiy3-0/+28
Store bitmaps and mark them read-only on reopening image as read-only. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20170628120530.31251-21-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qcow2: add persistent dirty bitmaps supportVladimir Sementsov-Ogievskiy3-0/+486
Store persistent dirty bitmaps in qcow2 image. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20170628120530.31251-20-vsementsov@virtuozzo.com [mreitz: Always assign ret in store_bitmap() in case of an error] Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block/dirty-bitmap: add bdrv_dirty_bitmap_next()Vladimir Sementsov-Ogievskiy2-0/+9
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-19-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block: introduce persistent dirty bitmapsVladimir Sementsov-Ogievskiy3-0/+34
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 <vsementsov@virtuozzo.com> Message-id: 20170628120530.31251-18-vsementsov@virtuozzo.com [mreitz: Fixed indentation] Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block: bdrv_close: release bitmaps after drv->bdrv_closeVladimir Sementsov-Ogievskiy1-3/+3
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 <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20170628120530.31251-17-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block/dirty-bitmap: add autoload field to BdrvDirtyBitmapVladimir Sementsov-Ogievskiy3-0/+22
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 <vsementsov@virtuozzo.com> Message-id: 20170628120530.31251-16-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qcow2: support .bdrv_reopen_bitmaps_rwVladimir Sementsov-Ogievskiy3-0/+64
Realize bdrv_reopen_bitmaps_rw interface. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20170628120530.31251-15-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block: new bdrv_reopen_bitmaps_rw interfaceVladimir Sementsov-Ogievskiy2-0/+26
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 <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20170628120530.31251-14-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block: refactor bdrv_reopen_commitVladimir Sementsov-Ogievskiy1-6/+8
Add bs local variable to simplify code. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-13-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qcow2: autoloading dirty bitmapsVladimir Sementsov-Ogievskiy3-2/+406
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: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-12-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block/dirty-bitmap: add readonly field to BdrvDirtyBitmapVladimir Sementsov-Ogievskiy4-0/+54
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 Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20170628120530.31251-11-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block/dirty-bitmap: fix comment for BlockDirtyBitmap.disabled fieldVladimir Sementsov-Ogievskiy1-1/+2
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20170628120530.31251-10-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qcow2: add bitmaps extensionVladimir Sementsov-Ogievskiy5-6/+593
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 resize if it has bitmaps. It will be fixed later. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-9-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11qcow2-refcount: rename inc_refcounts() and make it publicVladimir Sementsov-Ogievskiy2-28/+35
This is needed for the following patch, which will introduce refcounts checking for qcow2 bitmaps. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-8-vsementsov@virtuozzo.com [mreitz: s/inc_refcounts/qcow2_inc_refcounts_imrt/ in one more (new) place] Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block/dirty-bitmap: add deserialize_ones funcVladimir Sementsov-Ogievskiy4-0/+42
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 <vsementsov@virtuozzo.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-7-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11block: fix bdrv_dirty_bitmap_granularity signatureVladimir Sementsov-Ogievskiy2-2/+2
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 <vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-id: 20170628120530.31251-6-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11tests: add hbitmap iter testVladimir Sementsov-Ogievskiy1-0/+19
Test that hbitmap iter is resistant to bitmap resetting. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-5-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11hbitmap: improve dirty iterVladimir Sementsov-Ogievskiy2-23/+26
Make dirty iter resistant to resetting bits in corresponding HBitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-4-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11specs/qcow2: do not use wording 'bitmap header'Vladimir Sementsov-Ogievskiy1-3/+2
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' (which is extension of qcow2 header) Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-3-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11specs/qcow2: fix bitmap granularity qemu-specific noteVladimir Sementsov-Ogievskiy1-2/+1
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-2-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11mirror: Fix inconsistent backing AioContext for after mirroringsochin.jiang1-0/+1
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 <sochin.jiang@huawei.com> Message-id: 1498475064-39816-1-git-send-email-sochin.jiang@huawei.com [mreitz: Reworded commit message] Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-07-11iotests: 181 does not work for all formatsMax Reitz1-0/+2
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 <mreitz@redhat.com> Message-id: 20170621131157.16584-1-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>