qemu: Check if domain is active in GetControlInfo

Reporting status of a control connection makes no sense for an inactive
domain.

https://bugzilla.redhat.com/show_bug.cgi?id=1281706

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2016-03-03 13:26:51 +01:00
parent 1a0f076dd6
commit e53f2dc875

View File

@ -2763,6 +2763,12 @@ qemuDomainGetControlInfo(virDomainPtr dom,
if (virDomainGetControlInfoEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("domain is not running"));
goto cleanup;
}
priv = vm->privateData;
memset(info, 0, sizeof(*info));