mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-08 16:54:49 +00:00
qemu: Improve domainSetTime error info report
check domain's status before call virQEMUCapsGet to report a accurate error when domain is shut off Resolve: https://bugzilla.redhat.com/show_bug.cgi?id=1147847 Signed-off-by: Shanzhi Yu <shyu@redhat.com>
This commit is contained in:
parent
b4022de33a
commit
a4771c5860
@ -17377,13 +17377,6 @@ qemuDomainSetTime(virDomainPtr dom,
|
||||
|
||||
priv = vm->privateData;
|
||||
|
||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_RTC_RESET_REINJECTION)) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot set time: qemu doesn't support "
|
||||
"rtc-reset-reinjection command"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||
goto cleanup;
|
||||
|
||||
@ -17393,6 +17386,13 @@ qemuDomainSetTime(virDomainPtr dom,
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_RTC_RESET_REINJECTION)) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot set time: qemu doesn't support "
|
||||
"rtc-reset-reinjection command"));
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (!qemuDomainAgentAvailable(priv, true))
|
||||
goto endjob;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user