vbox: Add more IStorageController API mappings

This patch exposes additional methods of the native VBOX API to the
libvirt 'unified' vbox API to deal with IStorageController. The exposed
methods are:

* IStorageController->GetStorageControllerType()
* IStorageController->SetStorageControllerType()
* IMachine->GetStorageControllers()
This commit is contained in:
Dawid Zamirski 2017-10-24 15:35:31 -04:00 committed by John Ferlan
parent 1bf7e97733
commit 06c4fd10fd
3 changed files with 36 additions and 0 deletions

View File

@ -235,6 +235,19 @@ enum StorageBus
StorageBus_SAS = 5 StorageBus_SAS = 5
}; };
enum StorageControllerType
{
StorageControllerType_Null = 0,
StorageControllerType_LsiLogic = 1,
StorageControllerType_BusLogic = 2,
StorageControllerType_IntelAhci = 3,
StorageControllerType_PIIX3 = 4,
StorageControllerType_PIIX4 = 5,
StorageControllerType_ICH6 = 6,
StorageControllerType_I82078 = 7,
StorageControllerType_LsiLogicSas = 8
};
enum AccessMode enum AccessMode
{ {
AccessMode_ReadOnly = 1, AccessMode_ReadOnly = 1,

View File

@ -572,6 +572,11 @@ static void* _handleUSBGetDeviceFilters(IUSBCommon *USBCommon)
return USBCommon->vtbl->GetDeviceFilters; return USBCommon->vtbl->GetDeviceFilters;
} }
static void* _handleMachineGetStorageControllers(IMachine *machine)
{
return machine->vtbl->GetStorageControllers;
}
static void* _handleMachineGetMediumAttachments(IMachine *machine) static void* _handleMachineGetMediumAttachments(IMachine *machine)
{ {
return machine->vtbl->GetMediumAttachments; return machine->vtbl->GetMediumAttachments;
@ -1987,6 +1992,18 @@ _storageControllerGetBus(IStorageController *storageController, PRUint32 *bus)
return storageController->vtbl->GetBus(storageController, bus); return storageController->vtbl->GetBus(storageController, bus);
} }
static nsresult
_storageControllerGetControllerType(IStorageController *storageController, PRUint32 *controllerType)
{
return storageController->vtbl->GetControllerType(storageController, controllerType);
}
static nsresult
_storageControllerSetControllerType(IStorageController *storageController, PRUint32 controllerType)
{
return storageController->vtbl->SetControllerType(storageController, controllerType);
}
static nsresult static nsresult
_sharedFolderGetHostPath(ISharedFolder *sharedFolder, PRUnichar **hostPath) _sharedFolderGetHostPath(ISharedFolder *sharedFolder, PRUnichar **hostPath)
{ {
@ -2336,6 +2353,7 @@ static vboxUniformedArray _UArray = {
.handleGetMachines = _handleGetMachines, .handleGetMachines = _handleGetMachines,
.handleGetHardDisks = _handleGetHardDisks, .handleGetHardDisks = _handleGetHardDisks,
.handleUSBGetDeviceFilters = _handleUSBGetDeviceFilters, .handleUSBGetDeviceFilters = _handleUSBGetDeviceFilters,
.handleMachineGetStorageControllers = _handleMachineGetStorageControllers,
.handleMachineGetMediumAttachments = _handleMachineGetMediumAttachments, .handleMachineGetMediumAttachments = _handleMachineGetMediumAttachments,
.handleMachineGetSharedFolders = _handleMachineGetSharedFolders, .handleMachineGetSharedFolders = _handleMachineGetSharedFolders,
.handleSnapshotGetChildren = _handleSnapshotGetChildren, .handleSnapshotGetChildren = _handleSnapshotGetChildren,
@ -2567,6 +2585,8 @@ static vboxUniformedIMediumAttachment _UIMediumAttachment = {
static vboxUniformedIStorageController _UIStorageController = { static vboxUniformedIStorageController _UIStorageController = {
.GetBus = _storageControllerGetBus, .GetBus = _storageControllerGetBus,
.GetControllerType = _storageControllerGetControllerType,
.SetControllerType = _storageControllerSetControllerType,
}; };
static vboxUniformedISharedFolder _UISharedFolder = { static vboxUniformedISharedFolder _UISharedFolder = {

View File

@ -135,6 +135,7 @@ typedef struct {
void* (*handleGetMachines)(IVirtualBox *vboxObj); void* (*handleGetMachines)(IVirtualBox *vboxObj);
void* (*handleGetHardDisks)(IVirtualBox *vboxObj); void* (*handleGetHardDisks)(IVirtualBox *vboxObj);
void* (*handleUSBGetDeviceFilters)(IUSBCommon *USBCommon); void* (*handleUSBGetDeviceFilters)(IUSBCommon *USBCommon);
void* (*handleMachineGetStorageControllers)(IMachine *machine);
void* (*handleMachineGetMediumAttachments)(IMachine *machine); void* (*handleMachineGetMediumAttachments)(IMachine *machine);
void* (*handleMachineGetSharedFolders)(IMachine *machine); void* (*handleMachineGetSharedFolders)(IMachine *machine);
void* (*handleSnapshotGetChildren)(ISnapshot *snapshot); void* (*handleSnapshotGetChildren)(ISnapshot *snapshot);
@ -410,6 +411,8 @@ typedef struct {
/* Functions for IStorageController */ /* Functions for IStorageController */
typedef struct { typedef struct {
nsresult (*GetBus)(IStorageController *storageController, PRUint32 *bus); nsresult (*GetBus)(IStorageController *storageController, PRUint32 *bus);
nsresult (*SetControllerType)(IStorageController *storageController, PRUint32 controllerType);
nsresult (*GetControllerType)(IStorageController *storageController, PRUint32 *controllerType);
} vboxUniformedIStorageController; } vboxUniformedIStorageController;
/* Functions for ISharedFolder */ /* Functions for ISharedFolder */