Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
ed922850
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,发现更多精彩内容 >>
提交
ed922850
编写于
8月 21, 2012
作者:
H
Hu Tao
提交者:
Daniel Veillard
8月 22, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change virDomainVcpuPinDefParseXML to support parsing emulatorpin
上级
fe1d3259
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
9 deletion
+22
-9
src/conf/domain_conf.c
src/conf/domain_conf.c
+22
-9
未找到文件。
src/conf/domain_conf.c
浏览文件 @
ed922850
...
@@ -7902,15 +7902,28 @@ cleanup:
...
@@ -7902,15 +7902,28 @@ cleanup:
return
ret
;
return
ret
;
}
}
/* Parse the XML definition for a vcpupin */
/* Parse the XML definition for a vcpupin or emulatorpin.
*
* vcpupin has the form of
*
* <vcpupin vcpu='0' cpuset='0'/>
*
* and emulatorpin has the form of
*
* <emulatorpin cpuset='0'/>
*
* A vcpuid of -1 is valid and only valid for emulatorpin. So callers
* have to check the returned cpuid for validity.
*/
static
virDomainVcpuPinDefPtr
static
virDomainVcpuPinDefPtr
virDomainVcpuPinDefParseXML
(
const
xmlNodePtr
node
,
virDomainVcpuPinDefParseXML
(
const
xmlNodePtr
node
,
xmlXPathContextPtr
ctxt
,
xmlXPathContextPtr
ctxt
,
int
maxvcpus
)
int
maxvcpus
,
int
emulator
)
{
{
virDomainVcpuPinDefPtr
def
;
virDomainVcpuPinDefPtr
def
;
xmlNodePtr
oldnode
=
ctxt
->
node
;
xmlNodePtr
oldnode
=
ctxt
->
node
;
unsigned
int
vcpuid
;
int
vcpuid
;
char
*
tmp
=
NULL
;
char
*
tmp
=
NULL
;
int
ret
;
int
ret
;
...
@@ -7921,14 +7934,14 @@ virDomainVcpuPinDefParseXML(const xmlNodePtr node,
...
@@ -7921,14 +7934,14 @@ virDomainVcpuPinDefParseXML(const xmlNodePtr node,
ctxt
->
node
=
node
;
ctxt
->
node
=
node
;
ret
=
virXPath
U
Int
(
"string(./@vcpu)"
,
ctxt
,
&
vcpuid
);
ret
=
virXPathInt
(
"string(./@vcpu)"
,
ctxt
,
&
vcpuid
);
if
(
ret
==
-
2
)
{
if
(
(
ret
==
-
2
)
||
(
vcpuid
<
-
1
)
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"vcpu id must be an unsigned integer"
));
"%s"
,
_
(
"vcpu id must be an unsigned integer
or -1
"
));
goto
error
;
goto
error
;
}
else
if
(
ret
==
-
1
)
{
}
else
if
(
(
vcpuid
==
-
1
)
&&
(
emulator
==
0
)
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"
can't parse vcpupin node
"
));
"%s"
,
_
(
"
vcpu id value -1 is not allowed for vcpupin
"
));
goto
error
;
goto
error
;
}
}
...
@@ -8346,7 +8359,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
...
@@ -8346,7 +8359,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
i
=
0
;
i
<
n
;
i
++
)
{
virDomainVcpuPinDefPtr
vcpupin
=
NULL
;
virDomainVcpuPinDefPtr
vcpupin
=
NULL
;
vcpupin
=
virDomainVcpuPinDefParseXML
(
nodes
[
i
],
ctxt
,
def
->
maxvcpus
);
vcpupin
=
virDomainVcpuPinDefParseXML
(
nodes
[
i
],
ctxt
,
def
->
maxvcpus
,
0
);
if
(
!
vcpupin
)
if
(
!
vcpupin
)
goto
error
;
goto
error
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录