libvirt/src/qemu
Jiri Denemark eca9d21e6c qemu: Fix post-copy migration on the source
Post-copy migration has been broken on the source since commit
v3.8.0-245-g32c29f10db which implemented support for
pause-before-switchover QEMU migration capability.

Even though the migration itself went well, the source did not really
know when it switched to the post-copy mode despite the messages logged
by MIGRATION event handler. As a result of this, the events emitted by
source libvirtd were not accurate and statistics of the completed
migration would cover only the pre-copy part of migration. Moreover, if
migration failed during the post-copy phase for some reason, the source
libvirtd would just happily resume the domain, which could lead to disk
corruption.

With the pause-before-switchover capability enabled, the order of events
emitted by QEMU changed:

                    pause-before-switchover
           disabled                        enabled
    MIGRATION, postcopy-active      STOP
    STOP                            MIGRATION, pre-switchover
                                    MIGRATION, postcopy-active

The STOP even handler checks the migration status (postcopy-active) and
sets the domain state accordingly. Which is sufficient when
pause-before-switchover is disabled, but once we enable it, the
migration status is still active when we get STOP from QEMU. Thus the
domain state set in the STOP handler has to be corrected once we are
notified that migration changed to postcopy-active.

This results in two SUSPENDED events to be emitted by the source
libvirtd during post-copy migration. The first one with
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED detail, while the second one reports
the corrected VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY detail. This is
inevitable because we don't know whether migration will eventually
switch to post-copy at the time we emit the first event.

https://bugzilla.redhat.com/show_bug.cgi?id=1647365

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-11-29 11:36:15 +01:00
..
EVENTHANDLERS.txt
libvirtd_qemu.aug qemu: Temporarily disable metadata locking 2018-09-27 16:22:44 +02:00
Makefile.inc.am qemu: add qemu_monitor_priv.h to sources list 2018-06-12 10:16:41 +01:00
MIGRATION.txt
qemu_agent.c qemu: agent: Avoid agentError when closing the QEMU agent 2018-11-15 13:51:02 -05:00
qemu_agent.h qemu: implementing qemuAgentGetHostname() function. 2018-09-05 13:13:37 -04:00
qemu_alias.c src: remove blank first line in function body 2018-09-17 13:29:01 +02:00
qemu_alias.h qemu: alias: Generate QOM name of the block backend for disks 2018-08-21 15:46:06 +02:00
qemu_block.c qemu: block: Add generator for the 'copy-on-read' blockdev driver 2018-08-21 15:46:06 +02:00
qemu_block.h qemu: block: Add generator for the 'copy-on-read' blockdev driver 2018-08-21 15:46:06 +02:00
qemu_blockjob.c qemu: domain: Move out clearing of backing chain in qemuDomainDetermineDiskChain 2018-07-20 15:33:20 +02:00
qemu_blockjob.h
qemu_capabilities.c qemu: Introduce QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV 2018-11-27 17:12:18 +01:00
qemu_capabilities.h qemu: Introduce QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV 2018-11-27 17:12:18 +01:00
qemu_capspriv.h qemu: remove unnecessary virQEMUCapsFreeHostCPUModel 2018-09-12 21:12:22 +02:00
qemu_cgroup.c Revert "util: cgroup: modify virCgroupFree to take virCgroupPtr" 2018-07-30 13:30:11 +02:00
qemu_cgroup.h
qemu_command.c qemu: Format nested-hv feature on the command line 2018-11-27 17:12:21 +01:00
qemu_command.h qemu: Generate and use zPCI device in QEMU command line 2018-11-15 12:32:18 +01:00
qemu_conf.c qemu: Fix virDoes*Exist usage 2018-11-19 22:33:05 +01:00
qemu_conf.h Revert "qemu_conf: Introduce metadata_lock_manager" 2018-11-16 13:42:39 +01:00
qemu_domain_address.c conf: Allocate/release 'uid' and 'fid' in PCI address 2018-11-15 12:32:18 +01:00
qemu_domain_address.h qemu: move qemuDomainCCWAddrSetCreateFromDomain 2018-07-03 15:37:32 -04:00
qemu_domain.c conf: Parse and format nested-hv feature 2018-11-27 17:12:19 +01:00
qemu_domain.h qemu_domain: Track if domain remembers original owner 2018-11-16 13:42:38 +01:00
qemu_driver.c qemu: Report cache occupancy (CMT) with domstats 2018-11-26 19:33:01 -05:00
qemu_driver.h
qemu_extdevice.c qemu_tpm: Pass virDomainObjPtr instead of virDomainDefPtr 2018-11-16 13:42:38 +01:00
qemu_extdevice.h qemu_tpm: Pass virDomainObjPtr instead of virDomainDefPtr 2018-11-16 13:42:38 +01:00
qemu_hostdev.c src: More cleanup of some system headers already contained in internal.h 2018-09-20 10:16:39 +02:00
qemu_hostdev.h hostdev: Maintain a driver list of active mediated devices 2017-03-27 15:39:35 +02:00
qemu_hotplug.c qemu: Add hotpluging support for PCI devices on S390 guests 2018-11-15 12:32:18 +01:00
qemu_hotplug.h Revert "qemu: hotplug: consolidate media change code paths" 2018-10-08 12:37:07 +02:00
qemu_hotplugpriv.h
qemu_interface.c nwfilter: convert virt drivers to use public API for nwfilter bindings 2018-06-26 18:17:23 +01:00
qemu_interface.h
qemu_migration_cookie.c qemuMigrationEatCookie: Pass virDomainDef instead of virDomainObj 2018-11-23 16:25:42 +01:00
qemu_migration_cookie.h qemuMigrationEatCookie: Pass virDomainDef instead of virDomainObj 2018-11-23 16:25:42 +01:00
qemu_migration_params.c
qemu_migration_params.h
qemu_migration_paramspriv.h
qemu_migration.c qemuMigrationSrcConfirm: Don't remove domain config if confirm phase fails 2018-11-23 16:25:54 +01:00
qemu_migration.h
qemu_monitor_json.c qemu: Add monitor functions to set IOThread params 2018-11-19 07:26:40 -05:00
qemu_monitor_json.h qemu: Add monitor functions to set IOThread params 2018-11-19 07:26:40 -05:00
qemu_monitor_priv.h qemu: monitor: Add possibility to reset command sequence in tests 2018-06-12 10:27:49 +02:00
qemu_monitor_text.c src: More cleanup of some system headers already contained in internal.h 2018-09-20 10:16:39 +02:00
qemu_monitor_text.h
qemu_monitor.c qemu: Add monitor functions to set IOThread params 2018-11-19 07:26:40 -05:00
qemu_monitor.h qemu: Add monitor functions to set IOThread params 2018-11-19 07:26:40 -05:00
qemu_parse_command.c qemu: add support for Hyper-V Enlightened VMCS 2018-11-15 09:54:57 +01:00
qemu_parse_command.h qemu: fix default machine for argv -> xml convertor 2018-08-28 11:49:01 +01:00
qemu_process.c qemu: Fix post-copy migration on the source 2018-11-29 11:36:15 +01:00
qemu_process.h qemu_process.c: moving qemuValidateCpuCount to qemu_domain.c 2018-11-15 16:39:16 -05:00
qemu_processpriv.h
qemu_qapi.c qemu: qapi: Allow selecting specifically optional schema entries in virQEMUQAPISchemaTraverse 2018-08-24 15:58:33 +02:00
qemu_qapi.h
qemu_security.c virSecurityManagerTransactionCommit: Do metadata locking iff enabled in config 2018-11-16 13:42:38 +01:00
qemu_security.h qemu_tpm: Pass virDomainObjPtr instead of virDomainDefPtr 2018-11-16 13:42:38 +01:00
qemu_tpm.c qemu_tpm: Pass virDomainObjPtr instead of virDomainDefPtr 2018-11-16 13:42:38 +01:00
qemu_tpm.h qemu_tpm: Pass virDomainObjPtr instead of virDomainDefPtr 2018-11-16 13:42:38 +01:00
qemu.conf qemu: Temporarily disable metadata locking 2018-09-27 16:22:44 +02:00
test_libvirtd_qemu.aug.in qemu: Temporarily disable metadata locking 2018-09-27 16:22:44 +02:00
THREADS.txt qemu: Introduce APIs for manipulating qemuDomainAgentJob 2018-06-20 13:24:17 +02:00