Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
39e49ad7
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,发现更多精彩内容 >>
提交
39e49ad7
编写于
1月 23, 2009
作者:
J
John Levon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix recursive lock hang in xenstore driver
上级
ad70b324
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
30 deletion
+49
-30
ChangeLog
ChangeLog
+4
-0
src/xs_internal.c
src/xs_internal.c
+45
-30
未找到文件。
ChangeLog
浏览文件 @
39e49ad7
Fri Jan 23 11:07:42 PST 2009 John Levon <john.levon@sun.com>
* src/xs_internal.c: fix recursive lock hang
Fri Jan 23 16:20:03 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
* src/qemu_conf.c: Support driver format for setting disk
...
...
src/xs_internal.c
浏览文件 @
39e49ad7
...
...
@@ -565,58 +565,73 @@ xenStoreNumOfDomains(virConnectPtr conn)
}
/**
* xenStoreListDomains:
* xenStore
Do
ListDomains:
* @conn: pointer to the hypervisor connection
* @ids: array to collect the list of IDs of active domains
* @maxids: size of @ids
*
* Collect the list of active domains, and store their ID in @maxids
* Internal API: collect the list of active domains, and store
* their ID in @maxids. The driver lock must be held.
*
* Returns the number of domain found or -1 in case of error
*/
int
xenStore
ListDomains
(
virConnectPtr
conn
,
int
*
ids
,
int
maxids
)
static
int
xenStore
DoListDomains
(
xenUnifiedPrivatePtr
priv
,
int
*
ids
,
int
maxids
)
{
char
**
idlist
=
NULL
,
*
endptr
;
unsigned
int
num
,
i
;
int
ret
;
int
ret
=
-
1
;
long
id
;
xenUnifiedPrivatePtr
priv
;
if
((
conn
==
NULL
)
||
(
ids
==
NULL
))
{
virXenStoreError
(
conn
,
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
return
(
-
1
);
}
priv
=
(
xenUnifiedPrivatePtr
)
conn
->
privateData
;
xenUnifiedLock
(
priv
);
if
(
priv
->
xshandle
==
NULL
)
goto
error
;
goto
out
;
idlist
=
xs_directory
(
priv
->
xshandle
,
0
,
"/local/domain"
,
&
num
);
if
(
idlist
==
NULL
)
goto
error
;
goto
out
;
for
(
ret
=
0
,
i
=
0
;
(
i
<
num
)
&&
(
ret
<
maxids
);
i
++
)
{
id
=
strtol
(
idlist
[
i
],
&
endptr
,
10
);
if
((
endptr
==
idlist
[
i
])
||
(
*
endptr
!=
0
))
{
ret
=
-
1
;
break
;
}
#if 0
if (virConnectCheckStoreID(conn, (int) id) < 0)
continue;
#endif
if
((
endptr
==
idlist
[
i
])
||
(
*
endptr
!=
0
))
goto
out
;
ids
[
ret
++
]
=
(
int
)
id
;
}
free
(
idlist
);
xenUnifiedUnlock
(
priv
);
return
(
ret
);
error:
out:
VIR_FREE
(
idlist
);
return
ret
;
}
/**
* xenStoreListDomains:
* @conn: pointer to the hypervisor connection
* @ids: array to collect the list of IDs of active domains
* @maxids: size of @ids
*
* Collect the list of active domains, and store their ID in @maxids
*
* Returns the number of domain found or -1 in case of error
*/
int
xenStoreListDomains
(
virConnectPtr
conn
,
int
*
ids
,
int
maxids
)
{
xenUnifiedPrivatePtr
priv
;
int
ret
;
if
((
conn
==
NULL
)
||
(
ids
==
NULL
))
{
virXenStoreError
(
conn
,
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
return
(
-
1
);
}
priv
=
(
xenUnifiedPrivatePtr
)
conn
->
privateData
;
xenUnifiedLock
(
priv
);
ret
=
xenStoreDoListDomains
(
priv
,
ids
,
maxids
);
xenUnifiedUnlock
(
priv
);
return
-
1
;
return
(
ret
);
}
/**
...
...
@@ -1260,7 +1275,7 @@ retry:
"%s"
,
_
(
"failed to allocate domids"
));
return
-
1
;
}
nread
=
xenStore
ListDomains
(
conn
,
new_domids
,
new_domain_cnt
);
nread
=
xenStore
DoListDomains
(
priv
,
new_domids
,
new_domain_cnt
);
if
(
nread
!=
new_domain_cnt
)
{
// mismatch. retry this read
VIR_FREE
(
new_domids
);
...
...
@@ -1342,7 +1357,7 @@ retry:
"%s"
,
_
(
"failed to allocate domids"
));
return
-
1
;
}
nread
=
xenStore
ListDomains
(
conn
,
new_domids
,
new_domain_cnt
);
nread
=
xenStore
DoListDomains
(
priv
,
new_domids
,
new_domain_cnt
);
if
(
nread
!=
new_domain_cnt
)
{
// mismatch. retry this read
VIR_FREE
(
new_domids
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录