Branch: refs/heads/staging Home: https://github.com/qemu/qemu Commit: e6ddad1fd53e6e4d65726e41c7063900a69ab694 https://github.com/qemu/qemu/commit/e6ddad1fd53e6e4d65726e41c7063900a69ab694 Author: Jinhao Gao <gaojin...@huawei.com> Date: 2021-02-08 (Mon, 08 Feb 2021)
Changed paths: M hw/ppc/spapr_pci.c Log Message: ----------- spapr_pci: Fix memory leak of vmstate_spapr_pci When VM migrate VMState of spapr_pci, the field(msi_devs) of spapr_pci having a flag of VMS_ALLOC need to allocate memory. If the src doesn't free memory of msi_devs in SaveStateEntry of spapr_pci after QEMUFile save VMState of spapr_pci, it may result in memory leak of msi_devs. We add the post_save func to free memory, which prevents memory leak. Reported-by: Euler Robot <euler.ro...@huawei.com> Signed-off-by: Jinhao Gao <gaojin...@huawei.com> Acked-by: David Gibson <da...@gibson.dropbear.id.au> Reviewed-by: Michael S. Tsirkin <m...@redhat.com> Message-Id: <20201231061020.828-2-gaojin...@huawei.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 39f633d429f249db4f5d2eff7f56381517c7531e https://github.com/qemu/qemu/commit/39f633d429f249db4f5d2eff7f56381517c7531e Author: Jinhao Gao <gaojin...@huawei.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M migration/savevm.c Log Message: ----------- savevm: Fix memory leak of vmstate_configuration When VM migrate VMState of configuration, the fields(name and capabilities) of configuration having a flag of VMS_ALLOC need to allocate memory. If the src doesn't free memory of capabilities in SaveState after save VMState of configuration, or the dst doesn't free memory of name and capabilities in post load of configuration, it may result in memory leak of name and capabilities. We free memory in configuration_post_save and configuration_post_load func, which prevents memory leak. Reported-by: Euler Robot <euler.ro...@huawei.com> Signed-off-by: Jinhao Gao <gaojin...@huawei.com> Reviewed-by: Michael S. Tsirkin <m...@redhat.com> Message-Id: <20201231061020.828-3-gaojin...@huawei.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 1dfafcbd39d55b88abc96401642f697db6131ea0 https://github.com/qemu/qemu/commit/1dfafcbd39d55b88abc96401642f697db6131ea0 Author: Wainer dos Santos Moschetta <waine...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M migration/qemu-file.c Log Message: ----------- migration/qemu-file: Fix maybe uninitialized on qemu_get_buffer_in_place() Fixed error when compiling migration/qemu-file.c with -Werror=maybe-uninitialized as shown here: ../migration/qemu-file.c: In function 'qemu_get_buffer_in_place': ../migration/qemu-file.c:604:18: error: 'src' may be used uninitialized in this function [-Werror=maybe-uninitialized] 604 | *buf = src; | ~~~~~^~~~~ cc1: all warnings being treated as errors Signed-off-by: Wainer dos Santos Moschetta <waine...@redhat.com> Message-Id: <20210128130625.569900-1-waine...@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 6e8c25b4c623f755f588893661fec77ae88e128a https://github.com/qemu/qemu/commit/6e8c25b4c623f755f588893661fec77ae88e128a Author: Andrey Gruzdev <andrey.gruz...@virtuozzo.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M migration/migration.c M migration/migration.h M migration/ram.c M migration/ram.h M qapi/migration.json Log Message: ----------- migration: introduce 'background-snapshot' migration capability Add new capability to 'qapi/migration.json' schema. Update migrate_caps_check() to validate enabled capability set against introduced one. Perform checks for required kernel features and compatibility with guest memory backends. Signed-off-by: Andrey Gruzdev <andrey.gruz...@virtuozzo.com> Reviewed-by: Peter Xu <pet...@redhat.com> Acked-by: Markus Armbruster <arm...@redhat.com> Message-Id: <20210129101407.103458-2-andrey.gruz...@virtuozzo.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 0e9b5cd6b238b7ca9a3a50d957f50c37082705a0 https://github.com/qemu/qemu/commit/0e9b5cd6b238b7ca9a3a50d957f50c37082705a0 Author: Andrey Gruzdev <andrey.gruz...@virtuozzo.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M include/exec/memory.h A include/qemu/userfaultfd.h M util/meson.build M util/trace-events A util/userfaultfd.c Log Message: ----------- migration: introduce UFFD-WP low-level interface helpers Glue code to the userfaultfd kernel implementation. Querying feature support, createing file descriptor, feature control, memory region registration, IOCTLs on registered registered regions. Signed-off-by: Andrey Gruzdev <andrey.gruz...@virtuozzo.com> Reviewed-by: Peter Xu <pet...@redhat.com> Message-Id: <20210129101407.103458-3-andrey.gruz...@virtuozzo.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Fixed up range.start casting for 32bit Commit: 278e2f551a095b234de74dca9c214d5502a1f72c https://github.com/qemu/qemu/commit/278e2f551a095b234de74dca9c214d5502a1f72c Author: Andrey Gruzdev <andrey.gruz...@virtuozzo.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M include/exec/memory.h M migration/ram.c M migration/ram.h M migration/trace-events Log Message: ----------- migration: support UFFD write fault processing in ram_save_iterate() In this particular implementation the same single migration thread is responsible for both normal linear dirty page migration and procesing UFFD page fault events. Processing write faults includes reading UFFD file descriptor, finding respective RAM block and saving faulting page to the migration stream. After page has been saved, write protection can be removed. Since asynchronous version of qemu_put_buffer() is expected to be used to save pages, we also have to flush migraion stream prior to un-protecting saved memory range. Write protection is being removed for any previously protected memory chunk that has hit the migration stream. That's valid for pages from linear page scan along with write fault pages. Signed-off-by: Andrey Gruzdev <andrey.gruz...@virtuozzo.com> Acked-by: Peter Xu <pet...@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Message-Id: <20210129101407.103458-4-andrey.gruz...@virtuozzo.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> fixup pagefault.address cast for 32bit Commit: 8518278a6af589ccc401f06e35f171b1e6fae800 https://github.com/qemu/qemu/commit/8518278a6af589ccc401f06e35f171b1e6fae800 Author: Andrey Gruzdev <andrey.gruz...@virtuozzo.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M migration/migration.c M migration/migration.h M migration/savevm.c M migration/savevm.h Log Message: ----------- migration: implementation of background snapshot thread Introducing implementation of 'background' snapshot thread which in overall follows the logic of precopy migration while internally utilizes completely different mechanism to 'freeze' vmstate at the start of snapshot creation. This mechanism is based on userfault_fd with wr-protection support and is Linux-specific. Signed-off-by: Andrey Gruzdev <andrey.gruz...@virtuozzo.com> Acked-by: Peter Xu <pet...@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Message-Id: <20210129101407.103458-5-andrey.gruz...@virtuozzo.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: c7243566d0b58966e41fd2b56145f885a04793ec https://github.com/qemu/qemu/commit/c7243566d0b58966e41fd2b56145f885a04793ec Author: Andrey Gruzdev <andrey.gruz...@virtuozzo.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: A scripts/userfaultfd-wrlat.py Log Message: ----------- migration: introduce 'userfaultfd-wrlat.py' script Add BCC/eBPF script to analyze userfaultfd write fault latency distribution. Signed-off-by: Andrey Gruzdev <andrey.gruz...@virtuozzo.com> Reviewed-by: Peter Xu <pet...@redhat.com> Message-Id: <20210129101407.103458-6-andrey.gruz...@virtuozzo.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: ec17de0ac09f1f45c78d6afd0d7aea05ffb0ed9d https://github.com/qemu/qemu/commit/ec17de0ac09f1f45c78d6afd0d7aea05ffb0ed9d Author: Markus Armbruster <arm...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M monitor/hmp-cmds.c M qapi/migration.json Log Message: ----------- migration: Fix migrate-set-parameters argument validation Commit 741d4086c8 "migration: Use proper types in json" (v2.12.0) switched MigrationParameters to narrower integer types, and removed the simplified qmp_migrate_set_parameters()'s argument checking accordingly. Good idea, except qmp_migrate_set_parameters() takes MigrateSetParameters, not MigrationParameters. Its job is updating migrate_get_current()->parameters (which *is* of type MigrationParameters) according to its argument. The integers now get truncated silently. Reproducer: ---> {'execute': 'query-migrate-parameters'} <--- {"return": {[...] "compress-threads": 8, [...]}} ---> {"execute": "migrate-set-parameters", "arguments": {"compress-threads": 257}} <--- {"return": {}} ---> {'execute': 'query-migrate-parameters'} <--- {"return": {[...] "compress-threads": 1, [...]}} Fix by resynchronizing MigrateSetParameters with MigrationParameters. Fixes: 741d4086c856320807a2575389d7c0505578270b Signed-off-by: Markus Armbruster <arm...@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Message-Id: <20210202141734.2488076-2-arm...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 8b9407a09f925ff9e4dcf6783add8df68f5c7eb6 https://github.com/qemu/qemu/commit/8b9407a09f925ff9e4dcf6783add8df68f5c7eb6 Author: Markus Armbruster <arm...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M migration/migration.c M migration/migration.h M migration/page_cache.c M migration/page_cache.h M migration/ram.c M migration/ram.h M qapi/migration.json Log Message: ----------- migration: Clean up signed vs. unsigned XBZRLE cache-size 73af8dd8d7 "migration: Make xbzrle_cache_size a migration parameter" (v2.11.0) made the new parameter unsigned (QAPI type 'size', uint64_t in C). It neglected to update existing code, which continues to use int64_t. migrate_xbzrle_cache_size() returns the new parameter. Adjust its return type. QMP query-migrate-cache-size returns migrate_xbzrle_cache_size(). Adjust its return type. migrate-set-parameters passes the new parameter to xbzrle_cache_resize(). Adjust its parameter type. xbzrle_cache_resize() passes it on to cache_init(). Adjust its parameter type. Signed-off-by: Markus Armbruster <arm...@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Message-Id: <20210202141734.2488076-3-arm...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 7bfc47936e9e083ea7743fccb8e235b063ae6590 https://github.com/qemu/qemu/commit/7bfc47936e9e083ea7743fccb8e235b063ae6590 Author: Markus Armbruster <arm...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M migration/page_cache.c Log Message: ----------- migration: Fix cache_init()'s "Failed to allocate" error messages cache_init() attempts to handle allocation failure. The two error messages are garbage, as untested error messages commonly are: Parameter 'cache size' expects Failed to allocate cache Parameter 'cache size' expects Failed to allocate page cache Fix them to just Failed to allocate cache Failed to allocate page cache Signed-off-by: Markus Armbruster <arm...@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Message-Id: <20210202141734.2488076-4-arm...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 54270c450adf403e4a5945210fe99009d5f85e91 https://github.com/qemu/qemu/commit/54270c450adf403e4a5945210fe99009d5f85e91 Author: Markus Armbruster <arm...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M migration/migration.c Log Message: ----------- migration: Fix a few absurdly defective error messages migrate_params_check() has a number of error messages of the form Parameter 'NAME' expects is invalid, it should be ... Fix them to something like Parameter 'NAME' expects a ... Signed-off-by: Markus Armbruster <arm...@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Message-Id: <20210202141734.2488076-5-arm...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 3af8554bd068576b0399087583df48518a2a98f6 https://github.com/qemu/qemu/commit/3af8554bd068576b0399087583df48518a2a98f6 Author: Dr. David Alan Gilbert <dgilb...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M migration/migration.c M migration/savevm.c M migration/savevm.h M qapi/migration.json Log Message: ----------- migration: Add blocker information Modify query-migrate so that it has a flag indicating if outbound migration is blocked, and if it is a list of reasons. Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Message-Id: <20210202135522.127380-2-dgilb...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Peter Xu <pet...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: a64aec725ea0b26fa4e44f8b8b8c72be9aaa4230 https://github.com/qemu/qemu/commit/a64aec725ea0b26fa4e44f8b8b8c72be9aaa4230 Author: Dr. David Alan Gilbert <dgilb...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M monitor/hmp-cmds.c Log Message: ----------- migration: Display the migration blockers Update 'info migrate' to display migration blocking information. If the outbound migration is not blocked, there is no change, however if it is blocked a message is displayed with a list of reasons why, e.g. qemu-system-x86_64 -nographic -smp 4 -m 4G -M pc,usb=on \ -chardev null,id=n -device usb-serial,chardev=n \ -virtfs local,path=/home,mount_tag=fs,security_model=none \ -drive if=virtio,file=myimage.qcow2 (qemu) info migrate globals: store-global-state: on only-migratable: off send-configuration: on send-section-footer: on decompress-error-check: on clear-bitmap-shift: 18 Outgoing migration blocked: Migration is disabled when VirtFS export path '/home' is mounted in the guest using mount_tag 'fs' non-migratable device: 0000:00:01.2/1/usb-serial Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Message-Id: <20210202135522.127380-3-dgilb...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Peter Xu <pet...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: e26f98e2097cf17db04462e9aa2e423b93e7455c https://github.com/qemu/qemu/commit/e26f98e2097cf17db04462e9aa2e423b93e7455c Author: Daniel P. Berrangé <berra...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M block/monitor/block-hmp-cmds.c M block/snapshot.c M include/block/snapshot.h M migration/savevm.c M monitor/hmp-cmds.c M replay/replay-debugging.c M tests/qemu-iotests/267.out Log Message: ----------- block: push error reporting into bdrv_all_*_snapshot functions The bdrv_all_*_snapshot functions return a BlockDriverState pointer for the invalid backend, which the callers then use to report an error message. In some cases multiple callers are reporting the same error message, but with slightly different text. In the future there will be more error scenarios for some of these methods, which will benefit from fine grained error message reporting. So it is helpful to push error reporting down a level. Reviewed-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> [PMD: Initialize variables] Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com> Message-Id: <20210204124834.774401-2-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 7ea14df230b98ffb33342f40cfffbdbb8ddd2b06 https://github.com/qemu/qemu/commit/7ea14df230b98ffb33342f40cfffbdbb8ddd2b06 Author: Philippe Mathieu-Daudé <phi...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M include/migration/snapshot.h M migration/savevm.c M replay/replay-debugging.c M replay/replay-snapshot.c Log Message: ----------- migration: Make save_snapshot() return bool, not 0/-1 Just for consistency, following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), return a boolean value indicating an error is set or not. Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Acked-by: Pavel Dovgalyuk <pavel.dovgal...@ispras.ru> Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com> Message-Id: <20210204124834.774401-3-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: f61fe11aa6f7f8f0ffe4ddaa56a8108f3ab57854 https://github.com/qemu/qemu/commit/f61fe11aa6f7f8f0ffe4ddaa56a8108f3ab57854 Author: Daniel P. Berrangé <berra...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M include/migration/snapshot.h M migration/savevm.c M monitor/hmp-cmds.c M replay/replay-snapshot.c M softmmu/vl.c Log Message: ----------- migration: stop returning errno from load_snapshot() None of the callers care about the errno value since there is a full Error object populated. This gives consistency with save_snapshot() which already just returns a boolean value. Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> [PMD: Return false/true instead of -1/0, document function] Acked-by: Pavel Dovgalyuk <pavel.dovgal...@ispras.ru> Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com> Message-Id: <20210204124834.774401-4-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: cf3a74c94f3da92fdf8d45047756f0e43657be1a https://github.com/qemu/qemu/commit/cf3a74c94f3da92fdf8d45047756f0e43657be1a Author: Daniel P. Berrangé <berra...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M block/monitor/block-hmp-cmds.c M block/snapshot.c M include/block/snapshot.h M migration/savevm.c M monitor/hmp-cmds.c M replay/replay-debugging.c Log Message: ----------- block: add ability to specify list of blockdevs during snapshot When running snapshot operations, there are various rules for which blockdevs are included/excluded. While this provides reasonable default behaviour, there are scenarios that are not well handled by the default logic. Some of the conditions do not have a single correct answer. Thus there needs to be a way for the mgmt app to provide an explicit list of blockdevs to perform snapshots across. This can be achieved by passing a list of node names that should be used. Reviewed-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> Message-Id: <20210204124834.774401-5-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: c22d644ca78dcccdfc4a2e2bc3594bd27c1f4fe5 https://github.com/qemu/qemu/commit/c22d644ca78dcccdfc4a2e2bc3594bd27c1f4fe5 Author: Daniel P. Berrangé <berra...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M block/monitor/block-hmp-cmds.c M block/snapshot.c M include/block/snapshot.h M migration/savevm.c M replay/replay-debugging.c M tests/qemu-iotests/267.out Log Message: ----------- block: allow specifying name of block device for vmstate storage Currently the vmstate will be stored in the first block device that supports snapshots. Historically this would have usually been the root device, but with UEFI it might be the variable store. There needs to be a way to override the choice of block device to store the state in. Reviewed-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> Message-Id: <20210204124834.774401-6-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 3d3e9b1f669b60d9d3cb857edbfc3d54cbb9c0ef https://github.com/qemu/qemu/commit/3d3e9b1f669b60d9d3cb857edbfc3d54cbb9c0ef Author: Daniel P. Berrangé <berra...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M block/monitor/block-hmp-cmds.c M block/snapshot.c M include/block/snapshot.h M migration/savevm.c M replay/replay-debugging.c Log Message: ----------- block: rename and alter bdrv_all_find_snapshot semantics Currently bdrv_all_find_snapshot() will return 0 if it finds a snapshot, -1 if an error occurs, or if it fails to find a snapshot. New callers to be added want to distinguish between the error scenario and failing to find a snapshot. Rename it to bdrv_all_has_snapshot and make it return -1 on error, 0 if no snapshot is found and 1 if snapshot is found. Reviewed-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> Message-Id: <20210204124834.774401-7-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: f781f84189e3e325da0b0c6a241b77d54b7ea26c https://github.com/qemu/qemu/commit/f781f84189e3e325da0b0c6a241b77d54b7ea26c Author: Daniel P. Berrangé <berra...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M include/migration/snapshot.h M migration/savevm.c M monitor/hmp-cmds.c M replay/replay-debugging.c M replay/replay-snapshot.c Log Message: ----------- migration: control whether snapshots are ovewritten The traditional HMP "savevm" command will overwrite an existing snapshot if it already exists with the requested name. This new flag allows this to be controlled allowing for safer behaviour with a future QMP command. Reviewed-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> Message-Id: <20210204124834.774401-8-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: f1a9fcdd0197ed5ecfee187f8834e7b609d596a6 https://github.com/qemu/qemu/commit/f1a9fcdd0197ed5ecfee187f8834e7b609d596a6 Author: Daniel P. Berrangé <berra...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M include/migration/snapshot.h M migration/savevm.c M monitor/hmp-cmds.c M replay/replay-debugging.c M replay/replay-snapshot.c M softmmu/vl.c Log Message: ----------- migration: wire up support for snapshot device selection Modify load_snapshot/save_snapshot to accept the device list and vmstate node name parameters previously added to the block layer. Reviewed-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> Message-Id: <20210204124834.774401-9-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: bef7e9e2c7549696f7ddbe3a1dd236531d2af518 https://github.com/qemu/qemu/commit/bef7e9e2c7549696f7ddbe3a1dd236531d2af518 Author: Daniel P. Berrangé <berra...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M include/migration/snapshot.h M migration/savevm.c M monitor/hmp-cmds.c Log Message: ----------- migration: introduce a delete_snapshot wrapper Make snapshot deletion consistent with the snapshot save and load commands by using a wrapper around the blockdev layer. The main difference is that we get upfront validation of the passed in device list (if any). Reviewed-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> Message-Id: <20210204124834.774401-10-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: aae12d4baa1304756c073fac34ac53e6445f4fdf https://github.com/qemu/qemu/commit/aae12d4baa1304756c073fac34ac53e6445f4fdf Author: Daniel P. Berrangé <berra...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M tests/qemu-iotests/common.qemu Log Message: ----------- iotests: add support for capturing and matching QMP events When using the _launch_qemu and _send_qemu_cmd functions from common.qemu, any QMP events get mixed in with the output from the commands and responses. This makes it difficult to write a test case as the ordering of events in the output is not stable. This introduces a variable 'capture_events' which can be set to a list of event names. Any events listed in this variable will not be printed, instead collected in the $QEMU_EVENTS environment variable. A new '_wait_event' function can be invoked to collect events at a fixed point in time. The function will first pull events cached in $QEMU_EVENTS variable, and if none are found, will then read more from QMP. Reviewed-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> Message-Id: <20210204124834.774401-11-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 458598e6a53077872da5defbe8c9642f6390c8d2 https://github.com/qemu/qemu/commit/458598e6a53077872da5defbe8c9642f6390c8d2 Author: Daniel P. Berrangé <berra...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M tests/qemu-iotests/common.rc Log Message: ----------- iotests: fix loading of common.config from tests/ subdir common.rc assumes it is being sourced from the same directory and so also tries to source common.config from the current working directory. With the ability to now have named tests in the tests/ subdir we need to check two locations for common.config. Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Philippe Mathieu-Daudé <phi...@redhat.com> Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> Message-Id: <20210204124834.774401-12-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 0f0d83a456d0a60be9031a19311bfcb0f9519afb https://github.com/qemu/qemu/commit/0f0d83a456d0a60be9031a19311bfcb0f9519afb Author: Daniel P. Berrangé <berra...@redhat.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M migration/savevm.c M qapi/job.json M qapi/migration.json Log Message: ----------- migration: introduce snapshot-{save, load, delete} QMP commands savevm, loadvm and delvm are some of the few HMP commands that have never been converted to use QMP. The reasons for the lack of conversion are that they blocked execution of the event thread, and the semantics around choice of disks were ill-defined. Despite this downside, however, libvirt and applications using libvirt have used these commands for as long as QMP has existed, via the "human-monitor-command" passthrough command. IOW, while it is clearly desirable to be able to fix the problems, they are not a blocker to all real world usage. Meanwhile there is a need for other features which involve adding new parameters to the commands. This is possible with HMP passthrough, but it provides no reliable way for apps to introspect features, so using QAPI modelling is highly desirable. This patch thus introduces new snapshot-{load,save,delete} commands to QMP that are intended to replace the old HMP counterparts. The new commands are given different names, because they will be using the new QEMU job framework and thus will have diverging behaviour from the HMP originals. It would thus be misleading to keep the same name. While this design uses the generic job framework, the current impl is still blocking. The intention that the blocking problem is fixed later. None the less applications using these new commands should assume that they are asynchronous and thus wait for the job status change event to indicate completion. In addition to using the job framework, the new commands require the caller to be explicit about all the block device nodes used in the snapshot operations, with no built-in default heuristics in use. Note that the existing "query-named-block-nodes" can be used to query what snapshots currently exist for block nodes. Acked-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> Message-Id: <20210204124834.774401-13-berra...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> dgilbert: removed tests for now, the output ordering isn't deterministic Commit: e846b746502e94ce5cb148201ebdaa9c0f658741 https://github.com/qemu/qemu/commit/e846b746502e94ce5cb148201ebdaa9c0f658741 Author: Stefan Reiter <s.rei...@proxmox.com> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M migration/ram.c Log Message: ----------- migration: only check page size match if RAM postcopy is enabled Postcopy may also be advised for dirty-bitmap migration only, in which case the remote page size will not be available and we'll instead read bogus data, blocking migration with a mismatch error if the VM uses hugepages. Fixes: 58110f0acb ("migration: split common postcopy out of ram postcopy") Signed-off-by: Stefan Reiter <s.rei...@proxmox.com> Message-Id: <20210204163522.13291-1-s.rei...@proxmox.com> Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> Commit: 2436651b26584c8ebe91db5df67ee054509a0949 https://github.com/qemu/qemu/commit/2436651b26584c8ebe91db5df67ee054509a0949 Author: Peter Maydell <peter.mayd...@linaro.org> Date: 2021-02-08 (Mon, 08 Feb 2021) Changed paths: M block/monitor/block-hmp-cmds.c M block/snapshot.c M hw/ppc/spapr_pci.c M include/block/snapshot.h M include/exec/memory.h M include/migration/snapshot.h A include/qemu/userfaultfd.h M migration/migration.c M migration/migration.h M migration/page_cache.c M migration/page_cache.h M migration/qemu-file.c M migration/ram.c M migration/ram.h M migration/savevm.c M migration/savevm.h M migration/trace-events M monitor/hmp-cmds.c M qapi/job.json M qapi/migration.json M replay/replay-debugging.c M replay/replay-snapshot.c A scripts/userfaultfd-wrlat.py M softmmu/vl.c M tests/qemu-iotests/267.out M tests/qemu-iotests/common.qemu M tests/qemu-iotests/common.rc M util/meson.build M util/trace-events A util/userfaultfd.c Log Message: ----------- Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20210208a' into staging Migration pull 2021-02-08 v2 Dropped vmstate: Fix memory leak in vmstate_handle_alloc Broke on Power Added migration: only check page size match if RAM postcopy is enabled # gpg: Signature made Mon 08 Feb 2021 11:28:14 GMT # gpg: using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilb...@redhat.com>" [full] # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert/tags/pull-migration-20210208a: (27 commits) migration: only check page size match if RAM postcopy is enabled migration: introduce snapshot-{save, load, delete} QMP commands iotests: fix loading of common.config from tests/ subdir iotests: add support for capturing and matching QMP events migration: introduce a delete_snapshot wrapper migration: wire up support for snapshot device selection migration: control whether snapshots are ovewritten block: rename and alter bdrv_all_find_snapshot semantics block: allow specifying name of block device for vmstate storage block: add ability to specify list of blockdevs during snapshot migration: stop returning errno from load_snapshot() migration: Make save_snapshot() return bool, not 0/-1 block: push error reporting into bdrv_all_*_snapshot functions migration: Display the migration blockers migration: Add blocker information migration: Fix a few absurdly defective error messages migration: Fix cache_init()'s "Failed to allocate" error messages migration: Clean up signed vs. unsigned XBZRLE cache-size migration: Fix migrate-set-parameters argument validation migration: introduce 'userfaultfd-wrlat.py' script ... Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> Compare: https://github.com/qemu/qemu/compare/4f799257b323...2436651b2658