Move it to qemu_domain.c and rename it to qemuDomainObjFromDomain. This will allow reusing it after splitting out checkpoint code from qemu_driver.c. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_domain.c | 31 +++++ src/qemu/qemu_domain.h | 1 + src/qemu/qemu_driver.c | 303 +++++++++++++++++++---------------------- 3 files changed, 169 insertions(+), 166 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2aa2164953..e8e895d9aa 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -119,6 +119,37 @@ VIR_ENUM_IMPL(qemuDomainNamespace, "mount", ); + +/** + * qemuDomainObjFromDomain: + * @domain: Domain pointer that has to be looked up + * + * This function looks up @domain and returns the appropriate virDomainObjPtr + * that has to be released by calling virDomainObjEndAPI(). + * + * Returns the domain object with incremented reference counter which is locked + * on success, NULL otherwise. + */ +virDomainObjPtr +qemuDomainObjFromDomain(virDomainPtr domain) +{ + virDomainObjPtr vm; + virQEMUDriverPtr driver = domain->conn->privateData; + char uuidstr[VIR_UUID_STRING_BUFLEN]; + + vm = virDomainObjListFindByUUID(driver->domains, domain->uuid); + if (!vm) { + virUUIDFormat(domain->uuid, uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s' (%s)"), + uuidstr, domain->name); + return NULL; + } + + return vm; +} + + struct _qemuDomainLogContext { virObject parent; diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 6c490bd9d8..c740bb955a 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -593,6 +593,7 @@ struct _qemuDomainXmlNsDef { char **capsdel; }; +virDomainObjPtr qemuDomainObjFromDomain(virDomainPtr domain); qemuDomainSaveCookiePtr qemuDomainSaveCookieNew(virDomainObjPtr vm); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0c65414a1a..b2d42affe3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -161,42 +161,13 @@ static int qemuARPGetInterfaces(virDomainObjPtr vm, static virQEMUDriverPtr qemu_driver; -/** - * qemuDomObjFromDomain: - * @domain: Domain pointer that has to be looked up - * - * This function looks up @domain and returns the appropriate virDomainObjPtr - * that has to be released by calling virDomainObjEndAPI(). - * - * Returns the domain object with incremented reference counter which is locked - * on success, NULL otherwise. - */ -static virDomainObjPtr -qemuDomObjFromDomain(virDomainPtr domain) -{ - virDomainObjPtr vm; - virQEMUDriverPtr driver = domain->conn->privateData; - char uuidstr[VIR_UUID_STRING_BUFLEN]; - - vm = virDomainObjListFindByUUID(driver->domains, domain->uuid); - if (!vm) { - virUUIDFormat(domain->uuid, uuidstr); - virReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s' (%s)"), - uuidstr, domain->name); - return NULL; - } - - return vm; -} - /* Looks up the domain object from snapshot and unlocks the * driver. The returned domain object is locked and ref'd and the * caller must call virDomainObjEndAPI() on it. */ static virDomainObjPtr qemuDomObjFromSnapshot(virDomainSnapshotPtr snapshot) { - return qemuDomObjFromDomain(snapshot->domain); + return qemuDomainObjFromDomain(snapshot->domain); } @@ -230,7 +201,7 @@ qemuSnapObjFromSnapshot(virDomainObjPtr vm, static virDomainObjPtr qemuDomObjFromCheckpoint(virDomainCheckpointPtr checkpoint) { - return qemuDomObjFromDomain(checkpoint->domain); + return qemuDomainObjFromDomain(checkpoint->domain); } @@ -1742,7 +1713,7 @@ static int qemuDomainIsActive(virDomainPtr dom) virDomainObjPtr obj; int ret = -1; - if (!(obj = qemuDomObjFromDomain(dom))) + if (!(obj = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainIsActiveEnsureACL(dom->conn, obj->def) < 0) @@ -1760,7 +1731,7 @@ static int qemuDomainIsPersistent(virDomainPtr dom) virDomainObjPtr obj; int ret = -1; - if (!(obj = qemuDomObjFromDomain(dom))) + if (!(obj = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainIsPersistentEnsureACL(dom->conn, obj->def) < 0) @@ -1778,7 +1749,7 @@ static int qemuDomainIsUpdated(virDomainPtr dom) virDomainObjPtr obj; int ret = -1; - if (!(obj = qemuDomObjFromDomain(dom))) + if (!(obj = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainIsUpdatedEnsureACL(dom->conn, obj->def) < 0) @@ -1958,7 +1929,7 @@ static int qemuDomainSuspend(virDomainPtr dom) int state; virQEMUDriverConfigPtr cfg = NULL; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainSuspendEnsureACL(dom->conn, vm->def) < 0) @@ -2013,7 +1984,7 @@ static int qemuDomainResume(virDomainPtr dom) int reason; virQEMUDriverConfigPtr cfg = NULL; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; cfg = virQEMUDriverGetConfig(driver); @@ -2076,7 +2047,7 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags) virCheckFlags(VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN | VIR_DOMAIN_SHUTDOWN_GUEST_AGENT, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (vm->def->onPoweroff == VIR_DOMAIN_LIFECYCLE_ACTION_RESTART || @@ -2180,7 +2151,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags) virCheckFlags(VIR_DOMAIN_REBOOT_ACPI_POWER_BTN | VIR_DOMAIN_REBOOT_GUEST_AGENT, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY || @@ -2268,7 +2239,7 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags) virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainResetEnsureACL(dom->conn, vm->def) < 0) @@ -2331,7 +2302,7 @@ qemuDomainDestroyFlags(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_DESTROY_GRACEFUL, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; priv = vm->privateData; @@ -2396,7 +2367,7 @@ static char *qemuDomainGetOSType(virDomainPtr dom) { virDomainObjPtr vm; char *type = NULL; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetOSTypeEnsureACL(dom->conn, vm->def) < 0) @@ -2416,7 +2387,7 @@ qemuDomainGetMaxMemory(virDomainPtr dom) virDomainObjPtr vm; unsigned long long ret = 0; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetMaxMemoryEnsureACL(dom->conn, vm->def) < 0) @@ -2444,7 +2415,7 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, VIR_DOMAIN_AFFECT_CONFIG | VIR_DOMAIN_MEM_MAXIMUM, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; cfg = virQEMUDriverGetConfig(driver); @@ -2571,7 +2542,7 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period, virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; cfg = virQEMUDriverGetConfig(driver); @@ -2642,7 +2613,7 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags) virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return -1; if (virDomainInjectNMIEnsureACL(domain->conn, vm->def) < 0) @@ -2702,7 +2673,7 @@ static int qemuDomainSendKey(virDomainPtr domain, } } - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) goto cleanup; priv = vm->privateData; @@ -2738,7 +2709,7 @@ qemuDomainGetInfo(virDomainPtr dom, virDomainObjPtr vm; int ret = -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetInfoEnsureACL(dom->conn, vm->def) < 0) @@ -2794,7 +2765,7 @@ qemuDomainGetState(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetStateEnsureACL(dom->conn, vm->def) < 0) @@ -2819,7 +2790,7 @@ qemuDomainGetControlInfo(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetControlInfoEnsureACL(dom->conn, vm->def) < 0) @@ -3629,7 +3600,7 @@ qemuDomainSaveFlags(virDomainPtr dom, const char *path, const char *dxml, "save", false)) < 0) goto cleanup; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainSaveFlagsEnsureACL(dom->conn, vm->def) < 0) @@ -3684,7 +3655,7 @@ qemuDomainManagedSave(virDomainPtr dom, unsigned int flags) VIR_DOMAIN_SAVE_RUNNING | VIR_DOMAIN_SAVE_PAUSED, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainManagedSaveEnsureACL(dom->conn, vm->def) < 0) @@ -3755,7 +3726,7 @@ qemuDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainHasManagedSaveImageEnsureACL(dom->conn, vm->def) < 0) @@ -3778,7 +3749,7 @@ qemuDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags) virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainManagedSaveRemoveEnsureACL(dom->conn, vm->def) < 0) @@ -4021,7 +3992,7 @@ qemuDomainCoreDumpWithFormat(virDomainPtr dom, VIR_DUMP_BYPASS_CACHE | VIR_DUMP_RESET | VIR_DUMP_MEMORY_ONLY, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainCoreDumpWithFormatEnsureACL(dom->conn, vm->def) < 0) @@ -4135,7 +4106,7 @@ qemuDomainScreenshot(virDomainPtr dom, virCheckFlags(0, NULL); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; priv = vm->privateData; @@ -5198,7 +5169,7 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, VIR_DOMAIN_VCPU_GUEST | VIR_DOMAIN_VCPU_HOTPLUGGABLE, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainSetVcpusFlagsEnsureACL(dom->conn, vm->def, flags) < 0) @@ -5345,7 +5316,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom, cfg = virQEMUDriverGetConfig(driver); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainPinVcpuFlagsEnsureACL(dom->conn, vm->def, flags) < 0) @@ -5425,7 +5396,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetVcpuPinInfoEnsureACL(dom->conn, vm->def) < 0) @@ -5470,7 +5441,7 @@ qemuDomainPinEmulator(virDomainPtr dom, cfg = virQEMUDriverGetConfig(driver); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainPinEmulatorEnsureACL(dom->conn, vm->def, flags) < 0) @@ -5574,7 +5545,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetEmulatorPinInfoEnsureACL(dom->conn, vm->def) < 0) @@ -5623,7 +5594,7 @@ qemuDomainGetVcpus(virDomainPtr dom, virDomainObjPtr vm; int ret = -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetVcpusEnsureACL(dom->conn, vm->def) < 0) @@ -5660,7 +5631,7 @@ qemuDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags) VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_VCPU_GUEST, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainGetVcpusFlagsEnsureACL(dom->conn, vm->def, flags) < 0) @@ -5895,7 +5866,7 @@ qemuDomainGetIOThreadInfo(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetIOThreadInfoEnsureACL(dom->conn, vm->def) < 0) @@ -5942,7 +5913,7 @@ qemuDomainPinIOThread(virDomainPtr dom, cfg = virQEMUDriverGetConfig(driver); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; priv = vm->privateData; @@ -6519,7 +6490,7 @@ qemuDomainAddIOThread(virDomainPtr dom, return -1; } - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainAddIOThreadEnsureACL(dom->conn, vm->def, flags) < 0) @@ -6554,7 +6525,7 @@ qemuDomainDelIOThread(virDomainPtr dom, return -1; } - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainDelIOThreadEnsureACL(dom->conn, vm->def, flags) < 0) @@ -6603,7 +6574,7 @@ qemuDomainSetIOThreadParams(virDomainPtr dom, iothread.iothread_id = iothread_id; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainSetIOThreadParamsEnsureACL(dom->conn, vm->def, flags) < 0) @@ -6629,7 +6600,7 @@ static int qemuDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secl memset(seclabel, 0, sizeof(*seclabel)); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainGetSecurityLabelEnsureACL(dom->conn, vm->def) < 0) @@ -6670,7 +6641,7 @@ static int qemuDomainGetSecurityLabelList(virDomainPtr dom, size_t i; int ret = -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainGetSecurityLabelListEnsureACL(dom->conn, vm->def) < 0) @@ -7360,7 +7331,7 @@ qemuDomainManagedSaveGetXMLDesc(virDomainPtr dom, unsigned int flags) virCheckFlags(VIR_DOMAIN_SAVE_IMAGE_XML_SECURE, NULL); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return ret; priv = vm->privateData; @@ -7402,7 +7373,7 @@ qemuDomainManagedSaveDefineXML(virDomainPtr dom, const char *dxml, char *path = NULL; int ret = -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainManagedSaveDefineXMLEnsureACL(conn, vm->def) < 0) @@ -7518,7 +7489,7 @@ static char virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS | VIR_DOMAIN_XML_UPDATE_CPU, NULL); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetXMLDescEnsureACL(dom->conn, vm->def, flags) < 0) @@ -7758,7 +7729,7 @@ qemuDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) virNWFilterReadLockFilterUpdates(); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainCreateWithFlagsEnsureACL(dom->conn, vm->def) < 0) @@ -7911,7 +7882,7 @@ qemuDomainUndefineFlags(virDomainPtr dom, return -1; } - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; cfg = virQEMUDriverGetConfig(driver); @@ -8936,7 +8907,7 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom, virNWFilterReadLockFilterUpdates(); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainAttachDeviceFlagsEnsureACL(dom->conn, vm->def, flags) < 0) @@ -8995,7 +8966,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom, if (!(caps = virQEMUDriverGetCapabilities(driver, false))) goto cleanup; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; priv = vm->privateData; @@ -9266,7 +9237,7 @@ qemuDomainDetachDeviceFlags(virDomainPtr dom, virDomainObjPtr vm = NULL; int ret = -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainDetachDeviceFlagsEnsureACL(dom->conn, vm->def, flags) < 0) @@ -9301,7 +9272,7 @@ qemuDomainDetachDeviceAlias(virDomainPtr dom, virDomainObjPtr vm = NULL; int ret = -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainDetachDeviceAliasEnsureACL(dom->conn, vm->def, flags) < 0) @@ -9339,7 +9310,7 @@ static int qemuDomainGetAutostart(virDomainPtr dom, virDomainObjPtr vm; int ret = -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetAutostartEnsureACL(dom->conn, vm->def) < 0) @@ -9362,7 +9333,7 @@ static int qemuDomainSetAutostart(virDomainPtr dom, int ret = -1; virQEMUDriverConfigPtr cfg = NULL; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; cfg = virQEMUDriverGetConfig(driver); @@ -9438,7 +9409,7 @@ static char *qemuDomainGetSchedulerType(virDomainPtr dom, qemuDomainObjPrivatePtr priv; virQEMUDriverPtr driver = dom->conn->privateData; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; priv = vm->privateData; @@ -9693,7 +9664,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, NULL) < 0) return -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; priv = vm->privateData; @@ -9901,7 +9872,7 @@ qemuDomainGetBlkioParameters(virDomainPtr dom, * that can't parse it. */ flags &= ~VIR_TYPED_PARAM_STRING_OKAY; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; priv = vm->privateData; @@ -10003,7 +9974,7 @@ qemuDomainSetMemoryParameters(virDomainPtr dom, return -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; priv = vm->privateData; @@ -10137,7 +10108,7 @@ qemuDomainGetMemoryParameters(virDomainPtr dom, VIR_DOMAIN_AFFECT_CONFIG | VIR_TYPED_PARAM_STRING_OKAY, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; priv = vm->privateData; @@ -10291,7 +10262,7 @@ qemuDomainSetNumaParameters(virDomainPtr dom, NULL) < 0) return -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; priv = vm->privateData; @@ -10410,7 +10381,7 @@ qemuDomainGetNumaParameters(virDomainPtr dom, VIR_DOMAIN_AFFECT_CONFIG | VIR_TYPED_PARAM_STRING_OKAY, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; priv = vm->privateData; @@ -10528,7 +10499,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom, NULL) < 0) return -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; cfg = virQEMUDriverGetConfig(driver); @@ -10607,7 +10578,7 @@ qemuDomainGetPerfEvents(virDomainPtr dom, VIR_DOMAIN_AFFECT_CONFIG | VIR_TYPED_PARAM_STRING_OKAY, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetPerfEventsEnsureACL(dom->conn, vm->def) < 0) @@ -10802,7 +10773,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, NULL) < 0) return -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; priv = vm->privateData; @@ -11223,7 +11194,7 @@ qemuDomainGetSchedulerParametersFlags(virDomainPtr dom, VIR_DOMAIN_AFFECT_CONFIG | VIR_TYPED_PARAM_STRING_OKAY, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; priv = vm->privateData; @@ -11351,7 +11322,7 @@ qemuDomainBlockResize(virDomainPtr dom, size *= 1024; } - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; priv = vm->privateData; @@ -11553,7 +11524,7 @@ qemuDomainBlockStats(virDomainPtr dom, int ret = -1; virDomainObjPtr vm; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainBlockStatsEnsureACL(dom->conn, vm->def) < 0) @@ -11611,7 +11582,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom, /* We don't return strings, and thus trivially support this flag. */ flags &= ~VIR_TYPED_PARAM_STRING_OKAY; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainBlockStatsFlagsEnsureACL(dom->conn, vm->def) < 0) @@ -11687,7 +11658,7 @@ qemuDomainInterfaceStats(virDomainPtr dom, virDomainNetDefPtr net = NULL; int ret = -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainInterfaceStatsEnsureACL(dom->conn, vm->def) < 0) @@ -11754,7 +11725,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, NULL) < 0) return -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; cfg = virQEMUDriverGetConfig(driver); @@ -11945,7 +11916,7 @@ qemuDomainGetInterfaceParameters(virDomainPtr dom, VIR_DOMAIN_AFFECT_CONFIG | VIR_TYPED_PARAM_STRING_OKAY, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainGetInterfaceParametersEnsureACL(dom->conn, vm->def) < 0) @@ -12088,7 +12059,7 @@ qemuDomainMemoryStats(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainMemoryStatsEnsureACL(dom->conn, vm->def) < 0) @@ -12122,7 +12093,7 @@ qemuDomainBlockPeek(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainBlockPeekEnsureACL(dom->conn, vm->def) < 0) @@ -12190,7 +12161,7 @@ qemuDomainMemoryPeek(virDomainPtr dom, virCheckFlags(VIR_MEMORY_VIRTUAL | VIR_MEMORY_PHYSICAL, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; cfg = virQEMUDriverGetConfig(driver); @@ -12479,7 +12450,7 @@ qemuDomainGetBlockInfo(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; cfg = virQEMUDriverGetConfig(driver); @@ -12817,7 +12788,7 @@ qemuDomainMigratePerform(virDomainPtr dom, QEMU_MIGRATION_SOURCE))) goto cleanup; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainMigratePerformEnsureACL(dom->conn, vm->def) < 0) @@ -12904,7 +12875,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain, virCheckFlags(QEMU_MIGRATION_FLAGS, NULL); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return NULL; if (virDomainMigrateBegin3EnsureACL(domain->conn, vm->def) < 0) { @@ -12950,7 +12921,7 @@ qemuDomainMigrateBegin3Params(virDomainPtr domain, if (nmigrate_disks < 0) goto cleanup; - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) goto cleanup; if (virDomainMigrateBegin3ParamsEnsureACL(domain->conn, vm->def) < 0) { @@ -13246,7 +13217,7 @@ qemuDomainMigratePerform3(virDomainPtr dom, QEMU_MIGRATION_SOURCE))) goto cleanup; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainMigratePerform3EnsureACL(dom->conn, vm->def) < 0) @@ -13332,7 +13303,7 @@ qemuDomainMigratePerform3Params(virDomainPtr dom, QEMU_MIGRATION_SOURCE))) goto cleanup; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainMigratePerform3ParamsEnsureACL(dom->conn, vm->def) < 0) @@ -13453,7 +13424,7 @@ qemuDomainMigrateConfirm3(virDomainPtr domain, virCheckFlags(QEMU_MIGRATION_FLAGS, -1); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return -1; if (virDomainMigrateConfirm3EnsureACL(domain->conn, vm->def) < 0) { @@ -13481,7 +13452,7 @@ qemuDomainMigrateConfirm3Params(virDomainPtr domain, if (virTypedParamsValidate(params, nparams, QEMU_MIGRATION_PARAMETERS) < 0) return -1; - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return -1; if (virDomainMigrateConfirm3ParamsEnsureACL(domain->conn, vm->def) < 0) { @@ -14055,7 +14026,7 @@ qemuDomainGetJobInfo(virDomainPtr dom, virDomainObjPtr vm; int ret = -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetJobInfoEnsureACL(dom->conn, vm->def) < 0) @@ -14095,7 +14066,7 @@ qemuDomainGetJobStats(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_JOB_STATS_COMPLETED, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetJobStatsEnsureACL(dom->conn, vm->def) < 0) @@ -14132,7 +14103,7 @@ static int qemuDomainAbortJob(virDomainPtr dom) qemuDomainObjPrivatePtr priv; int reason; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainAbortJobEnsureACL(dom->conn, vm->def) < 0) @@ -14203,7 +14174,7 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainMigrateSetMaxDowntimeEnsureACL(dom->conn, vm->def) < 0) @@ -14245,7 +14216,7 @@ qemuDomainMigrateGetMaxDowntime(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainMigrateGetMaxDowntimeEnsureACL(dom->conn, vm->def) < 0) @@ -14298,7 +14269,7 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainMigrateGetCompressionCacheEnsureACL(dom->conn, vm->def) < 0) @@ -14346,7 +14317,7 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainMigrateSetCompressionCacheEnsureACL(dom->conn, vm->def) < 0) @@ -14398,7 +14369,7 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; priv = vm->privateData; @@ -14530,7 +14501,7 @@ qemuDomainMigrateGetMaxSpeed(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; priv = vm->privateData; @@ -14564,7 +14535,7 @@ qemuDomainMigrateStartPostCopy(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainMigrateStartPostCopyEnsureACL(dom->conn, vm->def) < 0) @@ -15899,7 +15870,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, if (redefine) parse_flags |= VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE; - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) goto cleanup; priv = vm->privateData; @@ -16171,7 +16142,7 @@ qemuDomainSnapshotListNames(virDomainPtr domain, VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL | VIR_DOMAIN_SNAPSHOT_FILTERS_ALL, -1); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return -1; if (virDomainSnapshotListNamesEnsureACL(domain->conn, vm->def) < 0) @@ -16197,7 +16168,7 @@ qemuDomainSnapshotNum(virDomainPtr domain, VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL | VIR_DOMAIN_SNAPSHOT_FILTERS_ALL, -1); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return -1; if (virDomainSnapshotNumEnsureACL(domain->conn, vm->def) < 0) @@ -16223,7 +16194,7 @@ qemuDomainListAllSnapshots(virDomainPtr domain, VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL | VIR_DOMAIN_SNAPSHOT_FILTERS_ALL, -1); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return -1; if (virDomainListAllSnapshotsEnsureACL(domain->conn, vm->def) < 0) @@ -16340,7 +16311,7 @@ qemuDomainSnapshotLookupByName(virDomainPtr domain, virCheckFlags(0, NULL); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return NULL; if (virDomainSnapshotLookupByNameEnsureACL(domain->conn, vm->def) < 0) @@ -16366,7 +16337,7 @@ qemuDomainHasCurrentSnapshot(virDomainPtr domain, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return -1; if (virDomainHasCurrentSnapshotEnsureACL(domain->conn, vm->def) < 0) @@ -16424,7 +16395,7 @@ qemuDomainSnapshotCurrent(virDomainPtr domain, virCheckFlags(0, NULL); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return NULL; if (virDomainSnapshotCurrentEnsureACL(domain->conn, vm->def) < 0) @@ -17290,7 +17261,7 @@ qemuDomainCheckpointCreateXML(virDomainPtr domain, update_current = false; } - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) goto cleanup; if (virDomainSnapshotObjListNum(vm->snapshots, NULL, 0) > 0) { @@ -17428,7 +17399,7 @@ qemuDomainListAllCheckpoints(virDomainPtr domain, VIR_DOMAIN_CHECKPOINT_LIST_TOPOLOGICAL | VIR_DOMAIN_CHECKPOINT_FILTERS_ALL, -1); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return -1; if (virDomainListAllCheckpointsEnsureACL(domain->conn, vm->def) < 0) @@ -17485,7 +17456,7 @@ qemuDomainCheckpointLookupByName(virDomainPtr domain, virCheckFlags(0, NULL); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return NULL; if (virDomainCheckpointLookupByNameEnsureACL(domain->conn, vm->def) < 0) @@ -17690,7 +17661,7 @@ static int qemuDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd, virCheckFlags(VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP, -1); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) goto cleanup; if (virDomainQemuMonitorCommandEnsureACL(domain->conn, vm->def) < 0) @@ -17737,7 +17708,7 @@ qemuDomainOpenConsole(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_CONSOLE_SAFE | VIR_DOMAIN_CONSOLE_FORCE, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainOpenConsoleEnsureACL(dom->conn, vm->def) < 0) @@ -17814,7 +17785,7 @@ qemuDomainOpenChannel(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_CHANNEL_FORCE, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainOpenChannelEnsureACL(dom->conn, vm->def) < 0) @@ -18082,7 +18053,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC | VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainBlockJobAbortEnsureACL(dom->conn, vm->def) < 0) @@ -18244,7 +18215,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainGetBlockJobInfoEnsureACL(dom->conn, vm->def) < 0) @@ -18316,7 +18287,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom, speed <<= 20; } - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainBlockJobSetSpeedEnsureACL(dom->conn, vm->def) < 0) @@ -18774,7 +18745,7 @@ qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base, VIR_DOMAIN_BLOCK_REBASE_COPY_DEV | VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainBlockRebaseEnsureACL(dom->conn, vm->def) < 0) @@ -18864,7 +18835,7 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *disk, const char *destxml, NULL) < 0) return -1; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainBlockCopyEnsureACL(dom->conn, vm->def) < 0) @@ -18930,7 +18901,7 @@ qemuDomainBlockPull(virDomainPtr dom, const char *path, unsigned long bandwidth, virDomainObjPtr vm; virCheckFlags(VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainBlockPullEnsureACL(dom->conn, vm->def) < 0) { @@ -18988,7 +18959,7 @@ qemuDomainBlockCommit(virDomainPtr dom, VIR_DOMAIN_BLOCK_COMMIT_RELATIVE | VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; priv = vm->privateData; @@ -19211,7 +19182,7 @@ qemuDomainOpenGraphics(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainOpenGraphicsEnsureACL(dom->conn, vm->def) < 0) @@ -19283,7 +19254,7 @@ qemuDomainOpenGraphicsFD(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainOpenGraphicsFdEnsureACL(dom->conn, vm->def) < 0) @@ -19500,7 +19471,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, memset(&info, 0, sizeof(info)); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; if (virDomainSetBlockIoTuneEnsureACL(dom->conn, vm->def, flags) < 0) @@ -19797,7 +19768,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, /* We don't return strings, and thus trivially support this flag. */ flags &= ~VIR_TYPED_PARAM_STRING_OKAY; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; priv = vm->privateData; @@ -19944,7 +19915,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; priv = vm->privateData; @@ -20024,7 +19995,7 @@ qemuDomainSetMetadata(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return -1; cfg = virQEMUDriverGetConfig(driver); @@ -20066,7 +20037,7 @@ qemuDomainGetMetadata(virDomainPtr dom, virDomainObjPtr vm; char *ret = NULL; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return NULL; if (virDomainGetMetadataEnsureACL(dom->conn, vm->def) < 0) @@ -20095,7 +20066,7 @@ qemuDomainGetCPUStats(virDomainPtr domain, virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) return -1; priv = vm->privateData; @@ -20179,7 +20150,7 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom, return -1; } - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainPMSuspendForDurationEnsureACL(dom->conn, vm->def) < 0) @@ -20262,7 +20233,7 @@ qemuDomainPMWakeup(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainPMWakeupEnsureACL(dom->conn, vm->def) < 0) @@ -20323,7 +20294,7 @@ qemuDomainQemuAgentCommand(virDomainPtr domain, virCheckFlags(0, NULL); - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) goto cleanup; if (virDomainQemuAgentCommandEnsureACL(domain->conn, vm->def) < 0) @@ -20423,7 +20394,7 @@ qemuDomainFSTrim(virDomainPtr dom, return -1; } - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainFSTrimEnsureACL(dom->conn, vm->def) < 0) @@ -20603,7 +20574,7 @@ qemuDomainGetHostname(virDomainPtr dom, virCheckFlags(0, NULL); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return NULL; if (virDomainGetHostnameEnsureACL(dom->conn, vm->def) < 0) @@ -20645,7 +20616,7 @@ qemuDomainGetTime(virDomainPtr dom, virCheckFlags(0, ret); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return ret; if (virDomainGetTimeEnsureACL(dom->conn, vm->def) < 0) @@ -20694,7 +20665,7 @@ qemuDomainSetTime(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_TIME_SYNC, ret); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return ret; if (virDomainSetTimeEnsureACL(dom->conn, vm->def) < 0) @@ -20769,7 +20740,7 @@ qemuDomainFSFreeze(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainFSFreezeEnsureACL(dom->conn, vm->def) < 0) @@ -20810,7 +20781,7 @@ qemuDomainFSThaw(virDomainPtr dom, return ret; } - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainFSThawEnsureACL(dom->conn, vm->def) < 0) @@ -22036,7 +22007,7 @@ qemuDomainGetFSInfo(virDomainPtr dom, virCheckFlags(0, ret); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return ret; if (virDomainGetFSInfoEnsureACL(dom->conn, vm->def) < 0) @@ -22078,7 +22049,7 @@ qemuDomainInterfaceAddresses(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainInterfaceAddressesEnsureACL(dom->conn, vm->def) < 0) @@ -22296,7 +22267,7 @@ qemuDomainSetUserPassword(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_PASSWORD_ENCRYPTED, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) return ret; if (virDomainSetUserPasswordEnsureACL(dom->conn, vm->def) < 0) @@ -22456,7 +22427,7 @@ static int qemuDomainRename(virDomainPtr dom, virCheckFlags(0, ret); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainRenameEnsureACL(dom->conn, vm->def) < 0) @@ -22596,7 +22567,7 @@ qemuDomainGetGuestVcpus(virDomainPtr dom, virCheckFlags(0, ret); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetGuestVcpusEnsureACL(dom->conn, vm->def) < 0) @@ -22655,7 +22626,7 @@ qemuDomainSetGuestVcpus(virDomainPtr dom, if (virBitmapParse(cpumap, &map, QEMU_GUEST_VCPU_MAX_ID) < 0) goto cleanup; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainSetGuestVcpusEnsureACL(dom->conn, vm->def) < 0) @@ -22748,7 +22719,7 @@ qemuDomainSetVcpu(virDomainPtr dom, goto cleanup; } - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainSetVcpuEnsureACL(dom->conn, vm->def, flags) < 0) @@ -22806,7 +22777,7 @@ qemuDomainSetBlockThreshold(virDomainPtr dom, virCheckFlags(0, -1); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; priv = vm->privateData; @@ -22902,7 +22873,7 @@ qemuDomainSetLifecycleAction(virDomainPtr dom, if (!virDomainDefLifecycleActionAllowed(type, action)) goto cleanup; - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; priv = vm->privateData; @@ -23076,7 +23047,7 @@ qemuDomainGetLaunchSecurityInfo(virDomainPtr domain, virDomainObjPtr vm; int ret = -1; - if (!(vm = qemuDomObjFromDomain(domain))) + if (!(vm = qemuDomainObjFromDomain(domain))) goto cleanup; if (virDomainGetLaunchSecurityInfoEnsureACL(domain->conn, vm->def) < 0) @@ -23129,7 +23100,7 @@ qemuDomainGetGuestInfo(virDomainPtr dom, virCheckFlags(0, -1); qemuDomainGetGuestInfoCheckSupport(&supportedTypes); - if (!(vm = qemuDomObjFromDomain(dom))) + if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; if (virDomainGetGuestInfoEnsureACL(dom->conn, vm->def) < 0) -- 2.21.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list