[libvirt PATCH v2 47/81] qemu: Do not set job owner in qemuMigrationJobSetPhase

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

 



Both qemuMigrationJobSetPhase and qemuMigrationJobStartPhase were doing
the same thing, which made little sense. Let's follow the difference
between qemuDomainObjSetJobPhase and qemuDomainObjStartJobPhase and
change job owner only in qemuMigrationJobStartPhase.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>
Reviewed-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---

Notes:
    Version 2:
    - no change

 src/qemu/qemu_migration.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 1c015c0bcb..88702c94e4 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -165,7 +165,7 @@ qemuMigrationJobSetPhase(virDomainObj *vm,
     if (qemuMigrationCheckPhase(vm, phase) < 0)
         return -1;
 
-    qemuDomainObjStartJobPhase(vm, phase);
+    qemuDomainObjSetJobPhase(vm, phase);
     return 0;
 }
 
@@ -174,7 +174,11 @@ static int G_GNUC_WARN_UNUSED_RESULT
 qemuMigrationJobStartPhase(virDomainObj *vm,
                            qemuMigrationJobPhase phase)
 {
-    return qemuMigrationJobSetPhase(vm, phase);
+    if (qemuMigrationCheckPhase(vm, phase) < 0)
+        return -1;
+
+    qemuDomainObjStartJobPhase(vm, phase);
+    return 0;
 }
 
 
@@ -2570,7 +2574,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
      * change protection.
      */
     if (priv->job.asyncJob == VIR_ASYNC_JOB_MIGRATION_OUT &&
-        qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_BEGIN3) < 0)
+        qemuMigrationJobStartPhase(vm, QEMU_MIGRATION_PHASE_BEGIN3) < 0)
         return NULL;
 
     if (!qemuMigrationSrcIsAllowed(driver, vm, true, flags))
@@ -3121,7 +3125,7 @@ qemuMigrationDstPrepareAny(virQEMUDriver *driver,
                               flags) < 0)
         goto cleanup;
 
-    if (qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_PREPARE) < 0)
+    if (qemuMigrationJobStartPhase(vm, QEMU_MIGRATION_PHASE_PREPARE) < 0)
         goto stopjob;
 
     /* Domain starts inactive, even if the domain XML had an id field. */
@@ -3642,7 +3646,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriver *driver,
     else
         phase = QEMU_MIGRATION_PHASE_CONFIRM3_CANCELLED;
 
-    if (qemuMigrationJobSetPhase(vm, phase) < 0)
+    if (qemuMigrationJobStartPhase(vm, phase) < 0)
         return -1;
 
     if (!(mig = qemuMigrationCookieParse(driver, vm->def, priv->origname, priv,
@@ -4893,7 +4897,7 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriver *driver,
      * until the migration is complete.
      */
     VIR_DEBUG("Perform %p", sconn);
-    ignore_value(qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_PERFORM2));
+    ignore_value(qemuMigrationJobStartPhase(vm, QEMU_MIGRATION_PHASE_PERFORM2));
     if (flags & VIR_MIGRATE_TUNNELLED)
         ret = qemuMigrationSrcPerformTunnel(driver, vm, st, NULL,
                                             NULL, 0, NULL, NULL,
@@ -5538,7 +5542,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver,
                                                migParams, flags, dname, resource,
                                                &v3proto);
     } else {
-        if (qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_PERFORM2) < 0)
+        if (qemuMigrationJobStartPhase(vm, QEMU_MIGRATION_PHASE_PERFORM2) < 0)
             goto endjob;
 
         ret = qemuMigrationSrcPerformNative(driver, vm, persist_xml, uri, cookiein, cookieinlen,
-- 
2.35.1




[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