summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | mirror: Fix bdrv_has_zero_init() useMax Reitz2019-08-194-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bdrv_has_zero_init() only has meaning for newly created images or image areas. If the mirror job itself did not create the image, it cannot rely on bdrv_has_zero_init()'s result to carry any meaning. This is the case for drive-mirror with mode=existing and always for blockdev-mirror. Note that we only have to zero-initialize the target with sync=full, because other modes actually do not promise that the target will contain the same data as the source after the job -- sync=top only promises to copy anything allocated in the top layer, and sync=none will only copy new I/O. (Which is how mirror has always handled it.) Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190724171239.8764-3-mreitz@redhat.com Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
| * | qemu-img: Fix bdrv_has_zero_init() use in convertMax Reitz2019-08-191-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bdrv_has_zero_init() only has meaning for newly created images or image areas. If qemu-img convert did not create the image itself, it cannot rely on bdrv_has_zero_init()'s result to carry any meaning. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190724171239.8764-2-mreitz@redhat.com Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
| * | LUKS: support preallocationMaxim Levitsky2019-08-192-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | preallocation=off and preallocation=metadata both allocate luks header only, and preallocation=falloc/full is passed to underlying file. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1534951 Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-id: 20190716161901.1430-1-mlevitsk@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* | | Merge remote-tracking branch 'remotes/rth/tags/pull-dt-20190819' into stagingPeter Maydell2019-08-195-30/+79
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement parameter fields. Push warning pragmas into the generated code. # gpg: Signature made Mon 19 Aug 2019 16:14:41 BST # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth/tags/pull-dt-20190819: target/riscv: Remove redundant declaration pragmas decodetree: Suppress redundant declaration warnings decodetree: Allow !function with no input bits Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | target/riscv: Remove redundant declaration pragmasRichard Henderson2019-08-191-18/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are now generated by decodetree itself. Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Acked-by: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
| * | decodetree: Suppress redundant declaration warningsRichard Henderson2019-08-191-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can tell that a decodetree input file is "secondary" when it uses an argument set marked "!extern". This indicates that at least one of the insn translation functions will have already been declared by the "primary" input file, but given only the secondary we cannot tell which. Avoid redundant declaration warnings by suppressing them with pragmas. Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
| * | decodetree: Allow !function with no input bitsRichard Henderson2019-08-194-12/+56
| |/ | | | | | | | | | | | | | | Call this form a "parameter", returning a value extracted from the DisasContext. Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* | Merge remote-tracking branch ↵Peter Maydell2019-08-1920-285/+342
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/stsquad/tags/pull-softfloat-headers-190819-1' into staging Softfloat updates - minor refactoring of constants - drop LIT64 macro - re-organise header inclusion # gpg: Signature made Mon 19 Aug 2019 12:08:37 BST # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full] # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-softfloat-headers-190819-1: targets (various): use softfloat-helpers.h where we can target/riscv: rationalise softfloat includes target/mips: rationalise softfloat includes fpu: rename softfloat-specialize.h -> .inc.c fpu: make softfloat-macros "self-contained" fpu: move inline helpers into a separate header fpu: remove the LIT64 macro target/m68k: replace LIT64 with UINT64_C macros fpu: replace LIT64 with UINT64_C macros fpu: use min/max values from stdint.h for integral overflow fpu: convert float[16/32/64]_squash_denormal to new modern style fpu: replace LIT64 usage with UINT64_C for specialize constants Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * targets (various): use softfloat-helpers.h where we canAlex Bennée2019-08-196-7/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | Generally the cpu and non-FP helper files just want to manipulate the softfloat flags. For this they can just use the -helpers.h include which brings in a minimal number of inline helpers. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
| * target/riscv: rationalise softfloat includesAlex Bennée2019-08-193-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | We should avoid including the whole of softfloat headers in cpu.h and explicitly include it only where we will be calling softfloat functions. We can use the -types.h and -helpers.h in cpu.h for the few bits that are global. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Palmer Dabbelt <palmer@sifive.com>
| * target/mips: rationalise softfloat includesAlex Bennée2019-08-195-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | We should avoid including the whole of softfloat headers in cpu.h and explicitly include it only where we will be calling softfloat functions. We can use the -types.h in cpu.h for the few bits that are global. We also move the restore_snan_bit_mode into internal.h and include -helpers.h there. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
| * fpu: rename softfloat-specialize.h -> .inc.cAlex Bennée2019-08-192-1/+1
| | | | | | | | | | | | | | | | | | | | | | This is not a normal header and should only be included in the main softfloat.c file to bring in the various target specific specialisations. Indeed as it contains non-inlined C functions it is not even a legal header. Rename it to match our included C convention. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
| * fpu: make softfloat-macros "self-contained"Alex Bennée2019-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | The macros use the "flags" type and to be consistent if anyone just needs the macros we should bring in the header we need. There is an outstanding TODO to audit the use of "flags" and replace with bool at which point this include could be dropped. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
| * fpu: move inline helpers into a separate headerAlex Bennée2019-08-192-62/+133
| | | | | | | | | | | | | | | | | | | | | | There are a bunch of users of the inline helpers who do not need access to the entire softfloat API. Move those inline helpers into a new header file which can be included without bringing in the rest of the world. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
| * fpu: remove the LIT64 macroAlex Bennée2019-08-191-2/+0Star
| | | | | | | | | | | | | | Now the rest of the code has been cleaned up we can remove this. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
| * target/m68k: replace LIT64 with UINT64_C macrosAlex Bennée2019-08-191-49/+49
| | | | | | | | | | | | | | | | In our quest to eliminate the home rolled LIT64 macro we fixup usage inside for m68k's many constants. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
| * fpu: replace LIT64 with UINT64_C macrosAlex Bennée2019-08-192-62/+62
| | | | | | | | | | | | | | | | | | In our quest to eliminate the home rolled LIT64 macro we fixup usage inside the softfloat code. While we are at it we remove some of the extraneous spaces to closer fit the house style. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
| * fpu: use min/max values from stdint.h for integral overflowAlex Bennée2019-08-191-17/+15Star
| | | | | | | | | | | | | | | | | | Remove some more use of LIT64 while making the meaning more clear. We also avoid the need of casts as the results by definition fit into the return type. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
| * fpu: convert float[16/32/64]_squash_denormal to new modern styleAlex Bennée2019-08-191-63/+49Star
| | | | | | | | | | | | | | | | | | | | This also allows us to remove the extractFloat16exp/frac helpers. We avoid using the floatXX_pack_raw functions as they are slight overkill for masking out all but the top bit of the number. The generated code is almost exactly the same as makes no difference to the pre-conversion code. Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
| * fpu: replace LIT64 usage with UINT64_C for specialize constantsAlex Bennée2019-08-191-13/+13
| | | | | | | | | | | | | | | | We have a wrapper that does the right thing from stdint.h so lets use it for our constants in softfloat-specialize.h Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* | Merge remote-tracking branch ↵Peter Maydell2019-08-195-33/+46
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/huth-gitlab/tags/pull-request-2019-08-17' into staging - Run the iotest during "make check" # gpg: Signature made Sat 17 Aug 2019 09:46:13 BST # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * remotes/huth-gitlab/tags/pull-request-2019-08-17: gitlab-ci: Remove qcow2 tests that are handled by "make check" already tests: Run the iotests during "make check" again block: fix NetBSD qemu-iotests failure Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | gitlab-ci: Remove qcow2 tests that are handled by "make check" alreadyThomas Huth2019-08-171-9/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since most iotests are now run during "make check" already, we do not need to test them explicitly from the gitlab-ci.yml script anymore. And while we're at it, add some of the new non-auto tests >= 246 instead. Message-Id: <20190717111947.30356-5-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * | tests: Run the iotests during "make check" againThomas Huth2019-08-173-22/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | People often forget to run the iotests before submitting patches or pull requests - this is likely due to the fact that we do not run the tests during our mandatory "make check" tests yet. Now that we've got a proper "auto" group of iotests that should be fine to run in every environment, we can enable the iotests during "make check" again by running the "auto" tests by default from the check-block.sh script. Some cases still need to be checked first, though: iotests need bash and GNU sed (otherwise they fail), and if gprof is enabled, it spoils the output of some test cases causing them to fail. So if we detect that one of the required programs is missing or that gprof is enabled, we still have to skip the iotests to avoid failures. And finally, since we are using check-block.sh now again, this patch also removes the qemu-iotests-quick.sh script since we do not need that anymore (and having two shell wrapper scripts around the block tests seems rather confusing than helpful). Message-Id: <20190717111947.30356-4-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> [AJB: -makecheck to check-block.sh, move check-block to start and gate it] Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
| * | block: fix NetBSD qemu-iotests failurePaolo Bonzini2019-08-171-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opening a block device on NetBSD has an additional step compared to other OSes, corresponding to raw_normalize_devicepath. The error message in that function is slightly different from that in raw_open_common and this was causing spurious failures in qemu-iotests. However, in general it is not important to know what exact step was failing, for example in the qemu-iotests case the error message contains the fairly unequivocal "No such file or directory" text from strerror. We can thus fix the failures by standardizing on a single error message for both raw_open_common and raw_normalize_devicepath; in fact, we can even use error_setg_file_open to make sure the error message is the same as in the rest of QEMU. Message-Id: <20190725095920.28419-1-pbonzini@redhat.com> Tested-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
* | Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into stagingPeter Maydell2019-08-194-73/+37Star
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull request Stable notes: patches one and two can be considered for the next -stable release. # gpg: Signature made Sat 17 Aug 2019 00:15:50 BST # gpg: using RSA key F9B7ABDBBCACDF95BE76CBD07DEF8106AAFC390E # gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" [full] # Primary key fingerprint: FAEB 9711 A12C F475 812F 18F2 88A9 064D 1835 61EB # Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76 CBD0 7DEF 8106 AAFC 390E * remotes/jnsnow/tags/ide-pull-request: hw/ide/atapi: Use the ldst API Revert "ide/ahci: Check for -ECANCELED in aio callbacks" dma-helpers: ensure AIO callback is invoked after cancellation Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | hw/ide/atapi: Use the ldst APIPhilippe Mathieu-Daudé2019-08-171-52/+28Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The big-endian load/store functions are already provided by "qemu/bswap.h". Avoid code duplication, use the generic API. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20190808130454.9930-1-philmd@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * | Revert "ide/ahci: Check for -ECANCELED in aio callbacks"John Snow2019-08-172-17/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0d910cfeaf2076b116b4517166d5deb0fea76394. It's not correct to just ignore an error code in a callback; we need to handle that error and possible report failure to the guest so that they don't wait indefinitely for an operation that will now never finish. This ought to help cases reported by Nutanix where iSCSI returns a legitimate -ECANCELED for certain operations which should be propagated normally. Reported-by: Shaju Abraham <shaju.abraham@nutanix.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20190729223605.7163-1-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * | dma-helpers: ensure AIO callback is invoked after cancellationPaolo Bonzini2019-08-171-4/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dma_aio_cancel unschedules the BH if there is one, which corresponds to the reschedule_dma case of dma_blk_cb. This can stall the DMA permanently, because dma_complete will never get invoked and therefore nobody will ever invoke the original AIO callback in dbs->common.cb. Fix this by invoking the callback (which is ensured to happen after a bdrv_aio_cancel_async, or done manually in the dbs->bh case), and add assertions to check that the DMA state machine is indeed waiting for dma_complete or reschedule_dma, but never both. Reported-by: John Snow <jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20190729213416.1972-1-pbonzini@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
* | Merge remote-tracking branch 'remotes/jnsnow/tags/bitmaps-pull-request' into ↵Peter Maydell2019-08-1929-391/+6829
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging Pull request Rebase notes: 011/36:[0003] [FC] 'block/backup: upgrade copy_bitmap to BdrvDirtyBitmap' 016/36:[----] [-C] 'iotests: Add virtio-scsi device helper' 017/36:[0002] [FC] 'iotests: add test 257 for bitmap-mode backups' 030/36:[0011] [FC] 'block/backup: teach TOP to never copy unallocated regions' 032/36:[0018] [FC] 'iotests/257: test traditional sync modes' 11: A new hbitmap call was added late in 4.1, changed to bdrv_dirty_bitmap_next_zero. 16: Context-only (self.has_quit is new context in 040) 17: Removed 'auto' to follow upstream trends in iotest fashion 30: Handled explicitly on-list with R-B from Max. 32: Fix capitalization in test, as mentioned on-list. # gpg: Signature made Sat 17 Aug 2019 00:12:13 BST # gpg: using RSA key F9B7ABDBBCACDF95BE76CBD07DEF8106AAFC390E # gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" [full] # Primary key fingerprint: FAEB 9711 A12C F475 812F 18F2 88A9 064D 1835 61EB # Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76 CBD0 7DEF 8106 AAFC 390E * remotes/jnsnow/tags/bitmaps-pull-request: (36 commits) tests/test-hbitmap: test next_zero and _next_dirty_area after truncate block/backup: refactor write_flags block/backup: deal with zero detection qapi: add dirty-bitmaps to query-named-block-nodes result iotests/257: test traditional sync modes block/backup: support bitmap sync modes for non-bitmap backups block/backup: teach TOP to never copy unallocated regions block/backup: add backup_is_cluster_allocated block/backup: centralize copy_bitmap initialization block/backup: improve sync=bitmap work estimates iotests/257: test API failures block/backup: hoist bitmap check into QMP interface iotests/257: Refactor backup helpers iotests/257: add EmulatedBitmap class iotests/257: add Pattern class iotests: test bitmap moving inside 254 qapi: implement block-dirty-bitmap-remove transaction action blockdev: reduce aio_context locked sections in bitmap add/remove block/backup: loosen restriction on readonly bitmaps iotests: add test 257 for bitmap-mode backups ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * tests/test-hbitmap: test next_zero and _next_dirty_area after truncateVladimir Sementsov-Ogievskiy2019-08-171-0/+22
| | | | | | | | | | | | | | | | | | | | | | Test that hbitmap_next_zero and hbitmap_next_dirty_area can find things after old bitmap end. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20190805164652.42409-1-vsementsov@virtuozzo.com Tested-by: John Snow <jsnow@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com>
| * block/backup: refactor write_flagsVladimir Sementsov-Ogievskiy2019-08-171-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | write flags are constant, let's store it in BackupBlockJob instead of recalculating. It also makes two boolean fields to be unused, so, drop them. 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: 20190730163251.755248-4-vsementsov@virtuozzo.com Signed-off-by: John Snow <jsnow@redhat.com>
| * block/backup: deal with zero detectionVladimir Sementsov-Ogievskiy2019-08-172-13/+10Star
| | | | | | | | | | | | | | | | | | | | | | | | | | We have detect_zeroes option, so at least for blockdev-backup user should define it if zero-detection is needed. For drive-backup leave detection enabled by default but do it through existing option instead of open-coding. 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: 20190730163251.755248-2-vsementsov@virtuozzo.com Signed-off-by: John Snow <jsnow@redhat.com>
| * qapi: add dirty-bitmaps to query-named-block-nodes resultVladimir Sementsov-Ogievskiy2019-08-173-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | Let's add a possibility to query dirty-bitmaps not only on root nodes. It is useful when dealing both with snapshots and incremental backups. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20190717173937.18747-1-jsnow@redhat.com [Added deprecation information. --js] Signed-off-by: John Snow <jsnow@redhat.com> [Fixed spelling --js]
| * iotests/257: test traditional sync modesJohn Snow2019-08-172-2/+3128
| | | | | | | | | | | | | | | | Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-12-jsnow@redhat.com [Edit 'Bitmap' --> 'bitmap' in 257.out --js] Signed-off-by: John Snow <jsnow@redhat.com>
| * block/backup: support bitmap sync modes for non-bitmap backupsJohn Snow2019-08-173-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accept bitmaps and sync policies for the other backup modes. This allows us to do things like create a bitmap synced to a full backup without a transaction, or start a resumable backup process. Some combinations don't make sense, though: - NEVER policy combined with any non-BITMAP mode doesn't do anything, because the bitmap isn't used for input or output. It's harmless, but is almost certainly never what the user wanted. - sync=NONE is more questionable. It can't use on-success because this job never completes with success anyway, and the resulting artifact of 'always' is suspect: because we start with a full bitmap and only copy out segments that get written to, the final output bitmap will always be ... a fully set bitmap. Maybe there's contexts in which bitmaps make sense for sync=none, but not without more severe changes to the current job, and omitting it here doesn't prevent us from adding it later. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-11-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * block/backup: teach TOP to never copy unallocated regionsJohn Snow2019-08-162-9/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Presently, If sync=TOP is selected, we mark the entire bitmap as dirty. In the write notifier handler, we dutifully copy out such regions. Fix this in three parts: 1. Mark the bitmap as being initialized before the first yield. 2. After the first yield but before the backup loop, interrogate the allocation status asynchronously and initialize the bitmap. 3. Teach the write notifier to interrogate allocation status if it is invoked during bitmap initialization. As an effect of this patch, the job progress for TOP backups now behaves like this: - total progress starts at bdrv_length. - As allocation status is interrogated, total progress decreases. - As blocks are copied, current progress increases. Taken together, the floor and ceiling move to meet each other. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20190716000117.25219-10-jsnow@redhat.com [Remove ret = -ECANCELED change. --js] [Squash in conflict resolution based on Max's patch --js] Message-id: c8b0ab36-79c8-0b4b-3193-4e12ed8c848b@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com>
| * block/backup: add backup_is_cluster_allocatedJohn Snow2019-08-161-18/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify bdrv_is_unallocated_range to utilize the pnum return from bdrv_is_allocated, and in the process change the semantics from "is unallocated" to "is allocated." Optionally returns a full number of clusters that share the same allocation status. This will be used to carefully toggle bits in the bitmap for sync=top initialization in the following commits. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-9-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * block/backup: centralize copy_bitmap initializationJohn Snow2019-08-161-14/+15
| | | | | | | | | | | | | | | | | | | | Just a few housekeeping changes that keeps the following commit easier to read; perform the initial copy_bitmap initialization in one place. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-8-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * block/backup: improve sync=bitmap work estimatesJohn Snow2019-08-163-25/+23Star
| | | | | | | | | | | | | | | | | | | | | | | | | | When making backups based on bitmaps, the work estimate can be more accurate. Update iotests to reflect the new strategy. TOP work estimates are broken, but do not get worse with this commit. That issue is addressed in the following commits instead. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-7-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * iotests/257: test API failuresJohn Snow2019-08-162-0/+152
| | | | | | | | | | | | | | Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-6-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * block/backup: hoist bitmap check into QMP interfaceJohn Snow2019-08-162-9/+14
| | | | | | | | | | | | | | | | | | | | This is nicer to do in the unified QMP interface that we have now, because it lets us use the right terminology back at the user. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-5-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * iotests/257: Refactor backup helpersJohn Snow2019-08-162-120/+128
| | | | | | | | | | | | | | | | | | | | | | This test needs support for non-bitmap backups and missing or unspecified bitmap sync modes, so rewrite the helpers to be a little more generic. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-4-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * iotests/257: add EmulatedBitmap classJohn Snow2019-08-161-49/+75
| | | | | | | | | | | | | | | | | | | | | | Represent a bitmap with an object that we can mark and clear bits in. This makes it easier to manage partial writes when we don't write a full group's worth of patterns before an error. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-3-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * iotests/257: add Pattern classJohn Snow2019-08-161-26/+32
| | | | | | | | | | | | | | | | | | | | Just kidding, this is easier to manage with a full class instead of a namedtuple. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-2-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * iotests: test bitmap moving inside 254Vladimir Sementsov-Ogievskiy2019-08-162-2/+110
| | | | | | | | | | | | | | | | | | | | | | | | Test persistent bitmap copying with and without removal of original bitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190708220502.12977-4-jsnow@redhat.com [Edited comment "bitmap1" --> "bitmap2" as per review. --js] Signed-off-by: John Snow <jsnow@redhat.com>
| * qapi: implement block-dirty-bitmap-remove transaction actionJohn Snow2019-08-166-17/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is used to do transactional movement of the bitmap (which is possible in conjunction with merge command). Transactional bitmap movement is needed in scenarios with external snapshot, when we don't want to leave copy of the bitmap in the base image. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190708220502.12977-3-jsnow@redhat.com [Edited "since" version to 4.2 --js] Signed-off-by: John Snow <jsnow@redhat.com>
| * blockdev: reduce aio_context locked sections in bitmap add/removeVladimir Sementsov-Ogievskiy2019-08-161-17/+13Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0a6c86d024c52 returned these locks back to add/remove functionality, to protect from intersection of persistent bitmap related IO with other IO. But other bitmap-related functions called here are unrelated to the problem, and there are no needs to keep these calls inside critical sections. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190708220502.12977-2-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * block/backup: loosen restriction on readonly bitmapsJohn Snow2019-08-162-1/+7
| | | | | | | | | | | | | | | | | | | | | | With the "never" sync policy, we actually can utilize readonly bitmaps now. Loosen the check at the QMP level, and tighten it based on provided arguments down at the job creation level instead. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190709232550.10724-19-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
| * iotests: add test 257 for bitmap-mode backupsJohn Snow2019-08-163-0/+2664
| | | | | | | | | | | | | | | | Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190709232550.10724-18-jsnow@redhat.com [Removed 'auto' group, as per new testing config guidelines --js] Signed-off-by: John Snow <jsnow@redhat.com>
| * iotests: Add virtio-scsi device helperJohn Snow2019-08-165-18/+10Star
| | | | | | | | | | | | | | | | | | Seems that it comes up enough. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190709232550.10724-17-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>