Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
76ee9256
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看板
提交
76ee9256
编写于
5月 02, 2016
作者:
P
Pavel Hrdina
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
graphics: use enums instead of int
Signed-off-by:
N
Pavel Hrdina
<
phrdina@redhat.com
>
上级
fb377701
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
43 addition
and
16 deletion
+43
-16
src/conf/domain_conf.c
src/conf/domain_conf.c
+10
-5
src/conf/domain_conf.h
src/conf/domain_conf.h
+7
-7
src/libxl/libxl_conf.c
src/libxl/libxl_conf.c
+8
-0
src/qemu/qemu_command.c
src/qemu/qemu_command.c
+14
-2
src/qemu/qemu_hotplug.c
src/qemu/qemu_hotplug.c
+1
-1
src/xenconfig/xen_sxpr.c
src/xenconfig/xen_sxpr.c
+3
-1
未找到文件。
src/conf/domain_conf.c
浏览文件 @
76ee9256
...
...
@@ -1240,7 +1240,7 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def)
if (!def)
return;
switch (
(virDomainGraphicsType)
def->type) {
switch (def->type) {
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
VIR_FREE(def->data.vnc.socket);
VIR_FREE(def->data.vnc.keymap);
...
...
@@ -10650,7 +10650,7 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def,
char *address = virXMLPropString(node, "address");
char *network = virXMLPropString(node, "network");
char *fromConfig = virXMLPropString(node, "fromConfig");
int tmp;
int tmp
, typeVal
;
if (!type) {
virReportError(VIR_ERR_XML_ERROR, "%s",
...
...
@@ -10658,11 +10658,12 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def,
goto error;
}
if ((
def->type
= virDomainGraphicsListenTypeFromString(type)) < 0) {
if ((
typeVal
= virDomainGraphicsListenTypeFromString(type)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown graphics listen type '%s'"), type);
goto error;
}
def->type = typeVal;
/* address is recognized if either type='address', or if
* type='network' and we're looking at live XML (i.e. *not*
...
...
@@ -11288,6 +11289,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
{
virDomainGraphicsDefPtr def;
char *type = NULL;
int typeVal;
if (VIR_ALLOC(def) < 0)
return NULL;
...
...
@@ -11299,13 +11301,14 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
goto error;
}
if ((
def->type
= virDomainGraphicsTypeFromString(type)) < 0) {
if ((
typeVal
= virDomainGraphicsTypeFromString(type)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown graphics device type '%s'"), type);
goto error;
}
def->type = typeVal;
switch (
(virDomainGraphicsType)
def->type) {
switch (def->type) {
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
if (virDomainGraphicsDefParseXMLVNC(def, node, ctxt, flags) < 0)
goto error;
...
...
@@ -21519,6 +21522,8 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
virDomainGraphicsAuthDefFormatAttr(buf, &def->data.spice.auth, flags);
break;
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
for (i = 0; i < def->nListens; i++) {
...
...
src/conf/domain_conf.h
浏览文件 @
76ee9256
...
...
@@ -1552,7 +1552,7 @@ typedef enum {
typedef
struct
_virDomainGraphicsListenDef
virDomainGraphicsListenDef
;
typedef
virDomainGraphicsListenDef
*
virDomainGraphicsListenDefPtr
;
struct
_virDomainGraphicsListenDef
{
int
type
;
/* enum virDomainGraphicsListenType */
virDomainGraphicsListenType
type
;
char
*
address
;
char
*
network
;
bool
fromConfig
;
/* true if the @address is config file originated */
...
...
@@ -1564,7 +1564,7 @@ struct _virDomainGraphicsDef {
* Value 0 means port wasn't specified in XML at all.
* Positive value is actual port number given in XML.
*/
int
type
;
virDomainGraphicsType
type
;
union
{
struct
{
int
port
;
...
...
@@ -1597,20 +1597,20 @@ struct _virDomainGraphicsDef {
int
tlsPort
;
bool
portReserved
;
bool
tlsPortReserved
;
int
mousemode
;
virDomainGraphicsSpiceMouseMode
mousemode
;
char
*
keymap
;
virDomainGraphicsAuthDef
auth
;
bool
autoport
;
int
channels
[
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST
];
int
defaultMode
;
/* enum virDomainGraphicsSpiceChannelMode */
virDomainGraphicsSpiceChannelMode
defaultMode
;
int
image
;
int
jpeg
;
int
zlib
;
int
playback
;
int
streaming
;
int
copypaste
;
/* enum virTristateBool */
int
filetransfer
;
/* enum virTristateBool */
int
gl
;
/* enum virTristateBool */
virTristateBool
copypaste
;
virTristateBool
filetransfer
;
virTristateBool
gl
;
}
spice
;
}
data
;
/* nListens, listens, and *port are only useful if type is vnc,
...
...
src/libxl/libxl_conf.c
浏览文件 @
76ee9256
...
...
@@ -1463,6 +1463,12 @@ libxlMakeVfb(virPortAllocatorPtr graphicsports,
if
(
VIR_STRDUP
(
x_vfb
->
keymap
,
l_vfb
->
data
.
vnc
.
keymap
)
<
0
)
return
-
1
;
break
;
case
VIR_DOMAIN_GRAPHICS_TYPE_RDP
:
case
VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP
:
case
VIR_DOMAIN_GRAPHICS_TYPE_SPICE
:
case
VIR_DOMAIN_GRAPHICS_TYPE_LAST
:
break
;
}
return
0
;
...
...
@@ -1579,6 +1585,8 @@ libxlMakeBuildInfoVfb(virPortAllocatorPtr graphicsports,
case
VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER
:
libxl_defbool_set
(
&
b_info
->
u
.
hvm
.
spice
.
agent_mouse
,
false
);
break
;
case
VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_LAST
:
break
;
}
#ifdef LIBXL_HAVE_SPICE_VDAGENT
...
...
src/qemu/qemu_command.c
浏览文件 @
76ee9256
...
...
@@ -7445,6 +7445,10 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
if
(
VIR_STRDUP
(
gListen
->
address
,
netAddr
)
<
0
)
goto
error
;
break
;
case
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE
:
case
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST
:
break
;
}
}
...
...
@@ -7602,6 +7606,10 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
if
(
VIR_STRDUP
(
gListen
->
address
,
listenAddr
)
<
0
)
goto
error
;
break
;
case
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE
:
case
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST
:
break
;
}
}
...
...
@@ -7727,7 +7735,7 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
}
}
if
(
graphics
->
data
.
spice
.
gl
==
VIR_TRISTATE_
SWITCH_ON
)
{
if
(
graphics
->
data
.
spice
.
gl
==
VIR_TRISTATE_
BOOL_YES
)
{
if
(
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_SPICE_GL
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"This QEMU doesn't support spice OpenGL"
));
...
...
@@ -7782,7 +7790,7 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr cfg,
virDomainGraphicsDefPtr
graphics
,
const
char
*
domainLibDir
)
{
switch
(
(
virDomainGraphicsType
)
graphics
->
type
)
{
switch
(
graphics
->
type
)
{
case
VIR_DOMAIN_GRAPHICS_TYPE_SDL
:
if
(
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_SDL
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
...
...
@@ -9320,6 +9328,10 @@ qemuBuildCommandLineValidate(virQEMUDriverPtr driver,
case
VIR_DOMAIN_GRAPHICS_TYPE_SPICE
:
++
spice
;
break
;
case
VIR_DOMAIN_GRAPHICS_TYPE_RDP
:
case
VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP
:
case
VIR_DOMAIN_GRAPHICS_TYPE_LAST
:
break
;
}
}
...
...
src/qemu/qemu_hotplug.c
浏览文件 @
76ee9256
...
...
@@ -2633,7 +2633,7 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver,
goto
cleanup
;
}
switch
(
(
virDomainGraphicsListenType
)
newlisten
->
type
)
{
switch
(
newlisten
->
type
)
{
case
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS
:
if
(
STRNEQ_NULLABLE
(
newlisten
->
address
,
oldlisten
->
address
))
{
virReportError
(
VIR_ERR_OPERATION_UNSUPPORTED
,
"%s"
,
...
...
src/xenconfig/xen_sxpr.c
浏览文件 @
76ee9256
...
...
@@ -929,6 +929,7 @@ xenParseSxprGraphicsNew(virDomainDefPtr def,
virDomainGraphicsDefPtr
graphics
=
NULL
;
const
struct
sexpr
*
cur
,
*
node
;
const
char
*
tmp
;
int
typeVal
;
/* append network devices and framebuffer */
for
(
cur
=
root
;
cur
->
kind
==
SEXPR_CONS
;
cur
=
cur
->
u
.
s
.
cdr
)
{
...
...
@@ -949,11 +950,12 @@ xenParseSxprGraphicsNew(virDomainDefPtr def,
if
(
VIR_ALLOC
(
graphics
)
<
0
)
goto
error
;
if
((
graphics
->
type
=
virDomainGraphicsTypeFromString
(
tmp
))
<
0
)
{
if
((
typeVal
=
virDomainGraphicsTypeFromString
(
tmp
))
<
0
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"unknown graphics type '%s'"
),
tmp
);
goto
error
;
}
graphics
->
type
=
typeVal
;
if
(
graphics
->
type
==
VIR_DOMAIN_GRAPHICS_TYPE_SDL
)
{
const
char
*
display
=
sexpr_node
(
node
,
"device/vfb/display"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录