[libvirt] [PATCH] qemu: avoid deadlock on domain object enter monitor fail

Wang King king.wang at huawei.com
Wed Jul 19 06:40:24 UTC 2017


Should be followed with qemuDomainObjExitMonitor only if
qemuDomainObjEnterMonitorAsync returns 0.
---
 src/qemu/qemu_migration.c | 2 +-
 src/qemu/qemu_process.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index c23fffe..dc56263 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -108,7 +108,7 @@ qemuMigrationCheckTLSCreds(virQEMUDriverPtr driver,
     qemuMonitorMigrationParams migParams = { 0 };
 
     if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
-        goto cleanup;
+        return -1;
 
     if (qemuMonitorGetMigrationParams(priv->mon, &migParams) < 0)
         goto cleanup;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index c2c3e8b..8d3cfe0 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4349,7 +4349,7 @@ qemuProcessSetupBalloon(virQEMUDriverPtr driver,
         return 0;
 
     if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
-        goto cleanup;
+        return -1;
 
     if (vm->def->memballoon->period)
         qemuMonitorSetMemoryStatsPeriod(priv->mon, vm->def->memballoon,
-- 
2.8.3





More information about the libvir-list mailing list