Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
7842e544
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看板
提交
7842e544
编写于
5月 25, 2010
作者:
C
Cole Robinson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xen: Remove unused function
Signed-off-by:
N
Cole Robinson
<
crobinso@redhat.com
>
上级
07f6c3a9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
229 deletion
+0
-229
src/xen/xend_internal.c
src/xen/xend_internal.c
+0
-223
src/xen/xend_internal.h
src/xen/xend_internal.h
+0
-6
未找到文件。
src/xen/xend_internal.c
浏览文件 @
7842e544
...
...
@@ -1204,229 +1204,6 @@ no_memory:
return
-
1
;
}
int
xend_parse_sexp_desc_char
(
virBufferPtr
buf
,
const
char
*
devtype
,
int
portNum
,
const
char
*
value
,
const
char
*
tty
)
{
const
char
*
type
;
int
telnet
=
0
;
char
*
bindPort
=
NULL
;
char
*
bindHost
=
NULL
;
char
*
connectPort
=
NULL
;
char
*
connectHost
=
NULL
;
char
*
path
=
NULL
;
int
ret
=
-
1
;
if
(
value
[
0
]
==
'/'
)
{
type
=
"dev"
;
}
else
if
(
STRPREFIX
(
value
,
"null"
))
{
type
=
"null"
;
value
=
NULL
;
}
else
if
(
STRPREFIX
(
value
,
"vc"
))
{
type
=
"vc"
;
value
=
NULL
;
}
else
if
(
STRPREFIX
(
value
,
"pty"
))
{
type
=
"pty"
;
value
=
NULL
;
}
else
if
(
STRPREFIX
(
value
,
"stdio"
))
{
type
=
"stdio"
;
value
=
NULL
;
}
else
if
(
STRPREFIX
(
value
,
"file:"
))
{
type
=
"file"
;
value
+=
sizeof
(
"file:"
)
-
1
;
}
else
if
(
STRPREFIX
(
value
,
"pipe:"
))
{
type
=
"pipe"
;
value
+=
sizeof
(
"pipe:"
)
-
1
;
}
else
if
(
STRPREFIX
(
value
,
"tcp:"
))
{
type
=
"tcp"
;
value
+=
sizeof
(
"tcp:"
)
-
1
;
}
else
if
(
STRPREFIX
(
value
,
"telnet:"
))
{
type
=
"tcp"
;
value
+=
sizeof
(
"telnet:"
)
-
1
;
telnet
=
1
;
}
else
if
(
STRPREFIX
(
value
,
"udp:"
))
{
type
=
"udp"
;
value
+=
sizeof
(
"udp:"
)
-
1
;
}
else
if
(
STRPREFIX
(
value
,
"unix:"
))
{
type
=
"unix"
;
value
+=
sizeof
(
"unix:"
)
-
1
;
}
else
{
virXendError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"Unknown char device type"
));
return
-
1
;
}
/* Compat with legacy <console tty='/dev/pts/5'/> syntax */
if
(
STREQ
(
devtype
,
"console"
)
&&
STREQ
(
type
,
"pty"
)
&&
tty
!=
NULL
)
{
virBufferVSprintf
(
buf
,
" <%s type='%s' tty='%s'>
\n
"
,
devtype
,
type
,
tty
);
}
else
{
virBufferVSprintf
(
buf
,
" <%s type='%s'>
\n
"
,
devtype
,
type
);
}
if
(
STREQ
(
type
,
"null"
)
||
STREQ
(
type
,
"vc"
)
||
STREQ
(
type
,
"stdio"
))
{
/* no source needed */
}
else
if
(
STREQ
(
type
,
"pty"
))
{
if
(
tty
)
virBufferVSprintf
(
buf
,
" <source path='%s'/>
\n
"
,
tty
);
}
else
if
(
STREQ
(
type
,
"file"
)
||
STREQ
(
type
,
"pipe"
))
{
virBufferVSprintf
(
buf
,
" <source path='%s'/>
\n
"
,
value
);
}
else
if
(
STREQ
(
type
,
"tcp"
))
{
sa_assert
(
value
);
const
char
*
offset
=
strchr
(
value
,
':'
);
const
char
*
offset2
;
const
char
*
mode
,
*
protocol
;
if
(
offset
==
NULL
)
{
virXendError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"malformed char device string"
));
goto
error
;
}
if
(
offset
!=
value
&&
(
bindHost
=
strndup
(
value
,
offset
-
value
))
==
NULL
)
goto
no_memory
;
offset2
=
strchr
(
offset
,
','
);
if
(
offset2
==
NULL
)
bindPort
=
strdup
(
offset
+
1
);
else
bindPort
=
strndup
(
offset
+
1
,
offset2
-
(
offset
+
1
));
if
(
bindPort
==
NULL
)
goto
no_memory
;
if
(
offset2
&&
strstr
(
offset2
,
",listen"
))
mode
=
"bind"
;
else
mode
=
"connect"
;
protocol
=
telnet
?
"telnet"
:
"raw"
;
if
(
bindHost
)
{
virBufferVSprintf
(
buf
,
" <source mode='%s' host='%s' service='%s'/>
\n
"
,
mode
,
bindHost
,
bindPort
);
}
else
{
virBufferVSprintf
(
buf
,
" <source mode='%s' service='%s'/>
\n
"
,
mode
,
bindPort
);
}
virBufferVSprintf
(
buf
,
" <protocol type='%s'/>
\n
"
,
protocol
);
}
else
if
(
STREQ
(
type
,
"udp"
))
{
sa_assert
(
value
);
const
char
*
offset
=
strchr
(
value
,
':'
);
const
char
*
offset2
,
*
offset3
;
if
(
offset
==
NULL
)
{
virXendError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"malformed char device string"
));
goto
error
;
}
if
(
offset
!=
value
&&
(
connectHost
=
strndup
(
value
,
offset
-
value
))
==
NULL
)
goto
no_memory
;
offset2
=
strchr
(
offset
,
'@'
);
if
(
offset2
!=
NULL
)
{
if
((
connectPort
=
strndup
(
offset
+
1
,
offset2
-
(
offset
+
1
)))
==
NULL
)
goto
no_memory
;
offset3
=
strchr
(
offset2
,
':'
);
if
(
offset3
==
NULL
)
{
virXendError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"malformed char device string"
));
goto
error
;
}
if
(
offset3
>
(
offset2
+
1
)
&&
(
bindHost
=
strndup
(
offset2
+
1
,
offset3
-
(
offset2
+
1
)))
==
NULL
)
goto
no_memory
;
if
((
bindPort
=
strdup
(
offset3
+
1
))
==
NULL
)
goto
no_memory
;
}
else
{
if
((
connectPort
=
strdup
(
offset
+
1
))
==
NULL
)
goto
no_memory
;
}
if
(
connectHost
)
{
virBufferVSprintf
(
buf
,
" <source mode='connect' host='%s' service='%s'/>
\n
"
,
connectHost
,
connectPort
);
}
else
{
virBufferVSprintf
(
buf
,
" <source mode='connect' service='%s'/>
\n
"
,
connectPort
);
}
if
(
bindPort
)
{
if
(
bindHost
)
{
virBufferVSprintf
(
buf
,
" <source mode='bind' host='%s' service='%s'/>
\n
"
,
bindHost
,
bindPort
);
}
else
{
virBufferVSprintf
(
buf
,
" <source mode='bind' service='%s'/>
\n
"
,
bindPort
);
}
}
}
else
if
(
STREQ
(
type
,
"unix"
))
{
sa_assert
(
value
);
const
char
*
offset
=
strchr
(
value
,
','
);
int
dolisten
=
0
;
if
(
offset
)
path
=
strndup
(
value
,
(
offset
-
value
));
else
path
=
strdup
(
value
);
if
(
path
==
NULL
)
goto
no_memory
;
if
(
offset
!=
NULL
&&
strstr
(
offset
,
",listen"
)
!=
NULL
)
dolisten
=
1
;
virBufferVSprintf
(
buf
,
" <source mode='%s' path='%s'/>
\n
"
,
dolisten
?
"bind"
:
"connect"
,
path
);
}
virBufferVSprintf
(
buf
,
" <target port='%d'/>
\n
"
,
portNum
);
virBufferVSprintf
(
buf
,
" </%s>
\n
"
,
devtype
);
ret
=
0
;
if
(
ret
==
-
1
)
{
no_memory:
virReportOOMError
();
}
error:
VIR_FREE
(
path
);
VIR_FREE
(
bindHost
);
VIR_FREE
(
bindPort
);
VIR_FREE
(
connectHost
);
VIR_FREE
(
connectPort
);
return
ret
;
}
virDomainChrDefPtr
xenDaemonParseSxprChar
(
const
char
*
value
,
const
char
*
tty
)
...
...
src/xen/xend_internal.h
浏览文件 @
7842e544
...
...
@@ -96,12 +96,6 @@ xenDaemonDomainFetch(virConnectPtr xend,
const
char
*
name
,
const
char
*
cpus
);
int
xend_parse_sexp_desc_char
(
virBufferPtr
buf
,
const
char
*
devtype
,
int
portNum
,
const
char
*
value
,
const
char
*
tty
);
virDomainDefPtr
xenDaemonParseSxprString
(
virConnectPtr
conn
,
const
char
*
sexpr
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录