mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu_driver: Probe capability before calculating dirty page rate
Probing QEMU_CAPS_CALC_DIRTY_RATE capability in advance in case of failure when calculating dirty page rate. Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
b207f84901
commit
f78b804b46
@ -20693,6 +20693,16 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom,
|
||||
if (virDomainStartDirtyRateCalcEnsureACL(dom->conn, vm->def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainObjCheckActive(vm) < 0)
|
||||
goto cleanup;
|
||||
|
||||
priv = vm->privateData;
|
||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CALC_DIRTY_RATE)) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("QEMU does not support calculating dirty page rate"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||
goto cleanup;
|
||||
|
||||
@ -20704,7 +20714,6 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom,
|
||||
|
||||
VIR_DEBUG("Calculate dirty rate in next %d seconds", seconds);
|
||||
|
||||
priv = vm->privateData;
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
ret = qemuMonitorStartDirtyRateCalc(priv->mon, seconds);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user