[PATCH 4/5] qemu: mark graphics ports as used on migration

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

 



Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
---
 src/qemu/qemu_migration.c | 6 ++++++
 src/qemu/qemu_process.c   | 2 +-
 src/qemu/qemu_process.h   | 3 +++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 435cd17..7e12ff6 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -4928,6 +4928,7 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver,
     qemuDomainJobInfoPtr jobInfo = NULL;
     bool inPostCopy = false;
     bool doKill = true;
+    size_t i;
 
     VIR_DEBUG("driver=%p, dconn=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
               "cookieout=%p, cookieoutlen=%p, flags=0x%lx, retcode=%d",
@@ -5000,6 +5001,11 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver,
     if (qemuConnectAgent(driver, vm) < 0)
         goto endjob;
 
+    for (i = 0; i < vm->def->ngraphics; i++) {
+        if (qemuProcessGraphicsReservePorts(vm->def->graphics[i], true) < 0)
+            goto endjob;
+    }
+
     if (flags & VIR_MIGRATE_PERSIST_DEST) {
         if (qemuMigrationDstPersist(driver, vm, mig, !v3proto) < 0) {
             /* Hmpf.  Migration was successful, but making it persistent
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 09e0327..9f41313 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4303,7 +4303,7 @@ qemuProcessStartHook(virQEMUDriverPtr driver,
 }
 
 
-static int
+int
 qemuProcessGraphicsReservePorts(virDomainGraphicsDefPtr graphics,
                                 bool reconnect)
 {
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index 07ce3a9..5d234f0 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -214,4 +214,7 @@ int qemuProcessStartManagedPRDaemon(virDomainObjPtr vm);
 
 void qemuProcessKillManagedPRDaemon(virDomainObjPtr vm);
 
+int qemuProcessGraphicsReservePorts(virDomainGraphicsDefPtr graphics,
+                                    bool reconnect);
+
 #endif /* __QEMU_PROCESS_H__ */
-- 
1.8.3.1

--
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