Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
6d6261f4
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,发现更多精彩内容 >>
提交
6d6261f4
编写于
2月 22, 2007
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Ensure domains are killed off if hotplug fails. Fix deletion of inactive domains
上级
0f5e637a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
29 deletion
+36
-29
ChangeLog
ChangeLog
+7
-0
src/xend_internal.c
src/xend_internal.c
+12
-14
src/xm_internal.c
src/xm_internal.c
+17
-15
未找到文件。
ChangeLog
浏览文件 @
6d6261f4
Thu Feb 22 14:06:24 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/xm_internal.c, src/xend_internal.c: Re-arrange VM creation
commands to ensure we destroy stillborn domains if device hotplug
fails to complete. Fix deletion of inactive VMs from internal
cache of domain configs.
Thu Feb 22 11:45:24 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/xs_internal.c: Refuse to do shutdown / reboot on
...
...
src/xend_internal.c
浏览文件 @
6d6261f4
...
...
@@ -2816,7 +2816,7 @@ xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc,
int
ret
;
char
*
sexpr
;
char
*
name
=
NULL
;
virDomainPtr
dom
;
virDomainPtr
dom
=
NULL
;
if
(
!
VIR_IS_CONNECT
(
conn
))
{
virXendError
(
conn
,
VIR_ERR_INVALID_CONN
,
__FUNCTION__
);
...
...
@@ -2841,32 +2841,30 @@ xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc,
ret
=
xenDaemonDomainCreateLinux
(
conn
,
sexpr
);
free
(
sexpr
);
if
(
ret
!=
0
)
{
fprintf
(
stderr
,
_
(
"Failed to create domain %s
\n
"
),
name
);
goto
error
;
}
ret
=
xend_wait_for_devices
(
conn
,
name
);
if
(
ret
!=
0
)
{
fprintf
(
stderr
,
_
(
"Failed to get devices for domain %s
\n
"
),
name
);
/* This comes before wait_for_devices, to ensure that latter
cleanup will destroy the domain upon failure */
if
(
!
(
dom
=
virDomainLookupByName
(
conn
,
name
)))
goto
error
;
}
dom
=
virDomainLookupByName
(
conn
,
name
);
if
(
dom
==
NULL
)
{
if
((
ret
=
xend_wait_for_devices
(
conn
,
name
))
<
0
)
goto
error
;
}
ret
=
xenDaemonDomainResume
(
dom
);
if
(
ret
!=
0
)
{
fprintf
(
stderr
,
_
(
"Failed to resume new domain %s
\n
"
),
name
);
xenDaemonDomainDestroy
(
dom
);
if
((
ret
=
xenDaemonDomainResume
(
dom
))
<
0
)
goto
error
;
}
free
(
name
);
return
(
dom
);
error:
/* Make sure we don't leave a still-born domain around */
if
(
dom
!=
NULL
)
{
xenDaemonDomainDestroy
(
dom
);
virFreeDomain
(
dom
->
conn
,
dom
);
}
if
(
name
!=
NULL
)
free
(
name
);
return
(
NULL
);
...
...
src/xm_internal.c
浏览文件 @
6d6261f4
...
...
@@ -50,7 +50,9 @@ typedef struct xenXMConfCache {
}
xenXMConfCache
;
static
char
configDir
[
PATH_MAX
];
/* Config file name to config object */
static
virHashTablePtr
configCache
=
NULL
;
/* Name to config file name */
static
virHashTablePtr
nameConfigMap
=
NULL
;
static
int
nconnections
=
0
;
static
time_t
lastRefresh
=
0
;
...
...
@@ -1295,13 +1297,6 @@ int xenXMDomainCreate(virDomainPtr domain) {
ret
=
xenDaemonDomainCreateLinux
(
domain
->
conn
,
sexpr
);
free
(
sexpr
);
if
(
ret
!=
0
)
{
fprintf
(
stderr
,
"Failed to create domain %s
\n
"
,
domain
->
name
);
return
(
-
1
);
}
ret
=
xend_wait_for_devices
(
domain
->
conn
,
domain
->
name
);
if
(
ret
!=
0
)
{
fprintf
(
stderr
,
"Failed to get devices for domain %s
\n
"
,
domain
->
name
);
return
(
-
1
);
}
...
...
@@ -1310,15 +1305,20 @@ int xenXMDomainCreate(virDomainPtr domain) {
}
domain
->
id
=
ret
;
ret
=
xenDaemonDomainResume
(
domain
);
if
(
ret
!=
0
)
{
fprintf
(
stderr
,
"Failed to resume new domain %s
\n
"
,
domain
->
name
);
if
((
ret
=
xend_wait_for_devices
(
domain
->
conn
,
domain
->
name
))
<
0
)
goto
cleanup
;
if
((
ret
=
xenDaemonDomainResume
(
domain
))
<
0
)
goto
cleanup
;
return
(
0
);
cleanup:
if
(
domain
->
id
!=
-
1
)
{
xenDaemonDomainDestroy
(
domain
);
domain
->
id
=
-
1
;
return
(
-
1
);
}
return
(
0
);
return
(
-
1
);
}
...
...
@@ -2165,10 +2165,12 @@ int xenXMDomainUndefine(virDomainPtr domain) {
if
(
unlink
(
entry
->
filename
)
<
0
)
return
(
-
1
);
if
(
virHashRemoveEntry
(
nameConfigMap
,
entry
->
filename
,
NULL
)
<
0
)
/* Remove the name -> filename mapping */
if
(
virHashRemoveEntry
(
nameConfigMap
,
domain
->
name
,
NULL
)
<
0
)
return
(
-
1
);
if
(
virHashRemoveEntry
(
configCache
,
domain
->
name
,
xenXMConfigFree
)
<
0
)
/* Remove the config record itself */
if
(
virHashRemoveEntry
(
configCache
,
entry
->
filename
,
xenXMConfigFree
)
<
0
)
return
(
-
1
);
return
(
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录