The IVRDxServer was used because vbox < 4 used to have IVRDPServer whereas vbox >= 4 has IVRDEServer. Now that support for legacy versions is being removed, we can use IVRDEServer. --- src/vbox/vbox_common.c | 36 +++++++++---------- src/vbox/vbox_common.h | 2 +- src/vbox/vbox_tmpl.c | 80 +++++++++++++++++++++---------------------- src/vbox/vbox_uniformed_api.h | 28 +++++++-------- 4 files changed, 72 insertions(+), 74 deletions(-)
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 6309a17..8bdf3bb 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -1586,27 +1586,27 @@ vboxAttachDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) virDomainGraphicsListenDefPtr glisten; for (i = 0; i < def->ngraphics; i++) { - IVRDxServer *VRDxServer = NULL; + IVRDEServer *VRDEServer = NULL; if ((def->graphics[i]->type == VIR_DOMAIN_GRAPHICS_TYPE_RDP) && (vrdpPresent == 0)) { vrdpPresent = 1; - gVBoxAPI.UIMachine.GetVRDxServer(machine, &VRDxServer); - if (VRDxServer) { - gVBoxAPI.UIVRDxServer.SetEnabled(VRDxServer, PR_TRUE); + gVBoxAPI.UIMachine.GetVRDEServer(machine, &VRDEServer); + if (VRDEServer) { + gVBoxAPI.UIVRDEServer.SetEnabled(VRDEServer, PR_TRUE); VIR_DEBUG("VRDP Support turned ON."); - gVBoxAPI.UIVRDxServer.SetPorts(data, VRDxServer, def->graphics[i]); + gVBoxAPI.UIVRDEServer.SetPorts(data, VRDEServer, def->graphics[i]); if (def->graphics[i]->data.rdp.replaceUser) { - gVBoxAPI.UIVRDxServer.SetReuseSingleConnection(VRDxServer, + gVBoxAPI.UIVRDEServer.SetReuseSingleConnection(VRDEServer, PR_TRUE); VIR_DEBUG("VRDP set to reuse single connection"); } if (def->graphics[i]->data.rdp.multiUser) { - gVBoxAPI.UIVRDxServer.SetAllowMultiConnection(VRDxServer, + gVBoxAPI.UIVRDEServer.SetAllowMultiConnection(VRDEServer, PR_TRUE); VIR_DEBUG("VRDP set to allow multiple connection"); } @@ -1616,7 +1616,7 @@ vboxAttachDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) PRUnichar *netAddressUtf16 = NULL; VBOX_UTF8_TO_UTF16(glisten->address, &netAddressUtf16); - gVBoxAPI.UIVRDxServer.SetNetAddress(data, VRDxServer, + gVBoxAPI.UIVRDEServer.SetNetAddress(data, VRDEServer, netAddressUtf16); VIR_DEBUG("VRDP listen address is set to: %s", glisten->address); @@ -1624,7 +1624,7 @@ vboxAttachDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) VBOX_UTF16_FREE(netAddressUtf16); } - VBOX_RELEASE(VRDxServer); + VBOX_RELEASE(VRDEServer); } } @@ -3263,7 +3263,7 @@ vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) PRUnichar *valueTypeUtf16 = NULL; char *valueTypeUtf8 = NULL; char *netAddressUtf8 = NULL; - IVRDxServer *VRDxServer = NULL; + IVRDEServer *VRDEServer = NULL; PRBool VRDxEnabled = PR_FALSE; virDomainGraphicsDefPtr graphics = NULL; int ret = -1; @@ -3325,9 +3325,9 @@ vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) VIR_APPEND_ELEMENT(def->graphics, def->ngraphics, graphics) < 0) goto cleanup; - gVBoxAPI.UIMachine.GetVRDxServer(machine, &VRDxServer); - if (VRDxServer) - gVBoxAPI.UIVRDxServer.GetEnabled(VRDxServer, &VRDxEnabled); + gVBoxAPI.UIMachine.GetVRDEServer(machine, &VRDEServer); + if (VRDEServer) + gVBoxAPI.UIVRDEServer.GetEnabled(VRDEServer, &VRDxEnabled); if (VRDxEnabled) { PRUnichar *netAddressUtf16 = NULL; @@ -3337,11 +3337,11 @@ vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) if (VIR_ALLOC(graphics) < 0) goto cleanup; - gVBoxAPI.UIVRDxServer.GetPorts(data, VRDxServer, graphics); + gVBoxAPI.UIVRDEServer.GetPorts(data, VRDEServer, graphics); graphics->type = VIR_DOMAIN_GRAPHICS_TYPE_RDP; - gVBoxAPI.UIVRDxServer.GetNetAddress(data, VRDxServer, &netAddressUtf16); + gVBoxAPI.UIVRDEServer.GetNetAddress(data, VRDEServer, &netAddressUtf16); if (netAddressUtf16) { VBOX_UTF16_TO_UTF8(netAddressUtf16, &netAddressUtf8); VBOX_UTF16_FREE(netAddressUtf16); @@ -3353,11 +3353,11 @@ vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) if (virDomainGraphicsListenAppendAddress(graphics, netAddressUtf8) < 0) goto cleanup; - gVBoxAPI.UIVRDxServer.GetAllowMultiConnection(VRDxServer, &allowMultiConnection); + gVBoxAPI.UIVRDEServer.GetAllowMultiConnection(VRDEServer, &allowMultiConnection); if (allowMultiConnection) graphics->data.rdp.multiUser = true; - gVBoxAPI.UIVRDxServer.GetReuseSingleConnection(VRDxServer, &reuseSingleConnection); + gVBoxAPI.UIVRDEServer.GetReuseSingleConnection(VRDEServer, &reuseSingleConnection); if (reuseSingleConnection) graphics->data.rdp.replaceUser = true; @@ -3368,7 +3368,7 @@ vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) ret = 0; cleanup: - VBOX_RELEASE(VRDxServer); + VBOX_RELEASE(VRDEServer); VBOX_UTF8_FREE(valueTypeUtf8); VBOX_UTF8_FREE(netAddressUtf8); virDomainGraphicsDefFree(graphics); diff --git a/src/vbox/vbox_common.h b/src/vbox/vbox_common.h index 76f7a8e..c6da892 100644 --- a/src/vbox/vbox_common.h +++ b/src/vbox/vbox_common.h @@ -328,7 +328,7 @@ typedef nsISupports IAudioAdapter; typedef nsISupports INetworkAdapter; typedef nsISupports ISerialPort; typedef nsISupports IParallelPort; -typedef nsISupports IVRDxServer; +typedef nsISupports IVRDEServer; typedef nsISupports IUSBCommon; typedef nsISupports IUSBDeviceFilter; typedef nsISupports IMedium; diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index aa30f91..5e6a919 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -72,8 +72,6 @@ /* Include this *last* or we'll get the wrong vbox_CAPI_*.h. */ #include "vbox_glue.h" -typedef IVRDEServer IVRDxServer; - #if VBOX_API_VERSION < 4003000 typedef IUSBController IUSBCommon; #else /* VBOX_API_VERSION >= 4003000 */ @@ -919,9 +917,9 @@ _machineGetParallelPort(IMachine *machine, PRUint32 slot, IParallelPort **port) } static nsresult -_machineGetVRDxServer(IMachine *machine, IVRDxServer **VRDxServer) +_machineGetVRDEServer(IMachine *machine, IVRDEServer **VRDEServer) { - return machine->vtbl->GetVRDEServer(machine, VRDxServer); + return machine->vtbl->GetVRDEServer(machine, VRDEServer); } static nsresult @@ -1607,27 +1605,27 @@ _parallelPortSetIOBase(IParallelPort *port, PRUint32 IOBase) } static nsresult -_vrdxServerGetEnabled(IVRDxServer *VRDxServer, PRBool *enabled) +_vrdeServerGetEnabled(IVRDEServer *VRDEServer, PRBool *enabled) { - return VRDxServer->vtbl->GetEnabled(VRDxServer, enabled); + return VRDEServer->vtbl->GetEnabled(VRDEServer, enabled); } static nsresult -_vrdxServerSetEnabled(IVRDxServer *VRDxServer, PRBool enabled) +_vrdeServerSetEnabled(IVRDEServer *VRDEServer, PRBool enabled) { - return VRDxServer->vtbl->SetEnabled(VRDxServer, enabled); + return VRDEServer->vtbl->SetEnabled(VRDEServer, enabled); } static nsresult -_vrdxServerGetPorts(vboxDriverPtr data ATTRIBUTE_UNUSED, - IVRDxServer *VRDxServer, virDomainGraphicsDefPtr graphics) +_vrdeServerGetPorts(vboxDriverPtr data ATTRIBUTE_UNUSED, + IVRDEServer *VRDEServer, virDomainGraphicsDefPtr graphics) { nsresult rc; PRUnichar *VRDEPortsKey = NULL; PRUnichar *VRDEPortsValue = NULL; VBOX_UTF8_TO_UTF16("TCP/Ports", &VRDEPortsKey); - rc = VRDxServer->vtbl->GetVRDEProperty(VRDxServer, VRDEPortsKey, &VRDEPortsValue); + rc = VRDEServer->vtbl->GetVRDEProperty(VRDEServer, VRDEPortsKey, &VRDEPortsValue); VBOX_UTF16_FREE(VRDEPortsKey); if (VRDEPortsValue) { /* even if vbox supports mutilpe ports, single port for now here */ @@ -1641,8 +1639,8 @@ _vrdxServerGetPorts(vboxDriverPtr data ATTRIBUTE_UNUSED, } static nsresult -_vrdxServerSetPorts(vboxDriverPtr data ATTRIBUTE_UNUSED, - IVRDxServer *VRDxServer, virDomainGraphicsDefPtr graphics) +_vrdeServerSetPorts(vboxDriverPtr data ATTRIBUTE_UNUSED, + IVRDEServer *VRDEServer, virDomainGraphicsDefPtr graphics) { nsresult rc = 0; PRUnichar *VRDEPortsKey = NULL; @@ -1650,7 +1648,7 @@ _vrdxServerSetPorts(vboxDriverPtr data ATTRIBUTE_UNUSED, VBOX_UTF8_TO_UTF16("TCP/Ports", &VRDEPortsKey); VRDEPortsValue = PRUnicharFromInt(data->pFuncs, graphics->data.rdp.port); - rc = VRDxServer->vtbl->SetVRDEProperty(VRDxServer, VRDEPortsKey, + rc = VRDEServer->vtbl->SetVRDEProperty(VRDEServer, VRDEPortsKey, VRDEPortsValue); VBOX_UTF16_FREE(VRDEPortsKey); VBOX_UTF16_FREE(VRDEPortsValue); @@ -1659,52 +1657,52 @@ _vrdxServerSetPorts(vboxDriverPtr data ATTRIBUTE_UNUSED, } static nsresult -_vrdxServerGetReuseSingleConnection(IVRDxServer *VRDxServer, PRBool *enabled) +_vrdeServerGetReuseSingleConnection(IVRDEServer *VRDEServer, PRBool *enabled) { - return VRDxServer->vtbl->GetReuseSingleConnection(VRDxServer, enabled); + return VRDEServer->vtbl->GetReuseSingleConnection(VRDEServer, enabled); } static nsresult -_vrdxServerSetReuseSingleConnection(IVRDxServer *VRDxServer, PRBool enabled) +_vrdeServerSetReuseSingleConnection(IVRDEServer *VRDEServer, PRBool enabled) { - return VRDxServer->vtbl->SetReuseSingleConnection(VRDxServer, enabled); + return VRDEServer->vtbl->SetReuseSingleConnection(VRDEServer, enabled); } static nsresult -_vrdxServerGetAllowMultiConnection(IVRDxServer *VRDxServer, PRBool *enabled) +_vrdeServerGetAllowMultiConnection(IVRDEServer *VRDEServer, PRBool *enabled) { - return VRDxServer->vtbl->GetAllowMultiConnection(VRDxServer, enabled); + return VRDEServer->vtbl->GetAllowMultiConnection(VRDEServer, enabled); } static nsresult -_vrdxServerSetAllowMultiConnection(IVRDxServer *VRDxServer, PRBool enabled) +_vrdeServerSetAllowMultiConnection(IVRDEServer *VRDEServer, PRBool enabled) { - return VRDxServer->vtbl->SetAllowMultiConnection(VRDxServer, enabled); + return VRDEServer->vtbl->SetAllowMultiConnection(VRDEServer, enabled); } static nsresult -_vrdxServerGetNetAddress(vboxDriverPtr data ATTRIBUTE_UNUSED, - IVRDxServer *VRDxServer, PRUnichar **netAddress) +_vrdeServerGetNetAddress(vboxDriverPtr data ATTRIBUTE_UNUSED, + IVRDEServer *VRDEServer, PRUnichar **netAddress) { PRUnichar *VRDENetAddressKey = NULL; nsresult rc; VBOX_UTF8_TO_UTF16("TCP/Address", &VRDENetAddressKey); - rc = VRDxServer->vtbl->GetVRDEProperty(VRDxServer, VRDENetAddressKey, netAddress); + rc = VRDEServer->vtbl->GetVRDEProperty(VRDEServer, VRDENetAddressKey, netAddress); VBOX_UTF16_FREE(VRDENetAddressKey); return rc; } static nsresult -_vrdxServerSetNetAddress(vboxDriverPtr data ATTRIBUTE_UNUSED, - IVRDxServer *VRDxServer, PRUnichar *netAddress) +_vrdeServerSetNetAddress(vboxDriverPtr data ATTRIBUTE_UNUSED, + IVRDEServer *VRDEServer, PRUnichar *netAddress) { PRUnichar *netAddressKey = NULL; nsresult rc; VBOX_UTF8_TO_UTF16("TCP/Address", &netAddressKey); - rc = VRDxServer->vtbl->SetVRDEProperty(VRDxServer, netAddressKey, + rc = VRDEServer->vtbl->SetVRDEProperty(VRDEServer, netAddressKey, netAddress); VBOX_UTF16_FREE(netAddressKey); @@ -2346,7 +2344,7 @@ static vboxUniformedIMachine _UIMachine = { .GetChipsetType = _machineGetChipsetType, .GetSerialPort = _machineGetSerialPort, .GetParallelPort = _machineGetParallelPort, - .GetVRDxServer = _machineGetVRDxServer, + .GetVRDEServer = _machineGetVRDEServer, .GetUSBCommon = _machineGetUSBCommon, .GetCurrentSnapshot = _machineGetCurrentSnapshot, .GetSettingsFilePath = _machineGetSettingsFilePath, @@ -2468,17 +2466,17 @@ static vboxUniformedIParallelPort _UIParallelPort = { .SetIOBase = _parallelPortSetIOBase, }; -static vboxUniformedIVRDxServer _UIVRDxServer = { - .GetEnabled = _vrdxServerGetEnabled, - .SetEnabled = _vrdxServerSetEnabled, - .GetPorts = _vrdxServerGetPorts, - .SetPorts = _vrdxServerSetPorts, - .GetReuseSingleConnection = _vrdxServerGetReuseSingleConnection, - .SetReuseSingleConnection = _vrdxServerSetReuseSingleConnection, - .GetAllowMultiConnection = _vrdxServerGetAllowMultiConnection, - .SetAllowMultiConnection = _vrdxServerSetAllowMultiConnection, - .GetNetAddress = _vrdxServerGetNetAddress, - .SetNetAddress = _vrdxServerSetNetAddress, +static vboxUniformedIVRDEServer _UIVRDEServer = { + .GetEnabled = _vrdeServerGetEnabled, + .SetEnabled = _vrdeServerSetEnabled, + .GetPorts = _vrdeServerGetPorts, + .SetPorts = _vrdeServerSetPorts, + .GetReuseSingleConnection = _vrdeServerGetReuseSingleConnection, + .SetReuseSingleConnection = _vrdeServerSetReuseSingleConnection, + .GetAllowMultiConnection = _vrdeServerGetAllowMultiConnection, + .SetAllowMultiConnection = _vrdeServerSetAllowMultiConnection, + .GetNetAddress = _vrdeServerGetNetAddress, + .SetNetAddress = _vrdeServerSetNetAddress, }; static vboxUniformedIUSBCommon _UIUSBCommon = { @@ -2617,7 +2615,7 @@ void NAME(InstallUniformedAPI)(vboxUniformedAPI *pVBoxAPI) pVBoxAPI->UINetworkAdapter = _UINetworkAdapter; pVBoxAPI->UISerialPort = _UISerialPort; pVBoxAPI->UIParallelPort = _UIParallelPort; - pVBoxAPI->UIVRDxServer = _UIVRDxServer; + pVBoxAPI->UIVRDEServer = _UIVRDEServer; pVBoxAPI->UIUSBCommon = _UIUSBCommon; pVBoxAPI->UIUSBDeviceFilter = _UIUSBDeviceFilter; pVBoxAPI->UIMedium = _UIMedium; diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h index f26de27..d1ce934 100644 --- a/src/vbox/vbox_uniformed_api.h +++ b/src/vbox/vbox_uniformed_api.h @@ -224,7 +224,7 @@ typedef struct { nsresult (*GetChipsetType)(IMachine *machine, PRUint32 *chipsetType); nsresult (*GetSerialPort)(IMachine *machine, PRUint32 slot, ISerialPort **port); nsresult (*GetParallelPort)(IMachine *machine, PRUint32 slot, IParallelPort **port); - nsresult (*GetVRDxServer)(IMachine *machine, IVRDxServer **VRDxServer); + nsresult (*GetVRDEServer)(IMachine *machine, IVRDEServer **VRDEServer); nsresult (*GetUSBCommon)(IMachine *machine, IUSBCommon **USBCommon); nsresult (*GetCurrentSnapshot)(IMachine *machine, ISnapshot **currentSnapshot); nsresult (*GetSettingsFilePath)(IMachine *machine, PRUnichar **settingsFilePath); @@ -359,23 +359,23 @@ typedef struct { nsresult (*SetIOBase)(IParallelPort *port, PRUint32 IOBase); } vboxUniformedIParallelPort; -/* Functions for IVRDPServer and IVRDEServer */ +/* Functions for IVRDEServer */ typedef struct { - nsresult (*GetEnabled)(IVRDxServer *VRDxServer, PRBool *enabled); - nsresult (*SetEnabled)(IVRDxServer *VRDxServer, PRBool enabled); - nsresult (*GetPorts)(vboxDriverPtr driver, IVRDxServer *VRDxServer, + nsresult (*GetEnabled)(IVRDEServer *VRDEServer, PRBool *enabled); + nsresult (*SetEnabled)(IVRDEServer *VRDEServer, PRBool enabled); + nsresult (*GetPorts)(vboxDriverPtr driver, IVRDEServer *VRDEServer, virDomainGraphicsDefPtr graphics); - nsresult (*SetPorts)(vboxDriverPtr driver, IVRDxServer *VRDxServer, + nsresult (*SetPorts)(vboxDriverPtr driver, IVRDEServer *VRDEServer, 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)(vboxDriverPtr driver, IVRDxServer *VRDxServer, + nsresult (*GetReuseSingleConnection)(IVRDEServer *VRDEServer, PRBool *enabled); + nsresult (*SetReuseSingleConnection)(IVRDEServer *VRDEServer, PRBool enabled); + nsresult (*GetAllowMultiConnection)(IVRDEServer *VRDEServer, PRBool *enabled); + nsresult (*SetAllowMultiConnection)(IVRDEServer *VRDEServer, PRBool enabled); + nsresult (*GetNetAddress)(vboxDriverPtr driver, IVRDEServer *VRDEServer, PRUnichar **netAddress); - nsresult (*SetNetAddress)(vboxDriverPtr driver, IVRDxServer *VRDxServer, + nsresult (*SetNetAddress)(vboxDriverPtr driver, IVRDEServer *VRDEServer, PRUnichar *netAddress); -} vboxUniformedIVRDxServer; +} vboxUniformedIVRDEServer; /* Common Functions for IUSBController and IUSBDeviceFilters */ typedef struct { @@ -553,7 +553,7 @@ typedef struct { vboxUniformedINetworkAdapter UINetworkAdapter; vboxUniformedISerialPort UISerialPort; vboxUniformedIParallelPort UIParallelPort; - vboxUniformedIVRDxServer UIVRDxServer; + vboxUniformedIVRDEServer UIVRDEServer; vboxUniformedIUSBCommon UIUSBCommon; vboxUniformedIUSBDeviceFilter UIUSBDeviceFilter; vboxUniformedIMedium UIMedium; -- 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list