Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
6da27ad1
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看板
提交
6da27ad1
编写于
5月 08, 2016
作者:
C
Cole Robinson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
domaincaps: Report graphics type enum
Requires adding the plumbing for <device><graphics> Wire it up for qemu too
上级
4e8b81e5
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
131 addition
and
2 deletion
+131
-2
docs/formatdomaincaps.html.in
docs/formatdomaincaps.html.in
+29
-1
docs/schemas/domaincaps.rng
docs/schemas/domaincaps.rng
+8
-0
src/conf/domain_capabilities.c
src/conf/domain_capabilities.c
+13
-0
src/conf/domain_capabilities.h
src/conf/domain_capabilities.h
+8
-0
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.c
+21
-1
tests/domaincapsschemadata/domaincaps-basic.xml
tests/domaincapsschemadata/domaincaps-basic.xml
+1
-0
tests/domaincapsschemadata/domaincaps-full.xml
tests/domaincapsschemadata/domaincaps-full.xml
+9
-0
tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
+7
-0
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml
+7
-0
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml
+6
-0
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml
+6
-0
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml
+6
-0
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml
+6
-0
tests/domaincapstest.c
tests/domaincapstest.c
+4
-0
未找到文件。
docs/formatdomaincaps.html.in
浏览文件 @
6da27ad1
...
@@ -175,7 +175,7 @@
...
@@ -175,7 +175,7 @@
<code>
floppy
</code>
, or
<code>
lun
</code>
.
</p>
<code>
floppy
</code>
, or
<code>
lun
</code>
.
</p>
<h4><a
name=
"elementsDisks"
>
Hard drives, floppy disks, CDROMs
</a></h4>
<h4><a
name=
"elementsDisks"
>
Hard drives, floppy disks, CDROMs
</a></h4>
<p>
Disk capabilities are exposed under
<code>
disk
</code>
element. For
<p>
Disk capabilities are exposed under
the
<code>
disk
</code>
element. For
instance:
</p>
instance:
</p>
<pre>
<pre>
...
@@ -216,6 +216,34 @@
...
@@ -216,6 +216,34 @@
element for a
<
disk/
>
.
</dd>
element for a
<
disk/
>
.
</dd>
</dl>
</dl>
<h4><a
name=
"elementsGraphics"
>
Graphical framebuffers
</a></h4>
<p>
Graphics device capabilities are exposed under the
<code>
graphics
</code>
element. For instance:
</p>
<pre>
<
domainCapabilities
>
...
<
devices
>
<
graphics supported='yes'
>
<
enum name='type'
>
<
value
>
sdl
<
/value
>
<
value
>
vnc
<
/value
>
<
value
>
spice
<
/value
>
<
/enum
>
<
/graphics
>
...
<
/devices
>
<
/domainCapabilities
>
</pre>
<dl>
<dt><code>
type
</code></dt>
<dd>
Options for the
<code>
type
</code>
attribute of the
<
graphics/
>
element.
</dd>
</dl>
<h4><a
name=
"elementsHostDev"
>
Host device assignment
</a></h4>
<h4><a
name=
"elementsHostDev"
>
Host device assignment
</a></h4>
<p>
Some host devices can be passed through to a guest (e.g. USB, PCI and
<p>
Some host devices can be passed through to a guest (e.g. USB, PCI and
SCSI). Well, only if the following is enabled:
</p>
SCSI). Well, only if the following is enabled:
</p>
...
...
docs/schemas/domaincaps.rng
浏览文件 @
6da27ad1
...
@@ -72,6 +72,7 @@
...
@@ -72,6 +72,7 @@
<element
name=
'devices'
>
<element
name=
'devices'
>
<interleave>
<interleave>
<ref
name=
'disk'
/>
<ref
name=
'disk'
/>
<ref
name=
'graphics'
/>
<ref
name=
'hostdev'
/>
<ref
name=
'hostdev'
/>
</interleave>
</interleave>
</element>
</element>
...
@@ -84,6 +85,13 @@
...
@@ -84,6 +85,13 @@
</element>
</element>
</define>
</define>
<define
name=
'graphics'
>
<element
name=
'graphics'
>
<ref
name=
'supported'
/>
<ref
name=
'enum'
/>
</element>
</define>
<define
name=
'hostdev'
>
<define
name=
'hostdev'
>
<element
name=
'hostdev'
>
<element
name=
'hostdev'
>
<ref
name=
'supported'
/>
<ref
name=
'supported'
/>
...
...
src/conf/domain_capabilities.c
浏览文件 @
6da27ad1
...
@@ -246,6 +246,18 @@ virDomainCapsDeviceDiskFormat(virBufferPtr buf,
...
@@ -246,6 +246,18 @@ virDomainCapsDeviceDiskFormat(virBufferPtr buf,
}
}
static
void
virDomainCapsDeviceGraphicsFormat
(
virBufferPtr
buf
,
virDomainCapsDeviceGraphicsPtr
const
graphics
)
{
FORMAT_PROLOGUE
(
graphics
);
ENUM_PROCESS
(
graphics
,
type
,
virDomainGraphicsTypeToString
);
FORMAT_EPILOGUE
(
graphics
);
}
static
void
static
void
virDomainCapsDeviceHostdevFormat
(
virBufferPtr
buf
,
virDomainCapsDeviceHostdevFormat
(
virBufferPtr
buf
,
virDomainCapsDeviceHostdevPtr
const
hostdev
)
virDomainCapsDeviceHostdevPtr
const
hostdev
)
...
@@ -314,6 +326,7 @@ virDomainCapsFormatInternal(virBufferPtr buf,
...
@@ -314,6 +326,7 @@ virDomainCapsFormatInternal(virBufferPtr buf,
virBufferAdjustIndent
(
buf
,
2
);
virBufferAdjustIndent
(
buf
,
2
);
virDomainCapsDeviceDiskFormat
(
buf
,
&
caps
->
disk
);
virDomainCapsDeviceDiskFormat
(
buf
,
&
caps
->
disk
);
virDomainCapsDeviceGraphicsFormat
(
buf
,
&
caps
->
graphics
);
virDomainCapsDeviceHostdevFormat
(
buf
,
&
caps
->
hostdev
);
virDomainCapsDeviceHostdevFormat
(
buf
,
&
caps
->
hostdev
);
virBufferAdjustIndent
(
buf
,
-
2
);
virBufferAdjustIndent
(
buf
,
-
2
);
...
...
src/conf/domain_capabilities.h
浏览文件 @
6da27ad1
...
@@ -69,6 +69,13 @@ struct _virDomainCapsDeviceDisk {
...
@@ -69,6 +69,13 @@ struct _virDomainCapsDeviceDisk {
/* add new fields here */
/* add new fields here */
};
};
typedef
struct
_virDomainCapsDeviceGraphics
virDomainCapsDeviceGraphics
;
typedef
virDomainCapsDeviceGraphics
*
virDomainCapsDeviceGraphicsPtr
;
struct
_virDomainCapsDeviceGraphics
{
bool
supported
;
virDomainCapsEnum
type
;
/* virDomainGraphicsType */
};
typedef
struct
_virDomainCapsDeviceHostdev
virDomainCapsDeviceHostdev
;
typedef
struct
_virDomainCapsDeviceHostdev
virDomainCapsDeviceHostdev
;
typedef
virDomainCapsDeviceHostdev
*
virDomainCapsDeviceHostdevPtr
;
typedef
virDomainCapsDeviceHostdev
*
virDomainCapsDeviceHostdevPtr
;
struct
_virDomainCapsDeviceHostdev
{
struct
_virDomainCapsDeviceHostdev
{
...
@@ -101,6 +108,7 @@ struct _virDomainCaps {
...
@@ -101,6 +108,7 @@ struct _virDomainCaps {
virDomainCapsOS
os
;
virDomainCapsOS
os
;
virDomainCapsDeviceDisk
disk
;
virDomainCapsDeviceDisk
disk
;
virDomainCapsDeviceGraphics
graphics
;
virDomainCapsDeviceHostdev
hostdev
;
virDomainCapsDeviceHostdev
hostdev
;
/* add new domain devices here */
/* add new domain devices here */
...
...
src/qemu/qemu_capabilities.c
浏览文件 @
6da27ad1
...
@@ -4170,6 +4170,23 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps,
...
@@ -4170,6 +4170,23 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps,
}
}
static
int
virQEMUCapsFillDomainDeviceGraphicsCaps
(
virQEMUCapsPtr
qemuCaps
,
virDomainCapsDeviceGraphicsPtr
dev
)
{
dev
->
supported
=
true
;
if
(
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_SDL
))
VIR_DOMAIN_CAPS_ENUM_SET
(
dev
->
type
,
VIR_DOMAIN_GRAPHICS_TYPE_SDL
);
if
(
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_VNC
))
VIR_DOMAIN_CAPS_ENUM_SET
(
dev
->
type
,
VIR_DOMAIN_GRAPHICS_TYPE_VNC
);
if
(
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_SPICE
))
VIR_DOMAIN_CAPS_ENUM_SET
(
dev
->
type
,
VIR_DOMAIN_GRAPHICS_TYPE_SPICE
);
return
0
;
}
static
int
static
int
virQEMUCapsFillDomainDeviceHostdevCaps
(
virQEMUCapsPtr
qemuCaps
,
virQEMUCapsFillDomainDeviceHostdevCaps
(
virQEMUCapsPtr
qemuCaps
,
virDomainCapsDeviceHostdevPtr
hostdev
)
virDomainCapsDeviceHostdevPtr
hostdev
)
...
@@ -4281,13 +4298,16 @@ virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps,
...
@@ -4281,13 +4298,16 @@ virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps,
virDomainCapsOSPtr
os
=
&
domCaps
->
os
;
virDomainCapsOSPtr
os
=
&
domCaps
->
os
;
virDomainCapsDeviceDiskPtr
disk
=
&
domCaps
->
disk
;
virDomainCapsDeviceDiskPtr
disk
=
&
domCaps
->
disk
;
virDomainCapsDeviceHostdevPtr
hostdev
=
&
domCaps
->
hostdev
;
virDomainCapsDeviceHostdevPtr
hostdev
=
&
domCaps
->
hostdev
;
virDomainCapsDeviceGraphicsPtr
graphics
=
&
domCaps
->
graphics
;
int
maxvcpus
=
virQEMUCapsGetMachineMaxCpus
(
qemuCaps
,
domCaps
->
machine
);
int
maxvcpus
=
virQEMUCapsGetMachineMaxCpus
(
qemuCaps
,
domCaps
->
machine
);
domCaps
->
maxvcpus
=
maxvcpus
;
domCaps
->
maxvcpus
=
maxvcpus
;
if
(
virQEMUCapsFillDomainOSCaps
(
qemuCaps
,
os
,
if
(
virQEMUCapsFillDomainOSCaps
(
qemuCaps
,
os
,
loader
,
nloader
)
<
0
||
loader
,
nloader
)
<
0
||
virQEMUCapsFillDomainDeviceDiskCaps
(
qemuCaps
,
domCaps
->
machine
,
disk
)
<
0
||
virQEMUCapsFillDomainDeviceDiskCaps
(
qemuCaps
,
domCaps
->
machine
,
disk
)
<
0
||
virQEMUCapsFillDomainDeviceGraphicsCaps
(
qemuCaps
,
graphics
)
<
0
||
virQEMUCapsFillDomainDeviceHostdevCaps
(
qemuCaps
,
hostdev
)
<
0
||
virQEMUCapsFillDomainDeviceHostdevCaps
(
qemuCaps
,
hostdev
)
<
0
||
virQEMUCapsFillDomainFeatureGICCaps
(
qemuCaps
,
domCaps
)
<
0
)
virQEMUCapsFillDomainFeatureGICCaps
(
qemuCaps
,
domCaps
)
<
0
)
return
-
1
;
return
-
1
;
...
...
tests/domaincapsschemadata/domaincaps-basic.xml
浏览文件 @
6da27ad1
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<os
supported=
'no'
/>
<os
supported=
'no'
/>
<devices>
<devices>
<disk
supported=
'no'
/>
<disk
supported=
'no'
/>
<graphics
supported=
'no'
/>
<hostdev
supported=
'no'
/>
<hostdev
supported=
'no'
/>
</devices>
</devices>
<features>
<features>
...
...
tests/domaincapsschemadata/domaincaps-full.xml
浏览文件 @
6da27ad1
...
@@ -39,6 +39,15 @@
...
@@ -39,6 +39,15 @@
<value>
sd
</value>
<value>
sd
</value>
</enum>
</enum>
</disk>
</disk>
<graphics
supported=
'yes'
>
<enum
name=
'type'
>
<value>
sdl
</value>
<value>
vnc
</value>
<value>
rdp
</value>
<value>
desktop
</value>
<value>
spice
</value>
</enum>
</graphics>
<hostdev
supported=
'yes'
>
<hostdev
supported=
'yes'
>
<enum
name=
'mode'
>
<enum
name=
'mode'
>
<value>
subsystem
</value>
<value>
subsystem
</value>
...
...
tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
浏览文件 @
6da27ad1
...
@@ -34,6 +34,13 @@
...
@@ -34,6 +34,13 @@
<value>
usb
</value>
<value>
usb
</value>
</enum>
</enum>
</disk>
</disk>
<graphics
supported=
'yes'
>
<enum
name=
'type'
>
<value>
sdl
</value>
<value>
vnc
</value>
<value>
spice
</value>
</enum>
</graphics>
<hostdev
supported=
'yes'
>
<hostdev
supported=
'yes'
>
<enum
name=
'mode'
>
<enum
name=
'mode'
>
<value>
subsystem
</value>
<value>
subsystem
</value>
...
...
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-1.xml
浏览文件 @
6da27ad1
...
@@ -34,6 +34,13 @@
...
@@ -34,6 +34,13 @@
<value>
usb
</value>
<value>
usb
</value>
</enum>
</enum>
</disk>
</disk>
<graphics
supported=
'yes'
>
<enum
name=
'type'
>
<value>
sdl
</value>
<value>
vnc
</value>
<value>
spice
</value>
</enum>
</graphics>
<hostdev
supported=
'yes'
>
<hostdev
supported=
'yes'
>
<enum
name=
'mode'
>
<enum
name=
'mode'
>
<value>
subsystem
</value>
<value>
subsystem
</value>
...
...
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-2.xml
浏览文件 @
6da27ad1
...
@@ -34,6 +34,12 @@
...
@@ -34,6 +34,12 @@
<value>
usb
</value>
<value>
usb
</value>
</enum>
</enum>
</disk>
</disk>
<graphics
supported=
'yes'
>
<enum
name=
'type'
>
<value>
sdl
</value>
<value>
vnc
</value>
</enum>
</graphics>
<hostdev
supported=
'yes'
>
<hostdev
supported=
'yes'
>
<enum
name=
'mode'
>
<enum
name=
'mode'
>
<value>
subsystem
</value>
<value>
subsystem
</value>
...
...
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-3.xml
浏览文件 @
6da27ad1
...
@@ -34,6 +34,12 @@
...
@@ -34,6 +34,12 @@
<value>
usb
</value>
<value>
usb
</value>
</enum>
</enum>
</disk>
</disk>
<graphics
supported=
'yes'
>
<enum
name=
'type'
>
<value>
sdl
</value>
<value>
vnc
</value>
</enum>
</graphics>
<hostdev
supported=
'yes'
>
<hostdev
supported=
'yes'
>
<enum
name=
'mode'
>
<enum
name=
'mode'
>
<value>
subsystem
</value>
<value>
subsystem
</value>
...
...
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-4.xml
浏览文件 @
6da27ad1
...
@@ -34,6 +34,12 @@
...
@@ -34,6 +34,12 @@
<value>
usb
</value>
<value>
usb
</value>
</enum>
</enum>
</disk>
</disk>
<graphics
supported=
'yes'
>
<enum
name=
'type'
>
<value>
sdl
</value>
<value>
vnc
</value>
</enum>
</graphics>
<hostdev
supported=
'yes'
>
<hostdev
supported=
'yes'
>
<enum
name=
'mode'
>
<enum
name=
'mode'
>
<value>
subsystem
</value>
<value>
subsystem
</value>
...
...
tests/domaincapsschemadata/domaincaps-qemu_2.6.0-5.xml
浏览文件 @
6da27ad1
...
@@ -32,6 +32,12 @@
...
@@ -32,6 +32,12 @@
<value>
usb
</value>
<value>
usb
</value>
</enum>
</enum>
</disk>
</disk>
<graphics
supported=
'yes'
>
<enum
name=
'type'
>
<value>
sdl
</value>
<value>
vnc
</value>
</enum>
</graphics>
<hostdev
supported=
'yes'
>
<hostdev
supported=
'yes'
>
<enum
name=
'mode'
>
<enum
name=
'mode'
>
<value>
subsystem
</value>
<value>
subsystem
</value>
...
...
tests/domaincapstest.c
浏览文件 @
6da27ad1
...
@@ -61,6 +61,7 @@ fillAllCaps(virDomainCapsPtr domCaps)
...
@@ -61,6 +61,7 @@ fillAllCaps(virDomainCapsPtr domCaps)
virDomainCapsOSPtr
os
=
&
domCaps
->
os
;
virDomainCapsOSPtr
os
=
&
domCaps
->
os
;
virDomainCapsLoaderPtr
loader
=
&
os
->
loader
;
virDomainCapsLoaderPtr
loader
=
&
os
->
loader
;
virDomainCapsDeviceDiskPtr
disk
=
&
domCaps
->
disk
;
virDomainCapsDeviceDiskPtr
disk
=
&
domCaps
->
disk
;
virDomainCapsDeviceGraphicsPtr
graphics
=
&
domCaps
->
graphics
;
virDomainCapsDeviceHostdevPtr
hostdev
=
&
domCaps
->
hostdev
;
virDomainCapsDeviceHostdevPtr
hostdev
=
&
domCaps
->
hostdev
;
domCaps
->
maxvcpus
=
255
;
domCaps
->
maxvcpus
=
255
;
...
@@ -79,6 +80,9 @@ fillAllCaps(virDomainCapsPtr domCaps)
...
@@ -79,6 +80,9 @@ fillAllCaps(virDomainCapsPtr domCaps)
SET_ALL_BITS
(
disk
->
diskDevice
);
SET_ALL_BITS
(
disk
->
diskDevice
);
SET_ALL_BITS
(
disk
->
bus
);
SET_ALL_BITS
(
disk
->
bus
);
graphics
->
supported
=
true
;
SET_ALL_BITS
(
graphics
->
type
);
hostdev
->
supported
=
true
;
hostdev
->
supported
=
true
;
SET_ALL_BITS
(
hostdev
->
mode
);
SET_ALL_BITS
(
hostdev
->
mode
);
SET_ALL_BITS
(
hostdev
->
startupPolicy
);
SET_ALL_BITS
(
hostdev
->
startupPolicy
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录