[PATCH] qemu: Use proper async job to refresh virtio channels

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

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_migration.c | 3 ++-
 src/qemu/qemu_process.c   | 9 ++++++---
 src/qemu/qemu_process.h   | 3 ++-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 83e1bfc..0b1770b 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -6225,7 +6225,8 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
     if (qemuMigrationStopNBDServer(driver, vm, mig) < 0)
         goto endjob;
 
-    if (qemuRefreshVirtioChannelState(driver, vm) < 0)
+    if (qemuRefreshVirtioChannelState(driver, vm,
+                                      QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
         goto endjob;
 
     if ((rc = qemuConnectAgent(driver, vm)) < 0) {
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 63da600..c8ff587 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1974,13 +1974,16 @@ qemuProcessRefreshChannelVirtioState(virQEMUDriverPtr driver,
 
 int
 qemuRefreshVirtioChannelState(virQEMUDriverPtr driver,
-                              virDomainObjPtr vm)
+                              virDomainObjPtr vm,
+                              qemuDomainAsyncJob asyncJob)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
     virHashTablePtr info = NULL;
     int ret = -1;
 
-    qemuDomainObjEnterMonitor(driver, vm);
+    if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+        goto cleanup;
+
     ret = qemuMonitorGetChardevInfo(priv->mon, &info);
     if (qemuDomainObjExitMonitor(driver, vm) < 0)
         ret = -1;
@@ -3312,7 +3315,7 @@ qemuProcessReconnect(void *opaque)
     if (qemuProcessRefreshDisks(driver, obj, QEMU_ASYNC_JOB_NONE) < 0)
         goto error;
 
-    if (qemuRefreshVirtioChannelState(driver, obj) < 0)
+    if (qemuRefreshVirtioChannelState(driver, obj, QEMU_ASYNC_JOB_NONE) < 0)
         goto error;
 
     /* If querying of guest's RTC failed, report error, but do not kill the domain. */
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index 37081ad..21f3b0c 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -180,7 +180,8 @@ int qemuProcessSetupIOThread(virDomainObjPtr vm,
                              virDomainIOThreadIDDefPtr iothread);
 
 int qemuRefreshVirtioChannelState(virQEMUDriverPtr driver,
-                                  virDomainObjPtr vm);
+                                  virDomainObjPtr vm,
+                                  qemuDomainAsyncJob asyncJob);
 
 int qemuProcessRefreshBalloonState(virQEMUDriverPtr driver,
                                    virDomainObjPtr vm,
-- 
2.9.0

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