qemuDomainGetSchedulerType: Prefer qemuDomObjFromDomain

In all qemu APIs we tend to prefer qemuDomObjFromDomain over
virDomainObjListFindByUUID. But somehow the
qemuDomainGetSchedulerType left unattended.
This commit is contained in:
Michal Privoznik 2013-07-17 08:07:20 +02:00
parent ba44dd2453
commit e80e07f657

View File

@ -7545,18 +7545,14 @@ cleanup:
static char *qemuDomainGetSchedulerType(virDomainPtr dom, static char *qemuDomainGetSchedulerType(virDomainPtr dom,
int *nparams) int *nparams)
{ {
virQEMUDriverPtr driver = dom->conn->privateData;
char *ret = NULL; char *ret = NULL;
int rc; int rc;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
vm = virDomainObjListFindByUUID(driver->domains, dom->uuid); if (!(vm = qemuDomObjFromDomain(dom)))
if (vm == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No such domain %s"), dom->uuid);
goto cleanup; goto cleanup;
}
priv = vm->privateData; priv = vm->privateData;
if (virDomainGetSchedulerTypeEnsureACL(dom->conn, vm->def) < 0) if (virDomainGetSchedulerTypeEnsureACL(dom->conn, vm->def) < 0)