mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
vbox: consolidate vbox IID structures.
* remove _vboxIID_v2_x and _vboxIID_v3_x structs and repalce with one _vboxIID as all supprted vbox versions have the same IID structure. * remove vboxIIDUnion that was used to abstract version depended IID differences. * remove IID_MEMBER macro and use the new vboxIID directly.
This commit is contained in:
parent
3628891789
commit
73c6f16baf
@ -273,7 +273,7 @@ vboxDestroyDriverConnection(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int openSessionForMachine(vboxDriverPtr data, const unsigned char *dom_uuid,
|
static int openSessionForMachine(vboxDriverPtr data, const unsigned char *dom_uuid,
|
||||||
vboxIIDUnion *iid, IMachine **machine)
|
vboxIID *iid, IMachine **machine)
|
||||||
{
|
{
|
||||||
VBOX_IID_INITIALIZE(iid);
|
VBOX_IID_INITIALIZE(iid);
|
||||||
vboxIIDFromUUID(iid, dom_uuid);
|
vboxIIDFromUUID(iid, dom_uuid);
|
||||||
@ -535,7 +535,7 @@ vboxDomainSave(virDomainPtr dom, const char *path ATTRIBUTE_UNUSED)
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IConsole *console = NULL;
|
IConsole *console = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
IProgress *progress = NULL;
|
IProgress *progress = NULL;
|
||||||
resultCodeUnion resultCode;
|
resultCodeUnion resultCode;
|
||||||
@ -751,7 +751,7 @@ static virDomainPtr vboxDomainLookupByID(virConnectPtr conn, int id)
|
|||||||
PRBool isAccessible = PR_FALSE;
|
PRBool isAccessible = PR_FALSE;
|
||||||
PRUnichar *machineNameUtf16 = NULL;
|
PRUnichar *machineNameUtf16 = NULL;
|
||||||
char *machineNameUtf8 = NULL;
|
char *machineNameUtf8 = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
PRUint32 state;
|
PRUint32 state;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
@ -825,7 +825,7 @@ virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn,
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = conn->privateData;
|
vboxDriverPtr data = conn->privateData;
|
||||||
vboxArray machines = VBOX_ARRAY_INITIALIZER;
|
vboxArray machines = VBOX_ARRAY_INITIALIZER;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
char *machineNameUtf8 = NULL;
|
char *machineNameUtf8 = NULL;
|
||||||
PRUnichar *machineNameUtf16 = NULL;
|
PRUnichar *machineNameUtf16 = NULL;
|
||||||
unsigned char iid_as_uuid[VIR_UUID_BUFLEN];
|
unsigned char iid_as_uuid[VIR_UUID_BUFLEN];
|
||||||
@ -902,7 +902,7 @@ vboxDomainLookupByName(virConnectPtr conn, const char *name)
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = conn->privateData;
|
vboxDriverPtr data = conn->privateData;
|
||||||
vboxArray machines = VBOX_ARRAY_INITIALIZER;
|
vboxArray machines = VBOX_ARRAY_INITIALIZER;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
char *machineNameUtf8 = NULL;
|
char *machineNameUtf8 = NULL;
|
||||||
PRUnichar *machineNameUtf16 = NULL;
|
PRUnichar *machineNameUtf16 = NULL;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
@ -1104,7 +1104,7 @@ vboxAttachDrives(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
|
|||||||
|
|
||||||
if (type == VIR_STORAGE_TYPE_FILE && src) {
|
if (type == VIR_STORAGE_TYPE_FILE && src) {
|
||||||
IMedium *medium = NULL;
|
IMedium *medium = NULL;
|
||||||
vboxIIDUnion mediumUUID;
|
vboxIID mediumUUID;
|
||||||
PRUnichar *mediumFileUtf16 = NULL;
|
PRUnichar *mediumFileUtf16 = NULL;
|
||||||
PRUint32 storageBus = StorageBus_Null;
|
PRUint32 storageBus = StorageBus_Null;
|
||||||
PRUint32 deviceType = DeviceType_Null;
|
PRUint32 deviceType = DeviceType_Null;
|
||||||
@ -1858,7 +1858,7 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags
|
|||||||
vboxDriverPtr data = conn->privateData;
|
vboxDriverPtr data = conn->privateData;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
IBIOSSettings *bios = NULL;
|
IBIOSSettings *bios = NULL;
|
||||||
vboxIIDUnion mchiid;
|
vboxIID mchiid;
|
||||||
virDomainDefPtr def = NULL;
|
virDomainDefPtr def = NULL;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||||
@ -2006,7 +2006,7 @@ static int vboxDomainUndefineFlags(virDomainPtr dom, unsigned int flags)
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
@ -2043,7 +2043,7 @@ static int vboxDomainUndefine(virDomainPtr dom)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vboxStartMachine(virDomainPtr dom, int maxDomID, IMachine *machine, vboxIIDUnion *iid)
|
vboxStartMachine(virDomainPtr dom, int maxDomID, IMachine *machine, vboxIID *iid)
|
||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
int vrdpPresent = 0;
|
int vrdpPresent = 0;
|
||||||
@ -2231,7 +2231,7 @@ static int vboxDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
|
|||||||
|
|
||||||
gVBoxAPI.UIMachine.GetAccessible(machine, &isAccessible);
|
gVBoxAPI.UIMachine.GetAccessible(machine, &isAccessible);
|
||||||
if (isAccessible) {
|
if (isAccessible) {
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
|
|
||||||
VBOX_IID_INITIALIZE(&iid);
|
VBOX_IID_INITIALIZE(&iid);
|
||||||
|
|
||||||
@ -2304,7 +2304,7 @@ static int vboxDomainIsActive(virDomainPtr dom)
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxArray machines = VBOX_ARRAY_INITIALIZER;
|
vboxArray machines = VBOX_ARRAY_INITIALIZER;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
char *machineNameUtf8 = NULL;
|
char *machineNameUtf8 = NULL;
|
||||||
PRUnichar *machineNameUtf16 = NULL;
|
PRUnichar *machineNameUtf16 = NULL;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
@ -2375,7 +2375,7 @@ static int vboxDomainIsPersistent(virDomainPtr dom)
|
|||||||
/* All domains are persistent. However, we do want to check for
|
/* All domains are persistent. However, we do want to check for
|
||||||
* existence. */
|
* existence. */
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
@ -2398,7 +2398,7 @@ static int vboxDomainIsUpdated(virDomainPtr dom)
|
|||||||
/* VBox domains never have a persistent state that differs from
|
/* VBox domains never have a persistent state that differs from
|
||||||
* current state. However, we do want to check for existence. */
|
* current state. However, we do want to check for existence. */
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
@ -2420,7 +2420,7 @@ static int vboxDomainSuspend(virDomainPtr dom)
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IConsole *console = NULL;
|
IConsole *console = NULL;
|
||||||
PRBool isAccessible = PR_FALSE;
|
PRBool isAccessible = PR_FALSE;
|
||||||
PRUint32 state;
|
PRUint32 state;
|
||||||
@ -2471,7 +2471,7 @@ static int vboxDomainResume(virDomainPtr dom)
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IConsole *console = NULL;
|
IConsole *console = NULL;
|
||||||
PRUint32 state;
|
PRUint32 state;
|
||||||
PRBool isAccessible = PR_FALSE;
|
PRBool isAccessible = PR_FALSE;
|
||||||
@ -2522,7 +2522,7 @@ static int vboxDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IConsole *console = NULL;
|
IConsole *console = NULL;
|
||||||
PRUint32 state;
|
PRUint32 state;
|
||||||
PRBool isAccessible = PR_FALSE;
|
PRBool isAccessible = PR_FALSE;
|
||||||
@ -2579,7 +2579,7 @@ static int vboxDomainReboot(virDomainPtr dom, unsigned int flags)
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IConsole *console = NULL;
|
IConsole *console = NULL;
|
||||||
PRUint32 state;
|
PRUint32 state;
|
||||||
PRBool isAccessible = PR_FALSE;
|
PRBool isAccessible = PR_FALSE;
|
||||||
@ -2627,7 +2627,7 @@ static int vboxDomainDestroyFlags(virDomainPtr dom, unsigned int flags)
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IConsole *console = NULL;
|
IConsole *console = NULL;
|
||||||
PRUint32 state;
|
PRUint32 state;
|
||||||
PRBool isAccessible = PR_FALSE;
|
PRBool isAccessible = PR_FALSE;
|
||||||
@ -2693,7 +2693,7 @@ static int vboxDomainSetMemory(virDomainPtr dom, unsigned long memory)
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
PRUint32 state;
|
PRUint32 state;
|
||||||
PRBool isAccessible = PR_FALSE;
|
PRBool isAccessible = PR_FALSE;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
@ -2834,7 +2834,7 @@ static int vboxDomainGetState(virDomainPtr dom, int *state,
|
|||||||
int *reason, unsigned int flags)
|
int *reason, unsigned int flags)
|
||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion domiid;
|
vboxIID domiid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
PRUint32 mstate;
|
PRUint32 mstate;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
@ -2866,7 +2866,7 @@ static int vboxDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
PRUint32 CPUCount = nvcpus;
|
PRUint32 CPUCount = nvcpus;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
@ -3782,7 +3782,7 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
|
|||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
virDomainDefPtr def = NULL;
|
virDomainDefPtr def = NULL;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
PRBool accessible = PR_FALSE;
|
PRBool accessible = PR_FALSE;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
PRBool PAEEnabled = PR_FALSE;
|
PRBool PAEEnabled = PR_FALSE;
|
||||||
@ -4041,7 +4041,7 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr dom,
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
PRUint32 state;
|
PRUint32 state;
|
||||||
virDomainDefPtr def = NULL;
|
virDomainDefPtr def = NULL;
|
||||||
virDomainDeviceDefPtr dev = NULL;
|
virDomainDeviceDefPtr dev = NULL;
|
||||||
@ -4160,7 +4160,7 @@ static int vboxDomainDetachDevice(virDomainPtr dom, const char *xml)
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
PRUint32 state;
|
PRUint32 state;
|
||||||
virDomainDefPtr def = NULL;
|
virDomainDefPtr def = NULL;
|
||||||
virDomainDeviceDefPtr dev = NULL;
|
virDomainDeviceDefPtr dev = NULL;
|
||||||
@ -4356,7 +4356,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
|
|||||||
* Finally, we register the machine with the new virtualbox description file.
|
* Finally, we register the machine with the new virtualbox description file.
|
||||||
*/
|
*/
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion domiid;
|
vboxIID domiid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
PRUnichar *settingsFilePath = NULL;
|
PRUnichar *settingsFilePath = NULL;
|
||||||
@ -4465,7 +4465,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
|
|||||||
PRUnichar *formatUtf = NULL;
|
PRUnichar *formatUtf = NULL;
|
||||||
char *format = NULL;
|
char *format = NULL;
|
||||||
const char *parentUuid = NULL;
|
const char *parentUuid = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
|
|
||||||
VBOX_IID_INITIALIZE(&iid);
|
VBOX_IID_INITIALIZE(&iid);
|
||||||
VBOX_UTF8_TO_UTF16(realReadWriteDisksPath[it], &locationUtf);
|
VBOX_UTF8_TO_UTF16(realReadWriteDisksPath[it], &locationUtf);
|
||||||
@ -4561,7 +4561,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
|
|||||||
char *format = NULL;
|
char *format = NULL;
|
||||||
char *parentUuid = NULL;
|
char *parentUuid = NULL;
|
||||||
virVBoxSnapshotConfHardDiskPtr readOnlyDisk = NULL;
|
virVBoxSnapshotConfHardDiskPtr readOnlyDisk = NULL;
|
||||||
vboxIIDUnion iid, parentiid;
|
vboxIID iid, parentiid;
|
||||||
|
|
||||||
VBOX_IID_INITIALIZE(&iid);
|
VBOX_IID_INITIALIZE(&iid);
|
||||||
VBOX_IID_INITIALIZE(&parentiid);
|
VBOX_IID_INITIALIZE(&parentiid);
|
||||||
@ -4867,7 +4867,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
|
|||||||
char *uuid = NULL;
|
char *uuid = NULL;
|
||||||
IMedium *parentDisk = NULL;
|
IMedium *parentDisk = NULL;
|
||||||
char *parentUuid = NULL;
|
char *parentUuid = NULL;
|
||||||
vboxIIDUnion iid, parentiid;
|
vboxIID iid, parentiid;
|
||||||
|
|
||||||
VBOX_IID_INITIALIZE(&iid);
|
VBOX_IID_INITIALIZE(&iid);
|
||||||
VBOX_IID_INITIALIZE(&parentiid);
|
VBOX_IID_INITIALIZE(&parentiid);
|
||||||
@ -4984,7 +4984,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
|
|||||||
char *uuid = NULL;
|
char *uuid = NULL;
|
||||||
char *format = NULL;
|
char *format = NULL;
|
||||||
char *tmp = NULL;
|
char *tmp = NULL;
|
||||||
vboxIIDUnion iid, parentiid;
|
vboxIID iid, parentiid;
|
||||||
|
|
||||||
VBOX_IID_INITIALIZE(&iid);
|
VBOX_IID_INITIALIZE(&iid);
|
||||||
VBOX_IID_INITIALIZE(&parentiid);
|
VBOX_IID_INITIALIZE(&parentiid);
|
||||||
@ -5216,7 +5216,7 @@ vboxDomainSnapshotCreateXML(virDomainPtr dom,
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
virDomainSnapshotDefPtr def = NULL;
|
virDomainSnapshotDefPtr def = NULL;
|
||||||
vboxIIDUnion domiid;
|
vboxIID domiid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
IConsole *console = NULL;
|
IConsole *console = NULL;
|
||||||
IProgress *progress = NULL;
|
IProgress *progress = NULL;
|
||||||
@ -5335,7 +5335,7 @@ vboxDomainSnapshotGetAll(virDomainPtr dom,
|
|||||||
IMachine *machine,
|
IMachine *machine,
|
||||||
ISnapshot ***snapshots)
|
ISnapshot ***snapshots)
|
||||||
{
|
{
|
||||||
vboxIIDUnion empty;
|
vboxIID empty;
|
||||||
ISnapshot **list = NULL;
|
ISnapshot **list = NULL;
|
||||||
PRUint32 count;
|
PRUint32 count;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
@ -5469,7 +5469,7 @@ static int vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPtr def,
|
|||||||
{
|
{
|
||||||
virDomainPtr dom = snapshot->domain;
|
virDomainPtr dom = snapshot->domain;
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion domiid;
|
vboxIID domiid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
ISnapshot *snap = NULL;
|
ISnapshot *snap = NULL;
|
||||||
IMachine *snapMachine = NULL;
|
IMachine *snapMachine = NULL;
|
||||||
@ -5478,7 +5478,7 @@ static int vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPtr def,
|
|||||||
PRUint32 maxSlotPerPort[StorageBus_Floppy + 1] = {};
|
PRUint32 maxSlotPerPort[StorageBus_Floppy + 1] = {};
|
||||||
int diskCount = 0;
|
int diskCount = 0;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
vboxIIDUnion snapIid;
|
vboxIID snapIid;
|
||||||
char *snapshotUuidStr = NULL;
|
char *snapshotUuidStr = NULL;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
@ -5690,7 +5690,7 @@ int vboxSnapshotGetReadOnlyDisks(virDomainSnapshotPtr snapshot,
|
|||||||
{
|
{
|
||||||
virDomainPtr dom = snapshot->domain;
|
virDomainPtr dom = snapshot->domain;
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion domiid;
|
vboxIID domiid;
|
||||||
ISnapshot *snap = NULL;
|
ISnapshot *snap = NULL;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
IMachine *snapMachine = NULL;
|
IMachine *snapMachine = NULL;
|
||||||
@ -5909,7 +5909,7 @@ static char *vboxDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
|
|||||||
{
|
{
|
||||||
virDomainPtr dom = snapshot->domain;
|
virDomainPtr dom = snapshot->domain;
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion domiid;
|
vboxIID domiid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
ISnapshot *snap = NULL;
|
ISnapshot *snap = NULL;
|
||||||
ISnapshot *parent = NULL;
|
ISnapshot *parent = NULL;
|
||||||
@ -6054,7 +6054,7 @@ static char *vboxDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
|
|||||||
static int vboxDomainSnapshotNum(virDomainPtr dom, unsigned int flags)
|
static int vboxDomainSnapshotNum(virDomainPtr dom, unsigned int flags)
|
||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
PRUint32 snapshotCount;
|
PRUint32 snapshotCount;
|
||||||
@ -6099,7 +6099,7 @@ static int vboxDomainSnapshotListNames(virDomainPtr dom, char **names,
|
|||||||
int nameslen, unsigned int flags)
|
int nameslen, unsigned int flags)
|
||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
ISnapshot **snapshots = NULL;
|
ISnapshot **snapshots = NULL;
|
||||||
@ -6121,7 +6121,7 @@ static int vboxDomainSnapshotListNames(virDomainPtr dom, char **names,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_SNAPSHOT_LIST_ROOTS) {
|
if (flags & VIR_DOMAIN_SNAPSHOT_LIST_ROOTS) {
|
||||||
vboxIIDUnion empty;
|
vboxIID empty;
|
||||||
|
|
||||||
VBOX_IID_INITIALIZE(&empty);
|
VBOX_IID_INITIALIZE(&empty);
|
||||||
if (VIR_ALLOC_N(snapshots, 1) < 0)
|
if (VIR_ALLOC_N(snapshots, 1) < 0)
|
||||||
@ -6180,7 +6180,7 @@ vboxDomainSnapshotLookupByName(virDomainPtr dom, const char *name,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
ISnapshot *snapshot = NULL;
|
ISnapshot *snapshot = NULL;
|
||||||
virDomainSnapshotPtr ret = NULL;
|
virDomainSnapshotPtr ret = NULL;
|
||||||
@ -6209,7 +6209,7 @@ static int vboxDomainHasCurrentSnapshot(virDomainPtr dom,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
ISnapshot *snapshot = NULL;
|
ISnapshot *snapshot = NULL;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
@ -6247,7 +6247,7 @@ vboxDomainSnapshotGetParent(virDomainSnapshotPtr snapshot,
|
|||||||
{
|
{
|
||||||
virDomainPtr dom = snapshot->domain;
|
virDomainPtr dom = snapshot->domain;
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
ISnapshot *snap = NULL;
|
ISnapshot *snap = NULL;
|
||||||
ISnapshot *parent = NULL;
|
ISnapshot *parent = NULL;
|
||||||
@ -6310,7 +6310,7 @@ static virDomainSnapshotPtr
|
|||||||
vboxDomainSnapshotCurrent(virDomainPtr dom, unsigned int flags)
|
vboxDomainSnapshotCurrent(virDomainPtr dom, unsigned int flags)
|
||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
ISnapshot *snapshot = NULL;
|
ISnapshot *snapshot = NULL;
|
||||||
PRUnichar *nameUtf16 = NULL;
|
PRUnichar *nameUtf16 = NULL;
|
||||||
@ -6368,7 +6368,7 @@ static int vboxDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot,
|
|||||||
{
|
{
|
||||||
virDomainPtr dom = snapshot->domain;
|
virDomainPtr dom = snapshot->domain;
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
ISnapshot *snap = NULL;
|
ISnapshot *snap = NULL;
|
||||||
ISnapshot *current = NULL;
|
ISnapshot *current = NULL;
|
||||||
@ -6429,7 +6429,7 @@ static int vboxDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
|
|||||||
{
|
{
|
||||||
virDomainPtr dom = snapshot->domain;
|
virDomainPtr dom = snapshot->domain;
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
ISnapshot *snap = NULL;
|
ISnapshot *snap = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
@ -6460,7 +6460,7 @@ static int vboxDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
|||||||
{
|
{
|
||||||
virDomainPtr dom = snapshot->domain;
|
virDomainPtr dom = snapshot->domain;
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion domiid;
|
vboxIID domiid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
ISnapshot *newSnapshot = NULL;
|
ISnapshot *newSnapshot = NULL;
|
||||||
ISnapshot *prevSnapshot = NULL;
|
ISnapshot *prevSnapshot = NULL;
|
||||||
@ -6534,7 +6534,7 @@ vboxDomainSnapshotDeleteSingle(vboxDriverPtr data,
|
|||||||
ISnapshot *snapshot)
|
ISnapshot *snapshot)
|
||||||
{
|
{
|
||||||
IProgress *progress = NULL;
|
IProgress *progress = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
resultCodeUnion result;
|
resultCodeUnion result;
|
||||||
@ -6626,7 +6626,7 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
|
|||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
virDomainSnapshotDefPtr def = NULL;
|
virDomainSnapshotDefPtr def = NULL;
|
||||||
char *defXml = NULL;
|
char *defXml = NULL;
|
||||||
vboxIIDUnion domiid;
|
vboxIID domiid;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
PRUnichar *settingsFilePathUtf16 = NULL;
|
PRUnichar *settingsFilePathUtf16 = NULL;
|
||||||
@ -6728,7 +6728,7 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
|
|||||||
char *uuid = NULL;
|
char *uuid = NULL;
|
||||||
char *format = NULL;
|
char *format = NULL;
|
||||||
char *tmp = NULL;
|
char *tmp = NULL;
|
||||||
vboxIIDUnion iid, parentiid;
|
vboxIID iid, parentiid;
|
||||||
resultCodeUnion resultCode;
|
resultCodeUnion resultCode;
|
||||||
|
|
||||||
VBOX_IID_INITIALIZE(&iid);
|
VBOX_IID_INITIALIZE(&iid);
|
||||||
@ -7061,7 +7061,7 @@ static int vboxDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
|
|||||||
{
|
{
|
||||||
virDomainPtr dom = snapshot->domain;
|
virDomainPtr dom = snapshot->domain;
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxIIDUnion domiid;
|
vboxIID domiid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
ISnapshot *snap = NULL;
|
ISnapshot *snap = NULL;
|
||||||
IConsole *console = NULL;
|
IConsole *console = NULL;
|
||||||
@ -7148,7 +7148,7 @@ vboxDomainScreenshot(virDomainPtr dom,
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IConsole *console = NULL;
|
IConsole *console = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
@ -7286,7 +7286,7 @@ vboxConnectListAllDomains(virConnectPtr conn,
|
|||||||
char *machineNameUtf8 = NULL;
|
char *machineNameUtf8 = NULL;
|
||||||
PRUnichar *machineNameUtf16 = NULL;
|
PRUnichar *machineNameUtf16 = NULL;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
PRUint32 state;
|
PRUint32 state;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -7495,7 +7495,7 @@ vboxDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
|
|||||||
{
|
{
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
vboxArray machines = VBOX_ARRAY_INITIALIZER;
|
vboxArray machines = VBOX_ARRAY_INITIALIZER;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
char *machineNameUtf8 = NULL;
|
char *machineNameUtf8 = NULL;
|
||||||
PRUnichar *machineNameUtf16 = NULL;
|
PRUnichar *machineNameUtf16 = NULL;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
@ -7571,7 +7571,7 @@ vboxDomainSendKey(virDomainPtr dom,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
vboxDriverPtr data = dom->conn->privateData;
|
vboxDriverPtr data = dom->conn->privateData;
|
||||||
IConsole *console = NULL;
|
IConsole *console = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
IKeyboard *keyboard = NULL;
|
IKeyboard *keyboard = NULL;
|
||||||
PRInt32 *keyDownCodes = NULL;
|
PRInt32 *keyDownCodes = NULL;
|
||||||
|
@ -255,7 +255,7 @@ static virNetworkPtr vboxNetworkLookupByUUID(virConnectPtr conn, const unsigned
|
|||||||
char *nameUtf8 = NULL;
|
char *nameUtf8 = NULL;
|
||||||
PRUnichar *nameUtf16 = NULL;
|
PRUnichar *nameUtf16 = NULL;
|
||||||
IHostNetworkInterface *networkInterface = NULL;
|
IHostNetworkInterface *networkInterface = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IHost *host = NULL;
|
IHost *host = NULL;
|
||||||
virNetworkPtr ret = NULL;
|
virNetworkPtr ret = NULL;
|
||||||
|
|
||||||
@ -307,7 +307,7 @@ static virNetworkPtr vboxNetworkLookupByName(virConnectPtr conn, const char *nam
|
|||||||
IHostNetworkInterface *networkInterface = NULL;
|
IHostNetworkInterface *networkInterface = NULL;
|
||||||
PRUint32 interfaceType = 0;
|
PRUint32 interfaceType = 0;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IHost *host = NULL;
|
IHost *host = NULL;
|
||||||
virNetworkPtr ret = NULL;
|
virNetworkPtr ret = NULL;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
@ -378,7 +378,7 @@ vboxNetworkDefineCreateXML(virConnectPtr conn, const char *xml, bool start)
|
|||||||
virNetworkDefPtr def = virNetworkDefParseString(xml);
|
virNetworkDefPtr def = virNetworkDefParseString(xml);
|
||||||
virNetworkIPDefPtr ipdef = NULL;
|
virNetworkIPDefPtr ipdef = NULL;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
vboxIIDUnion vboxnetiid;
|
vboxIID vboxnetiid;
|
||||||
virSocketAddr netmask;
|
virSocketAddr netmask;
|
||||||
IHost *host = NULL;
|
IHost *host = NULL;
|
||||||
virNetworkPtr ret = NULL;
|
virNetworkPtr ret = NULL;
|
||||||
@ -604,7 +604,7 @@ vboxNetworkUndefineDestroy(virNetworkPtr network, bool removeinterface)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (removeinterface) {
|
if (removeinterface) {
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
IProgress *progress = NULL;
|
IProgress *progress = NULL;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
resultCodeUnion resultCode;
|
resultCodeUnion resultCode;
|
||||||
@ -769,7 +769,7 @@ static char *vboxNetworkGetXMLDesc(virNetworkPtr network, unsigned int flags)
|
|||||||
PRUint32 interfaceType = 0;
|
PRUint32 interfaceType = 0;
|
||||||
PRUnichar *networkNameUtf16 = NULL;
|
PRUnichar *networkNameUtf16 = NULL;
|
||||||
IDHCPServer *dhcpServer = NULL;
|
IDHCPServer *dhcpServer = NULL;
|
||||||
vboxIIDUnion vboxnet0IID;
|
vboxIID vboxnet0IID;
|
||||||
IHost *host = NULL;
|
IHost *host = NULL;
|
||||||
char *ret = NULL;
|
char *ret = NULL;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
|
@ -221,7 +221,7 @@ vboxStorageVolLookupByName(virStoragePoolPtr pool, const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (nameUtf8 && STREQ(nameUtf8, name)) {
|
if (nameUtf8 && STREQ(nameUtf8, name)) {
|
||||||
vboxIIDUnion hddIID;
|
vboxIID hddIID;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
char key[VIR_UUID_STRING_BUFLEN] = "";
|
char key[VIR_UUID_STRING_BUFLEN] = "";
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ static virStorageVolPtr
|
|||||||
vboxStorageVolLookupByKey(virConnectPtr conn, const char *key)
|
vboxStorageVolLookupByKey(virConnectPtr conn, const char *key)
|
||||||
{
|
{
|
||||||
vboxDriverPtr data = conn->privateData;
|
vboxDriverPtr data = conn->privateData;
|
||||||
vboxIIDUnion hddIID;
|
vboxIID hddIID;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
IMedium *hardDisk = NULL;
|
IMedium *hardDisk = NULL;
|
||||||
PRUnichar *hddNameUtf16 = NULL;
|
PRUnichar *hddNameUtf16 = NULL;
|
||||||
@ -330,7 +330,7 @@ vboxStorageVolLookupByPath(virConnectPtr conn, const char *path)
|
|||||||
char *hddNameUtf8 = NULL;
|
char *hddNameUtf8 = NULL;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
char key[VIR_UUID_STRING_BUFLEN] = "";
|
char key[VIR_UUID_STRING_BUFLEN] = "";
|
||||||
vboxIIDUnion hddIID;
|
vboxIID hddIID;
|
||||||
PRUint32 hddstate;
|
PRUint32 hddstate;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
virStorageVolPtr ret = NULL;
|
virStorageVolPtr ret = NULL;
|
||||||
@ -407,7 +407,7 @@ vboxStorageVolCreateXML(virStoragePoolPtr pool,
|
|||||||
PRUnichar *hddNameUtf16 = NULL;
|
PRUnichar *hddNameUtf16 = NULL;
|
||||||
virStoragePoolDef poolDef;
|
virStoragePoolDef poolDef;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
vboxIIDUnion hddIID;
|
vboxIID hddIID;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
char key[VIR_UUID_STRING_BUFLEN] = "";
|
char key[VIR_UUID_STRING_BUFLEN] = "";
|
||||||
IMedium *hardDisk = NULL;
|
IMedium *hardDisk = NULL;
|
||||||
@ -517,7 +517,7 @@ static int vboxStorageVolDelete(virStorageVolPtr vol, unsigned int flags)
|
|||||||
size_t j = 0;
|
size_t j = 0;
|
||||||
PRUint32 machineIdsSize = 0;
|
PRUint32 machineIdsSize = 0;
|
||||||
vboxArray machineIds = VBOX_ARRAY_INITIALIZER;
|
vboxArray machineIds = VBOX_ARRAY_INITIALIZER;
|
||||||
vboxIIDUnion hddIID;
|
vboxIID hddIID;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!data->vboxObj)
|
if (!data->vboxObj)
|
||||||
@ -562,7 +562,7 @@ static int vboxStorageVolDelete(virStorageVolPtr vol, unsigned int flags)
|
|||||||
|
|
||||||
for (i = 0; i < machineIds.count; i++) {
|
for (i = 0; i < machineIds.count; i++) {
|
||||||
IMachine *machine = NULL;
|
IMachine *machine = NULL;
|
||||||
vboxIIDUnion machineId;
|
vboxIID machineId;
|
||||||
vboxArray hddAttachments = VBOX_ARRAY_INITIALIZER;
|
vboxArray hddAttachments = VBOX_ARRAY_INITIALIZER;
|
||||||
|
|
||||||
VBOX_IID_INITIALIZE(&machineId);
|
VBOX_IID_INITIALIZE(&machineId);
|
||||||
@ -591,7 +591,7 @@ static int vboxStorageVolDelete(virStorageVolPtr vol, unsigned int flags)
|
|||||||
for (j = 0; j < hddAttachments.count; j++) {
|
for (j = 0; j < hddAttachments.count; j++) {
|
||||||
IMediumAttachment *hddAttachment = hddAttachments.items[j];
|
IMediumAttachment *hddAttachment = hddAttachments.items[j];
|
||||||
IMedium *hdd = NULL;
|
IMedium *hdd = NULL;
|
||||||
vboxIIDUnion iid;
|
vboxIID iid;
|
||||||
|
|
||||||
if (!hddAttachment)
|
if (!hddAttachment)
|
||||||
continue;
|
continue;
|
||||||
@ -667,7 +667,7 @@ static int vboxStorageVolGetInfo(virStorageVolPtr vol, virStorageVolInfoPtr info
|
|||||||
PRUint32 hddstate;
|
PRUint32 hddstate;
|
||||||
PRUint64 hddLogicalSize = 0;
|
PRUint64 hddLogicalSize = 0;
|
||||||
PRUint64 hddActualSize = 0;
|
PRUint64 hddActualSize = 0;
|
||||||
vboxIIDUnion hddIID;
|
vboxIID hddIID;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
@ -725,7 +725,7 @@ static char *vboxStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags)
|
|||||||
PRUint64 hddActualSize = 0;
|
PRUint64 hddActualSize = 0;
|
||||||
virStoragePoolDef pool;
|
virStoragePoolDef pool;
|
||||||
virStorageVolDef def;
|
virStorageVolDef def;
|
||||||
vboxIIDUnion hddIID;
|
vboxIID hddIID;
|
||||||
PRUint32 hddstate;
|
PRUint32 hddstate;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
char *ret = NULL;
|
char *ret = NULL;
|
||||||
@ -813,7 +813,7 @@ static char *vboxStorageVolGetPath(virStorageVolPtr vol)
|
|||||||
PRUnichar *hddLocationUtf16 = NULL;
|
PRUnichar *hddLocationUtf16 = NULL;
|
||||||
char *hddLocationUtf8 = NULL;
|
char *hddLocationUtf8 = NULL;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
vboxIIDUnion hddIID;
|
vboxIID hddIID;
|
||||||
PRUint32 hddstate;
|
PRUint32 hddstate;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
char *ret = NULL;
|
char *ret = NULL;
|
||||||
|
@ -150,14 +150,10 @@ if (strUtf16) {\
|
|||||||
#define VBOX_SESSION_CLOSE() \
|
#define VBOX_SESSION_CLOSE() \
|
||||||
data->vboxSession->vtbl->UnlockMachine(data->vboxSession)
|
data->vboxSession->vtbl->UnlockMachine(data->vboxSession)
|
||||||
|
|
||||||
typedef struct _vboxIID_v3_x vboxIID;
|
|
||||||
typedef struct _vboxIID_v3_x vboxIID_v3_x;
|
|
||||||
|
|
||||||
#define VBOX_IID_INITIALIZER { NULL, true }
|
#define VBOX_IID_INITIALIZER { NULL, true }
|
||||||
#define IID_MEMBER(name) (iidu->vboxIID_v3_x.name)
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vboxIIDUnalloc_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid)
|
_vboxIIDUnalloc(vboxDriverPtr data, vboxIID *iid)
|
||||||
{
|
{
|
||||||
if (iid->value != NULL && iid->owner)
|
if (iid->value != NULL && iid->owner)
|
||||||
data->pFuncs->pfnUtf16Free(iid->value);
|
data->pFuncs->pfnUtf16Free(iid->value);
|
||||||
@ -167,13 +163,7 @@ vboxIIDUnalloc_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_vboxIIDUnalloc(vboxDriverPtr data, vboxIIDUnion *iidu)
|
_vboxIIDToUUID(vboxDriverPtr data, vboxIID *iid,
|
||||||
{
|
|
||||||
vboxIIDUnalloc_v3_x(data, &iidu->vboxIID_v3_x);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
vboxIIDToUUID_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid,
|
|
||||||
unsigned char *uuid)
|
unsigned char *uuid)
|
||||||
{
|
{
|
||||||
char *utf8 = NULL;
|
char *utf8 = NULL;
|
||||||
@ -186,35 +176,21 @@ vboxIIDToUUID_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_vboxIIDToUUID(vboxDriverPtr data, vboxIIDUnion *iidu,
|
_vboxIIDFromUUID(vboxDriverPtr data, vboxIID *iid,
|
||||||
unsigned char *uuid)
|
|
||||||
{
|
|
||||||
vboxIIDToUUID_v3_x(data, &iidu->vboxIID_v3_x, uuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
vboxIIDFromUUID_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid,
|
|
||||||
const unsigned char *uuid)
|
const unsigned char *uuid)
|
||||||
{
|
{
|
||||||
char utf8[VIR_UUID_STRING_BUFLEN];
|
char utf8[VIR_UUID_STRING_BUFLEN];
|
||||||
|
|
||||||
vboxIIDUnalloc_v3_x(data, iid);
|
_vboxIIDUnalloc(data, iid);
|
||||||
|
|
||||||
virUUIDFormat(uuid, utf8);
|
virUUIDFormat(uuid, utf8);
|
||||||
|
|
||||||
data->pFuncs->pfnUtf8ToUtf16(utf8, &iid->value);
|
data->pFuncs->pfnUtf8ToUtf16(utf8, &iid->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_vboxIIDFromUUID(vboxDriverPtr data, vboxIIDUnion *iidu,
|
|
||||||
const unsigned char *uuid)
|
|
||||||
{
|
|
||||||
vboxIIDFromUUID_v3_x(data, &iidu->vboxIID_v3_x, uuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
vboxIIDIsEqual_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid1,
|
_vboxIIDIsEqual(vboxDriverPtr data, vboxIID *iid1,
|
||||||
vboxIID_v3_x *iid2)
|
vboxIID *iid2)
|
||||||
{
|
{
|
||||||
unsigned char uuid1[VIR_UUID_BUFLEN];
|
unsigned char uuid1[VIR_UUID_BUFLEN];
|
||||||
unsigned char uuid2[VIR_UUID_BUFLEN];
|
unsigned char uuid2[VIR_UUID_BUFLEN];
|
||||||
@ -224,42 +200,28 @@ vboxIIDIsEqual_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid1,
|
|||||||
* or mixture of both and we don't want to fail here by
|
* or mixture of both and we don't want to fail here by
|
||||||
* using direct string comparison. Here virUUIDParse() takes
|
* using direct string comparison. Here virUUIDParse() takes
|
||||||
* care of these cases. */
|
* care of these cases. */
|
||||||
vboxIIDToUUID_v3_x(data, iid1, uuid1);
|
_vboxIIDToUUID(data, iid1, uuid1);
|
||||||
vboxIIDToUUID_v3_x(data, iid2, uuid2);
|
_vboxIIDToUUID(data, iid2, uuid2);
|
||||||
|
|
||||||
return memcmp(uuid1, uuid2, VIR_UUID_BUFLEN) == 0;
|
return memcmp(uuid1, uuid2, VIR_UUID_BUFLEN) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
|
||||||
_vboxIIDIsEqual(vboxDriverPtr data, vboxIIDUnion *iidu1,
|
|
||||||
vboxIIDUnion *iidu2)
|
|
||||||
{
|
|
||||||
return vboxIIDIsEqual_v3_x(data, &iidu1->vboxIID_v3_x, &iidu2->vboxIID_v3_x);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vboxIIDFromArrayItem_v3_x(vboxDriverPtr data, vboxIID_v3_x *iid,
|
_vboxIIDFromArrayItem(vboxDriverPtr data, vboxIID *iid,
|
||||||
vboxArray *array, int idx)
|
vboxArray *array, int idx)
|
||||||
{
|
{
|
||||||
vboxIIDUnalloc_v3_x(data, iid);
|
_vboxIIDUnalloc(data, iid);
|
||||||
|
|
||||||
iid->value = array->items[idx];
|
iid->value = array->items[idx];
|
||||||
iid->owner = false;
|
iid->owner = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
#define vboxIIDUnalloc(iid) _vboxIIDUnalloc(data, iid)
|
||||||
_vboxIIDFromArrayItem(vboxDriverPtr data, vboxIIDUnion *iidu,
|
#define vboxIIDToUUID(iid, uuid) _vboxIIDToUUID(data, iid, uuid)
|
||||||
vboxArray *array, int idx)
|
#define vboxIIDFromUUID(iid, uuid) _vboxIIDFromUUID(data, iid, uuid)
|
||||||
{
|
#define vboxIIDIsEqual(iid1, iid2) _vboxIIDIsEqual(data, iid1, iid2)
|
||||||
vboxIIDFromArrayItem_v3_x(data, &iidu->vboxIID_v3_x, array, idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define vboxIIDUnalloc(iid) vboxIIDUnalloc_v3_x(data, iid)
|
|
||||||
#define vboxIIDToUUID(iid, uuid) vboxIIDToUUID_v3_x(data, iid, uuid)
|
|
||||||
#define vboxIIDFromUUID(iid, uuid) vboxIIDFromUUID_v3_x(data, iid, uuid)
|
|
||||||
#define vboxIIDIsEqual(iid1, iid2) vboxIIDIsEqual_v3_x(data, iid1, iid2)
|
|
||||||
#define vboxIIDFromArrayItem(iid, array, idx) \
|
#define vboxIIDFromArrayItem(iid, array, idx) \
|
||||||
vboxIIDFromArrayItem_v3_x(data, iid, array, idx)
|
_vboxIIDFromArrayItem(data, iid, array, idx)
|
||||||
#define DEBUGIID(msg, strUtf16) DEBUGPRUnichar(msg, strUtf16)
|
#define DEBUGIID(msg, strUtf16) DEBUGPRUnichar(msg, strUtf16)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -412,11 +374,11 @@ _vboxDomainSnapshotRestore(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_unregisterMachine(vboxDriverPtr data, vboxIIDUnion *iidu, IMachine **machine)
|
_unregisterMachine(vboxDriverPtr data, vboxIID *iid, IMachine **machine)
|
||||||
{
|
{
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
vboxArray media = VBOX_ARRAY_INITIALIZER;
|
vboxArray media = VBOX_ARRAY_INITIALIZER;
|
||||||
rc = data->vboxObj->vtbl->FindMachine(data->vboxObj, IID_MEMBER(value), machine);
|
rc = data->vboxObj->vtbl->FindMachine(data->vboxObj, iid->value, machine);
|
||||||
if (NS_FAILED(rc)) {
|
if (NS_FAILED(rc)) {
|
||||||
virReportError(VIR_ERR_NO_DOMAIN, "%s",
|
virReportError(VIR_ERR_NO_DOMAIN, "%s",
|
||||||
_("no domain with matching uuid"));
|
_("no domain with matching uuid"));
|
||||||
@ -534,29 +496,29 @@ static int _pfnUtf8ToUtf16(PCVBOXXPCOM pFuncs, const char *pszString, PRUnichar
|
|||||||
return pFuncs->pfnUtf8ToUtf16(pszString, ppwszString);
|
return pFuncs->pfnUtf8ToUtf16(pszString, ppwszString);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _vboxIIDInitialize(vboxIIDUnion *iidu)
|
static void _vboxIIDInitialize(vboxIID *iid)
|
||||||
{
|
{
|
||||||
memset(iidu, 0, sizeof(vboxIIDUnion));
|
memset(iid, 0, sizeof(vboxIID));
|
||||||
IID_MEMBER(owner) = true;
|
iid->owner = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _DEBUGIID(vboxDriverPtr data, const char *msg, vboxIIDUnion *iidu)
|
static void _DEBUGIID(vboxDriverPtr data, const char *msg, vboxIID *iid)
|
||||||
{
|
{
|
||||||
DEBUGPRUnichar(msg, IID_MEMBER(value));
|
DEBUGPRUnichar(msg, iid->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_vboxIIDToUtf8(vboxDriverPtr data ATTRIBUTE_UNUSED,
|
_vboxIIDToUtf8(vboxDriverPtr data ATTRIBUTE_UNUSED,
|
||||||
vboxIIDUnion *iidu ATTRIBUTE_UNUSED,
|
vboxIID *iid ATTRIBUTE_UNUSED,
|
||||||
char **utf8 ATTRIBUTE_UNUSED)
|
char **utf8 ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
data->pFuncs->pfnUtf16ToUtf8(IID_MEMBER(value), utf8);
|
data->pFuncs->pfnUtf16ToUtf8(iid->value, utf8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_vboxArrayGetWithIIDArg(vboxArray *array, void *self, void *getter, vboxIIDUnion *iidu)
|
_vboxArrayGetWithIIDArg(vboxArray *array, void *self, void *getter, vboxIID *iid)
|
||||||
{
|
{
|
||||||
return vboxArrayGetWithPtrArg(array, self, getter, IID_MEMBER(value));
|
return vboxArrayGetWithPtrArg(array, self, getter, iid->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* _handleGetMachines(IVirtualBox *vboxObj)
|
static void* _handleGetMachines(IVirtualBox *vboxObj)
|
||||||
@ -626,9 +588,9 @@ _virtualboxGetVersion(IVirtualBox *vboxObj, PRUnichar **versionUtf16)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_virtualboxGetMachine(IVirtualBox *vboxObj, vboxIIDUnion *iidu, IMachine **machine)
|
_virtualboxGetMachine(IVirtualBox *vboxObj, vboxIID *iid, IMachine **machine)
|
||||||
{
|
{
|
||||||
return vboxObj->vtbl->FindMachine(vboxObj, IID_MEMBER(value), machine);
|
return vboxObj->vtbl->FindMachine(vboxObj, iid->value, machine);
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
@ -750,13 +712,13 @@ _virtualboxOpenMedium(IVirtualBox *vboxObj ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_virtualboxGetHardDiskByIID(IVirtualBox *vboxObj, vboxIIDUnion *iidu, IMedium **medium)
|
_virtualboxGetHardDiskByIID(IVirtualBox *vboxObj, vboxIID *iid, IMedium **medium)
|
||||||
{
|
{
|
||||||
#if VBOX_API_VERSION >= 4000000 && VBOX_API_VERSION < 4002000
|
#if VBOX_API_VERSION >= 4000000 && VBOX_API_VERSION < 4002000
|
||||||
return vboxObj->vtbl->FindMedium(vboxObj, IID_MEMBER(value), DeviceType_HardDisk,
|
return vboxObj->vtbl->FindMedium(vboxObj, iid->value, DeviceType_HardDisk,
|
||||||
medium);
|
medium);
|
||||||
#else /* VBOX_API_VERSION >= 4002000 */
|
#else /* VBOX_API_VERSION >= 4002000 */
|
||||||
return vboxObj->vtbl->OpenMedium(vboxObj, IID_MEMBER(value), DeviceType_HardDisk,
|
return vboxObj->vtbl->OpenMedium(vboxObj, iid->value, DeviceType_HardDisk,
|
||||||
AccessMode_ReadWrite, PR_FALSE, medium);
|
AccessMode_ReadWrite, PR_FALSE, medium);
|
||||||
#endif /* VBOX_API_VERSION >= 4002000 */
|
#endif /* VBOX_API_VERSION >= 4002000 */
|
||||||
}
|
}
|
||||||
@ -826,7 +788,7 @@ _machineRemoveSharedFolder(IMachine *machine, PRUnichar *name)
|
|||||||
static nsresult
|
static nsresult
|
||||||
_machineLaunchVMProcess(vboxDriverPtr data,
|
_machineLaunchVMProcess(vboxDriverPtr data,
|
||||||
IMachine *machine ATTRIBUTE_UNUSED,
|
IMachine *machine ATTRIBUTE_UNUSED,
|
||||||
vboxIIDUnion *iidu ATTRIBUTE_UNUSED,
|
vboxIID *iid ATTRIBUTE_UNUSED,
|
||||||
PRUnichar *sessionType, PRUnichar *env,
|
PRUnichar *sessionType, PRUnichar *env,
|
||||||
IProgress **progress)
|
IProgress **progress)
|
||||||
{
|
{
|
||||||
@ -844,9 +806,9 @@ _machineUnregister(IMachine *machine ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_machineFindSnapshot(IMachine *machine, vboxIIDUnion *iidu, ISnapshot **snapshot)
|
_machineFindSnapshot(IMachine *machine, vboxIID *iid, ISnapshot **snapshot)
|
||||||
{
|
{
|
||||||
return machine->vtbl->FindSnapshot(machine, IID_MEMBER(value), snapshot);
|
return machine->vtbl->FindSnapshot(machine, iid->value, snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
@ -875,9 +837,9 @@ _machineGetName(IMachine *machine, PRUnichar **name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_machineGetId(IMachine *machine, vboxIIDUnion *iidu)
|
_machineGetId(IMachine *machine, vboxIID *iid)
|
||||||
{
|
{
|
||||||
return machine->vtbl->GetId(machine, &IID_MEMBER(value));
|
return machine->vtbl->GetId(machine, &iid->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
@ -1067,13 +1029,13 @@ _machineSaveSettings(IMachine *machine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_sessionOpen(vboxDriverPtr data, vboxIIDUnion *iidu ATTRIBUTE_UNUSED, IMachine *machine)
|
_sessionOpen(vboxDriverPtr data, vboxIID *iid ATTRIBUTE_UNUSED, IMachine *machine)
|
||||||
{
|
{
|
||||||
return machine->vtbl->LockMachine(machine, data->vboxSession, LockType_Write);
|
return machine->vtbl->LockMachine(machine, data->vboxSession, LockType_Write);
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_sessionOpenExisting(vboxDriverPtr data, vboxIIDUnion *iidu ATTRIBUTE_UNUSED, IMachine *machine)
|
_sessionOpenExisting(vboxDriverPtr data, vboxIID *iid ATTRIBUTE_UNUSED, IMachine *machine)
|
||||||
{
|
{
|
||||||
return machine->vtbl->LockMachine(machine, data->vboxSession, LockType_Shared);
|
return machine->vtbl->LockMachine(machine, data->vboxSession, LockType_Shared);
|
||||||
}
|
}
|
||||||
@ -1182,10 +1144,10 @@ _consoleTakeSnapshot(IConsole *console, PRUnichar *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_consoleDeleteSnapshot(IConsole *console, vboxIIDUnion *iidu, IProgress **progress)
|
_consoleDeleteSnapshot(IConsole *console, vboxIID *iid, IProgress **progress)
|
||||||
{
|
{
|
||||||
#if VBOX_API_VERSION < 5000000 /* VBOX_API_VERSION < 5000000 */
|
#if VBOX_API_VERSION < 5000000 /* VBOX_API_VERSION < 5000000 */
|
||||||
return console->vtbl->DeleteSnapshot(console, IID_MEMBER(value), progress);
|
return console->vtbl->DeleteSnapshot(console, iid->value, progress);
|
||||||
#else /* VBOX_API_VERSION >= 5000000 */
|
#else /* VBOX_API_VERSION >= 5000000 */
|
||||||
IMachine *machine;
|
IMachine *machine;
|
||||||
nsresult rc;
|
nsresult rc;
|
||||||
@ -1193,7 +1155,7 @@ _consoleDeleteSnapshot(IConsole *console, vboxIIDUnion *iidu, IProgress **progre
|
|||||||
rc = console->vtbl->GetMachine(console, &machine);
|
rc = console->vtbl->GetMachine(console, &machine);
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rc))
|
if (NS_SUCCEEDED(rc))
|
||||||
rc = machine->vtbl->DeleteSnapshot(machine, IID_MEMBER(value), progress);
|
rc = machine->vtbl->DeleteSnapshot(machine, iid->value, progress);
|
||||||
else
|
else
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to get machine from console. (error %d)"), rc);
|
_("unable to get machine from console. (error %d)"), rc);
|
||||||
@ -1786,9 +1748,9 @@ _usbDeviceFilterSetVendorId(IUSBDeviceFilter *USBDeviceFilter, PRUnichar *vendor
|
|||||||
return USBDeviceFilter->vtbl->SetVendorId(USBDeviceFilter, vendorId);
|
return USBDeviceFilter->vtbl->SetVendorId(USBDeviceFilter, vendorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult _mediumGetId(IMedium *medium, vboxIIDUnion *iidu)
|
static nsresult _mediumGetId(IMedium *medium, vboxIID *iid)
|
||||||
{
|
{
|
||||||
return medium->vtbl->GetId(medium, &IID_MEMBER(value));
|
return medium->vtbl->GetId(medium, &iid->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult _mediumGetLocation(IMedium *medium, PRUnichar **location)
|
static nsresult _mediumGetLocation(IMedium *medium, PRUnichar **location)
|
||||||
@ -1968,9 +1930,9 @@ _snapshotGetName(ISnapshot *snapshot, PRUnichar **name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_snapshotGetId(ISnapshot *snapshot, vboxIIDUnion *iidu)
|
_snapshotGetId(ISnapshot *snapshot, vboxIID *iid)
|
||||||
{
|
{
|
||||||
return snapshot->vtbl->GetId(snapshot, &IID_MEMBER(value));
|
return snapshot->vtbl->GetId(snapshot, &iid->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
@ -2046,10 +2008,10 @@ _displayTakeScreenShotPNGToArray(IDisplay *display, PRUint32 screenId,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_hostFindHostNetworkInterfaceById(IHost *host, vboxIIDUnion *iidu,
|
_hostFindHostNetworkInterfaceById(IHost *host, vboxIID *iid,
|
||||||
IHostNetworkInterface **networkInterface)
|
IHostNetworkInterface **networkInterface)
|
||||||
{
|
{
|
||||||
return host->vtbl->FindHostNetworkInterfaceById(host, IID_MEMBER(value),
|
return host->vtbl->FindHostNetworkInterfaceById(host, iid->value,
|
||||||
networkInterface);
|
networkInterface);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2082,10 +2044,10 @@ _hostCreateHostOnlyNetworkInterface(vboxDriverPtr data ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_hostRemoveHostOnlyNetworkInterface(IHost *host ATTRIBUTE_UNUSED,
|
_hostRemoveHostOnlyNetworkInterface(IHost *host ATTRIBUTE_UNUSED,
|
||||||
vboxIIDUnion *iidu ATTRIBUTE_UNUSED,
|
vboxIID *iid ATTRIBUTE_UNUSED,
|
||||||
IProgress **progress ATTRIBUTE_UNUSED)
|
IProgress **progress ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
return host->vtbl->RemoveHostOnlyNetworkInterface(host, IID_MEMBER(value), progress);
|
return host->vtbl->RemoveHostOnlyNetworkInterface(host, iid->value, progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
@ -2107,9 +2069,9 @@ _hnInterfaceGetName(IHostNetworkInterface *hni, PRUnichar **name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
_hnInterfaceGetId(IHostNetworkInterface *hni, vboxIIDUnion *iidu)
|
_hnInterfaceGetId(IHostNetworkInterface *hni, vboxIID *iid)
|
||||||
{
|
{
|
||||||
return hni->vtbl->GetId(hni, &IID_MEMBER(value));
|
return hni->vtbl->GetId(hni, &iid->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
|
@ -58,24 +58,7 @@
|
|||||||
|
|
||||||
/* Extracted define from vbox_tmpl.c */
|
/* Extracted define from vbox_tmpl.c */
|
||||||
|
|
||||||
# ifdef WIN32
|
struct _vboxIID {
|
||||||
struct _vboxIID_v2_x_WIN32 {
|
|
||||||
/* IID is represented by a GUID value. */
|
|
||||||
GUID value;
|
|
||||||
};
|
|
||||||
# endif /* !WIN32 */
|
|
||||||
|
|
||||||
struct _vboxIID_v2_x {
|
|
||||||
/* IID is represented by a pointer to a nsID. */
|
|
||||||
nsID *value;
|
|
||||||
|
|
||||||
/* backing is used in cases where we need to create or copy an IID.
|
|
||||||
* We cannot allocate memory that can be freed by ComUnallocMem.
|
|
||||||
* Therefore, we use this stack allocated nsID instead. */
|
|
||||||
nsID backing;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _vboxIID_v3_x {
|
|
||||||
/* IID is represented by a UTF-16 encoded UUID in string form. */
|
/* IID is represented by a UTF-16 encoded UUID in string form. */
|
||||||
PRUnichar *value;
|
PRUnichar *value;
|
||||||
|
|
||||||
@ -83,13 +66,7 @@ struct _vboxIID_v3_x {
|
|||||||
bool owner;
|
bool owner;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef union {
|
typedef struct _vboxIID vboxIID;
|
||||||
# ifdef WIN32
|
|
||||||
struct _vboxIID_v2_x_WIN32 vboxIID_v2_x_WIN32;
|
|
||||||
# endif /* !WIN32 */
|
|
||||||
struct _vboxIID_v2_x vboxIID_v2_x;
|
|
||||||
struct _vboxIID_v3_x vboxIID_v3_x;
|
|
||||||
} vboxIIDUnion;
|
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
nsresult uResultCode;
|
nsresult uResultCode;
|
||||||
@ -138,20 +115,20 @@ typedef struct {
|
|||||||
|
|
||||||
/* Functions for vboxIID */
|
/* Functions for vboxIID */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void (*vboxIIDInitialize)(vboxIIDUnion *iidu);
|
void (*vboxIIDInitialize)(vboxIID *iid);
|
||||||
void (*vboxIIDUnalloc)(vboxDriverPtr driver, vboxIIDUnion *iidu);
|
void (*vboxIIDUnalloc)(vboxDriverPtr driver, vboxIID *iid);
|
||||||
void (*vboxIIDToUUID)(vboxDriverPtr driver, vboxIIDUnion *iidu, unsigned char *uuid);
|
void (*vboxIIDToUUID)(vboxDriverPtr driver, vboxIID *iid, unsigned char *uuid);
|
||||||
void (*vboxIIDFromUUID)(vboxDriverPtr driver, vboxIIDUnion *iidu, const unsigned char *uuid);
|
void (*vboxIIDFromUUID)(vboxDriverPtr driver, vboxIID *iid, const unsigned char *uuid);
|
||||||
bool (*vboxIIDIsEqual)(vboxDriverPtr driver, vboxIIDUnion *iidu1, vboxIIDUnion *iidu2);
|
bool (*vboxIIDIsEqual)(vboxDriverPtr driver, vboxIID *iid1, vboxIID *iid2);
|
||||||
void (*vboxIIDFromArrayItem)(vboxDriverPtr driver, vboxIIDUnion *iidu, vboxArray *array, int idx);
|
void (*vboxIIDFromArrayItem)(vboxDriverPtr driver, vboxIID *iid, vboxArray *array, int idx);
|
||||||
void (*vboxIIDToUtf8)(vboxDriverPtr driver, vboxIIDUnion *iidu, char **utf8);
|
void (*vboxIIDToUtf8)(vboxDriverPtr driver, vboxIID *iid, char **utf8);
|
||||||
void (*DEBUGIID)(vboxDriverPtr driver, const char *msg, vboxIIDUnion *iidu);
|
void (*DEBUGIID)(vboxDriverPtr driver, const char *msg, vboxIID *iid);
|
||||||
} vboxUniformedIID;
|
} vboxUniformedIID;
|
||||||
|
|
||||||
/* Functions for vboxArray */
|
/* Functions for vboxArray */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
nsresult (*vboxArrayGet)(vboxArray *array, void *self, void *getter);
|
nsresult (*vboxArrayGet)(vboxArray *array, void *self, void *getter);
|
||||||
nsresult (*vboxArrayGetWithIIDArg)(vboxArray *array, void *self, void *getter, vboxIIDUnion *iidu);
|
nsresult (*vboxArrayGetWithIIDArg)(vboxArray *array, void *self, void *getter, vboxIID *iid);
|
||||||
void (*vboxArrayRelease)(vboxArray *array);
|
void (*vboxArrayRelease)(vboxArray *array);
|
||||||
void (*vboxArrayUnalloc)(vboxArray *array);
|
void (*vboxArrayUnalloc)(vboxArray *array);
|
||||||
/* Generate function pointers for vboxArrayGet */
|
/* Generate function pointers for vboxArrayGet */
|
||||||
@ -176,7 +153,7 @@ typedef struct {
|
|||||||
/* Functions for IVirtualBox */
|
/* Functions for IVirtualBox */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
nsresult (*GetVersion)(IVirtualBox *vboxObj, PRUnichar **versionUtf16);
|
nsresult (*GetVersion)(IVirtualBox *vboxObj, PRUnichar **versionUtf16);
|
||||||
nsresult (*GetMachine)(IVirtualBox *vboxObj, vboxIIDUnion *iidu, IMachine **machine);
|
nsresult (*GetMachine)(IVirtualBox *vboxObj, vboxIID *iid, IMachine **machine);
|
||||||
nsresult (*OpenMachine)(IVirtualBox *vboxObj, PRUnichar *settingsFile, IMachine **machine);
|
nsresult (*OpenMachine)(IVirtualBox *vboxObj, PRUnichar *settingsFile, IMachine **machine);
|
||||||
nsresult (*GetSystemProperties)(IVirtualBox *vboxObj, ISystemProperties **systemProperties);
|
nsresult (*GetSystemProperties)(IVirtualBox *vboxObj, ISystemProperties **systemProperties);
|
||||||
nsresult (*GetHost)(IVirtualBox *vboxObj, IHost **host);
|
nsresult (*GetHost)(IVirtualBox *vboxObj, IHost **host);
|
||||||
@ -186,7 +163,7 @@ typedef struct {
|
|||||||
nsresult (*FindHardDisk)(IVirtualBox *vboxObj, PRUnichar *location, PRUint32 deviceType,
|
nsresult (*FindHardDisk)(IVirtualBox *vboxObj, PRUnichar *location, PRUint32 deviceType,
|
||||||
PRUint32 accessMode, IMedium **medium);
|
PRUint32 accessMode, IMedium **medium);
|
||||||
nsresult (*OpenMedium)(IVirtualBox *vboxObj, PRUnichar *location, PRUint32 deviceType, PRUint32 accessMode, IMedium **medium);
|
nsresult (*OpenMedium)(IVirtualBox *vboxObj, PRUnichar *location, PRUint32 deviceType, PRUint32 accessMode, IMedium **medium);
|
||||||
nsresult (*GetHardDiskByIID)(IVirtualBox *vboxObj, vboxIIDUnion *iidu, IMedium **medium);
|
nsresult (*GetHardDiskByIID)(IVirtualBox *vboxObj, vboxIID *iid, IMedium **medium);
|
||||||
nsresult (*FindDHCPServerByNetworkName)(IVirtualBox *vboxObj, PRUnichar *name, IDHCPServer **server);
|
nsresult (*FindDHCPServerByNetworkName)(IVirtualBox *vboxObj, PRUnichar *name, IDHCPServer **server);
|
||||||
nsresult (*CreateDHCPServer)(IVirtualBox *vboxObj, PRUnichar *name, IDHCPServer **server);
|
nsresult (*CreateDHCPServer)(IVirtualBox *vboxObj, PRUnichar *name, IDHCPServer **server);
|
||||||
nsresult (*RemoveDHCPServer)(IVirtualBox *vboxObj, IDHCPServer *server);
|
nsresult (*RemoveDHCPServer)(IVirtualBox *vboxObj, IDHCPServer *server);
|
||||||
@ -206,18 +183,18 @@ typedef struct {
|
|||||||
PRBool automount);
|
PRBool automount);
|
||||||
nsresult (*RemoveSharedFolder)(IMachine *machine, PRUnichar *name);
|
nsresult (*RemoveSharedFolder)(IMachine *machine, PRUnichar *name);
|
||||||
nsresult (*LaunchVMProcess)(vboxDriverPtr driver, IMachine *machine,
|
nsresult (*LaunchVMProcess)(vboxDriverPtr driver, IMachine *machine,
|
||||||
vboxIIDUnion *iidu,
|
vboxIID *iid,
|
||||||
PRUnichar *sessionType, PRUnichar *env,
|
PRUnichar *sessionType, PRUnichar *env,
|
||||||
IProgress **progress);
|
IProgress **progress);
|
||||||
nsresult (*Unregister)(IMachine *machine, PRUint32 cleanupMode,
|
nsresult (*Unregister)(IMachine *machine, PRUint32 cleanupMode,
|
||||||
PRUint32 *aMediaSize, IMedium ***aMedia);
|
PRUint32 *aMediaSize, IMedium ***aMedia);
|
||||||
nsresult (*FindSnapshot)(IMachine *machine, vboxIIDUnion *iidu, ISnapshot **snapshot);
|
nsresult (*FindSnapshot)(IMachine *machine, vboxIID *iid, ISnapshot **snapshot);
|
||||||
nsresult (*DetachDevice)(IMachine *machine, PRUnichar *name,
|
nsresult (*DetachDevice)(IMachine *machine, PRUnichar *name,
|
||||||
PRInt32 controllerPort, PRInt32 device);
|
PRInt32 controllerPort, PRInt32 device);
|
||||||
nsresult (*GetAccessible)(IMachine *machine, PRBool *isAccessible);
|
nsresult (*GetAccessible)(IMachine *machine, PRBool *isAccessible);
|
||||||
nsresult (*GetState)(IMachine *machine, PRUint32 *state);
|
nsresult (*GetState)(IMachine *machine, PRUint32 *state);
|
||||||
nsresult (*GetName)(IMachine *machine, PRUnichar **name);
|
nsresult (*GetName)(IMachine *machine, PRUnichar **name);
|
||||||
nsresult (*GetId)(IMachine *machine, vboxIIDUnion *iidu);
|
nsresult (*GetId)(IMachine *machine, vboxIID *iid);
|
||||||
nsresult (*GetBIOSSettings)(IMachine *machine, IBIOSSettings **bios);
|
nsresult (*GetBIOSSettings)(IMachine *machine, IBIOSSettings **bios);
|
||||||
nsresult (*GetAudioAdapter)(IMachine *machine, IAudioAdapter **audioAdapter);
|
nsresult (*GetAudioAdapter)(IMachine *machine, IAudioAdapter **audioAdapter);
|
||||||
nsresult (*GetNetworkAdapter)(IMachine *machine, PRUint32 slot, INetworkAdapter **adapter);
|
nsresult (*GetNetworkAdapter)(IMachine *machine, PRUint32 slot, INetworkAdapter **adapter);
|
||||||
@ -252,8 +229,8 @@ typedef struct {
|
|||||||
|
|
||||||
/* Functions for ISession */
|
/* Functions for ISession */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
nsresult (*Open)(vboxDriverPtr driver, vboxIIDUnion *iidu, IMachine *machine);
|
nsresult (*Open)(vboxDriverPtr driver, vboxIID *iid, IMachine *machine);
|
||||||
nsresult (*OpenExisting)(vboxDriverPtr driver, vboxIIDUnion *iidu, IMachine *machine);
|
nsresult (*OpenExisting)(vboxDriverPtr driver, vboxIID *iid, IMachine *machine);
|
||||||
nsresult (*GetConsole)(ISession *session, IConsole **console);
|
nsresult (*GetConsole)(ISession *session, IConsole **console);
|
||||||
nsresult (*GetMachine)(ISession *session, IMachine **machine);
|
nsresult (*GetMachine)(ISession *session, IMachine **machine);
|
||||||
nsresult (*Close)(ISession *session);
|
nsresult (*Close)(ISession *session);
|
||||||
@ -269,7 +246,7 @@ typedef struct {
|
|||||||
nsresult (*Reset)(IConsole *console);
|
nsresult (*Reset)(IConsole *console);
|
||||||
nsresult (*TakeSnapshot)(IConsole *console, PRUnichar *name,
|
nsresult (*TakeSnapshot)(IConsole *console, PRUnichar *name,
|
||||||
PRUnichar *description, IProgress **progress);
|
PRUnichar *description, IProgress **progress);
|
||||||
nsresult (*DeleteSnapshot)(IConsole *console, vboxIIDUnion *iidu, IProgress **progress);
|
nsresult (*DeleteSnapshot)(IConsole *console, vboxIID *iid, IProgress **progress);
|
||||||
nsresult (*GetDisplay)(IConsole *console, IDisplay **display);
|
nsresult (*GetDisplay)(IConsole *console, IDisplay **display);
|
||||||
nsresult (*GetKeyboard)(IConsole *console, IKeyboard **keyboard);
|
nsresult (*GetKeyboard)(IConsole *console, IKeyboard **keyboard);
|
||||||
} vboxUniformedIConsole;
|
} vboxUniformedIConsole;
|
||||||
@ -398,7 +375,7 @@ typedef struct {
|
|||||||
|
|
||||||
/* Functions for IMedium */
|
/* Functions for IMedium */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
nsresult (*GetId)(IMedium *medium, vboxIIDUnion *iidu);
|
nsresult (*GetId)(IMedium *medium, vboxIID *iid);
|
||||||
nsresult (*GetLocation)(IMedium *medium, PRUnichar **location);
|
nsresult (*GetLocation)(IMedium *medium, PRUnichar **location);
|
||||||
nsresult (*GetState)(IMedium *medium, PRUint32 *state);
|
nsresult (*GetState)(IMedium *medium, PRUint32 *state);
|
||||||
nsresult (*GetName)(IMedium *medium, PRUnichar **name);
|
nsresult (*GetName)(IMedium *medium, PRUnichar **name);
|
||||||
@ -445,7 +422,7 @@ typedef struct {
|
|||||||
/* Functions for ISnapshot */
|
/* Functions for ISnapshot */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
nsresult (*GetName)(ISnapshot *snapshot, PRUnichar **name);
|
nsresult (*GetName)(ISnapshot *snapshot, PRUnichar **name);
|
||||||
nsresult (*GetId)(ISnapshot *snapshot, vboxIIDUnion *iidu);
|
nsresult (*GetId)(ISnapshot *snapshot, vboxIID *iid);
|
||||||
nsresult (*GetMachine)(ISnapshot *snapshot, IMachine **machine);
|
nsresult (*GetMachine)(ISnapshot *snapshot, IMachine **machine);
|
||||||
nsresult (*GetDescription)(ISnapshot *snapshot, PRUnichar **description);
|
nsresult (*GetDescription)(ISnapshot *snapshot, PRUnichar **description);
|
||||||
nsresult (*GetTimeStamp)(ISnapshot *snapshot, PRInt64 *timeStamp);
|
nsresult (*GetTimeStamp)(ISnapshot *snapshot, PRInt64 *timeStamp);
|
||||||
@ -472,14 +449,14 @@ typedef struct {
|
|||||||
|
|
||||||
/* Functions for IHost */
|
/* Functions for IHost */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
nsresult (*FindHostNetworkInterfaceById)(IHost *host, vboxIIDUnion *iidu,
|
nsresult (*FindHostNetworkInterfaceById)(IHost *host, vboxIID *iid,
|
||||||
IHostNetworkInterface **networkInterface);
|
IHostNetworkInterface **networkInterface);
|
||||||
nsresult (*FindHostNetworkInterfaceByName)(IHost *host, PRUnichar *name,
|
nsresult (*FindHostNetworkInterfaceByName)(IHost *host, PRUnichar *name,
|
||||||
IHostNetworkInterface **networkInterface);
|
IHostNetworkInterface **networkInterface);
|
||||||
nsresult (*CreateHostOnlyNetworkInterface)(vboxDriverPtr driver,
|
nsresult (*CreateHostOnlyNetworkInterface)(vboxDriverPtr driver,
|
||||||
IHost *host, char *name,
|
IHost *host, char *name,
|
||||||
IHostNetworkInterface **networkInterface);
|
IHostNetworkInterface **networkInterface);
|
||||||
nsresult (*RemoveHostOnlyNetworkInterface)(IHost *host, vboxIIDUnion *iidu,
|
nsresult (*RemoveHostOnlyNetworkInterface)(IHost *host, vboxIID *iid,
|
||||||
IProgress **progress);
|
IProgress **progress);
|
||||||
} vboxUniformedIHost;
|
} vboxUniformedIHost;
|
||||||
|
|
||||||
@ -488,7 +465,7 @@ typedef struct {
|
|||||||
nsresult (*GetInterfaceType)(IHostNetworkInterface *hni, PRUint32 *interfaceType);
|
nsresult (*GetInterfaceType)(IHostNetworkInterface *hni, PRUint32 *interfaceType);
|
||||||
nsresult (*GetStatus)(IHostNetworkInterface *hni, PRUint32 *status);
|
nsresult (*GetStatus)(IHostNetworkInterface *hni, PRUint32 *status);
|
||||||
nsresult (*GetName)(IHostNetworkInterface *hni, PRUnichar **name);
|
nsresult (*GetName)(IHostNetworkInterface *hni, PRUnichar **name);
|
||||||
nsresult (*GetId)(IHostNetworkInterface *hni, vboxIIDUnion *iidu);
|
nsresult (*GetId)(IHostNetworkInterface *hni, vboxIID *iid);
|
||||||
nsresult (*GetHardwareAddress)(IHostNetworkInterface *hni, PRUnichar **hardwareAddress);
|
nsresult (*GetHardwareAddress)(IHostNetworkInterface *hni, PRUnichar **hardwareAddress);
|
||||||
nsresult (*GetIPAddress)(IHostNetworkInterface *hni, PRUnichar **IPAddress);
|
nsresult (*GetIPAddress)(IHostNetworkInterface *hni, PRUnichar **IPAddress);
|
||||||
nsresult (*GetNetworkMask)(IHostNetworkInterface *hni, PRUnichar **networkMask);
|
nsresult (*GetNetworkMask)(IHostNetworkInterface *hni, PRUnichar **networkMask);
|
||||||
@ -533,7 +510,7 @@ typedef struct {
|
|||||||
uint32_t APIVersion;
|
uint32_t APIVersion;
|
||||||
uint32_t XPCOMCVersion;
|
uint32_t XPCOMCVersion;
|
||||||
/* vbox APIs */
|
/* vbox APIs */
|
||||||
nsresult (*unregisterMachine)(vboxDriverPtr driver, vboxIIDUnion *iidu, IMachine **machine);
|
nsresult (*unregisterMachine)(vboxDriverPtr driver, vboxIID *iid, IMachine **machine);
|
||||||
void (*deleteConfig)(IMachine *machine);
|
void (*deleteConfig)(IMachine *machine);
|
||||||
void (*vboxAttachDrivesOld)(virDomainDefPtr def, vboxDriverPtr driver, IMachine *machine);
|
void (*vboxAttachDrivesOld)(virDomainDefPtr def, vboxDriverPtr driver, IMachine *machine);
|
||||||
virDomainState (*vboxConvertState)(PRUint32 state);
|
virDomainState (*vboxConvertState)(PRUint32 state);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user