Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
0147f727
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看板
提交
0147f727
编写于
7月 26, 2017
作者:
J
John Ferlan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
storage: Use virStoragePoolObj{Is|Set}Active
Use the new accessor APIs for storage_driver, test_driver, and gluster backend.
上级
1bd43496
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
14 deletion
+14
-14
src/storage/storage_backend_gluster.c
src/storage/storage_backend_gluster.c
+1
-1
src/storage/storage_driver.c
src/storage/storage_driver.c
+8
-8
src/test/test_driver.c
src/test/test_driver.c
+5
-5
未找到文件。
src/storage/storage_backend_gluster.c
浏览文件 @
0147f727
...
...
@@ -544,7 +544,7 @@ virStorageBackendGlusterCheckPool(virStoragePoolObjPtr pool,
/* Return previous state remembered by the status XML. If the pool is not
* available we will fail to refresh it and end up in the same situation.
* This will save one attempt to open the connection to the remote server */
*
active
=
pool
->
active
;
*
active
=
virStoragePoolObjIsActive
(
pool
)
;
return
0
;
}
...
...
src/storage/storage_driver.c
浏览文件 @
0147f727
...
...
@@ -145,9 +145,9 @@ storagePoolUpdateState(virStoragePoolObjPtr obj)
}
}
obj
->
active
=
active
;
virStoragePoolObjSetActive
(
obj
,
active
)
;
if
(
!
obj
->
active
)
if
(
!
virStoragePoolObjIsActive
(
obj
)
)
virStoragePoolUpdateInactive
(
&
obj
);
cleanup:
...
...
@@ -226,7 +226,7 @@ storageDriverAutostart(void)
_
(
"Failed to autostart storage pool '%s': %s"
),
obj
->
def
->
name
,
virGetLastErrorMessage
());
}
else
{
obj
->
active
=
true
;
virStoragePoolObjSetActive
(
obj
,
true
)
;
}
VIR_FREE
(
stateFile
);
}
...
...
@@ -735,7 +735,7 @@ storagePoolCreateXML(virConnectPtr conn,
0
);
VIR_INFO
(
"Creating storage pool '%s'"
,
obj
->
def
->
name
);
obj
->
active
=
true
;
virStoragePoolObjSetActive
(
obj
,
true
)
;
pool
=
virGetStoragePool
(
conn
,
obj
->
def
->
name
,
obj
->
def
->
uuid
,
NULL
,
NULL
);
...
...
@@ -940,7 +940,7 @@ storagePoolCreate(virStoragePoolPtr pool,
VIR_STORAGE_POOL_EVENT_STARTED
,
0
);
obj
->
active
=
true
;
virStoragePoolObjSetActive
(
obj
,
true
)
;
ret
=
0
;
cleanup:
...
...
@@ -1040,7 +1040,7 @@ storagePoolDestroy(virStoragePoolPtr pool)
VIR_STORAGE_POOL_EVENT_STOPPED
,
0
);
obj
->
active
=
false
;
virStoragePoolObjSetActive
(
obj
,
false
)
;
virStoragePoolUpdateInactive
(
&
obj
);
...
...
@@ -1156,7 +1156,7 @@ storagePoolRefresh(virStoragePoolPtr pool,
obj
->
def
->
uuid
,
VIR_STORAGE_POOL_EVENT_STOPPED
,
0
);
obj
->
active
=
false
;
virStoragePoolObjSetActive
(
obj
,
false
)
;
virStoragePoolUpdateInactive
(
&
obj
);
...
...
@@ -1194,7 +1194,7 @@ storagePoolGetInfo(virStoragePoolPtr pool,
goto
cleanup
;
memset
(
info
,
0
,
sizeof
(
virStoragePoolInfo
));
if
(
obj
->
active
)
if
(
virStoragePoolObjIsActive
(
obj
)
)
info
->
state
=
VIR_STORAGE_POOL_RUNNING
;
else
info
->
state
=
VIR_STORAGE_POOL_INACTIVE
;
...
...
src/test/test_driver.c
浏览文件 @
0147f727
...
...
@@ -1131,7 +1131,7 @@ testParseStorage(testDriverPtr privconn,
virStoragePoolObjUnlock
(
obj
);
goto
error
;
}
obj
->
active
=
true
;
virStoragePoolObjSetActive
(
obj
,
true
)
;
/* Find storage volumes */
if
(
testOpenVolumesForPool
(
file
,
ctxt
,
obj
,
i
+
1
)
<
0
)
{
...
...
@@ -4344,7 +4344,7 @@ testStoragePoolCreate(virStoragePoolPtr pool,
if
(
!
(
obj
=
testStoragePoolObjFindInactiveByName
(
privconn
,
pool
->
name
)))
return
-
1
;
obj
->
active
=
true
;
virStoragePoolObjSetActive
(
obj
,
true
)
;
event
=
virStoragePoolEventLifecycleNew
(
pool
->
name
,
pool
->
uuid
,
VIR_STORAGE_POOL_EVENT_STARTED
,
...
...
@@ -4492,7 +4492,7 @@ testStoragePoolCreateXML(virConnectPtr conn,
* code will not Remove the pool */
virStoragePoolObjSetConfigFile
(
obj
,
NULL
);
obj
->
active
=
true
;
virStoragePoolObjSetActive
(
obj
,
true
)
;
event
=
virStoragePoolEventLifecycleNew
(
obj
->
def
->
name
,
obj
->
def
->
uuid
,
VIR_STORAGE_POOL_EVENT_STARTED
,
...
...
@@ -4640,7 +4640,7 @@ testStoragePoolDestroy(virStoragePoolPtr pool)
if
(
!
(
obj
=
testStoragePoolObjFindActiveByName
(
privconn
,
pool
->
name
)))
return
-
1
;
obj
->
active
=
false
;
virStoragePoolObjSetActive
(
obj
,
false
)
;
if
(
obj
->
def
->
source
.
adapter
.
type
==
VIR_STORAGE_ADAPTER_TYPE_FC_HOST
)
{
...
...
@@ -4718,7 +4718,7 @@ testStoragePoolGetInfo(virStoragePoolPtr pool,
return
-
1
;
memset
(
info
,
0
,
sizeof
(
virStoragePoolInfo
));
if
(
obj
->
active
)
if
(
virStoragePoolObjIsActive
(
obj
)
)
info
->
state
=
VIR_STORAGE_POOL_RUNNING
;
else
info
->
state
=
VIR_STORAGE_POOL_INACTIVE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录