Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
bb15e65a
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,发现更多精彩内容 >>
提交
bb15e65a
编写于
7月 26, 2017
作者:
J
John Ferlan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
storage: Use virStoragePoolObj{Is|Set}Autostart
Use the new accessor APIs for storage_driver and test_driver.
上级
0147f727
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
13 deletion
+11
-13
src/storage/storage_driver.c
src/storage/storage_driver.c
+9
-11
src/test/test_driver.c
src/test/test_driver.c
+2
-2
未找到文件。
src/storage/storage_driver.c
浏览文件 @
bb15e65a
...
...
@@ -196,7 +196,7 @@ storageDriverAutostart(void)
continue
;
}
if
(
obj
->
autostart
&&
if
(
virStoragePoolObjIsAutostart
(
obj
)
&&
!
virStoragePoolObjIsActive
(
obj
))
{
if
(
backend
->
startPool
&&
backend
->
startPool
(
conn
,
obj
)
<
0
)
{
...
...
@@ -1249,11 +1249,7 @@ storagePoolGetAutostart(virStoragePoolPtr pool,
if
(
virStoragePoolGetAutostartEnsureACL
(
pool
->
conn
,
obj
->
def
)
<
0
)
goto
cleanup
;
if
(
!
virStoragePoolObjGetConfigFile
(
obj
))
{
*
autostart
=
0
;
}
else
{
*
autostart
=
obj
->
autostart
;
}
*
autostart
=
virStoragePoolObjIsAutostart
(
obj
)
?
1
:
0
;
ret
=
0
;
...
...
@@ -1269,6 +1265,8 @@ storagePoolSetAutostart(virStoragePoolPtr pool,
virStoragePoolObjPtr
obj
;
const
char
*
configFile
;
const
char
*
autostartLink
;
bool
new_autostart
;
bool
cur_autostart
;
int
ret
=
-
1
;
storageDriverLock
();
...
...
@@ -1286,10 +1284,10 @@ storagePoolSetAutostart(virStoragePoolPtr pool,
autostartLink
=
virStoragePoolObjGetAutostartLink
(
obj
);
autostart
=
(
autostart
!=
0
);
if
(
obj
->
autostart
!=
autostart
)
{
if
(
autostart
)
{
new_
autostart
=
(
autostart
!=
0
);
cur_autostart
=
virStoragePoolObjIsAutostart
(
obj
);
if
(
cur_autostart
!=
new_
autostart
)
{
if
(
new_
autostart
)
{
if
(
virFileMakePath
(
driver
->
autostartDir
)
<
0
)
{
virReportSystemError
(
errno
,
_
(
"cannot create autostart directory %s"
),
...
...
@@ -1312,7 +1310,7 @@ storagePoolSetAutostart(virStoragePoolPtr pool,
goto
cleanup
;
}
}
obj
->
autostart
=
autostart
;
virStoragePoolObjSetAutostart
(
obj
,
autostart
)
;
}
ret
=
0
;
...
...
src/test/test_driver.c
浏览文件 @
bb15e65a
...
...
@@ -4764,7 +4764,7 @@ testStoragePoolGetAutostart(virStoragePoolPtr pool,
if
(
!
virStoragePoolObjGetConfigFile
(
obj
))
*
autostart
=
0
;
else
*
autostart
=
obj
->
autostart
;
*
autostart
=
virStoragePoolObjIsAutostart
(
obj
)
?
1
:
0
;
virStoragePoolObjUnlock
(
obj
);
return
0
;
...
...
@@ -4789,7 +4789,7 @@ testStoragePoolSetAutostart(virStoragePoolPtr pool,
}
autostart
=
(
autostart
!=
0
);
obj
->
autostart
=
autostart
;
virStoragePoolObjSetAutostart
(
obj
,
autostart
)
;
ret
=
0
;
cleanup:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录