Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
4e7b9aa2
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,发现更多精彩内容 >>
提交
4e7b9aa2
编写于
9月 14, 2006
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Ensure we strip the :disk postfix from disks in Xen 3.0.3
上级
1ed4d292
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
53 addition
and
20 deletion
+53
-20
ChangeLog
ChangeLog
+13
-0
src/xend_internal.c
src/xend_internal.c
+27
-7
src/xml.c
src/xml.c
+4
-4
tests/sexpr2xmldata/sexpr2xml-fv-v2.sexpr
tests/sexpr2xmldata/sexpr2xml-fv-v2.sexpr
+1
-1
tests/sexpr2xmltest.c
tests/sexpr2xmltest.c
+2
-2
tests/virshtest.c
tests/virshtest.c
+2
-2
tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr
tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr
+1
-1
tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr
tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr
+1
-1
tests/xml2sexprtest.c
tests/xml2sexprtest.c
+2
-2
未找到文件。
ChangeLog
浏览文件 @
4e7b9aa2
Thu Sep 14 10:33:23 EDT 2006 Daniel Berrange <berrange@redhat.com>
* src/xml.c: Append :disk for normal disk devices being created
when Xen >= 3.0.3, even though its technically optional
* src/xend_internal.c: Strip the :disk trailing component when
generating XML when Xen >= 3.0.3. We don't want to expose
that postfix in the <target> element, since its already set in
the device attribute on <disk> element.
* tests/sexpr2xmldata/*, tests/xml2sexprdata/*: Update to test
for handling of :disk postfix in sexpr/XML
* tests/virshtest.c, tests/sexpr2xmltest.c, tests/xml2sexprtest.c:
Cast size_t arg to an int to avoid format warnings from printf
Tue Sep 11 20:37:28 EDT 2006 Daniel Berrange <berrange@redhat.com>
Tue Sep 11 20:37:28 EDT 2006 Daniel Berrange <berrange@redhat.com>
* src/xml.c: Added support for setting VNC port when creating
* src/xml.c: Added support for setting VNC port when creating
...
...
src/xend_internal.c
浏览文件 @
4e7b9aa2
...
@@ -1566,12 +1566,18 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
...
@@ -1566,12 +1566,18 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
}
}
if
(
!
strncmp
(
dst
,
"ioemu:"
,
6
))
if
(
!
strncmp
(
dst
,
"ioemu:"
,
6
))
dst
+=
6
;
dst
+=
6
;
/* New style
cdrom
config from Xen >= 3.0.3 */
/* New style
disk
config from Xen >= 3.0.3 */
if
(
xendConfigVersion
>
1
)
{
if
(
xendConfigVersion
>
1
)
{
char
*
offset
=
rindex
(
dst
,
':'
);
char
*
offset
=
rindex
(
dst
,
':'
);
if
(
offset
&&
!
strcmp
(
offset
,
":cdrom"
))
{
if
(
offset
)
{
offset
[
0
]
=
'\0'
;
if
(
!
strcmp
(
offset
,
":cdrom"
))
{
cdrom
=
1
;
cdrom
=
1
;
}
else
if
(
!
strcmp
(
offset
,
":disk"
))
{
/* defualt anyway */
}
else
{
/* Unknown, lets pretend its a disk */
}
offset
[
0
]
=
'\0'
;
}
}
}
}
...
@@ -1599,9 +1605,15 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
...
@@ -1599,9 +1605,15 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
/* New style cdrom config from Xen >= 3.0.3 */
/* New style cdrom config from Xen >= 3.0.3 */
if
(
xendConfigVersion
>
1
)
{
if
(
xendConfigVersion
>
1
)
{
char
*
offset
=
rindex
(
dst
,
':'
);
char
*
offset
=
rindex
(
dst
,
':'
);
if
(
offset
&&
!
strcmp
(
offset
,
":cdrom"
))
{
if
(
offset
)
{
offset
[
0
]
=
'\0'
;
if
(
!
strcmp
(
offset
,
":cdrom"
))
{
cdrom
=
1
;
cdrom
=
1
;
}
else
if
(
!
strcmp
(
offset
,
":disk"
))
{
/* defualt anyway */
}
else
{
/* Unknown, lets pretend its a disk */
}
offset
[
0
]
=
'\0'
;
}
}
}
}
...
@@ -2850,3 +2862,11 @@ xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc,
...
@@ -2850,3 +2862,11 @@ xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc,
}
}
#endif
/* ! PROXY */
#endif
/* ! PROXY */
/*
* Local variables:
* indent-tabs-mode: nil
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 4
* End:
*/
src/xml.c
浏览文件 @
4e7b9aa2
...
@@ -973,15 +973,15 @@ virDomainParseXMLDiskDesc(xmlNodePtr node, virBufferPtr buf, int hvm, int xendCo
...
@@ -973,15 +973,15 @@ virDomainParseXMLDiskDesc(xmlNodePtr node, virBufferPtr buf, int hvm, int xendCo
* under the hvm (image (os)) block
* under the hvm (image (os)) block
*/
*/
if
(
hvm
&&
if
(
hvm
&&
device
&&
device
&&
!
strcmp
((
const
char
*
)
device
,
"floppy"
))
{
!
strcmp
((
const
char
*
)
device
,
"floppy"
))
{
return
0
;
return
0
;
}
}
/* Xend <= 3.0.2 doesn't include cdrom config here */
/* Xend <= 3.0.2 doesn't include cdrom config here */
if
(
hvm
&&
if
(
hvm
&&
device
&&
device
&&
!
strcmp
((
const
char
*
)
device
,
"cdrom"
))
{
!
strcmp
((
const
char
*
)
device
,
"cdrom"
))
{
if
(
xendConfigVersion
==
1
)
if
(
xendConfigVersion
==
1
)
return
0
;
return
0
;
else
else
...
@@ -1002,7 +1002,7 @@ virDomainParseXMLDiskDesc(xmlNodePtr node, virBufferPtr buf, int hvm, int xendCo
...
@@ -1002,7 +1002,7 @@ virDomainParseXMLDiskDesc(xmlNodePtr node, virBufferPtr buf, int hvm, int xendCo
if
(
xendConfigVersion
==
1
)
if
(
xendConfigVersion
==
1
)
virBufferVSprintf
(
buf
,
"(dev 'ioemu:%s')"
,
(
const
char
*
)
tmp
);
virBufferVSprintf
(
buf
,
"(dev 'ioemu:%s')"
,
(
const
char
*
)
tmp
);
else
/* But newer does not */
else
/* But newer does not */
virBufferVSprintf
(
buf
,
"(dev '%s%s')"
,
(
const
char
*
)
tmp
,
cdrom
?
":cdrom"
:
""
);
virBufferVSprintf
(
buf
,
"(dev '%s%s')"
,
(
const
char
*
)
tmp
,
cdrom
?
":cdrom"
:
"
:disk
"
);
}
else
}
else
virBufferVSprintf
(
buf
,
"(dev '%s')"
,
(
const
char
*
)
target
);
virBufferVSprintf
(
buf
,
"(dev '%s')"
,
(
const
char
*
)
target
);
...
...
tests/sexpr2xmldata/sexpr2xml-fv-v2.sexpr
浏览文件 @
4e7b9aa2
(domain (domid 3)(name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(boot c)(acpi 1)(vnc 1)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
(domain (domid 3)(name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(boot c)(acpi 1)(vnc 1)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda
:disk
')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
tests/sexpr2xmltest.c
浏览文件 @
4e7b9aa2
...
@@ -28,8 +28,8 @@ static int testCompareFiles(const char *xml, const char *sexpr, int xendConfigVe
...
@@ -28,8 +28,8 @@ static int testCompareFiles(const char *xml, const char *sexpr, int xendConfigVe
return
-
1
;
return
-
1
;
if
(
getenv
(
"DEBUG_TESTS"
))
{
if
(
getenv
(
"DEBUG_TESTS"
))
{
printf
(
"
In %d '%s'
\n
"
,
strlen
(
xmlData
),
xmlData
);
printf
(
"
Expect %d '%s'
\n
"
,
(
int
)
strlen
(
xmlData
),
xmlData
);
printf
(
"
Out %d '%s'
\n
"
,
strlen
(
gotxml
),
gotxml
);
printf
(
"
Actual %d '%s'
\n
"
,
(
int
)
strlen
(
gotxml
),
gotxml
);
}
}
if
(
strcmp
(
xmlData
,
gotxml
))
if
(
strcmp
(
xmlData
,
gotxml
))
return
-
1
;
return
-
1
;
...
...
tests/virshtest.c
浏览文件 @
4e7b9aa2
...
@@ -43,8 +43,8 @@ static int testCompareOutput(const char *expect, const char *filter, const char
...
@@ -43,8 +43,8 @@ static int testCompareOutput(const char *expect, const char *filter, const char
return
-
1
;
return
-
1
;
if
(
getenv
(
"DEBUG_TESTS"
))
{
if
(
getenv
(
"DEBUG_TESTS"
))
{
printf
(
"Expect %d '%s'
\n
"
,
strlen
(
expectData
),
expectData
);
printf
(
"Expect %d '%s'
\n
"
,
(
int
)
strlen
(
expectData
),
expectData
);
printf
(
"Actual %d '%s'
\n
"
,
strlen
(
actualData
),
actualData
);
printf
(
"Actual %d '%s'
\n
"
,
(
int
)
strlen
(
actualData
),
actualData
);
}
}
if
(
strcmp
(
expectData
,
actualData
))
if
(
strcmp
(
expectData
,
actualData
))
return
-
1
;
return
-
1
;
...
...
tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr
浏览文件 @
4e7b9aa2
(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(boot c)(acpi 1)(vnc 1)(vncdisplay 17)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(boot c)(acpi 1)(vnc 1)(vncdisplay 17)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda:disk')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
\ No newline at end of file
tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr
浏览文件 @
4e7b9aa2
(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(boot c)(acpi 1)(vnc 1)(vncunused 1)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(boot c)(acpi 1)(vnc 1)(vncunused 1)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda:disk')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
\ No newline at end of file
tests/xml2sexprtest.c
浏览文件 @
4e7b9aa2
...
@@ -28,8 +28,8 @@ static int testCompareFiles(const char *xml, const char *sexpr, const char *name
...
@@ -28,8 +28,8 @@ static int testCompareFiles(const char *xml, const char *sexpr, const char *name
return
-
1
;
return
-
1
;
if
(
getenv
(
"DEBUG_TESTS"
))
{
if
(
getenv
(
"DEBUG_TESTS"
))
{
printf
(
"
In %d '%s'
\n
"
,
strlen
(
sexprData
),
sexprData
);
printf
(
"
Expect %d '%s'
\n
"
,
(
int
)
strlen
(
sexprData
),
sexprData
);
printf
(
"
Out %d '%s'
\n
"
,
strlen
(
gotsexpr
),
gotsexpr
);
printf
(
"
Actual %d '%s'
\n
"
,
(
int
)
strlen
(
gotsexpr
),
gotsexpr
);
}
}
if
(
strcmp
(
sexprData
,
gotsexpr
))
if
(
strcmp
(
sexprData
,
gotsexpr
))
return
-
1
;
return
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录