[PATCH 14/19] qemu: Remove special case for virDomainGetBlockInfo

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

 



Like other query commands, this can now be called directly during
migration.
---
 src/qemu/qemu_domain.h    |    4 ----
 src/qemu/qemu_driver.c    |   42 ++++++++++++------------------------------
 src/qemu/qemu_migration.c |   14 --------------
 3 files changed, 12 insertions(+), 48 deletions(-)

diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 387c64c..0958bf2 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -71,7 +71,6 @@ enum qemuDomainJobSignals {
     QEMU_JOB_SIGNAL_MIGRATE_DOWNTIME = 1 << 2, /* Request migration downtime change */
     QEMU_JOB_SIGNAL_MIGRATE_SPEED = 1 << 3, /* Request migration speed change */
     QEMU_JOB_SIGNAL_BLKSTAT = 1 << 4, /* Request blkstat during migration */
-    QEMU_JOB_SIGNAL_BLKINFO = 1 << 5, /* Request blkinfo during migration */
 };
 
 struct qemuDomainJobSignalsData {
@@ -80,9 +79,6 @@ struct qemuDomainJobSignalsData {
     char *statDevName; /* Device name used by blkstat calls */
     virDomainBlockStatsPtr blockStat; /* Block statistics for QEMU_JOB_SIGNAL_BLKSTAT */
     int *statRetCode; /* Return code for the blkstat calls */
-    char *infoDevName; /* Device name used by blkinfo calls */
-    virDomainBlockInfoPtr blockInfo; /* Block information for QEMU_JOB_SIGNAL_BLKINFO */
-    int *infoRetCode; /* Return code for the blkinfo calls */
 };
 
 struct qemuDomainJobObj {
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e317c5b..76dfbd8 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6455,39 +6455,21 @@ static int qemuDomainGetBlockInfo(virDomainPtr dom,
         virDomainObjIsActive(vm)) {
         qemuDomainObjPrivatePtr priv = vm->privateData;
 
-        if ((priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_OUT)
-            || (priv->job.asyncJob == QEMU_ASYNC_JOB_SAVE)) {
-            virDomainObjRef(vm);
-            while (priv->job.signals & QEMU_JOB_SIGNAL_BLKINFO)
-                ignore_value(virCondWait(&priv->job.signalCond, &vm->lock));
-
-            priv->job.signalsData.infoDevName = disk->info.alias;
-            priv->job.signalsData.blockInfo = info;
-            priv->job.signalsData.infoRetCode = &ret;
-            priv->job.signals |= QEMU_JOB_SIGNAL_BLKINFO;
-
-            while (priv->job.signals & QEMU_JOB_SIGNAL_BLKINFO)
-                ignore_value(virCondWait(&priv->job.signalCond, &vm->lock));
+        if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
+            goto cleanup;
 
-            if (virDomainObjUnref(vm) == 0)
-                vm = NULL;
+        if (virDomainObjIsActive(vm)) {
+            ignore_value(qemuDomainObjEnterMonitor(driver, vm));
+            ret = qemuMonitorGetBlockExtent(priv->mon,
+                                            disk->info.alias,
+                                            &info->allocation);
+            qemuDomainObjExitMonitor(driver, vm);
         } else {
-            if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
-                goto cleanup;
-
-            if (virDomainObjIsActive(vm)) {
-                ignore_value(qemuDomainObjEnterMonitor(driver, vm));
-                ret = qemuMonitorGetBlockExtent(priv->mon,
-                                                disk->info.alias,
-                                                &info->allocation);
-                qemuDomainObjExitMonitor(driver, vm);
-            } else {
-                ret = 0;
-            }
-
-            if (qemuDomainObjEndJob(driver, vm) == 0)
-                vm = NULL;
+            ret = 0;
         }
+
+        if (qemuDomainObjEndJob(driver, vm) == 0)
+            vm = NULL;
     } else {
         ret = 0;
     }
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index bcca454..8a14d2e 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -819,20 +819,6 @@ qemuMigrationProcessJobSignals(struct qemud_driver *driver,
 
         if (ret < 0)
             VIR_WARN("Unable to get block statistics");
-    } else if (priv->job.signals & QEMU_JOB_SIGNAL_BLKINFO) {
-        ret = qemuDomainObjEnterMonitorWithDriver(driver, vm);
-        if (ret == 0) {
-            ret = qemuMonitorGetBlockExtent(priv->mon,
-                               priv->job.signalsData.infoDevName,
-                               &priv->job.signalsData.blockInfo->allocation);
-            qemuDomainObjExitMonitorWithDriver(driver, vm);
-        }
-
-        *priv->job.signalsData.infoRetCode = ret;
-        priv->job.signals ^= QEMU_JOB_SIGNAL_BLKINFO;
-
-        if (ret < 0)
-            VIR_WARN("Unable to get block information");
     } else {
         ret = 0;
     }
-- 
1.7.6

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