[PATCH] qemuProcessReconnect: Avoid relabeling images after migration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Restarting libvirtd on the source host at the end of migration when a
domain is already running on the destination would cause image labels to
be reset effectively killing the domain. Commit e8d0166e1d fixed similar
issue on the destination host, but kept the source always resetting the
labels, which was mostly correct except for the specific case handled by
this patch.

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

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_process.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index f8f379a58..01c9259b6 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2955,7 +2955,8 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
                                virConnectPtr conn,
                                qemuMigrationJobPhase phase,
                                virDomainState state,
-                               int reason)
+                               int reason,
+                               unsigned int *stopFlags)
 {
     bool postcopy = state == VIR_DOMAIN_PAUSED &&
                     (reason == VIR_DOMAIN_PAUSED_POSTCOPY ||
@@ -3019,6 +3020,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
 
     case QEMU_MIGRATION_PHASE_CONFIRM3:
         /* migration completed, we need to kill the domain here */
+        *stopFlags |= VIR_QEMU_PROCESS_STOP_MIGRATED;
         return -1;
     }
 
@@ -3044,7 +3046,8 @@ static int
 qemuProcessRecoverJob(virQEMUDriverPtr driver,
                       virDomainObjPtr vm,
                       virConnectPtr conn,
-                      const struct qemuDomainJobObj *job)
+                      const struct qemuDomainJobObj *job,
+                      unsigned int *stopFlags)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
     virDomainState state;
@@ -3055,7 +3058,7 @@ qemuProcessRecoverJob(virQEMUDriverPtr driver,
     switch (job->asyncJob) {
     case QEMU_ASYNC_JOB_MIGRATION_OUT:
         if (qemuProcessRecoverMigrationOut(driver, vm, conn, job->phase,
-                                           state, reason) < 0)
+                                           state, reason, stopFlags) < 0)
             return -1;
         break;
 
@@ -3402,7 +3405,7 @@ qemuProcessReconnect(void *opaque)
     if (qemuProcessRefreshBalloonState(driver, obj, QEMU_ASYNC_JOB_NONE) < 0)
         goto error;
 
-    if (qemuProcessRecoverJob(driver, obj, conn, &oldjob) < 0)
+    if (qemuProcessRecoverJob(driver, obj, conn, &oldjob, &stopFlags) < 0)
         goto error;
 
     if (qemuProcessUpdateDevices(driver, obj) < 0)
-- 
2.11.0.rc2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux