提交 06c4fd10 编写于 作者: D Dawid Zamirski 提交者: John Ferlan

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()
上级 1bf7e977
......@@ -235,6 +235,19 @@ enum StorageBus
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
{
AccessMode_ReadOnly = 1,
......
......@@ -572,6 +572,11 @@ static void* _handleUSBGetDeviceFilters(IUSBCommon *USBCommon)
return USBCommon->vtbl->GetDeviceFilters;
}
static void* _handleMachineGetStorageControllers(IMachine *machine)
{
return machine->vtbl->GetStorageControllers;
}
static void* _handleMachineGetMediumAttachments(IMachine *machine)
{
return machine->vtbl->GetMediumAttachments;
......@@ -1987,6 +1992,18 @@ _storageControllerGetBus(IStorageController *storageController, PRUint32 *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
_sharedFolderGetHostPath(ISharedFolder *sharedFolder, PRUnichar **hostPath)
{
......@@ -2336,6 +2353,7 @@ static vboxUniformedArray _UArray = {
.handleGetMachines = _handleGetMachines,
.handleGetHardDisks = _handleGetHardDisks,
.handleUSBGetDeviceFilters = _handleUSBGetDeviceFilters,
.handleMachineGetStorageControllers = _handleMachineGetStorageControllers,
.handleMachineGetMediumAttachments = _handleMachineGetMediumAttachments,
.handleMachineGetSharedFolders = _handleMachineGetSharedFolders,
.handleSnapshotGetChildren = _handleSnapshotGetChildren,
......@@ -2567,6 +2585,8 @@ static vboxUniformedIMediumAttachment _UIMediumAttachment = {
static vboxUniformedIStorageController _UIStorageController = {
.GetBus = _storageControllerGetBus,
.GetControllerType = _storageControllerGetControllerType,
.SetControllerType = _storageControllerSetControllerType,
};
static vboxUniformedISharedFolder _UISharedFolder = {
......
......@@ -135,6 +135,7 @@ typedef struct {
void* (*handleGetMachines)(IVirtualBox *vboxObj);
void* (*handleGetHardDisks)(IVirtualBox *vboxObj);
void* (*handleUSBGetDeviceFilters)(IUSBCommon *USBCommon);
void* (*handleMachineGetStorageControllers)(IMachine *machine);
void* (*handleMachineGetMediumAttachments)(IMachine *machine);
void* (*handleMachineGetSharedFolders)(IMachine *machine);
void* (*handleSnapshotGetChildren)(ISnapshot *snapshot);
......@@ -410,6 +411,8 @@ typedef struct {
/* Functions for IStorageController */
typedef struct {
nsresult (*GetBus)(IStorageController *storageController, PRUint32 *bus);
nsresult (*SetControllerType)(IStorageController *storageController, PRUint32 controllerType);
nsresult (*GetControllerType)(IStorageController *storageController, PRUint32 *controllerType);
} vboxUniformedIStorageController;
/* Functions for ISharedFolder */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册