[libvirt] [PATCH 2/3] qemu: Clarify usage of DomainObjIsActive for PMSuspended
Ján Tomko
jtomko at redhat.com
Tue Apr 19 14:18:31 UTC 2016
On Fri, Apr 15, 2016 at 10:00:13AM -0400, Cole Robinson wrote:
> ---
> src/qemu/qemu_driver.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 9a3d46b..f8dfa27 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -18237,6 +18237,9 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom,
> if (virDomainPMSuspendForDurationEnsureACL(dom->conn, vm->def) < 0)
> goto cleanup;
>
> + /* We also perform this check further down after grabbing the
> + job lock, but do it here too so we can throw an error for
> + an invalid config, before trying to talk to the guest agent */
This is wrong.
Even without this check, we would not talk to the guest agent.
The real reason for this check is that for an inactive domain,
priv->qemuCaps is NULL and we would report QEMU_CAPS_WAKEUP as missing.
Jan
> if (!virDomainObjIsActive(vm)) {
> virReportError(VIR_ERR_OPERATION_INVALID,
> "%s", _("domain is not running"));
> --
> 2.7.3
>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
More information about the libvir-list
mailing list