From 35ebd44b3326a0b0d35597cdfb42e935f9e6875a Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jan 29 2019 15:26:40 +0000 Subject: import libvirt-4.5.0-10.el7_6.4 --- diff --git a/SOURCES/libvirt-RHEL-cpu_map-Mark-arch-facilities-feature-as-non-migratable.patch b/SOURCES/libvirt-RHEL-cpu_map-Mark-arch-facilities-feature-as-non-migratable.patch new file mode 100644 index 0000000..ebdaa75 --- /dev/null +++ b/SOURCES/libvirt-RHEL-cpu_map-Mark-arch-facilities-feature-as-non-migratable.patch @@ -0,0 +1,43 @@ +From a74e5a0ea4e4a938bf9694b3d6194b68e5cffab1 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Denemark +Date: Wed, 9 Jan 2019 15:39:49 +0100 +Subject: [PATCH] RHEL: cpu_map: Mark arch-facilities feature as non-migratable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RHEL-only + +The arch-facilities feature, which was added only in RHEL, is not +migratable and thus it should not be included in host-model features. + +The feature was introduced as arch-capabilities upstream in QEMU 3.1.0, +which is later than QEMU 2.10, where we started probing what features +cannot be migrated, so we don't need to add this cpu_map hack there. + +https://bugzilla.redhat.com/show_bug.cgi?id=1658406 +https://bugzilla.redhat.com/show_bug.cgi?id=1664793 + +Signed-off-by: Jiri Denemark +Reviewed-by: Ján Tomko +--- + src/cpu/cpu_map.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml +index f1f8048c14..9d53d4b43a 100644 +--- a/src/cpu/cpu_map.xml ++++ b/src/cpu/cpu_map.xml +@@ -301,7 +301,7 @@ + + + +- ++ + + + +-- +2.20.1 + diff --git a/SOURCES/libvirt-qemu-Fix-post-copy-migration-on-the-source.patch b/SOURCES/libvirt-qemu-Fix-post-copy-migration-on-the-source.patch new file mode 100644 index 0000000..4445b81 --- /dev/null +++ b/SOURCES/libvirt-qemu-Fix-post-copy-migration-on-the-source.patch @@ -0,0 +1,110 @@ +From 35c8afb44903ae12239323873af0c0376082b02b Mon Sep 17 00:00:00 2001 +Message-Id: <35c8afb44903ae12239323873af0c0376082b02b@dist-git> +From: Jiri Denemark +Date: Thu, 15 Nov 2018 11:16:43 +0100 +Subject: [PATCH] qemu: Fix post-copy migration on the source +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 +Reviewed-by: Ján Tomko +(cherry picked from commit eca9d21e6cc8129ec4426fbf1ace30e215b9cfbc) + +https://bugzilla.redhat.com/show_bug.cgi?id=1649169 +https://bugzilla.redhat.com/show_bug.cgi?id=1654732 + +Signed-off-by: Jiri Denemark +--- + src/qemu/qemu_process.c | 26 +++++++++++++++++++++++++- + 1 file changed, 25 insertions(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c +index 9b5cb93325..485e455a44 100644 +--- a/src/qemu/qemu_process.c ++++ b/src/qemu/qemu_process.c +@@ -1521,9 +1521,13 @@ static int + qemuProcessHandleMigrationStatus(qemuMonitorPtr mon ATTRIBUTE_UNUSED, + virDomainObjPtr vm, + int status, +- void *opaque ATTRIBUTE_UNUSED) ++ void *opaque) + { + qemuDomainObjPrivatePtr priv; ++ virQEMUDriverPtr driver = opaque; ++ virObjectEventPtr event = NULL; ++ virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); ++ int reason; + + virObjectLock(vm); + +@@ -1540,8 +1544,28 @@ qemuProcessHandleMigrationStatus(qemuMonitorPtr mon ATTRIBUTE_UNUSED, + priv->job.current->stats.mig.status = status; + virDomainObjBroadcast(vm); + ++ if (status == QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY && ++ virDomainObjGetState(vm, &reason) == VIR_DOMAIN_PAUSED && ++ reason == VIR_DOMAIN_PAUSED_MIGRATION) { ++ VIR_DEBUG("Correcting paused state reason for domain %s to %s", ++ vm->def->name, ++ virDomainPausedReasonTypeToString(VIR_DOMAIN_PAUSED_POSTCOPY)); ++ ++ virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_POSTCOPY); ++ event = virDomainEventLifecycleNewFromObj(vm, ++ VIR_DOMAIN_EVENT_SUSPENDED, ++ VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY); ++ ++ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) { ++ VIR_WARN("Unable to save status on vm %s after state change", ++ vm->def->name); ++ } ++ } ++ + cleanup: + virObjectUnlock(vm); ++ virObjectEventStateQueue(driver->domainEventState, event); ++ virObjectUnref(cfg); + return 0; + } + +-- +2.20.1 + diff --git a/SPECS/libvirt.spec b/SPECS/libvirt.spec index 926c37d..d43a998 100644 --- a/SPECS/libvirt.spec +++ b/SPECS/libvirt.spec @@ -253,7 +253,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 4.5.0 -Release: 10%{?dist}.3%{?extra_release} +Release: 10%{?dist}.4%{?extra_release} License: LGPLv2+ URL: https://libvirt.org/ @@ -381,6 +381,8 @@ Patch115: libvirt-qemu-Pass-running-reason-to-RESUME-event-handler.patch Patch116: libvirt-qemu-Map-running-reason-to-resume-event-detail.patch Patch117: libvirt-qemu-Avoid-duplicate-resume-events-and-state-changes.patch Patch118: libvirt-qemu-Don-t-ignore-resume-events.patch +Patch119: libvirt-qemu-Fix-post-copy-migration-on-the-source.patch +Patch120: libvirt-RHEL-cpu_map-Mark-arch-facilities-feature-as-non-migratable.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -2280,6 +2282,10 @@ exit 0 %changelog +* Thu Jan 10 2019 Jiri Denemark - 4.5.0-10.el7_6.4 +- qemu: Fix post-copy migration on the source (rhbz#1654732) +- RHEL: cpu_map: Mark arch-facilities feature as non-migratable (rhbz#1664793) + * Thu Nov 8 2018 Jiri Denemark - 4.5.0-10.el7_6.3 - virfile: Take symlink into account in virFileIsSharedFixFUSE (rhbz#1641798) - qemu: Properly report VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT (rhbz#1634759)