Like other query commands, this can now be called directly during
migration.
---
src/qemu/qemu_domain.h | 4 ---
src/qemu/qemu_driver.c | 54 +++++++++++++++------------------------------
src/qemu/qemu_migration.c | 18 ---------------
3 files changed, 18 insertions(+), 58 deletions(-)
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 37c9515..a3acaf5 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -76,15 +76,11 @@ enum qemuDomainJobSignals {
QEMU_JOB_SIGNAL_SUSPEND = 1 << 1, /* Request VM suspend to finish live
migration offline */
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 */
};
struct qemuDomainJobSignalsData {
unsigned long long migrateDowntime; /* Data for QEMU_JOB_SIGNAL_MIGRATE_DOWNTIME */
unsigned long migrateBandwidth; /* Data for QEMU_JOB_SIGNAL_MIGRATE_SPEED */
- 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 */
};
struct qemuDomainJobObj {
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 407f52f..f6cd433 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6056,46 +6056,28 @@ qemudDomainBlockStats (virDomainPtr dom,
}
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_BLKSTAT)
- ignore_value(virCondWait(&priv->job.signalCond, &vm->lock));
-
- priv->job.signalsData.statDevName = disk->info.alias;
- priv->job.signalsData.blockStat = stats;
- priv->job.signalsData.statRetCode = &ret;
- priv->job.signals |= QEMU_JOB_SIGNAL_BLKSTAT;
-
- while (priv->job.signals & QEMU_JOB_SIGNAL_BLKSTAT)
- ignore_value(virCondWait(&priv->job.signalCond, &vm->lock));
-
- if (virDomainObjUnref(vm) == 0)
- vm = NULL;
- } else {
- if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
- goto cleanup;
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
+ goto cleanup;
- if (!virDomainObjIsActive(vm)) {
- qemuReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("domain is not running"));
- goto endjob;
- }
+ if (!virDomainObjIsActive(vm)) {
+ qemuReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
+ goto endjob;
+ }
- ignore_value(qemuDomainObjEnterMonitor(driver, vm));
- ret = qemuMonitorGetBlockStatsInfo(priv->mon,
- disk->info.alias,
- &stats->rd_req,
- &stats->rd_bytes,
- &stats->wr_req,
- &stats->wr_bytes,
- &stats->errs);
- qemuDomainObjExitMonitor(driver, vm);
+ ignore_value(qemuDomainObjEnterMonitor(driver, vm));
+ ret = qemuMonitorGetBlockStatsInfo(priv->mon,
+ disk->info.alias,
+ &stats->rd_req,
+ &stats->rd_bytes,
+ &stats->wr_req,
+ &stats->wr_bytes,
+ &stats->errs);
+ qemuDomainObjExitMonitor(driver, vm);
endjob:
- if (qemuDomainObjEndJob(driver, vm) == 0)
- vm = NULL;
- }
+ if (qemuDomainObjEndJob(driver, vm) == 0)
+ vm = NULL;
cleanup:
if (vm)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index d90219c..52262e2 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -801,24 +801,6 @@ qemuMigrationProcessJobSignals(struct qemud_driver *driver,
}
if (ret < 0)
VIR_WARN("Unable to set migration speed");
- } else if (priv->job.signals & QEMU_JOB_SIGNAL_BLKSTAT) {
- ret = qemuDomainObjEnterMonitorWithDriver(driver, vm);
- if (ret == 0) {
- ret = qemuMonitorGetBlockStatsInfo(priv->mon,
- priv->job.signalsData.statDevName,
- &priv->job.signalsData.blockStat->rd_req,
- &priv->job.signalsData.blockStat->rd_bytes,
- &priv->job.signalsData.blockStat->wr_req,
- &priv->job.signalsData.blockStat->wr_bytes,
- &priv->job.signalsData.blockStat->errs);
- qemuDomainObjExitMonitorWithDriver(driver, vm);
- }
-
- *priv->job.signalsData.statRetCode = ret;
- priv->job.signals ^= QEMU_JOB_SIGNAL_BLKSTAT;
-
- if (ret < 0)
- VIR_WARN("Unable to get block statistics");
} else {
ret = 0;
}
--
1.7.6