mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-08 22:39:56 +00:00
vbox: Rewrite vboxConnectGetCapabilities
This commit is contained in:
parent
82513be8ba
commit
30a95f30ef
@ -463,3 +463,14 @@ vboxConnectGetMaxVcpus(virConnectPtr conn, const char *type ATTRIBUTE_UNUSED)
|
||||
VBOX_RELEASE(systemProperties);
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *vboxConnectGetCapabilities(virConnectPtr conn)
|
||||
{
|
||||
VBOX_OBJECT_CHECK(conn, char *, NULL);
|
||||
|
||||
vboxDriverLock(data);
|
||||
ret = virCapabilitiesFormatXML(data->caps);
|
||||
vboxDriverUnlock(data);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -256,6 +256,11 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml);
|
||||
static int vboxDomainCreate(virDomainPtr dom);
|
||||
static int vboxDomainUndefineFlags(virDomainPtr dom, unsigned int flags);
|
||||
|
||||
#if VBOX_API_VERSION > 2002000 && VBOX_API_VERSION < 4000000
|
||||
/* Since vboxConnectGetCapabilities has been rewritten,
|
||||
* vboxDriverLock and vboxDriverUnlock only be used in code for
|
||||
* 3.x release. */
|
||||
|
||||
static void vboxDriverLock(vboxGlobalData *data)
|
||||
{
|
||||
virMutexLock(&data->lock);
|
||||
@ -266,6 +271,8 @@ static void vboxDriverUnlock(vboxGlobalData *data)
|
||||
virMutexUnlock(&data->lock);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if VBOX_API_VERSION == 2002000
|
||||
|
||||
static void nsIDtoChar(unsigned char *uuid, const nsID *iid)
|
||||
@ -914,16 +921,6 @@ vboxSocketParseAddrUtf16(vboxGlobalData *data, const PRUnichar *utf16,
|
||||
return result;
|
||||
}
|
||||
|
||||
static char *vboxConnectGetCapabilities(virConnectPtr conn) {
|
||||
VBOX_OBJECT_CHECK(conn, char *, NULL);
|
||||
|
||||
vboxDriverLock(data);
|
||||
ret = virCapabilitiesFormatXML(data->caps);
|
||||
vboxDriverUnlock(data);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int vboxConnectListDomains(virConnectPtr conn, int *ids, int nids)
|
||||
{
|
||||
VBOX_OBJECT_CHECK(conn, int, -1);
|
||||
|
@ -233,6 +233,7 @@ int vboxConnectIsSecure(virConnectPtr conn);
|
||||
int vboxConnectIsEncrypted(virConnectPtr conn);
|
||||
int vboxConnectIsAlive(virConnectPtr conn);
|
||||
int vboxConnectGetMaxVcpus(virConnectPtr conn, const char *type);
|
||||
char *vboxConnectGetCapabilities(virConnectPtr conn);
|
||||
|
||||
/* Version specified functions for installing uniformed API */
|
||||
void vbox22InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
|
||||
|
Loading…
Reference in New Issue
Block a user