Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
4a891820
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看板
提交
4a891820
编写于
2月 07, 2007
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix vcpu info for HVM guests
上级
5e395c2a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
12 deletion
+19
-12
ChangeLog
ChangeLog
+6
-0
src/xml.c
src/xml.c
+10
-9
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/xml2sexprdata/xml2sexpr-fv.sexpr
tests/xml2sexprdata/xml2sexpr-fv.sexpr
+1
-1
未找到文件。
ChangeLog
浏览文件 @
4a891820
Wed Feb 7 07:43:21 EST 2007 Daniel Berrange <berrange@redhat.com>
* src/xml.c, tests/xml2sexprdata/*.sexpr: Also include the
vcpu info in the (image (hvm)) part of the SEXPR for fully
virt guests, so it gets passed on into QEMU.
Wed Feb 7 07:40:21 EST 2007 Daniel Berrange <berrange@redhat.com>
* configure.in, tests/Makefile.am: Only enable the low level
...
...
src/xml.c
浏览文件 @
4a891820
...
...
@@ -692,6 +692,7 @@ static int virDomainParseXMLGraphicsDescVFB(xmlNodePtr node, virBufferPtr buf)
* @node: node containing HVM OS description
* @buf: a buffer for the result S-Expr
* @ctxt: a path context representing the XML description
* @vcpus: number of virtual CPUs to configure
* @xendConfigVersion: xend configuration file format
*
* Parse the OS part of the XML description for an HVM domain and add it to
...
...
@@ -702,7 +703,7 @@ static int virDomainParseXMLGraphicsDescVFB(xmlNodePtr node, virBufferPtr buf)
* Returns 0 in case of success, -1 in case of error.
*/
static
int
virDomainParseXMLOSDescHVM
(
xmlNodePtr
node
,
virBufferPtr
buf
,
xmlXPathContextPtr
ctxt
,
int
xendConfigVersion
)
virDomainParseXMLOSDescHVM
(
xmlNodePtr
node
,
virBufferPtr
buf
,
xmlXPathContextPtr
ctxt
,
int
vcpus
,
int
xendConfigVersion
)
{
xmlXPathObjectPtr
obj
=
NULL
;
xmlNodePtr
cur
,
txt
;
...
...
@@ -758,6 +759,8 @@ virDomainParseXMLOSDescHVM(xmlNodePtr node, virBufferPtr buf, xmlXPathContextPtr
xmlXPathFreeObject
(
obj
);
obj
=
NULL
;
virBufferVSprintf
(
buf
,
"(vcpus %d)"
,
vcpus
);
if
(
boot_dev
)
{
if
(
xmlStrEqual
(
boot_dev
,
BAD_CAST
"fd"
))
{
virBufferVSprintf
(
buf
,
"(boot a)"
,
(
const
char
*
)
boot_dev
);
...
...
@@ -1285,6 +1288,7 @@ virDomainParseXMLDesc(const char *xmldesc, char **name, int xendConfigVersion)
int
i
,
res
;
int
bootloader
=
0
;
int
hvm
=
0
;
unsigned
int
vcpus
=
1
;
unsigned
long
mem
=
0
,
max_mem
=
0
;
if
(
name
!=
NULL
)
...
...
@@ -1365,14 +1369,11 @@ virDomainParseXMLDesc(const char *xmldesc, char **name, int xendConfigVersion)
virBufferVSprintf
(
&
buf
,
"(memory %lu)(maxmem %lu)"
,
mem
,
max_mem
);
obj
=
xmlXPathEval
(
BAD_CAST
"number(/domain/vcpu[1])"
,
ctxt
);
if
((
obj
==
NULL
)
||
(
obj
->
type
!=
XPATH_NUMBER
)
||
(
isnan
(
obj
->
floatval
))
||
(
obj
->
floatval
<=
0
))
{
virBufferVSprintf
(
&
buf
,
"(vcpus 1)"
);
}
else
{
unsigned
int
cpu
=
(
unsigned
int
)
obj
->
floatval
;
virBufferVSprintf
(
&
buf
,
"(vcpus %u)"
,
cpu
);
if
((
obj
!=
NULL
)
&&
(
obj
->
type
==
XPATH_NUMBER
)
&&
(
!
isnan
(
obj
->
floatval
))
&&
(
obj
->
floatval
>
0
))
{
vcpus
=
(
unsigned
int
)
obj
->
floatval
;
}
virBufferVSprintf
(
&
buf
,
"(vcpus %u)"
,
vcpus
);
xmlXPathFreeObject
(
obj
);
obj
=
xmlXPathEval
(
BAD_CAST
"string(/domain/uuid[1])"
,
ctxt
);
...
...
@@ -1439,7 +1440,7 @@ virDomainParseXMLDesc(const char *xmldesc, char **name, int xendConfigVersion)
}
else
{
hvm
=
1
;
res
=
virDomainParseXMLOSDescHVM
(
obj
->
nodesetval
->
nodeTab
[
0
],
&
buf
,
ctxt
,
xendConfigVersion
);
&
buf
,
ctxt
,
vcpus
,
xendConfigVersion
);
}
xmlXPathFreeObject
(
tmpobj
);
...
...
tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr
浏览文件 @
4a891820
(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
(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')(vcpus 1)(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
tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr
浏览文件 @
4a891820
(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
(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')(vcpus 1)(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
tests/xml2sexprdata/xml2sexpr-fv.sexpr
浏览文件 @
4a891820
(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)(cdrom '/root/boot.iso')(acpi 1)(vnc 1)))(device (vbd (dev 'ioemu:hda')(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
(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')(vcpus 1)(boot c)(cdrom '/root/boot.iso')(acpi 1)(vnc 1)))(device (vbd (dev 'ioemu:hda')(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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录