Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
34364df3
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
34364df3
编写于
8月 11, 2014
作者:
T
Taowei
提交者:
Michal Privoznik
8月 15, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vbox: Rewrite vboxDomainDefineXML
上级
e60e8da4
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
3557 addition
and
2365 deletion
+3557
-2365
src/vbox/vbox_common.c
src/vbox/vbox_common.c
+1169
-0
src/vbox/vbox_common.h
src/vbox/vbox_common.h
+90
-0
src/vbox/vbox_tmpl.c
src/vbox/vbox_tmpl.c
+2170
-2365
src/vbox/vbox_uniformed_api.h
src/vbox/vbox_uniformed_api.h
+128
-0
未找到文件。
src/vbox/vbox_common.c
浏览文件 @
34364df3
此差异已折叠。
点击以展开。
src/vbox/vbox_common.h
浏览文件 @
34364df3
...
@@ -158,6 +158,86 @@ struct _vboxArray {
...
@@ -158,6 +158,86 @@ struct _vboxArray {
# endif
/* !WIN32 */
# endif
/* !WIN32 */
/* We make the assumption that these enum flags
* are compatible in all vbox API version.
*
* Yes it is, as it has been checked from vbox 2.2 to
* vbox 4.3.3. And this rule MAY NOT stands for new
* vbox versions.
* */
enum
CPUPropertyType
{
CPUPropertyType_Null
=
0
,
CPUPropertyType_PAE
=
1
,
CPUPropertyType_Synthetic
=
2
,
};
enum
AudioControllerType
{
AudioControllerType_AC97
=
0
,
AudioControllerType_SB16
=
1
};
enum
ChipsetType
{
ChipsetType_Null
=
0
,
ChipsetType_PIIX3
=
1
,
ChipsetType_ICH9
=
2
};
enum
NetworkAdapterType
{
NetworkAdapterType_Null
=
0
,
NetworkAdapterType_Am79C970A
=
1
,
NetworkAdapterType_Am79C973
=
2
,
NetworkAdapterType_I82540EM
=
3
,
NetworkAdapterType_I82543GC
=
4
,
NetworkAdapterType_I82545EM
=
5
,
NetworkAdapterType_Virtio
=
6
};
enum
PortMode
{
PortMode_Disconnected
=
0
,
PortMode_HostPipe
=
1
,
PortMode_HostDevice
=
2
,
PortMode_RawFile
=
3
};
enum
DeviceType
{
DeviceType_Null
=
0
,
DeviceType_Floppy
=
1
,
DeviceType_DVD
=
2
,
DeviceType_HardDisk
=
3
,
DeviceType_Network
=
4
,
DeviceType_USB
=
5
,
DeviceType_SharedFolder
=
6
};
enum
StorageBus
{
StorageBus_Null
=
0
,
StorageBus_IDE
=
1
,
StorageBus_SATA
=
2
,
StorageBus_SCSI
=
3
,
StorageBus_Floppy
=
4
,
StorageBus_SAS
=
5
};
enum
AccessMode
{
AccessMode_ReadOnly
=
1
,
AccessMode_ReadWrite
=
2
};
enum
MediumType
{
MediumType_Normal
=
0
,
MediumType_Immutable
=
1
,
MediumType_Writethrough
=
2
,
};
/* Simplied definitions in vbox_CAPI_*.h */
/* Simplied definitions in vbox_CAPI_*.h */
typedef
void
const
*
PCVBOXXPCOM
;
typedef
void
const
*
PCVBOXXPCOM
;
...
@@ -168,5 +248,15 @@ typedef nsISupports IConsole;
...
@@ -168,5 +248,15 @@ typedef nsISupports IConsole;
typedef
nsISupports
IProgress
;
typedef
nsISupports
IProgress
;
typedef
nsISupports
IMachine
;
typedef
nsISupports
IMachine
;
typedef
nsISupports
ISystemProperties
;
typedef
nsISupports
ISystemProperties
;
typedef
nsISupports
IBIOSSettings
;
typedef
nsISupports
IAudioAdapter
;
typedef
nsISupports
INetworkAdapter
;
typedef
nsISupports
ISerialPort
;
typedef
nsISupports
IParallelPort
;
typedef
nsISupports
IVRDxServer
;
typedef
nsISupports
IUSBCommon
;
typedef
nsISupports
IUSBDeviceFilter
;
typedef
nsISupports
IMedium
;
typedef
nsISupports
IStorageController
;
#endif
/* VBOX_COMMON_H */
#endif
/* VBOX_COMMON_H */
src/vbox/vbox_tmpl.c
浏览文件 @
34364df3
此差异已折叠。
点击以展开。
src/vbox/vbox_uniformed_api.h
浏览文件 @
34364df3
...
@@ -180,14 +180,43 @@ typedef struct {
...
@@ -180,14 +180,43 @@ 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
,
vboxIIDUnion
*
iidu
,
IMachine
**
machine
);
nsresult
(
*
GetSystemProperties
)(
IVirtualBox
*
vboxObj
,
ISystemProperties
**
systemProperties
);
nsresult
(
*
GetSystemProperties
)(
IVirtualBox
*
vboxObj
,
ISystemProperties
**
systemProperties
);
nsresult
(
*
CreateMachine
)(
vboxGlobalData
*
data
,
virDomainDefPtr
def
,
IMachine
**
machine
,
char
*
uuidstr
);
nsresult
(
*
RegisterMachine
)(
IVirtualBox
*
vboxObj
,
IMachine
*
machine
);
nsresult
(
*
FindMedium
)(
IVirtualBox
*
vboxObj
,
PRUnichar
*
location
,
PRUint32
deviceType
,
PRUint32
accessMode
,
IMedium
**
medium
);
nsresult
(
*
OpenMedium
)(
IVirtualBox
*
vboxObj
,
PRUnichar
*
location
,
PRUint32
deviceType
,
PRUint32
accessMode
,
IMedium
**
medium
);
}
vboxUniformedIVirtualBox
;
}
vboxUniformedIVirtualBox
;
/* Functions for IMachine */
/* Functions for IMachine */
typedef
struct
{
typedef
struct
{
nsresult
(
*
AddStorageController
)(
IMachine
*
machine
,
PRUnichar
*
name
,
PRUint32
connectionType
,
IStorageController
**
controller
);
nsresult
(
*
AttachDevice
)(
IMachine
*
machine
,
PRUnichar
*
name
,
PRInt32
controllerPort
,
PRInt32
device
,
PRUint32
type
,
IMedium
*
medium
);
nsresult
(
*
CreateSharedFolder
)(
IMachine
*
machine
,
PRUnichar
*
name
,
PRUnichar
*
hostPath
,
PRBool
writable
,
PRBool
automount
);
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
,
vboxIIDUnion
*
iidu
);
nsresult
(
*
GetBIOSSettings
)(
IMachine
*
machine
,
IBIOSSettings
**
bios
);
nsresult
(
*
GetAudioAdapter
)(
IMachine
*
machine
,
IAudioAdapter
**
audioAdapter
);
nsresult
(
*
GetNetworkAdapter
)(
IMachine
*
machine
,
PRUint32
slot
,
INetworkAdapter
**
adapter
);
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
(
*
GetUSBCommon
)(
IMachine
*
machine
,
IUSBCommon
**
USBCommon
);
nsresult
(
*
SetCPUCount
)(
IMachine
*
machine
,
PRUint32
CPUCount
);
nsresult
(
*
SetMemorySize
)(
IMachine
*
machine
,
PRUint32
memorySize
);
nsresult
(
*
SetCPUProperty
)(
IMachine
*
machine
,
PRUint32
property
,
PRBool
value
);
nsresult
(
*
SetBootOrder
)(
IMachine
*
machine
,
PRUint32
position
,
PRUint32
device
);
nsresult
(
*
SetVRAMSize
)(
IMachine
*
machine
,
PRUint32
VRAMSize
);
nsresult
(
*
SetMonitorCount
)(
IMachine
*
machine
,
PRUint32
monitorCount
);
nsresult
(
*
SetAccelerate3DEnabled
)(
IMachine
*
machine
,
PRBool
accelerate3DEnabled
);
nsresult
(
*
SetAccelerate2DVideoEnabled
)(
IMachine
*
machine
,
PRBool
accelerate2DVideoEnabled
);
nsresult
(
*
SetExtraData
)(
IMachine
*
machine
,
PRUnichar
*
key
,
PRUnichar
*
value
);
nsresult
(
*
SaveSettings
)(
IMachine
*
machine
);
nsresult
(
*
SaveSettings
)(
IMachine
*
machine
);
}
vboxUniformedIMachine
;
}
vboxUniformedIMachine
;
...
@@ -214,8 +243,93 @@ typedef struct {
...
@@ -214,8 +243,93 @@ typedef struct {
/* Functions for ISystemProperties */
/* Functions for ISystemProperties */
typedef
struct
{
typedef
struct
{
nsresult
(
*
GetMaxGuestCPUCount
)(
ISystemProperties
*
systemProperties
,
PRUint32
*
maxCPUCount
);
nsresult
(
*
GetMaxGuestCPUCount
)(
ISystemProperties
*
systemProperties
,
PRUint32
*
maxCPUCount
);
nsresult
(
*
GetMaxBootPosition
)(
ISystemProperties
*
systemProperties
,
PRUint32
*
maxBootPosition
);
nsresult
(
*
GetMaxNetworkAdapters
)(
ISystemProperties
*
systemProperties
,
PRUint32
chipset
,
PRUint32
*
maxNetworkAdapters
);
nsresult
(
*
GetSerialPortCount
)(
ISystemProperties
*
systemProperties
,
PRUint32
*
SerialPortCount
);
nsresult
(
*
GetParallelPortCount
)(
ISystemProperties
*
systemProperties
,
PRUint32
*
ParallelPortCount
);
nsresult
(
*
GetMaxPortCountForStorageBus
)(
ISystemProperties
*
systemProperties
,
PRUint32
bus
,
PRUint32
*
maxPortCount
);
nsresult
(
*
GetMaxDevicesPerPortForStorageBus
)(
ISystemProperties
*
systemProperties
,
PRUint32
bus
,
PRUint32
*
maxDevicesPerPort
);
}
vboxUniformedISystemProperties
;
}
vboxUniformedISystemProperties
;
/* Functions for IBIOSSettings */
typedef
struct
{
nsresult
(
*
SetACPIEnabled
)(
IBIOSSettings
*
bios
,
PRBool
ACPIEnabled
);
nsresult
(
*
SetIOAPICEnabled
)(
IBIOSSettings
*
bios
,
PRBool
IOAPICEnabled
);
}
vboxUniformedIBIOSSettings
;
/* Functions for IAudioAdapter */
typedef
struct
{
nsresult
(
*
SetEnabled
)(
IAudioAdapter
*
audioAdapter
,
PRBool
enabled
);
nsresult
(
*
SetAudioController
)(
IAudioAdapter
*
audioAdapter
,
PRUint32
audioController
);
}
vboxUniformedIAudioAdapter
;
/* Functions for INetworkAdapter */
typedef
struct
{
nsresult
(
*
SetEnabled
)(
INetworkAdapter
*
adapter
,
PRBool
enabled
);
nsresult
(
*
SetAdapterType
)(
INetworkAdapter
*
adapter
,
PRUint32
adapterType
);
nsresult
(
*
SetBridgedInterface
)(
INetworkAdapter
*
adapter
,
PRUnichar
*
bridgedInterface
);
nsresult
(
*
SetInternalNetwork
)(
INetworkAdapter
*
adapter
,
PRUnichar
*
internalNetwork
);
nsresult
(
*
SetHostOnlyInterface
)(
INetworkAdapter
*
adapter
,
PRUnichar
*
hostOnlyInterface
);
nsresult
(
*
SetMACAddress
)(
INetworkAdapter
*
adapter
,
PRUnichar
*
MACAddress
);
nsresult
(
*
AttachToBridgedInterface
)(
INetworkAdapter
*
adapter
);
nsresult
(
*
AttachToInternalNetwork
)(
INetworkAdapter
*
adapter
);
nsresult
(
*
AttachToHostOnlyInterface
)(
INetworkAdapter
*
adapter
);
nsresult
(
*
AttachToNAT
)(
INetworkAdapter
*
adapter
);
}
vboxUniformedINetworkAdapter
;
/* Functions for ISerialPort */
typedef
struct
{
nsresult
(
*
SetEnabled
)(
ISerialPort
*
port
,
PRBool
enabled
);
nsresult
(
*
SetPath
)(
ISerialPort
*
port
,
PRUnichar
*
path
);
nsresult
(
*
SetIRQ
)(
ISerialPort
*
port
,
PRUint32
IRQ
);
nsresult
(
*
SetIOBase
)(
ISerialPort
*
port
,
PRUint32
IOBase
);
nsresult
(
*
SetHostMode
)(
ISerialPort
*
port
,
PRUint32
hostMode
);
}
vboxUniformedISerialPort
;
/* Functions for IParallelPort */
typedef
struct
{
nsresult
(
*
SetEnabled
)(
IParallelPort
*
port
,
PRBool
enabled
);
nsresult
(
*
SetPath
)(
IParallelPort
*
port
,
PRUnichar
*
path
);
nsresult
(
*
SetIRQ
)(
IParallelPort
*
port
,
PRUint32
IRQ
);
nsresult
(
*
SetIOBase
)(
IParallelPort
*
port
,
PRUint32
IOBase
);
}
vboxUniformedIParallelPort
;
/* Functions for IVRDPServer and IVRDEServer */
typedef
struct
{
nsresult
(
*
SetEnabled
)(
IVRDxServer
*
VRDxServer
,
PRBool
enabled
);
nsresult
(
*
SetPorts
)(
vboxGlobalData
*
data
,
IVRDxServer
*
VRDxServer
,
virDomainGraphicsDefPtr
graphics
);
nsresult
(
*
SetReuseSingleConnection
)(
IVRDxServer
*
VRDxServer
,
PRBool
enabled
);
nsresult
(
*
SetAllowMultiConnection
)(
IVRDxServer
*
VRDxServer
,
PRBool
enabled
);
nsresult
(
*
SetNetAddress
)(
vboxGlobalData
*
data
,
IVRDxServer
*
VRDxServer
,
PRUnichar
*
netAddress
);
}
vboxUniformedIVRDxServer
;
/* Common Functions for IUSBController and IUSBDeviceFilters */
typedef
struct
{
nsresult
(
*
Enable
)(
IUSBCommon
*
USBCommon
);
nsresult
(
*
CreateDeviceFilter
)(
IUSBCommon
*
USBCommon
,
PRUnichar
*
name
,
IUSBDeviceFilter
**
filter
);
nsresult
(
*
InsertDeviceFilter
)(
IUSBCommon
*
USBCommon
,
PRUint32
position
,
IUSBDeviceFilter
*
filter
);
}
vboxUniformedIUSBCommon
;
typedef
struct
{
nsresult
(
*
SetProductId
)(
IUSBDeviceFilter
*
USBDeviceFilter
,
PRUnichar
*
productId
);
nsresult
(
*
SetActive
)(
IUSBDeviceFilter
*
USBDeviceFilter
,
PRBool
active
);
nsresult
(
*
SetVendorId
)(
IUSBDeviceFilter
*
USBDeviceFilter
,
PRUnichar
*
vendorId
);
}
vboxUniformedIUSBDeviceFilter
;
/* Functions for IMedium */
typedef
struct
{
nsresult
(
*
GetId
)(
IMedium
*
medium
,
vboxIIDUnion
*
iidu
);
nsresult
(
*
Release
)(
IMedium
*
medium
);
nsresult
(
*
SetType
)(
IMedium
*
medium
,
PRUint32
type
);
}
vboxUniformedIMedium
;
typedef
struct
{
typedef
struct
{
bool
(
*
Online
)(
PRUint32
state
);
bool
(
*
Online
)(
PRUint32
state
);
}
uniformedMachineStateChecker
;
}
uniformedMachineStateChecker
;
...
@@ -230,6 +344,7 @@ typedef struct {
...
@@ -230,6 +344,7 @@ typedef struct {
void
(
*
detachDevices
)(
vboxGlobalData
*
data
,
IMachine
*
machine
,
PRUnichar
*
hddcnameUtf16
);
void
(
*
detachDevices
)(
vboxGlobalData
*
data
,
IMachine
*
machine
,
PRUnichar
*
hddcnameUtf16
);
nsresult
(
*
unregisterMachine
)(
vboxGlobalData
*
data
,
vboxIIDUnion
*
iidu
,
IMachine
**
machine
);
nsresult
(
*
unregisterMachine
)(
vboxGlobalData
*
data
,
vboxIIDUnion
*
iidu
,
IMachine
**
machine
);
void
(
*
deleteConfig
)(
IMachine
*
machine
);
void
(
*
deleteConfig
)(
IMachine
*
machine
);
void
(
*
vboxAttachDrivesOld
)(
virDomainDefPtr
def
,
vboxGlobalData
*
data
,
IMachine
*
machine
);
vboxUniformedPFN
UPFN
;
vboxUniformedPFN
UPFN
;
vboxUniformedIID
UIID
;
vboxUniformedIID
UIID
;
vboxUniformedArray
UArray
;
vboxUniformedArray
UArray
;
...
@@ -240,12 +355,24 @@ typedef struct {
...
@@ -240,12 +355,24 @@ typedef struct {
vboxUniformedIConsole
UIConsole
;
vboxUniformedIConsole
UIConsole
;
vboxUniformedIProgress
UIProgress
;
vboxUniformedIProgress
UIProgress
;
vboxUniformedISystemProperties
UISystemProperties
;
vboxUniformedISystemProperties
UISystemProperties
;
vboxUniformedIBIOSSettings
UIBIOSSettings
;
vboxUniformedIAudioAdapter
UIAudioAdapter
;
vboxUniformedINetworkAdapter
UINetworkAdapter
;
vboxUniformedISerialPort
UISerialPort
;
vboxUniformedIParallelPort
UIParallelPort
;
vboxUniformedIVRDxServer
UIVRDxServer
;
vboxUniformedIUSBCommon
UIUSBCommon
;
vboxUniformedIUSBDeviceFilter
UIUSBDeviceFilter
;
vboxUniformedIMedium
UIMedium
;
uniformedMachineStateChecker
machineStateChecker
;
uniformedMachineStateChecker
machineStateChecker
;
/* vbox API features */
/* vbox API features */
bool
domainEventCallbacks
;
bool
domainEventCallbacks
;
bool
hasStaticGlobalData
;
bool
hasStaticGlobalData
;
bool
getMachineForSession
;
bool
getMachineForSession
;
bool
detachDevicesExplicitly
;
bool
detachDevicesExplicitly
;
bool
chipsetType
;
bool
accelerate2DVideo
;
bool
vboxAttachDrivesUseOld
;
}
vboxUniformedAPI
;
}
vboxUniformedAPI
;
/* libvirt API
/* libvirt API
...
@@ -269,6 +396,7 @@ int vboxConnectNumOfDomains(virConnectPtr conn);
...
@@ -269,6 +396,7 @@ int vboxConnectNumOfDomains(virConnectPtr conn);
virDomainPtr
vboxDomainLookupByID
(
virConnectPtr
conn
,
int
id
);
virDomainPtr
vboxDomainLookupByID
(
virConnectPtr
conn
,
int
id
);
virDomainPtr
vboxDomainLookupByUUID
(
virConnectPtr
conn
,
virDomainPtr
vboxDomainLookupByUUID
(
virConnectPtr
conn
,
const
unsigned
char
*
uuid
);
const
unsigned
char
*
uuid
);
virDomainPtr
vboxDomainDefineXML
(
virConnectPtr
conn
,
const
char
*
xml
);
int
vboxDomainUndefineFlags
(
virDomainPtr
dom
,
unsigned
int
flags
);
int
vboxDomainUndefineFlags
(
virDomainPtr
dom
,
unsigned
int
flags
);
/* Version specified functions for installing uniformed API */
/* Version specified functions for installing uniformed API */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录