1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-26 14:03:49 +03:00

vbox: get rid of g_pVBoxGlobalData

now that we have a new global vboxDriver object, remove the old
vboxGlobalData struct and all references to it.
This commit is contained in:
Dawid Zamirski 2016-11-23 14:01:11 -05:00 committed by John Ferlan
parent 04518c364b
commit 6358653596
7 changed files with 319 additions and 368 deletions

View File

@ -31,6 +31,8 @@
</li>
<li><strong>Improvements</strong>
<ul>
<li>vbox: Address thread safety issues
</li>
<li>virsh: Add support for passing an alternative persistent XML
to migrate command
</li>

View File

@ -282,7 +282,7 @@ vboxDestroyDriverConnection(void)
virMutexUnlock(&vbox_driver_lock);
}
static int openSessionForMachine(vboxGlobalData *data, const unsigned char *dom_uuid, vboxIIDUnion *iid,
static int openSessionForMachine(vboxDriverPtr data, const unsigned char *dom_uuid, vboxIIDUnion *iid,
IMachine **machine, bool checkflag)
{
VBOX_IID_INITIALIZE(iid);
@ -543,7 +543,7 @@ static int vboxConnectClose(virConnectPtr conn)
static int
vboxDomainSave(virDomainPtr dom, const char *path ATTRIBUTE_UNUSED)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IConsole *console = NULL;
vboxIIDUnion iid;
IMachine *machine = NULL;
@ -595,24 +595,14 @@ vboxDomainSave(virDomainPtr dom, const char *path ATTRIBUTE_UNUSED)
return ret;
}
static void vboxDriverLock(vboxGlobalData *data)
{
virMutexLock(&data->lock);
}
static void vboxDriverUnlock(vboxGlobalData *data)
{
virMutexUnlock(&data->lock);
}
static int vboxConnectGetVersion(virConnectPtr conn, unsigned long *version)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
VIR_DEBUG("%s: in vboxGetVersion", conn->driver->name);
vboxDriverLock(data);
virObjectLock(data);
*version = data->version;
vboxDriverUnlock(data);
virObjectUnlock(data);
return 0;
}
@ -642,7 +632,7 @@ static int vboxConnectIsAlive(virConnectPtr conn ATTRIBUTE_UNUSED)
static int
vboxConnectGetMaxVcpus(virConnectPtr conn, const char *type ATTRIBUTE_UNUSED)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
PRUint32 maxCPUCount = 0;
int ret = -1;
@ -669,22 +659,22 @@ vboxConnectGetMaxVcpus(virConnectPtr conn, const char *type ATTRIBUTE_UNUSED)
static char *vboxConnectGetCapabilities(virConnectPtr conn)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
char *ret = NULL;
if (!data->vboxObj)
return ret;
vboxDriverLock(data);
virObjectLock(data);
ret = virCapabilitiesFormatXML(data->caps);
vboxDriverUnlock(data);
virObjectUnlock(data);
return ret;
}
static int vboxConnectListDomains(virConnectPtr conn, int *ids, int nids)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxArray machines = VBOX_ARRAY_INITIALIZER;
PRUint32 state;
nsresult rc;
@ -726,7 +716,7 @@ static int vboxConnectListDomains(virConnectPtr conn, int *ids, int nids)
static int vboxConnectNumOfDomains(virConnectPtr conn)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxArray machines = VBOX_ARRAY_INITIALIZER;
PRUint32 state;
nsresult rc;
@ -765,7 +755,7 @@ static int vboxConnectNumOfDomains(virConnectPtr conn)
static virDomainPtr vboxDomainLookupByID(virConnectPtr conn, int id)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxArray machines = VBOX_ARRAY_INITIALIZER;
IMachine *machine;
PRBool isAccessible = PR_FALSE;
@ -843,7 +833,7 @@ static virDomainPtr vboxDomainLookupByID(virConnectPtr conn, int id)
virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn,
const unsigned char *uuid)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxArray machines = VBOX_ARRAY_INITIALIZER;
vboxIIDUnion iid;
char *machineNameUtf8 = NULL;
@ -920,7 +910,7 @@ virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn,
static virDomainPtr
vboxDomainLookupByName(virConnectPtr conn, const char *name)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxArray machines = VBOX_ARRAY_INITIALIZER;
vboxIIDUnion iid;
char *machineNameUtf8 = NULL;
@ -992,7 +982,7 @@ vboxDomainLookupByName(virConnectPtr conn, const char *name)
}
static void
vboxSetBootDeviceOrder(virDomainDefPtr def, vboxGlobalData *data,
vboxSetBootDeviceOrder(virDomainDefPtr def, vboxDriverPtr data,
IMachine *machine)
{
ISystemProperties *systemProperties = NULL;
@ -1049,7 +1039,7 @@ vboxSetBootDeviceOrder(virDomainDefPtr def, vboxGlobalData *data,
}
static void
vboxAttachDrivesNew(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
vboxAttachDrivesNew(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
{
/* AttachDrives for 3.0 and later */
size_t i;
@ -1258,7 +1248,7 @@ vboxAttachDrivesNew(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine
}
static void
vboxAttachDrives(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
vboxAttachDrives(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
{
/* Here, About the vboxAttachDrives. In fact,there is
* three different implementations. We name it as
@ -1329,7 +1319,7 @@ vboxAttachSound(virDomainDefPtr def, IMachine *machine)
}
static int
vboxAttachNetwork(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
vboxAttachNetwork(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
{
ISystemProperties *systemProperties = NULL;
PRUint32 chipsetType = ChipsetType_Null;
@ -1475,7 +1465,7 @@ vboxAttachNetwork(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
}
static void
vboxAttachSerial(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
vboxAttachSerial(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
{
ISystemProperties *systemProperties = NULL;
PRUint32 serialPortCount = 0;
@ -1551,7 +1541,7 @@ vboxAttachSerial(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
}
static void
vboxAttachParallel(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
vboxAttachParallel(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
{
ISystemProperties *systemProperties = NULL;
PRUint32 parallelPortCount = 0;
@ -1640,7 +1630,7 @@ vboxAttachVideo(virDomainDefPtr def, IMachine *machine)
}
static void
vboxAttachDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
vboxAttachDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
{
int vrdpPresent = 0;
int sdlPresent = 0;
@ -1787,7 +1777,7 @@ vboxAttachDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
}
static void
vboxAttachUSB(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
vboxAttachUSB(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
{
IUSBCommon *USBCommon = NULL;
size_t i = 0;
@ -1891,7 +1881,7 @@ vboxAttachUSB(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
}
static void
vboxAttachSharedFolder(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
vboxAttachSharedFolder(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
{
size_t i;
PRUnichar *nameUtf16;
@ -1920,7 +1910,7 @@ vboxAttachSharedFolder(virDomainDefPtr def, vboxGlobalData *data, IMachine *mach
static virDomainPtr
vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
IMachine *machine = NULL;
IBIOSSettings *bios = NULL;
vboxIIDUnion mchiid;
@ -2068,7 +2058,7 @@ vboxDomainDefineXML(virConnectPtr conn, const char *xml)
}
static void
detachDevices_common(vboxGlobalData *data, vboxIIDUnion *iidu)
detachDevices_common(vboxDriverPtr data, vboxIIDUnion *iidu)
{
/* Block for checking if HDD's are attched to VM.
* considering just IDE bus for now. Also skipped
@ -2105,7 +2095,7 @@ detachDevices_common(vboxGlobalData *data, vboxIIDUnion *iidu)
static int vboxDomainUndefineFlags(virDomainPtr dom, unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IMachine *machine = NULL;
vboxIIDUnion iid;
nsresult rc;
@ -2148,7 +2138,7 @@ static int vboxDomainUndefine(virDomainPtr dom)
static int
vboxStartMachine(virDomainPtr dom, int maxDomID, IMachine *machine, vboxIIDUnion *iid)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
int vrdpPresent = 0;
int sdlPresent = 0;
int guiPresent = 0;
@ -2300,7 +2290,7 @@ vboxStartMachine(virDomainPtr dom, int maxDomID, IMachine *machine, vboxIIDUnion
static int vboxDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxArray machines = VBOX_ARRAY_INITIALIZER;
unsigned char uuid[VIR_UUID_BUFLEN] = {0};
nsresult rc;
@ -2405,7 +2395,7 @@ static virDomainPtr vboxDomainCreateXML(virConnectPtr conn, const char *xml,
static int vboxDomainIsActive(virDomainPtr dom)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxArray machines = VBOX_ARRAY_INITIALIZER;
vboxIIDUnion iid;
char *machineNameUtf8 = NULL;
@ -2477,7 +2467,7 @@ static int vboxDomainIsPersistent(virDomainPtr dom)
{
/* All domains are persistent. However, we do want to check for
* existence. */
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion iid;
IMachine *machine = NULL;
int ret = -1;
@ -2500,7 +2490,7 @@ static int vboxDomainIsUpdated(virDomainPtr dom)
{
/* VBox domains never have a persistent state that differs from
* current state. However, we do want to check for existence. */
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion iid;
IMachine *machine = NULL;
int ret = -1;
@ -2521,7 +2511,7 @@ static int vboxDomainIsUpdated(virDomainPtr dom)
static int vboxDomainSuspend(virDomainPtr dom)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IMachine *machine = NULL;
vboxIIDUnion iid;
IConsole *console = NULL;
@ -2572,7 +2562,7 @@ static int vboxDomainSuspend(virDomainPtr dom)
static int vboxDomainResume(virDomainPtr dom)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IMachine *machine = NULL;
vboxIIDUnion iid;
IConsole *console = NULL;
@ -2623,7 +2613,7 @@ static int vboxDomainResume(virDomainPtr dom)
static int vboxDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IMachine *machine = NULL;
vboxIIDUnion iid;
IConsole *console = NULL;
@ -2680,7 +2670,7 @@ static int vboxDomainShutdown(virDomainPtr dom)
static int vboxDomainReboot(virDomainPtr dom, unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IMachine *machine = NULL;
vboxIIDUnion iid;
IConsole *console = NULL;
@ -2728,7 +2718,7 @@ static int vboxDomainReboot(virDomainPtr dom, unsigned int flags)
static int vboxDomainDestroyFlags(virDomainPtr dom, unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IMachine *machine = NULL;
vboxIIDUnion iid;
IConsole *console = NULL;
@ -2794,7 +2784,7 @@ static char *vboxDomainGetOSType(virDomainPtr dom ATTRIBUTE_UNUSED) {
static int vboxDomainSetMemory(virDomainPtr dom, unsigned long memory)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IMachine *machine = NULL;
vboxIIDUnion iid;
PRUint32 state;
@ -2852,7 +2842,7 @@ static int vboxDomainSetMemory(virDomainPtr dom, unsigned long memory)
static int vboxDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxArray machines = VBOX_ARRAY_INITIALIZER;
char *machineName = NULL;
PRUnichar *machineNameUtf16 = NULL;
@ -2936,7 +2926,7 @@ static int vboxDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
static int vboxDomainGetState(virDomainPtr dom, int *state,
int *reason, unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion domiid;
IMachine *machine = NULL;
PRUint32 mstate;
@ -2967,7 +2957,7 @@ static int vboxDomainGetState(virDomainPtr dom, int *state,
static int vboxDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IMachine *machine = NULL;
vboxIIDUnion iid;
PRUint32 CPUCount = nvcpus;
@ -3021,7 +3011,7 @@ static int vboxDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus)
static int vboxDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
ISystemProperties *systemProperties = NULL;
PRUint32 maxCPUCount = 0;
int ret = -1;
@ -3058,7 +3048,7 @@ static int vboxDomainGetMaxVcpus(virDomainPtr dom)
}
static void
vboxHostDeviceGetXMLDesc(vboxGlobalData *data, virDomainDefPtr def, IMachine *machine)
vboxHostDeviceGetXMLDesc(vboxDriverPtr data, virDomainDefPtr def, IMachine *machine)
{
IUSBCommon *USBCommon = NULL;
PRBool enabled = PR_FALSE;
@ -3164,7 +3154,7 @@ vboxHostDeviceGetXMLDesc(vboxGlobalData *data, virDomainDefPtr def, IMachine *ma
}
static void
vboxDumpIDEHDDsNew(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
vboxDumpIDEHDDsNew(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
{
/* dump IDE hdds if present */
vboxArray mediumAttachments = VBOX_ARRAY_INITIALIZER;
@ -3325,7 +3315,7 @@ vboxDumpIDEHDDsNew(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
}
static int
vboxDumpVideo(virDomainDefPtr def, vboxGlobalData *data ATTRIBUTE_UNUSED,
vboxDumpVideo(virDomainDefPtr def, vboxDriverPtr data ATTRIBUTE_UNUSED,
IMachine *machine)
{
/* dump video options vram/2d/3d/directx/etc. */
@ -3363,7 +3353,7 @@ vboxDumpVideo(virDomainDefPtr def, vboxGlobalData *data ATTRIBUTE_UNUSED,
}
static int
vboxDumpDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
{
/* dump display options vrdp/gui/sdl */
PRUnichar *keyUtf16 = NULL;
@ -3483,7 +3473,7 @@ vboxDumpDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
}
static void
vboxDumpSharedFolders(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
vboxDumpSharedFolders(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
{
/* shared folders */
vboxArray sharedFolders = VBOX_ARRAY_INITIALIZER;
@ -3544,7 +3534,7 @@ vboxDumpSharedFolders(virDomainDefPtr def, vboxGlobalData *data, IMachine *machi
}
static void
vboxDumpNetwork(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine, PRUint32 networkAdapterCount)
vboxDumpNetwork(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUint32 networkAdapterCount)
{
PRUint32 netAdpIncCnt = 0;
size_t i = 0;
@ -3683,7 +3673,7 @@ vboxDumpNetwork(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine, PR
}
static void
vboxDumpAudio(virDomainDefPtr def, vboxGlobalData *data ATTRIBUTE_UNUSED,
vboxDumpAudio(virDomainDefPtr def, vboxDriverPtr data ATTRIBUTE_UNUSED,
IMachine *machine)
{
/* dump sound card if active */
@ -3723,7 +3713,7 @@ vboxDumpAudio(virDomainDefPtr def, vboxGlobalData *data ATTRIBUTE_UNUSED,
}
static void
vboxDumpSerial(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine, PRUint32 serialPortCount)
vboxDumpSerial(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUint32 serialPortCount)
{
PRUint32 serialPortIncCount = 0;
size_t i = 0;
@ -3811,7 +3801,7 @@ vboxDumpSerial(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine, PRU
}
static void
vboxDumpParallel(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine, PRUint32 parallelPortCount)
vboxDumpParallel(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUint32 parallelPortCount)
{
PRUint32 parallelPortIncCount = 0;
size_t i = 0;
@ -3886,7 +3876,7 @@ vboxDumpParallel(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine, P
static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
virDomainDefPtr def = NULL;
IMachine *machine = NULL;
vboxIIDUnion iid;
@ -4054,7 +4044,7 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
static int vboxConnectListDefinedDomains(virConnectPtr conn,
char ** const names, int maxnames)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxArray machines = VBOX_ARRAY_INITIALIZER;
char *machineName = NULL;
PRUnichar *machineNameUtf16 = NULL;
@ -4116,7 +4106,7 @@ static int vboxConnectListDefinedDomains(virConnectPtr conn,
static int vboxConnectNumOfDefinedDomains(virConnectPtr conn)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxArray machines = VBOX_ARRAY_INITIALIZER;
PRUint32 state;
nsresult rc;
@ -4161,7 +4151,7 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr dom,
const char *xml,
int mediaChangeOnly ATTRIBUTE_UNUSED)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IMachine *machine = NULL;
vboxIIDUnion iid;
PRUint32 state;
@ -4292,7 +4282,7 @@ static int vboxDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
static int vboxDomainDetachDevice(virDomainPtr dom, const char *xml)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IMachine *machine = NULL;
vboxIIDUnion iid;
PRUint32 state;
@ -4405,7 +4395,7 @@ static int vboxDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
static int vboxCloseDisksRecursively(virDomainPtr dom, char *location)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
nsresult rc;
size_t i = 0;
PRUnichar *locationUtf = NULL;
@ -4506,7 +4496,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
*
* Finally, we register the machine with the new virtualbox description file.
*/
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion domiid;
IMachine *machine = NULL;
nsresult rc;
@ -5365,7 +5355,7 @@ vboxDomainSnapshotCreateXML(virDomainPtr dom,
const char *xmlDesc,
unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
virDomainSnapshotDefPtr def = NULL;
vboxIIDUnion domiid;
IMachine *machine = NULL;
@ -5566,7 +5556,7 @@ vboxDomainSnapshotGetAll(virDomainPtr dom,
}
static ISnapshot *
vboxDomainSnapshotGet(vboxGlobalData *data,
vboxDomainSnapshotGet(vboxDriverPtr data,
virDomainPtr dom,
IMachine *machine,
const char *name)
@ -5619,7 +5609,7 @@ static int vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPtr def,
virDomainSnapshotPtr snapshot)
{
virDomainPtr dom = snapshot->domain;
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion domiid;
IMachine *machine = NULL;
ISnapshot *snap = NULL;
@ -5840,7 +5830,7 @@ int vboxSnapshotGetReadOnlyDisks(virDomainSnapshotPtr snapshot,
virDomainSnapshotDefPtr def)
{
virDomainPtr dom = snapshot->domain;
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion domiid;
ISnapshot *snap = NULL;
IMachine *machine = NULL;
@ -6059,7 +6049,7 @@ static char *vboxDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainPtr dom = snapshot->domain;
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion domiid;
IMachine *machine = NULL;
ISnapshot *snap = NULL;
@ -6204,7 +6194,7 @@ static char *vboxDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
static int vboxDomainSnapshotNum(virDomainPtr dom, unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion iid;
IMachine *machine = NULL;
nsresult rc;
@ -6249,7 +6239,7 @@ static int vboxDomainSnapshotNum(virDomainPtr dom, unsigned int flags)
static int vboxDomainSnapshotListNames(virDomainPtr dom, char **names,
int nameslen, unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion iid;
IMachine *machine = NULL;
nsresult rc;
@ -6330,7 +6320,7 @@ static virDomainSnapshotPtr
vboxDomainSnapshotLookupByName(virDomainPtr dom, const char *name,
unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion iid;
IMachine *machine = NULL;
ISnapshot *snapshot = NULL;
@ -6359,7 +6349,7 @@ vboxDomainSnapshotLookupByName(virDomainPtr dom, const char *name,
static int vboxDomainHasCurrentSnapshot(virDomainPtr dom,
unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion iid;
IMachine *machine = NULL;
ISnapshot *snapshot = NULL;
@ -6397,7 +6387,7 @@ vboxDomainSnapshotGetParent(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainPtr dom = snapshot->domain;
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion iid;
IMachine *machine = NULL;
ISnapshot *snap = NULL;
@ -6460,7 +6450,7 @@ vboxDomainSnapshotGetParent(virDomainSnapshotPtr snapshot,
static virDomainSnapshotPtr
vboxDomainSnapshotCurrent(virDomainPtr dom, unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion iid;
IMachine *machine = NULL;
ISnapshot *snapshot = NULL;
@ -6518,7 +6508,7 @@ static int vboxDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainPtr dom = snapshot->domain;
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion iid;
IMachine *machine = NULL;
ISnapshot *snap = NULL;
@ -6579,7 +6569,7 @@ static int vboxDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainPtr dom = snapshot->domain;
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion iid;
IMachine *machine = NULL;
ISnapshot *snap = NULL;
@ -6610,7 +6600,7 @@ static int vboxDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainPtr dom = snapshot->domain;
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion domiid;
IMachine *machine = NULL;
ISnapshot *newSnapshot = NULL;
@ -6680,7 +6670,7 @@ static int vboxDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
}
static int
vboxDomainSnapshotDeleteSingle(vboxGlobalData *data,
vboxDomainSnapshotDeleteSingle(vboxDriverPtr data,
IConsole *console,
ISnapshot *snapshot)
{
@ -6727,7 +6717,7 @@ vboxDomainSnapshotDeleteSingle(vboxGlobalData *data,
}
static int
vboxDomainSnapshotDeleteTree(vboxGlobalData *data,
vboxDomainSnapshotDeleteTree(vboxDriverPtr data,
IConsole *console,
ISnapshot *snapshot)
{
@ -6774,7 +6764,7 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
*/
virDomainPtr dom = snapshot->domain;
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
virDomainSnapshotDefPtr def = NULL;
char *defXml = NULL;
vboxIIDUnion domiid;
@ -7211,7 +7201,7 @@ static int vboxDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainPtr dom = snapshot->domain;
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxIIDUnion domiid;
IMachine *machine = NULL;
ISnapshot *snap = NULL;
@ -7297,7 +7287,7 @@ vboxDomainScreenshot(virDomainPtr dom,
unsigned int screen,
unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IConsole *console = NULL;
vboxIIDUnion iid;
IMachine *machine = NULL;
@ -7438,7 +7428,7 @@ vboxConnectListAllDomains(virConnectPtr conn,
virDomainPtr **domains,
unsigned int flags)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxArray machines = VBOX_ARRAY_INITIALIZER;
char *machineNameUtf8 = NULL;
PRUnichar *machineNameUtf16 = NULL;
@ -7650,7 +7640,7 @@ vboxNodeAllocPages(virConnectPtr conn ATTRIBUTE_UNUSED,
static int
vboxDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
{
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
vboxArray machines = VBOX_ARRAY_INITIALIZER;
vboxIIDUnion iid;
char *machineNameUtf8 = NULL;
@ -7726,7 +7716,7 @@ vboxDomainSendKey(virDomainPtr dom,
unsigned int flags)
{
int ret = -1;
vboxGlobalData *data = dom->conn->privateData;
vboxDriverPtr data = dom->conn->privateData;
IConsole *console = NULL;
vboxIIDUnion iid;
IMachine *machine = NULL;

View File

@ -397,7 +397,7 @@ typedef nsISupports IKeyboard;
# define vboxIIDToUUID(iid, uuid) gVBoxAPI.UIID.vboxIIDToUUID(data, iid, uuid)
# define vboxIIDFromUUID(iid, uuid) gVBoxAPI.UIID.vboxIIDFromUUID(data, iid, uuid)
# define vboxIIDIsEqual(iid1, iid2) gVBoxAPI.UIID.vboxIIDIsEqual(data, iid1, iid2)
# define DEBUGIID(msg, iid) gVBoxAPI.UIID.DEBUGIID(msg, iid)
# define DEBUGIID(msg, iid) gVBoxAPI.UIID.DEBUGIID(data, msg, iid)
# define vboxIIDFromArrayItem(iid, array, idx) \
gVBoxAPI.UIID.vboxIIDFromArrayItem(data, iid, array, idx)

View File

@ -46,7 +46,7 @@ static vboxUniformedAPI gVBoxAPI;
static int vboxConnectNumOfNetworks(virConnectPtr conn)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxArray networkInterfaces = VBOX_ARRAY_INITIALIZER;
IHost *host = NULL;
size_t i = 0;
@ -91,7 +91,7 @@ static int vboxConnectNumOfNetworks(virConnectPtr conn)
static int vboxConnectListNetworks(virConnectPtr conn, char **const names, int nnames)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxArray networkInterfaces = VBOX_ARRAY_INITIALIZER;
IHost *host = NULL;
size_t i = 0;
@ -148,7 +148,7 @@ static int vboxConnectListNetworks(virConnectPtr conn, char **const names, int n
static int vboxConnectNumOfDefinedNetworks(virConnectPtr conn)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxArray networkInterfaces = VBOX_ARRAY_INITIALIZER;
IHost *host = NULL;
size_t i = 0;
@ -193,7 +193,7 @@ static int vboxConnectNumOfDefinedNetworks(virConnectPtr conn)
static int vboxConnectListDefinedNetworks(virConnectPtr conn, char **const names, int nnames)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxArray networkInterfaces = VBOX_ARRAY_INITIALIZER;
IHost *host = NULL;
size_t i = 0;
@ -250,7 +250,7 @@ static int vboxConnectListDefinedNetworks(virConnectPtr conn, char **const names
static virNetworkPtr vboxNetworkLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
PRUint32 interfaceType = 0;
char *nameUtf8 = NULL;
PRUnichar *nameUtf16 = NULL;
@ -302,7 +302,7 @@ static virNetworkPtr vboxNetworkLookupByUUID(virConnectPtr conn, const unsigned
static virNetworkPtr vboxNetworkLookupByName(virConnectPtr conn, const char *name)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
PRUnichar *nameUtf16 = NULL;
IHostNetworkInterface *networkInterface = NULL;
PRUint32 interfaceType = 0;
@ -350,7 +350,7 @@ static virNetworkPtr vboxNetworkLookupByName(virConnectPtr conn, const char *nam
}
static PRUnichar *
vboxSocketFormatAddrUtf16(vboxGlobalData *data, virSocketAddrPtr addr)
vboxSocketFormatAddrUtf16(vboxDriverPtr data, virSocketAddrPtr addr)
{
char *utf8 = NULL;
PRUnichar *utf16 = NULL;
@ -369,7 +369,7 @@ vboxSocketFormatAddrUtf16(vboxGlobalData *data, virSocketAddrPtr addr)
static virNetworkPtr
vboxNetworkDefineCreateXML(virConnectPtr conn, const char *xml, bool start)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
PRUnichar *networkInterfaceNameUtf16 = NULL;
char *networkInterfaceNameUtf8 = NULL;
PRUnichar *networkNameUtf16 = NULL;
@ -563,7 +563,7 @@ static virNetworkPtr vboxNetworkDefineXML(virConnectPtr conn, const char *xml)
static int
vboxNetworkUndefineDestroy(virNetworkPtr network, bool removeinterface)
{
vboxGlobalData *data = network->conn->privateData;
vboxDriverPtr data = network->conn->privateData;
char *networkNameUtf8 = NULL;
PRUnichar *networkInterfaceNameUtf16 = NULL;
IHostNetworkInterface *networkInterface = NULL;
@ -668,7 +668,7 @@ static int vboxNetworkDestroy(virNetworkPtr network)
static int vboxNetworkCreate(virNetworkPtr network)
{
vboxGlobalData *data = network->conn->privateData;
vboxDriverPtr data = network->conn->privateData;
char *networkNameUtf8 = NULL;
PRUnichar *networkInterfaceNameUtf16 = NULL;
IHostNetworkInterface *networkInterface = NULL;
@ -739,7 +739,7 @@ static int vboxNetworkCreate(virNetworkPtr network)
}
static int
vboxSocketParseAddrUtf16(vboxGlobalData *data, const PRUnichar *utf16,
vboxSocketParseAddrUtf16(vboxDriverPtr data, const PRUnichar *utf16,
virSocketAddrPtr addr)
{
int result = -1;
@ -760,7 +760,7 @@ vboxSocketParseAddrUtf16(vboxGlobalData *data, const PRUnichar *utf16,
static char *vboxNetworkGetXMLDesc(virNetworkPtr network, unsigned int flags)
{
vboxGlobalData *data = network->conn->privateData;
vboxDriverPtr data = network->conn->privateData;
virNetworkDefPtr def = NULL;
virNetworkIPDefPtr ipdef = NULL;
char *networkNameUtf8 = NULL;

View File

@ -86,7 +86,7 @@ vboxStoragePoolLookupByName(virConnectPtr conn, const char *name)
static int vboxStoragePoolNumOfVolumes(virStoragePoolPtr pool)
{
vboxGlobalData *data = pool->conn->privateData;
vboxDriverPtr data = pool->conn->privateData;
vboxArray hardDisks = VBOX_ARRAY_INITIALIZER;
PRUint32 hardDiskAccessible = 0;
nsresult rc;
@ -127,7 +127,7 @@ static int vboxStoragePoolNumOfVolumes(virStoragePoolPtr pool)
static int
vboxStoragePoolListVolumes(virStoragePoolPtr pool, char **const names, int nnames)
{
vboxGlobalData *data = pool->conn->privateData;
vboxDriverPtr data = pool->conn->privateData;
vboxArray hardDisks = VBOX_ARRAY_INITIALIZER;
PRUint32 numActive = 0;
nsresult rc;
@ -183,7 +183,7 @@ vboxStoragePoolListVolumes(virStoragePoolPtr pool, char **const names, int nname
static virStorageVolPtr
vboxStorageVolLookupByName(virStoragePoolPtr pool, const char *name)
{
vboxGlobalData *data = pool->conn->privateData;
vboxDriverPtr data = pool->conn->privateData;
vboxArray hardDisks = VBOX_ARRAY_INITIALIZER;
nsresult rc;
size_t i;
@ -256,7 +256,7 @@ vboxStorageVolLookupByName(virStoragePoolPtr pool, const char *name)
static virStorageVolPtr
vboxStorageVolLookupByKey(virConnectPtr conn, const char *key)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
vboxIIDUnion hddIID;
unsigned char uuid[VIR_UUID_BUFLEN];
IHardDisk *hardDisk = NULL;
@ -323,7 +323,7 @@ vboxStorageVolLookupByKey(virConnectPtr conn, const char *key)
static virStorageVolPtr
vboxStorageVolLookupByPath(virConnectPtr conn, const char *path)
{
vboxGlobalData *data = conn->privateData;
vboxDriverPtr data = conn->privateData;
PRUnichar *hddPathUtf16 = NULL;
IHardDisk *hardDisk = NULL;
PRUnichar *hddNameUtf16 = NULL;
@ -401,7 +401,7 @@ static virStorageVolPtr
vboxStorageVolCreateXML(virStoragePoolPtr pool,
const char *xml, unsigned int flags)
{
vboxGlobalData *data = pool->conn->privateData;
vboxDriverPtr data = pool->conn->privateData;
virStorageVolDefPtr def = NULL;
PRUnichar *hddFormatUtf16 = NULL;
PRUnichar *hddNameUtf16 = NULL;
@ -508,7 +508,7 @@ vboxStorageVolCreateXML(virStoragePoolPtr pool,
static int vboxStorageVolDelete(virStorageVolPtr vol, unsigned int flags)
{
vboxGlobalData *data = vol->conn->privateData;
vboxDriverPtr data = vol->conn->privateData;
unsigned char uuid[VIR_UUID_BUFLEN];
IHardDisk *hardDisk = NULL;
int deregister = 0;
@ -663,7 +663,7 @@ static int vboxStorageVolDelete(virStorageVolPtr vol, unsigned int flags)
static int vboxStorageVolGetInfo(virStorageVolPtr vol, virStorageVolInfoPtr info)
{
vboxGlobalData *data = vol->conn->privateData;
vboxDriverPtr data = vol->conn->privateData;
IHardDisk *hardDisk = NULL;
unsigned char uuid[VIR_UUID_BUFLEN];
PRUint32 hddstate;
@ -718,7 +718,7 @@ static int vboxStorageVolGetInfo(virStorageVolPtr vol, virStorageVolInfoPtr info
static char *vboxStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags)
{
vboxGlobalData *data = vol->conn->privateData;
vboxDriverPtr data = vol->conn->privateData;
IHardDisk *hardDisk = NULL;
unsigned char uuid[VIR_UUID_BUFLEN];
PRUnichar *hddFormatUtf16 = NULL;
@ -810,7 +810,7 @@ static char *vboxStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags)
static char *vboxStorageVolGetPath(virStorageVolPtr vol)
{
vboxGlobalData *data = vol->conn->privateData;
vboxDriverPtr data = vol->conn->privateData;
IHardDisk *hardDisk = NULL;
PRUnichar *hddLocationUtf16 = NULL;
char *hddLocationUtf8 = NULL;

File diff suppressed because it is too large Load Diff

View File

@ -96,45 +96,14 @@ typedef union {
PRInt32 resultCode;
} resultCodeUnion;
typedef struct {
virMutex lock;
unsigned long version;
virCapsPtr caps;
virDomainXMLOptionPtr xmlopt;
IVirtualBox *vboxObj;
ISession *vboxSession;
/** Our version specific API table pointer. */
PCVBOXXPCOM pFuncs;
/* The next is used for domainEvent */
# if defined(VBOX_API_VERSION) && VBOX_API_VERSION > 2002000 && VBOX_API_VERSION < 4000000
/* Async event handling */
virObjectEventStatePtr domainEvents;
int fdWatch;
IVirtualBoxCallback *vboxCallback;
nsIEventQueue *vboxQueue;
int volatile vboxCallBackRefCount;
/* pointer back to the connection */
struct _vboxCallback {
struct IVirtualBoxCallback_vtbl *vtbl;
virConnectPtr conn;
int vboxCallBackRefCount;
};
# else /* VBOX_API_VERSION <= 2002000 || VBOX_API_VERSION >= 4000000 || VBOX_API_VERSION undefined */
virObjectEventStatePtr domainEvents;
int fdWatch;
void *vboxCallback;
void *vboxQueue;
int volatile vboxCallBackRefCount;
virConnectPtr conn;
# endif /* VBOX_API_VERSION <= 2002000 || VBOX_API_VERSION >= 4000000 || VBOX_API_VERSION undefined */
} vboxGlobalData;
typedef struct _vboxCallback vboxCallback;
typedef struct _vboxCallback *vboxCallbackPtr;
struct _vboxDriver {
virObjectLockable parent;
@ -152,11 +121,10 @@ struct _vboxDriver {
# endif
int fdWatch;
vboxCallbackPtr vboxCallback;
# if VBOX_API_VERSION > 2002000 && VBOX_API_VERSION < 4000000
IVirtualBoxCallback *vboxCallback;
nsIEventQueue *vboxQueue;
# else
void *vboxCallback;
void *vboxQueue;
# endif
unsigned long version;
@ -186,13 +154,13 @@ typedef struct {
/* Functions for vboxIID */
typedef struct {
void (*vboxIIDInitialize)(vboxIIDUnion *iidu);
void (*vboxIIDUnalloc)(vboxGlobalData *data, vboxIIDUnion *iidu);
void (*vboxIIDToUUID)(vboxGlobalData *data, vboxIIDUnion *iidu, unsigned char *uuid);
void (*vboxIIDFromUUID)(vboxGlobalData *data, vboxIIDUnion *iidu, const unsigned char *uuid);
bool (*vboxIIDIsEqual)(vboxGlobalData *data, vboxIIDUnion *iidu1, vboxIIDUnion *iidu2);
void (*vboxIIDFromArrayItem)(vboxGlobalData *data, vboxIIDUnion *iidu, vboxArray *array, int idx);
void (*vboxIIDToUtf8)(vboxGlobalData *data, vboxIIDUnion *iidu, char **utf8);
void (*DEBUGIID)(const char *msg, vboxIIDUnion *iidu);
void (*vboxIIDUnalloc)(vboxDriverPtr driver, vboxIIDUnion *iidu);
void (*vboxIIDToUUID)(vboxDriverPtr driver, vboxIIDUnion *iidu, unsigned char *uuid);
void (*vboxIIDFromUUID)(vboxDriverPtr driver, vboxIIDUnion *iidu, const unsigned char *uuid);
bool (*vboxIIDIsEqual)(vboxDriverPtr driver, vboxIIDUnion *iidu1, vboxIIDUnion *iidu2);
void (*vboxIIDFromArrayItem)(vboxDriverPtr driver, vboxIIDUnion *iidu, vboxArray *array, int idx);
void (*vboxIIDToUtf8)(vboxDriverPtr driver, vboxIIDUnion *iidu, char **utf8);
void (*DEBUGIID)(vboxDriverPtr driver, const char *msg, vboxIIDUnion *iidu);
} vboxUniformedIID;
/* Functions for vboxArray */
@ -227,7 +195,7 @@ typedef struct {
nsresult (*OpenMachine)(IVirtualBox *vboxObj, PRUnichar *settingsFile, IMachine **machine);
nsresult (*GetSystemProperties)(IVirtualBox *vboxObj, ISystemProperties **systemProperties);
nsresult (*GetHost)(IVirtualBox *vboxObj, IHost **host);
nsresult (*CreateMachine)(vboxGlobalData *data, virDomainDefPtr def, IMachine **machine, char *uuidstr);
nsresult (*CreateMachine)(vboxDriverPtr driver, virDomainDefPtr def, IMachine **machine, char *uuidstr);
nsresult (*CreateHardDisk)(IVirtualBox *vboxObj, PRUnichar *format, PRUnichar *location, IHardDisk **hardDisk);
nsresult (*RegisterMachine)(IVirtualBox *vboxObj, IMachine *machine);
nsresult (*FindHardDisk)(IVirtualBox *vboxObj, PRUnichar *location, PRUint32 deviceType,
@ -252,7 +220,7 @@ typedef struct {
PRUnichar *hostPath, PRBool writable,
PRBool automount);
nsresult (*RemoveSharedFolder)(IMachine *machine, PRUnichar *name);
nsresult (*LaunchVMProcess)(vboxGlobalData *data, IMachine *machine,
nsresult (*LaunchVMProcess)(vboxDriverPtr driver, IMachine *machine,
vboxIIDUnion *iidu,
PRUnichar *sessionType, PRUnichar *env,
IProgress **progress);
@ -299,8 +267,8 @@ typedef struct {
/* Functions for ISession */
typedef struct {
nsresult (*Open)(vboxGlobalData *data, vboxIIDUnion *iidu, IMachine *machine);
nsresult (*OpenExisting)(vboxGlobalData *data, vboxIIDUnion *iidu, IMachine *machine);
nsresult (*Open)(vboxDriverPtr driver, vboxIIDUnion *iidu, IMachine *machine);
nsresult (*OpenExisting)(vboxDriverPtr driver, vboxIIDUnion *iidu, IMachine *machine);
nsresult (*GetConsole)(ISession *session, IConsole **console);
nsresult (*GetMachine)(ISession *session, IMachine **machine);
nsresult (*Close)(ISession *session);
@ -410,17 +378,17 @@ typedef struct {
typedef struct {
nsresult (*GetEnabled)(IVRDxServer *VRDxServer, PRBool *enabled);
nsresult (*SetEnabled)(IVRDxServer *VRDxServer, PRBool enabled);
nsresult (*GetPorts)(vboxGlobalData *data, IVRDxServer *VRDxServer,
nsresult (*GetPorts)(vboxDriverPtr driver, IVRDxServer *VRDxServer,
virDomainGraphicsDefPtr graphics);
nsresult (*SetPorts)(vboxGlobalData *data, IVRDxServer *VRDxServer,
nsresult (*SetPorts)(vboxDriverPtr driver, IVRDxServer *VRDxServer,
virDomainGraphicsDefPtr graphics);
nsresult (*GetReuseSingleConnection)(IVRDxServer *VRDxServer, PRBool *enabled);
nsresult (*SetReuseSingleConnection)(IVRDxServer *VRDxServer, PRBool enabled);
nsresult (*GetAllowMultiConnection)(IVRDxServer *VRDxServer, PRBool *enabled);
nsresult (*SetAllowMultiConnection)(IVRDxServer *VRDxServer, PRBool enabled);
nsresult (*GetNetAddress)(vboxGlobalData *data, IVRDxServer *VRDxServer,
nsresult (*GetNetAddress)(vboxDriverPtr driver, IVRDxServer *VRDxServer,
PRUnichar **netAddress);
nsresult (*SetNetAddress)(vboxGlobalData *data, IVRDxServer *VRDxServer,
nsresult (*SetNetAddress)(vboxDriverPtr driver, IVRDxServer *VRDxServer,
PRUnichar *netAddress);
} vboxUniformedIVRDxServer;
@ -518,7 +486,7 @@ typedef struct {
IHostNetworkInterface **networkInterface);
nsresult (*FindHostNetworkInterfaceByName)(IHost *host, PRUnichar *name,
IHostNetworkInterface **networkInterface);
nsresult (*CreateHostOnlyNetworkInterface)(vboxGlobalData *data,
nsresult (*CreateHostOnlyNetworkInterface)(vboxDriverPtr driver,
IHost *host, char *name,
IHostNetworkInterface **networkInterface);
nsresult (*RemoveHostOnlyNetworkInterface)(IHost *host, vboxIIDUnion *iidu,
@ -587,18 +555,17 @@ typedef struct {
uint32_t XPCOMCVersion;
/* vbox APIs */
int (*initializeDomainEvent)(vboxDriverPtr driver);
void (*registerGlobalData)(vboxGlobalData *data);
void (*detachDevices)(vboxGlobalData *data, IMachine *machine, PRUnichar *hddcnameUtf16);
nsresult (*unregisterMachine)(vboxGlobalData *data, vboxIIDUnion *iidu, IMachine **machine);
void (*detachDevices)(vboxDriverPtr driver, IMachine *machine, PRUnichar *hddcnameUtf16);
nsresult (*unregisterMachine)(vboxDriverPtr driver, vboxIIDUnion *iidu, IMachine **machine);
void (*deleteConfig)(IMachine *machine);
void (*vboxAttachDrivesOld)(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine);
void (*vboxAttachDrivesOld)(virDomainDefPtr def, vboxDriverPtr driver, IMachine *machine);
virDomainState (*vboxConvertState)(PRUint32 state);
void (*dumpIDEHDDsOld)(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine);
void (*dumpDVD)(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine);
int (*attachDVD)(vboxGlobalData *data, IMachine *machine, const char *src);
void (*dumpIDEHDDsOld)(virDomainDefPtr def, vboxDriverPtr driver, IMachine *machine);
void (*dumpDVD)(virDomainDefPtr def, vboxDriverPtr driver, IMachine *machine);
int (*attachDVD)(vboxDriverPtr driver, IMachine *machine, const char *src);
int (*detachDVD)(IMachine *machine);
void (*dumpFloppy)(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine);
int (*attachFloppy)(vboxGlobalData *data, IMachine *machine, const char *src);
void (*dumpFloppy)(virDomainDefPtr def, vboxDriverPtr driver, IMachine *machine);
int (*attachFloppy)(vboxDriverPtr driver, IMachine *machine, const char *src);
int (*detachFloppy)(IMachine *machine);
int (*snapshotRestore)(virDomainPtr dom, IMachine *machine, ISnapshot *snapshot);
void (*registerDomainEvent)(virHypervisorDriverPtr driver);
@ -634,7 +601,6 @@ typedef struct {
uniformedMachineStateChecker machineStateChecker;
/* vbox API features */
bool domainEventCallbacks;
bool hasStaticGlobalData;
bool getMachineForSession;
bool detachDevicesExplicitly;
bool chipsetType;