Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
8603d848
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看板
提交
8603d848
编写于
7月 26, 2017
作者:
J
John Ferlan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
storage: Use virStoragePoolObj{Get|Set}ConfigFile
Use the new accessor APIs for storage_driver and test_driver.
上级
5bf9b655
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
16 deletion
+22
-16
src/storage/storage_backend_scsi.c
src/storage/storage_backend_scsi.c
+3
-1
src/storage/storage_driver.c
src/storage/storage_driver.c
+7
-7
src/test/test_driver.c
src/test/test_driver.c
+12
-8
未找到文件。
src/storage/storage_backend_scsi.c
浏览文件 @
8603d848
...
...
@@ -443,8 +443,10 @@ static int
virStorageBackendSCSIStartPool
(
virConnectPtr
conn
,
virStoragePoolObjPtr
pool
)
{
const
char
*
configFile
=
virStoragePoolObjGetConfigFile
(
pool
);
if
(
pool
->
def
->
source
.
adapter
.
type
==
VIR_STORAGE_ADAPTER_TYPE_FC_HOST
)
return
createVport
(
conn
,
pool
->
def
,
pool
->
configFile
,
return
createVport
(
conn
,
pool
->
def
,
configFile
,
&
pool
->
def
->
source
.
adapter
.
data
.
fchost
);
return
0
;
...
...
src/storage/storage_driver.c
浏览文件 @
8603d848
...
...
@@ -91,7 +91,7 @@ virStoragePoolUpdateInactive(virStoragePoolObjPtr *objptr)
{
virStoragePoolObjPtr
obj
=
*
objptr
;
if
(
obj
->
configFile
==
NULL
)
{
if
(
!
virStoragePoolObjGetConfigFile
(
obj
)
)
{
virStoragePoolObjRemove
(
&
driver
->
pools
,
obj
);
*
objptr
=
NULL
;
}
else
if
(
obj
->
newDef
)
{
...
...
@@ -643,7 +643,7 @@ storagePoolIsPersistent(virStoragePoolPtr pool)
if
(
virStoragePoolIsPersistentEnsureACL
(
pool
->
conn
,
obj
->
def
)
<
0
)
goto
cleanup
;
ret
=
obj
->
configFile
?
1
:
0
;
ret
=
virStoragePoolObjGetConfigFile
(
obj
)
?
1
:
0
;
cleanup:
virStoragePoolObjUnlock
(
obj
);
...
...
@@ -849,7 +849,6 @@ storagePoolUndefine(virStoragePoolPtr pool)
obj
->
autostartLink
,
virStrerror
(
errno
,
ebuf
,
sizeof
(
ebuf
)));
}
VIR_FREE
(
obj
->
configFile
);
VIR_FREE
(
obj
->
autostartLink
);
event
=
virStoragePoolEventLifecycleNew
(
obj
->
def
->
name
,
...
...
@@ -1250,7 +1249,7 @@ storagePoolGetAutostart(virStoragePoolPtr pool,
if
(
virStoragePoolGetAutostartEnsureACL
(
pool
->
conn
,
obj
->
def
)
<
0
)
goto
cleanup
;
if
(
!
obj
->
configFile
)
{
if
(
!
virStoragePoolObjGetConfigFile
(
obj
)
)
{
*
autostart
=
0
;
}
else
{
*
autostart
=
obj
->
autostart
;
...
...
@@ -1268,6 +1267,7 @@ storagePoolSetAutostart(virStoragePoolPtr pool,
int
autostart
)
{
virStoragePoolObjPtr
obj
;
const
char
*
configFile
;
int
ret
=
-
1
;
storageDriverLock
();
...
...
@@ -1277,7 +1277,7 @@ storagePoolSetAutostart(virStoragePoolPtr pool,
if
(
virStoragePoolSetAutostartEnsureACL
(
pool
->
conn
,
obj
->
def
)
<
0
)
goto
cleanup
;
if
(
!
obj
->
configFile
)
{
if
(
!
(
configFile
=
virStoragePoolObjGetConfigFile
(
obj
))
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"pool has no config file"
));
goto
cleanup
;
...
...
@@ -1294,10 +1294,10 @@ storagePoolSetAutostart(virStoragePoolPtr pool,
goto
cleanup
;
}
if
(
symlink
(
obj
->
configFile
,
obj
->
autostartLink
)
<
0
)
{
if
(
symlink
(
configFile
,
obj
->
autostartLink
)
<
0
)
{
virReportSystemError
(
errno
,
_
(
"Failed to create symlink '%s' to '%s'"
),
obj
->
autostartLink
,
obj
->
configFile
);
obj
->
autostartLink
,
configFile
);
goto
cleanup
;
}
}
else
{
...
...
src/test/test_driver.c
浏览文件 @
8603d848
...
...
@@ -4072,12 +4072,17 @@ testInterfaceDestroy(virInterfacePtr iface,
static
int
testStoragePoolObjSetDefaults
(
virStoragePoolObjPtr
obj
)
{
char
*
configFile
;
obj
->
def
->
capacity
=
defaultPoolCap
;
obj
->
def
->
allocation
=
defaultPoolAlloc
;
obj
->
def
->
available
=
defaultPoolCap
-
defaultPoolAlloc
;
return
VIR_STRDUP
(
obj
->
configFile
,
""
);
if
(
VIR_STRDUP
(
configFile
,
""
)
<
0
)
return
-
1
;
virStoragePoolObjSetConfigFile
(
obj
,
configFile
);
return
0
;
}
...
...
@@ -4319,7 +4324,7 @@ testStoragePoolIsPersistent(virStoragePoolPtr pool)
if
(
!
(
obj
=
testStoragePoolObjFindByUUID
(
privconn
,
pool
->
uuid
)))
return
-
1
;
ret
=
obj
->
configFile
?
1
:
0
;
ret
=
virStoragePoolObjGetConfigFile
(
obj
)
?
1
:
0
;
virStoragePoolObjUnlock
(
obj
);
return
ret
;
...
...
@@ -4485,7 +4490,7 @@ testStoragePoolCreateXML(virConnectPtr conn,
/* *SetDefaults fills this in for the persistent pools, but this
* would be a transient pool so remove it; otherwise, the Destroy
* code will not Remove the pool */
VIR_FREE
(
obj
->
configFile
);
virStoragePoolObjSetConfigFile
(
obj
,
NULL
);
obj
->
active
=
true
;
...
...
@@ -4650,7 +4655,7 @@ testStoragePoolDestroy(virStoragePoolPtr pool)
VIR_STORAGE_POOL_EVENT_STOPPED
,
0
);
if
(
obj
->
configFile
==
NULL
)
{
if
(
!
(
virStoragePoolObjGetConfigFile
(
obj
))
)
{
virStoragePoolObjRemove
(
&
privconn
->
pools
,
obj
);
obj
=
NULL
;
}
...
...
@@ -4756,11 +4761,10 @@ testStoragePoolGetAutostart(virStoragePoolPtr pool,
if
(
!
(
obj
=
testStoragePoolObjFindByName
(
privconn
,
pool
->
name
)))
return
-
1
;
if
(
!
obj
->
configFile
)
{
if
(
!
virStoragePoolObjGetConfigFile
(
obj
))
*
autostart
=
0
;
}
else
{
else
*
autostart
=
obj
->
autostart
;
}
virStoragePoolObjUnlock
(
obj
);
return
0
;
...
...
@@ -4778,7 +4782,7 @@ testStoragePoolSetAutostart(virStoragePoolPtr pool,
if
(
!
(
obj
=
testStoragePoolObjFindByName
(
privconn
,
pool
->
name
)))
return
-
1
;
if
(
!
obj
->
configFile
)
{
if
(
!
virStoragePoolObjGetConfigFile
(
obj
)
)
{
virReportError
(
VIR_ERR_INVALID_ARG
,
"%s"
,
_
(
"pool has no config file"
));
goto
cleanup
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录