mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
vbox: Rewrite vboxDomainIsUpdated
This commit is contained in:
parent
c9537d13b0
commit
caba5247fd
@ -2343,3 +2343,22 @@ int vboxDomainIsPersistent(virDomainPtr dom)
|
|||||||
vboxIIDUnalloc(&iid);
|
vboxIIDUnalloc(&iid);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int vboxDomainIsUpdated(virDomainPtr dom)
|
||||||
|
{
|
||||||
|
/* VBox domains never have a persistent state that differs from
|
||||||
|
* current state. However, we do want to check for existence. */
|
||||||
|
VBOX_OBJECT_CHECK(dom->conn, int, -1);
|
||||||
|
vboxIIDUnion iid;
|
||||||
|
IMachine *machine = NULL;
|
||||||
|
|
||||||
|
if (openSessionForMachine(data, dom->uuid, &iid, &machine, false) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
VBOX_RELEASE(machine);
|
||||||
|
vboxIIDUnalloc(&iid);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
@ -933,31 +933,6 @@ vboxSocketParseAddrUtf16(vboxGlobalData *data, const PRUnichar *utf16,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vboxDomainIsUpdated(virDomainPtr dom ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
/* VBox domains never have a persistent state that differs from
|
|
||||||
* current state. However, we do want to check for existence. */
|
|
||||||
VBOX_OBJECT_CHECK(dom->conn, int, -1);
|
|
||||||
vboxIID iid = VBOX_IID_INITIALIZER;
|
|
||||||
IMachine *machine = NULL;
|
|
||||||
nsresult rc;
|
|
||||||
|
|
||||||
vboxIIDFromUUID(&iid, dom->uuid);
|
|
||||||
rc = VBOX_OBJECT_GET_MACHINE(iid.value, &machine);
|
|
||||||
if (NS_FAILED(rc)) {
|
|
||||||
virReportError(VIR_ERR_NO_DOMAIN, "%s",
|
|
||||||
_("no domain with matching UUID"));
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = 0;
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
VBOX_RELEASE(machine);
|
|
||||||
vboxIIDUnalloc(&iid);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int vboxDomainSuspend(virDomainPtr dom)
|
static int vboxDomainSuspend(virDomainPtr dom)
|
||||||
{
|
{
|
||||||
VBOX_OBJECT_CHECK(dom->conn, int, -1);
|
VBOX_OBJECT_CHECK(dom->conn, int, -1);
|
||||||
|
@ -413,6 +413,7 @@ virDomainPtr vboxDomainCreateXML(virConnectPtr conn, const char *xml,
|
|||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
int vboxDomainIsActive(virDomainPtr dom);
|
int vboxDomainIsActive(virDomainPtr dom);
|
||||||
int vboxDomainIsPersistent(virDomainPtr dom);
|
int vboxDomainIsPersistent(virDomainPtr dom);
|
||||||
|
int vboxDomainIsUpdated(virDomainPtr dom);
|
||||||
|
|
||||||
/* Version specified functions for installing uniformed API */
|
/* Version specified functions for installing uniformed API */
|
||||||
void vbox22InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
|
void vbox22InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user