mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +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);
|
VBOX_RELEASE(systemProperties);
|
||||||
return ret;
|
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 vboxDomainCreate(virDomainPtr dom);
|
||||||
static int vboxDomainUndefineFlags(virDomainPtr dom, unsigned int flags);
|
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)
|
static void vboxDriverLock(vboxGlobalData *data)
|
||||||
{
|
{
|
||||||
virMutexLock(&data->lock);
|
virMutexLock(&data->lock);
|
||||||
@ -266,6 +271,8 @@ static void vboxDriverUnlock(vboxGlobalData *data)
|
|||||||
virMutexUnlock(&data->lock);
|
virMutexUnlock(&data->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#if VBOX_API_VERSION == 2002000
|
#if VBOX_API_VERSION == 2002000
|
||||||
|
|
||||||
static void nsIDtoChar(unsigned char *uuid, const nsID *iid)
|
static void nsIDtoChar(unsigned char *uuid, const nsID *iid)
|
||||||
@ -914,16 +921,6 @@ vboxSocketParseAddrUtf16(vboxGlobalData *data, const PRUnichar *utf16,
|
|||||||
return result;
|
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)
|
static int vboxConnectListDomains(virConnectPtr conn, int *ids, int nids)
|
||||||
{
|
{
|
||||||
VBOX_OBJECT_CHECK(conn, int, -1);
|
VBOX_OBJECT_CHECK(conn, int, -1);
|
||||||
|
@ -233,6 +233,7 @@ int vboxConnectIsSecure(virConnectPtr conn);
|
|||||||
int vboxConnectIsEncrypted(virConnectPtr conn);
|
int vboxConnectIsEncrypted(virConnectPtr conn);
|
||||||
int vboxConnectIsAlive(virConnectPtr conn);
|
int vboxConnectIsAlive(virConnectPtr conn);
|
||||||
int vboxConnectGetMaxVcpus(virConnectPtr conn, const char *type);
|
int vboxConnectGetMaxVcpus(virConnectPtr conn, const char *type);
|
||||||
|
char *vboxConnectGetCapabilities(virConnectPtr conn);
|
||||||
|
|
||||||
/* 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