diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-05-14 19:33:23 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-05-14 19:33:23 +0100 |
commit | 9b1e81d1c231e7c9fa3a42b68d12a0482d51589c (patch) | |
tree | f897d41d0daa6a15765ffd3e265e51c2cef4c637 /migration | |
parent | 6d34aa9969ff85ca6eaeb4dc1988a4d4e13e7d79 (diff) | |
parent | 568740bedf22cc8d0ec9ab1ce522a97baab5961c (diff) | |
download | qemu-9b1e81d1c231e7c9fa3a42b68d12a0482d51589c.zip |
Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2021-05-14' into staging
* Replace YAML anchors by extends in the gitlab-CI yaml files
* Many small qtest fixes (e.g. to fix issues discovered by Coverity)
* Poison more config switches in common code
* Fix the failing Travis-CI and Cirrus-CI tasks
# gpg: Signature made Fri 14 May 2021 12:17:39 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/thuth-gitlab/tags/pull-request-2021-05-14:
cirrus.yml: Fix the MSYS2 task
pc-bios/s390-ccw: Fix inline assembly for older versions of Clang
tests/qtest/migration-test: Use g_autofree to avoid leaks on error paths
configure: Poison all current target-specific #defines
migration: Move populate_vfio_info() into a separate file
include/sysemu: Poison all accelerator CONFIG switches in common code
tests: Avoid side effects inside g_assert() arguments
tests/qtest/rtc-test: Remove pointless NULL check
tests/qtest/tpm-util.c: Free memory with correct free function
tests/migration-test: Fix "true" vs true
tests/qtest/npcm7xx_pwm-test.c: Avoid g_assert_true() for non-test assertions
tests/qtest/ahci-test.c: Calculate iso_size with 64-bit arithmetic
util/compatfd.c: Replaced a malloc call with g_malloc.
libqtest: refuse QTEST_QEMU_BINARY=qemu-kvm
docs/devel/qgraph: add troubleshooting information
libqos/qgraph: fix "UNAVAILBLE" typo
gitlab-ci: Replace YAML anchors by extends (native_test_job)
gitlab-ci: Replace YAML anchors by extends (native_build_job)
gitlab-ci: Replace YAML anchors by extends (container_job)
tests/docker/dockerfiles: Add ccache to containers where it was missing
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/meson.build | 3 | ||||
-rw-r--r-- | migration/migration.c | 15 | ||||
-rw-r--r-- | migration/migration.h | 2 | ||||
-rw-r--r-- | migration/target.c | 25 |
4 files changed, 29 insertions, 16 deletions
diff --git a/migration/meson.build b/migration/meson.build index 3ecedce94d..f8714dcb15 100644 --- a/migration/meson.build +++ b/migration/meson.build @@ -31,4 +31,5 @@ softmmu_ss.add(when: ['CONFIG_RDMA', rdma], if_true: files('rdma.c')) softmmu_ss.add(when: 'CONFIG_LIVE_BLOCK_MIGRATION', if_true: files('block.c')) softmmu_ss.add(when: zstd, if_true: files('multifd-zstd.c')) -specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('dirtyrate.c', 'ram.c')) +specific_ss.add(when: 'CONFIG_SOFTMMU', + if_true: files('dirtyrate.c', 'ram.c', 'target.c')) diff --git a/migration/migration.c b/migration/migration.c index 4698b47442..1885860d7b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -60,10 +60,6 @@ #include "qemu/yank.h" #include "sysemu/cpus.h" -#ifdef CONFIG_VFIO -#include "hw/vfio/vfio-common.h" -#endif - #define MAX_THROTTLE (128 << 20) /* Migration transfer speed throttling */ /* Amount of time to allocate to each "chunk" of bandwidth-throttled @@ -1064,17 +1060,6 @@ static void populate_disk_info(MigrationInfo *info) } } -static void populate_vfio_info(MigrationInfo *info) -{ -#ifdef CONFIG_VFIO - if (vfio_mig_active()) { - info->has_vfio = true; - info->vfio = g_malloc0(sizeof(*info->vfio)); - info->vfio->transferred = vfio_mig_bytes_transferred(); - } -#endif -} - static void fill_source_migration_info(MigrationInfo *info) { MigrationState *s = migrate_get_current(); diff --git a/migration/migration.h b/migration/migration.h index f7b388d718..b88bd8fe07 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -377,4 +377,6 @@ void migration_consume_urgent_request(void); bool migration_rate_limit(void); void migration_cancel(void); +void populate_vfio_info(MigrationInfo *info); + #endif diff --git a/migration/target.c b/migration/target.c new file mode 100644 index 0000000000..907ebf0a0a --- /dev/null +++ b/migration/target.c @@ -0,0 +1,25 @@ +/* + * QEMU live migration - functions that need to be compiled target-specific + * + * This work is licensed under the terms of the GNU GPL, version 2 + * or (at your option) any later version. + */ + +#include "qemu/osdep.h" +#include "qapi/qapi-types-migration.h" +#include "migration.h" + +#ifdef CONFIG_VFIO +#include "hw/vfio/vfio-common.h" +#endif + +void populate_vfio_info(MigrationInfo *info) +{ +#ifdef CONFIG_VFIO + if (vfio_mig_active()) { + info->has_vfio = true; + info->vfio = g_malloc0(sizeof(*info->vfio)); + info->vfio->transferred = vfio_mig_bytes_transferred(); + } +#endif +} |