mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'migration-20231020-pull-request' of https://gitlab.com/juan.quintela/qemu into staging
Migration Pull request (20231020) In this pull request: - disable analyze-migration on s390x (thomas) - Fix parse_ramblock() (peter) - start merging live update (steve) - migration-test support for using several binaries (fabiano) - multifd cleanups (fabiano) CI: https://gitlab.com/juan.quintela/qemu/-/pipelines/1042492801 Please apply. # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmUyJMsACgkQ9IfvGFhy # 1yP0AQ/9ELr6VJ0crqzfGm2dy2emnZMaQhDtzR4Kk4ciZF6U+GiATdGN9hK499mP # 6WzRIjtSzwD8YZvhLfegxIVTGcEttaM93uXFPznWrk7gwny6QTvuA4qtcRYejTSl # wE4GQQOsSrukVCUlqcZtY/t2aphVWQzlx8RRJE3XGaodT1gNLMjd+xp34NbbOoR3 # 32ixpSPUCOGvCd7hb+HG7pEzk+905Pn2URvbdiP71uqhgJZdjMAv8ehSGD3kufdg # FMrZyIEq7Eguk2bO1+7ZiVuIafXXRloIVqi1ENmjIyNDa/Rlv2CA85u0CfgeP6qY # Ttj+MZaz8PIhf97IJEILFn+NDXYgsGqEFl//uNbLuTeCpmr9NPhBzLw8CvCefPrR # rwBs3J+QbDHWX9EYjk6QZ9QfYJy/DXkl0KfdNtQy9Wf+0o1mHDn5/y3s782T24aJ # lGo0ph4VJLBNOx58rpgmoO5prRIjqzF5w4j8pCSeGUC4Bcub5af4TufYrwaf+cps # iIbNFx79dLXBlfkKIn7i9RLpz7641Fs/iTQ/MZh1eyvX++UDXAPWnbd4GDYOEewA # U3WKsTs/ipIbY8nqaO4j1VMzADPUfetBXznBw60xsZcfjynFJsPV6/F/0OpUupdv # qPEY4LZ2uwP4K7AlzrUzUn2f3BKrspL0ObX0qTn0WJ8WX5Jp/YA= # =m+uB # -----END PGP SIGNATURE----- # gpg: Signature made Thu 19 Oct 2023 23:57:15 PDT # gpg: using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full] # gpg: aka "Juan Quintela <quintela@trasno.org>" [full] # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03 4B82 F487 EF18 5872 D723 * tag 'migration-20231020-pull-request' of https://gitlab.com/juan.quintela/qemu: tests/qtest: Don't print messages from query instances tests/qtest/migration: Allow user to specify a machine type tests/qtest/migration: Support more than one QEMU binary tests/qtest/migration: Set q35 as the default machine for x86_86 tests/qtest/migration: Specify the geometry of the bootsector tests/qtest/migration: Define a machine for all architectures tests/qtest/migration: Introduce find_common_machine_version tests/qtest: Introduce qtest_resolve_machine_alias tests/qtest: Introduce qtest_has_machine_with_env tests/qtest: Allow qtest_get_machines to use an alternate QEMU binary tests/qtest: Introduce qtest_init_with_env tests/qtest: Allow qtest_qemu_binary to use a custom environment variable migration/multifd: Stop checking p->quit in multifd_send_thread migration: simplify notifiers migration: Fix parse_ramblock() on overwritten retvals migration: simplify blockers tests/qtest/migration-test: Disable the analyze-migration.py test on s390x Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
@@ -534,11 +534,8 @@ static int tpm_emulator_block_migration(TPMEmulator *tpm_emu)
|
||||
error_setg(&tpm_emu->migration_blocker,
|
||||
"Migration disabled: TPM emulator does not support "
|
||||
"migration");
|
||||
if (migrate_add_blocker(tpm_emu->migration_blocker, &err) < 0) {
|
||||
if (migrate_add_blocker(&tpm_emu->migration_blocker, &err) < 0) {
|
||||
error_report_err(err);
|
||||
error_free(tpm_emu->migration_blocker);
|
||||
tpm_emu->migration_blocker = NULL;
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -1016,10 +1013,7 @@ static void tpm_emulator_inst_finalize(Object *obj)
|
||||
|
||||
qapi_free_TPMEmulatorOptions(tpm_emu->options);
|
||||
|
||||
if (tpm_emu->migration_blocker) {
|
||||
migrate_del_blocker(tpm_emu->migration_blocker);
|
||||
error_free(tpm_emu->migration_blocker);
|
||||
}
|
||||
migrate_del_blocker(&tpm_emu->migration_blocker);
|
||||
|
||||
tpm_sized_buffer_reset(&state_blobs->volatil);
|
||||
tpm_sized_buffer_reset(&state_blobs->permanent);
|
||||
|
||||
+3
-6
@@ -1369,9 +1369,8 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
bdrv_graph_rdunlock_main_loop();
|
||||
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
ret = migrate_add_blocker(&s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_setg(errp, "Migration blocker error");
|
||||
goto fail;
|
||||
}
|
||||
qemu_co_mutex_init(&s->lock);
|
||||
@@ -1406,7 +1405,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
ret = bdrv_check(bs, &res, BDRV_FIX_ERRORS | BDRV_FIX_LEAKS);
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, -ret, "Could not repair corrupted image");
|
||||
migrate_del_blocker(s->migration_blocker);
|
||||
migrate_del_blocker(&s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
@@ -1423,7 +1422,6 @@ fail:
|
||||
*/
|
||||
parallels_free_used_bitmap(bs);
|
||||
|
||||
error_free(s->migration_blocker);
|
||||
g_free(s->bat_dirty_bmap);
|
||||
qemu_vfree(s->header);
|
||||
return ret;
|
||||
@@ -1448,8 +1446,7 @@ static void parallels_close(BlockDriverState *bs)
|
||||
g_free(s->bat_dirty_bmap);
|
||||
qemu_vfree(s->header);
|
||||
|
||||
migrate_del_blocker(s->migration_blocker);
|
||||
error_free(s->migration_blocker);
|
||||
migrate_del_blocker(&s->migration_blocker);
|
||||
}
|
||||
|
||||
static bool parallels_is_support_dirty_bitmaps(BlockDriverState *bs)
|
||||
|
||||
+2
-4
@@ -307,9 +307,8 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
bdrv_graph_rdunlock_main_loop();
|
||||
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
ret = migrate_add_blocker(&s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -802,8 +801,7 @@ static void qcow_close(BlockDriverState *bs)
|
||||
g_free(s->cluster_cache);
|
||||
g_free(s->cluster_data);
|
||||
|
||||
migrate_del_blocker(s->migration_blocker);
|
||||
error_free(s->migration_blocker);
|
||||
migrate_del_blocker(&s->migration_blocker);
|
||||
}
|
||||
|
||||
static int coroutine_fn GRAPH_UNLOCKED
|
||||
|
||||
+2
-4
@@ -498,9 +498,8 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
bdrv_graph_rdunlock_main_loop();
|
||||
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
ret = migrate_add_blocker(&s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail_free_bmap;
|
||||
}
|
||||
|
||||
@@ -988,8 +987,7 @@ static void vdi_close(BlockDriverState *bs)
|
||||
|
||||
qemu_vfree(s->bmap);
|
||||
|
||||
migrate_del_blocker(s->migration_blocker);
|
||||
error_free(s->migration_blocker);
|
||||
migrate_del_blocker(&s->migration_blocker);
|
||||
}
|
||||
|
||||
static int vdi_has_zero_init(BlockDriverState *bs)
|
||||
|
||||
+2
-4
@@ -985,8 +985,7 @@ static void vhdx_close(BlockDriverState *bs)
|
||||
s->bat = NULL;
|
||||
qemu_vfree(s->parent_entries);
|
||||
s->parent_entries = NULL;
|
||||
migrate_del_blocker(s->migration_blocker);
|
||||
error_free(s->migration_blocker);
|
||||
migrate_del_blocker(&s->migration_blocker);
|
||||
qemu_vfree(s->log.hdr);
|
||||
s->log.hdr = NULL;
|
||||
vhdx_region_unregister_all(s);
|
||||
@@ -1097,9 +1096,8 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
error_setg(&s->migration_blocker, "The vhdx format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
ret = migrate_add_blocker(&s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -1386,9 +1386,8 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
error_setg(&s->migration_blocker, "The vmdk format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
ret = migrate_add_blocker(&s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -2867,8 +2866,7 @@ static void vmdk_close(BlockDriverState *bs)
|
||||
vmdk_free_extents(bs);
|
||||
g_free(s->create_type);
|
||||
|
||||
migrate_del_blocker(s->migration_blocker);
|
||||
error_free(s->migration_blocker);
|
||||
migrate_del_blocker(&s->migration_blocker);
|
||||
}
|
||||
|
||||
static int64_t coroutine_fn GRAPH_RDLOCK
|
||||
|
||||
+2
-4
@@ -452,9 +452,8 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
bdrv_graph_rdunlock_main_loop();
|
||||
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
ret = migrate_add_blocker(&s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -1190,8 +1189,7 @@ static void vpc_close(BlockDriverState *bs)
|
||||
g_free(s->pageentry_u8);
|
||||
#endif
|
||||
|
||||
migrate_del_blocker(s->migration_blocker);
|
||||
error_free(s->migration_blocker);
|
||||
migrate_del_blocker(&s->migration_blocker);
|
||||
}
|
||||
|
||||
static QemuOptsList vpc_create_opts = {
|
||||
|
||||
+2
-4
@@ -1268,9 +1268,8 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
"The vvfat (rw) format used by node '%s' "
|
||||
"does not support live migration",
|
||||
bdrv_get_device_or_node_name(bs));
|
||||
ret = migrate_add_blocker(s->migration_blocker, errp);
|
||||
ret = migrate_add_blocker(&s->migration_blocker, errp);
|
||||
if (ret < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
@@ -3239,8 +3238,7 @@ static void vvfat_close(BlockDriverState *bs)
|
||||
g_free(s->cluster_buffer);
|
||||
|
||||
if (s->qcow) {
|
||||
migrate_del_blocker(s->migration_blocker);
|
||||
error_free(s->migration_blocker);
|
||||
migrate_del_blocker(&s->migration_blocker);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -111,7 +111,7 @@ static int dump_cleanup(DumpState *s)
|
||||
qemu_mutex_unlock_iothread();
|
||||
}
|
||||
}
|
||||
migrate_del_blocker(dump_migration_blocker);
|
||||
migrate_del_blocker(&dump_migration_blocker);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2158,7 +2158,7 @@ void qmp_dump_guest_memory(bool paging, const char *file,
|
||||
* Allows even for -only-migratable, but forbid migration during the
|
||||
* process of dump guest memory.
|
||||
*/
|
||||
if (migrate_add_blocker_internal(dump_migration_blocker, errp)) {
|
||||
if (migrate_add_blocker_internal(&dump_migration_blocker, errp)) {
|
||||
/* Remember to release the fd before passing it over to dump state */
|
||||
close(fd);
|
||||
return;
|
||||
|
||||
+2
-8
@@ -406,11 +406,7 @@ static int coroutine_fn put_fid(V9fsPDU *pdu, V9fsFidState *fidp)
|
||||
* delete the migration blocker. Ideally, this
|
||||
* should be hooked to transport close notification
|
||||
*/
|
||||
if (pdu->s->migration_blocker) {
|
||||
migrate_del_blocker(pdu->s->migration_blocker);
|
||||
error_free(pdu->s->migration_blocker);
|
||||
pdu->s->migration_blocker = NULL;
|
||||
}
|
||||
migrate_del_blocker(&pdu->s->migration_blocker);
|
||||
}
|
||||
return free_fid(pdu, fidp);
|
||||
}
|
||||
@@ -1505,10 +1501,8 @@ static void coroutine_fn v9fs_attach(void *opaque)
|
||||
error_setg(&s->migration_blocker,
|
||||
"Migration is disabled when VirtFS export path '%s' is mounted in the guest using mount_tag '%s'",
|
||||
s->ctx.fs_root ? s->ctx.fs_root : "NULL", s->tag);
|
||||
err = migrate_add_blocker(s->migration_blocker, NULL);
|
||||
err = migrate_add_blocker(&s->migration_blocker, NULL);
|
||||
if (err < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
s->migration_blocker = NULL;
|
||||
clunk_fid(s, fid);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -184,8 +184,7 @@ virtio_gpu_base_device_realize(DeviceState *qdev,
|
||||
|
||||
if (virtio_gpu_virgl_enabled(g->conf)) {
|
||||
error_setg(&g->migration_blocker, "virgl is not yet migratable");
|
||||
if (migrate_add_blocker(g->migration_blocker, errp) < 0) {
|
||||
error_free(g->migration_blocker);
|
||||
if (migrate_add_blocker(&g->migration_blocker, errp) < 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -253,10 +252,7 @@ virtio_gpu_base_device_unrealize(DeviceState *qdev)
|
||||
{
|
||||
VirtIOGPUBase *g = VIRTIO_GPU_BASE(qdev);
|
||||
|
||||
if (g->migration_blocker) {
|
||||
migrate_del_blocker(g->migration_blocker);
|
||||
error_free(g->migration_blocker);
|
||||
}
|
||||
migrate_del_blocker(&g->migration_blocker);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -516,8 +516,7 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)
|
||||
if (!kvm_arm_gic_can_save_restore(s)) {
|
||||
error_setg(&s->migration_blocker, "This operating system kernel does "
|
||||
"not support vGICv2 migration");
|
||||
if (migrate_add_blocker(s->migration_blocker, errp) < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
if (migrate_add_blocker(&s->migration_blocker, errp) < 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,8 +114,7 @@ static void kvm_arm_its_realize(DeviceState *dev, Error **errp)
|
||||
GITS_CTLR)) {
|
||||
error_setg(&s->migration_blocker, "This operating system kernel "
|
||||
"does not support vITS migration");
|
||||
if (migrate_add_blocker(s->migration_blocker, errp) < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
if (migrate_add_blocker(&s->migration_blocker, errp) < 0) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -878,8 +878,7 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp)
|
||||
GICD_CTLR)) {
|
||||
error_setg(&s->migration_blocker, "This operating system kernel does "
|
||||
"not support vGICv3 migration");
|
||||
if (migrate_add_blocker(s->migration_blocker, errp) < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
if (migrate_add_blocker(&s->migration_blocker, errp) < 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-6
@@ -903,8 +903,7 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
|
||||
if (!ivshmem_is_master(s)) {
|
||||
error_setg(&s->migration_blocker,
|
||||
"Migration is disabled when using feature 'peer mode' in device 'ivshmem'");
|
||||
if (migrate_add_blocker(s->migration_blocker, errp) < 0) {
|
||||
error_free(s->migration_blocker);
|
||||
if (migrate_add_blocker(&s->migration_blocker, errp) < 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -922,10 +921,7 @@ static void ivshmem_exit(PCIDevice *dev)
|
||||
IVShmemState *s = IVSHMEM_COMMON(dev);
|
||||
int i;
|
||||
|
||||
if (s->migration_blocker) {
|
||||
migrate_del_blocker(s->migration_blocker);
|
||||
error_free(s->migration_blocker);
|
||||
}
|
||||
migrate_del_blocker(&s->migration_blocker);
|
||||
|
||||
if (memory_region_is_mapped(s->ivshmem_bar2)) {
|
||||
if (!s->hostmem) {
|
||||
|
||||
+3
-3
@@ -3624,8 +3624,8 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
|
||||
n->primary_listener.hide_device = failover_hide_primary_device;
|
||||
qatomic_set(&n->failover_primary_hidden, true);
|
||||
device_listener_register(&n->primary_listener);
|
||||
n->migration_state.notify = virtio_net_migration_state_notifier;
|
||||
add_migration_state_change_notifier(&n->migration_state);
|
||||
migration_add_notifier(&n->migration_state,
|
||||
virtio_net_migration_state_notifier);
|
||||
n->host_features |= (1ULL << VIRTIO_NET_F_STANDBY);
|
||||
}
|
||||
|
||||
@@ -3788,7 +3788,7 @@ static void virtio_net_device_unrealize(DeviceState *dev)
|
||||
if (n->failover) {
|
||||
qobject_unref(n->primary_opts);
|
||||
device_listener_unregister(&n->primary_listener);
|
||||
remove_migration_state_change_notifier(&n->migration_state);
|
||||
migration_remove_notifier(&n->migration_state);
|
||||
} else {
|
||||
assert(n->primary_opts == NULL);
|
||||
}
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ static int kvmppc_svm_init(ConfidentialGuestSupport *cgs, Error **errp)
|
||||
/* add migration blocker */
|
||||
error_setg(&pef_mig_blocker, "PEF: Migration is not implemented");
|
||||
/* NB: This can fail if --only-migratable is used */
|
||||
migrate_add_blocker(pef_mig_blocker, &error_fatal);
|
||||
migrate_add_blocker(&pef_mig_blocker, &error_fatal);
|
||||
|
||||
cgs->ready = true;
|
||||
|
||||
|
||||
+1
-8
@@ -1761,7 +1761,7 @@ static void spapr_machine_reset(MachineState *machine, ShutdownCause reason)
|
||||
/* Signal all vCPUs waiting on this condition */
|
||||
qemu_cond_broadcast(&spapr->fwnmi_machine_check_interlock_cond);
|
||||
|
||||
migrate_del_blocker(spapr->fwnmi_migration_blocker);
|
||||
migrate_del_blocker(&spapr->fwnmi_migration_blocker);
|
||||
}
|
||||
|
||||
static void spapr_create_nvram(SpaprMachineState *spapr)
|
||||
@@ -2937,13 +2937,6 @@ static void spapr_machine_init(MachineState *machine)
|
||||
spapr_create_lmb_dr_connectors(spapr);
|
||||
}
|
||||
|
||||
if (spapr_get_cap(spapr, SPAPR_CAP_FWNMI) == SPAPR_CAP_ON) {
|
||||
/* Create the error string for live migration blocker */
|
||||
error_setg(&spapr->fwnmi_migration_blocker,
|
||||
"A machine check is being handled during migration. The handler"
|
||||
"may run and log hardware error on the destination");
|
||||
}
|
||||
|
||||
if (mc->nvdimm_supported) {
|
||||
spapr_create_nvdimm_dr_connectors(spapr);
|
||||
}
|
||||
|
||||
@@ -920,7 +920,11 @@ void spapr_mce_req_event(PowerPCCPU *cpu, bool recovered)
|
||||
* fails when running with -only-migrate. A proper interface to
|
||||
* delay migration completion for a bit could avoid that.
|
||||
*/
|
||||
ret = migrate_add_blocker(spapr->fwnmi_migration_blocker, NULL);
|
||||
error_setg(&spapr->fwnmi_migration_blocker,
|
||||
"A machine check is being handled during migration. The handler"
|
||||
"may run and log hardware error on the destination");
|
||||
|
||||
ret = migrate_add_blocker(&spapr->fwnmi_migration_blocker, NULL);
|
||||
if (ret == -EBUSY) {
|
||||
warn_report("Received a fwnmi while migration was in progress");
|
||||
}
|
||||
|
||||
+1
-1
@@ -496,7 +496,7 @@ static void rtas_ibm_nmi_interlock(PowerPCCPU *cpu,
|
||||
spapr->fwnmi_machine_check_interlock = -1;
|
||||
qemu_cond_signal(&spapr->fwnmi_machine_check_interlock_cond);
|
||||
rtas_st(rets, 0, RTAS_OUT_SUCCESS);
|
||||
migrate_del_blocker(spapr->fwnmi_migration_blocker);
|
||||
migrate_del_blocker(&spapr->fwnmi_migration_blocker);
|
||||
}
|
||||
|
||||
static struct rtas_call {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user