提交 90feb02d 编写于 作者: J Jiri Denemark 提交者: Eric Blake

qemu: Remove special case for virDomainBlockStats

Like other query commands, this can now be called directly during
migration.
上级 fb3cada0
......@@ -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 {
......
......@@ -6634,23 +6634,6 @@ 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;
......@@ -6673,7 +6656,6 @@ qemudDomainBlockStats (virDomainPtr dom,
endjob:
if (qemuDomainObjEndJob(driver, vm) == 0)
vm = NULL;
}
cleanup:
if (vm)
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册