Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
84b5415c
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,发现更多精彩内容 >>
提交
84b5415c
编写于
9月 29, 2007
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow empty bootloader tag
上级
fb741174
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
73 addition
and
6 deletion
+73
-6
ChangeLog
ChangeLog
+6
-0
src/sexpr.c
src/sexpr.c
+53
-5
src/sexpr.h
src/sexpr.h
+1
-0
src/xend_internal.c
src/xend_internal.c
+5
-1
src/xml.c
src/xml.c
+8
-0
未找到文件。
ChangeLog
浏览文件 @
84b5415c
Sat Sep 29 14:23:41 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/sexpr.h, src/sexpr.c, src/xml.c, src/xend_internal.c: Allow
bootloader tag to be empty, to indicate use of default configured
bootloader path.
Sat Sep 29 14:05:41 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/sexpr.h, src/sexpr.c, src/virsh.c, src/xend_internal.c:
...
...
src/sexpr.c
浏览文件 @
84b5415c
...
...
@@ -404,17 +404,18 @@ string2sexpr(const char *buffer)
/**
* sexpr_lookup:
* sexpr_lookup
_key
:
* @sexpr: a pointer to a parsed S-Expression
* @node: a path for the sub expression to lookup in the S-Expression
*
* Search a sub expression in the S-Expression based on its path
* Returns the key node, rather than the data node.
* NOTE: path are limited to 4096 bytes.
*
* Returns the pointer to the sub expression or NULL if not found.
*/
struct
sexpr
*
sexpr_lookup
(
struct
sexpr
*
sexpr
,
const
char
*
node
)
st
atic
st
ruct
sexpr
*
sexpr_lookup
_key
(
struct
sexpr
*
sexpr
,
const
char
*
node
)
{
char
buffer
[
4096
],
*
ptr
,
*
token
;
...
...
@@ -463,10 +464,57 @@ sexpr_lookup(struct sexpr *sexpr, const char *node)
return
NULL
;
}
if
(
sexpr
->
kind
!=
SEXPR_CONS
||
sexpr
->
u
.
s
.
cdr
->
kind
!=
SEXPR_CONS
)
return
sexpr
;
}
/**
* sexpr_lookup:
* @sexpr: a pointer to a parsed S-Expression
* @node: a path for the sub expression to lookup in the S-Expression
*
* Search a sub expression in the S-Expression based on its path.
* NOTE: path are limited to 4096 bytes.
*
* Returns the pointer to the sub expression or NULL if not found.
*/
struct
sexpr
*
sexpr_lookup
(
struct
sexpr
*
sexpr
,
const
char
*
node
)
{
struct
sexpr
*
s
=
sexpr_lookup_key
(
sexpr
,
node
);
if
(
s
==
NULL
)
return
NULL
;
return
sexpr
->
u
.
s
.
cdr
;
if
(
s
->
kind
!=
SEXPR_CONS
||
s
->
u
.
s
.
cdr
->
kind
!=
SEXPR_CONS
)
return
NULL
;
return
s
->
u
.
s
.
cdr
;
}
/**
* sexpr_has:
* @sexpr: a pointer to a parsed S-Expression
* @node: a path for the sub expression to lookup in the S-Expression
*
* Search a sub expression in the S-Expression based on its path.
* NOTE: path are limited to 4096 bytes.
* NB, even if the key was found sexpr_lookup may return NULL if
* the corresponding value was empty
*
* Returns true if the key was found, false otherwise
*/
int
sexpr_has
(
struct
sexpr
*
sexpr
,
const
char
*
node
)
{
struct
sexpr
*
s
=
sexpr_lookup_key
(
sexpr
,
node
);
if
(
s
==
NULL
)
return
0
;
if
(
s
->
kind
!=
SEXPR_CONS
)
return
0
;
return
1
;
}
/**
...
...
src/sexpr.h
浏览文件 @
84b5415c
...
...
@@ -50,4 +50,5 @@ const char *sexpr_node(struct sexpr *sexpr, const char *node);
const
char
*
sexpr_fmt_node
(
struct
sexpr
*
sexpr
,
const
char
*
fmt
,
...)
ATTRIBUTE_FORMAT
(
printf
,
2
,
3
);
struct
sexpr
*
sexpr_lookup
(
struct
sexpr
*
sexpr
,
const
char
*
node
);
int
sexpr_has
(
struct
sexpr
*
sexpr
,
const
char
*
node
);
#endif
src/xend_internal.c
浏览文件 @
84b5415c
...
...
@@ -1402,6 +1402,9 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
if
(
tmp
!=
NULL
)
{
bootloader
=
1
;
virBufferVSprintf
(
&
buf
,
" <bootloader>%s</bootloader>
\n
"
,
tmp
);
}
else
if
(
sexpr_has
(
root
,
"domain/bootloader"
))
{
bootloader
=
1
;
virBufferVSprintf
(
&
buf
,
" <bootloader/>
\n
"
);
}
tmp
=
sexpr_node
(
root
,
"domain/bootloader_args"
);
if
(
tmp
!=
NULL
&&
bootloader
)
{
...
...
@@ -1414,7 +1417,8 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
if
(
domid
!=
0
)
{
if
(
sexpr_lookup
(
root
,
"domain/image"
))
{
hvm
=
sexpr_lookup
(
root
,
"domain/image/hvm"
)
?
1
:
0
;
xend_parse_sexp_desc_os
(
conn
,
root
,
&
buf
,
hvm
,
bootloader
);
if
(
xend_parse_sexp_desc_os
(
conn
,
root
,
&
buf
,
hvm
,
bootloader
)
<
0
)
goto
error
;
}
}
...
...
src/xml.c
浏览文件 @
84b5415c
...
...
@@ -1179,6 +1179,14 @@ virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name, int
*/
bootloader
=
1
;
free
(
str
);
}
else
if
(
virXPathNumber
(
"count(/domain/bootloader)"
,
ctxt
,
&
f
)
==
0
&&
(
f
>
0
))
{
virBufferVSprintf
(
&
buf
,
"(bootloader)"
);
/*
* if using a bootloader, the kernel and initrd strings are not
* significant and should be discarded
*/
bootloader
=
1
;
}
str
=
virXPathString
(
"string(/domain/bootloader_args[1])"
,
ctxt
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录