mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 22:45:21 +00:00
qemu: Move, rename and export qemuDomObjFromDomain
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@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
44bf3bf3c5
commit
75f4a7b2c7
@ -119,6 +119,37 @@ VIR_ENUM_IMPL(qemuDomainNamespace,
|
|||||||
"mount",
|
"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 {
|
struct _qemuDomainLogContext {
|
||||||
virObject parent;
|
virObject parent;
|
||||||
|
|
||||||
|
@ -593,6 +593,7 @@ struct _qemuDomainXmlNsDef {
|
|||||||
char **capsdel;
|
char **capsdel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virDomainObjPtr qemuDomainObjFromDomain(virDomainPtr domain);
|
||||||
|
|
||||||
qemuDomainSaveCookiePtr qemuDomainSaveCookieNew(virDomainObjPtr vm);
|
qemuDomainSaveCookiePtr qemuDomainSaveCookieNew(virDomainObjPtr vm);
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user