Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
e3672d96
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看板
提交
e3672d96
编写于
1月 20, 2009
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow storage driver to handle daemon restarts
上级
23a090ab
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
30 deletion
+23
-30
ChangeLog
ChangeLog
+8
-0
src/storage_backend_iscsi.c
src/storage_backend_iscsi.c
+15
-8
src/storage_driver.c
src/storage_driver.c
+0
-22
未找到文件。
ChangeLog
浏览文件 @
e3672d96
Tue
Jan
20
22
:
39
:
53
GMT
2009
Daniel
P
.
Berrange
<
berrange
@
redhat
.
com
>
Properly
handle
daemon
restarts
with
storage
driver
*
src
/
storage_backend_iscsi
.
c
:
Detect
if
already
logged
into
an
iSCSI
target
*
src
/
storage_driver
.
c
:
Don
't shutdown storage when daemon
shuts down
Tue Jan 20 22:25:53 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
Allow virtual networks to survive a daemon restart
...
...
src/storage_backend_iscsi.c
浏览文件 @
e3672d96
...
...
@@ -107,7 +107,8 @@ virStorageBackendISCSIExtractSession(virConnectPtr conn,
static
char
*
virStorageBackendISCSISession
(
virConnectPtr
conn
,
virStoragePoolObjPtr
pool
)
virStoragePoolObjPtr
pool
,
int
probe
)
{
/*
* # iscsiadm --mode session
...
...
@@ -141,7 +142,8 @@ virStorageBackendISCSISession(virConnectPtr conn,
NULL
)
<
0
)
return
NULL
;
if
(
session
==
NULL
)
{
if
(
session
==
NULL
&&
!
probe
)
{
virStorageReportError
(
conn
,
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"cannot find session"
));
return
NULL
;
...
...
@@ -573,6 +575,7 @@ virStorageBackendISCSIStartPool(virConnectPtr conn,
virStoragePoolObjPtr
pool
)
{
char
*
portal
=
NULL
;
char
*
session
;
if
(
pool
->
def
->
source
.
host
.
name
==
NULL
)
{
virStorageReportError
(
conn
,
VIR_ERR_INTERNAL_ERROR
,
...
...
@@ -587,13 +590,17 @@ virStorageBackendISCSIStartPool(virConnectPtr conn,
return
-
1
;
}
if
((
portal
=
virStorageBackendISCSIPortal
(
conn
,
pool
))
==
NULL
)
return
-
1
;
if
(
virStorageBackendISCSILogin
(
conn
,
pool
,
portal
)
<
0
)
{
if
((
session
=
virStorageBackendISCSISession
(
conn
,
pool
,
1
))
==
NULL
)
{
if
((
portal
=
virStorageBackendISCSIPortal
(
conn
,
pool
))
==
NULL
)
return
-
1
;
if
(
virStorageBackendISCSILogin
(
conn
,
pool
,
portal
)
<
0
)
{
VIR_FREE
(
portal
);
return
-
1
;
}
VIR_FREE
(
portal
);
return
-
1
;
}
else
{
VIR_FREE
(
session
);
}
VIR_FREE
(
portal
);
return
0
;
}
...
...
@@ -607,7 +614,7 @@ virStorageBackendISCSIRefreshPool(virConnectPtr conn,
virStorageBackendWaitForDevices
(
conn
);
if
((
session
=
virStorageBackendISCSISession
(
conn
,
pool
))
==
NULL
)
if
((
session
=
virStorageBackendISCSISession
(
conn
,
pool
,
0
))
==
NULL
)
goto
cleanup
;
if
(
virStorageBackendISCSIRescanLUNs
(
conn
,
pool
,
session
)
<
0
)
goto
cleanup
;
...
...
src/storage_driver.c
浏览文件 @
e3672d96
...
...
@@ -238,32 +238,10 @@ storageDriverActive(void) {
*/
static
int
storageDriverShutdown
(
void
)
{
unsigned
int
i
;
if
(
!
driverState
)
return
-
1
;
storageDriverLock
(
driverState
);
/* shutdown active pools */
for
(
i
=
0
;
i
<
driverState
->
pools
.
count
;
i
++
)
{
virStoragePoolObjPtr
pool
=
driverState
->
pools
.
objs
[
i
];
if
(
virStoragePoolObjIsActive
(
pool
))
{
virStorageBackendPtr
backend
;
if
((
backend
=
virStorageBackendForType
(
pool
->
def
->
type
))
==
NULL
)
{
storageLog
(
"Missing backend"
);
continue
;
}
if
(
backend
->
stopPool
&&
backend
->
stopPool
(
NULL
,
pool
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
storageLog
(
"Failed to stop storage pool '%s': %s"
,
pool
->
def
->
name
,
err
?
err
->
message
:
NULL
);
}
virStoragePoolObjClearVols
(
pool
);
}
}
/* free inactive pools */
virStoragePoolObjListFree
(
&
driverState
->
pools
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录