Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
a5b7965a
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看板
提交
a5b7965a
编写于
6月 01, 2010
作者:
E
Eduardo Otubo
提交者:
Matthias Bolte
6月 03, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
phyp: Strict check when listing domains
上级
ca3b22bb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
20 deletion
+14
-20
src/phyp/phyp_driver.c
src/phyp/phyp_driver.c
+14
-20
未找到文件。
src/phyp/phyp_driver.c
浏览文件 @
a5b7965a
...
...
@@ -1857,41 +1857,34 @@ phypUUIDTable_Init(virConnectPtr conn)
{
uuid_tablePtr
uuid_table
;
phyp_driverPtr
phyp_driver
;
int
nids
=
0
;
int
nids_numdomains
=
0
;
int
nids_listdomains
=
0
;
int
*
ids
=
NULL
;
unsigned
int
i
=
0
;
if
((
nids
=
phypNumDomainsGeneric
(
conn
,
2
))
<
0
)
if
((
nids
_numdomains
=
phypNumDomainsGeneric
(
conn
,
2
))
<
0
)
goto
err
;
/* exit early if there are no domains */
if
(
nids
==
0
)
return
0
;
if
(
VIR_ALLOC_N
(
ids
,
nids
)
<
0
)
{
if
(
VIR_ALLOC_N
(
ids
,
nids_numdomains
)
<
0
)
{
virReportOOMError
();
goto
err
;
}
if
((
nids
=
phypListDomainsGeneric
(
conn
,
ids
,
nids
,
1
))
<
0
)
if
((
nids_listdomains
=
phypListDomainsGeneric
(
conn
,
ids
,
nids_numdomains
,
1
))
<
0
)
goto
err
;
/* exit early if there are no domains */
/* FIXME: phypNumDomainsGeneric() returned > 0 but phypListDomainsGeneric()
* returned 0. indicates this an error condition?
* an even stricter check would be to treat
*
* phypNumDomainsGeneric() != phypListDomainsGeneric()
*
* as an error */
if
(
nids
==
0
)
{
VIR_FREE
(
ids
);
return
0
;
if
(
nids_numdomains
==
0
&&
nids_listdomains
==
0
)
goto
exit
;
else
if
(
nids_numdomains
!=
nids_listdomains
)
{
VIR_ERROR0
(
_
(
"Unable to determine number of domains."
));
goto
err
;
}
phyp_driver
=
conn
->
privateData
;
uuid_table
=
phyp_driver
->
uuid_table
;
uuid_table
->
nlpars
=
nids
;
uuid_table
->
nlpars
=
nids
_listdomains
;
/* try to get the table from server */
if
(
phypUUIDTable_Pull
(
conn
)
==
-
1
)
{
...
...
@@ -1905,7 +1898,8 @@ phypUUIDTable_Init(virConnectPtr conn)
uuid_table
->
lpars
[
i
]
->
id
=
ids
[
i
];
if
(
virUUIDGenerate
(
uuid_table
->
lpars
[
i
]
->
uuid
)
<
0
)
VIR_WARN
(
"Unable to generate UUID for domain %d"
,
ids
[
i
]);
VIR_WARN
(
"Unable to generate UUID for domain %d"
,
ids
[
i
]);
}
}
else
{
virReportOOMError
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录