Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
bac66a60
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,发现更多精彩内容 >>
提交
bac66a60
编写于
11月 19, 2014
作者:
C
Chen Hanxiao
提交者:
Michal Privoznik
11月 19, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
storage: wrap storage_driver.c to 80 columns
Signed-off-by:
N
Chen Hanxiao
<
chenhanxiao@cn.fujitsu.com
>
上级
9b7e7e34
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
12 deletion
+23
-12
src/storage/storage_driver.c
src/storage/storage_driver.c
+23
-12
未找到文件。
src/storage/storage_driver.c
浏览文件 @
bac66a60
...
...
@@ -174,8 +174,9 @@ storageStateInitialize(bool privileged,
}
driver
->
privileged
=
privileged
;
/* Configuration paths are either $USER_CONFIG_HOME/libvirt/storage/... (session) or
* /etc/libvirt/storage/... (system).
/*
* Configuration paths are either $USER_CONFIG_HOME/libvirt/storage/...
* (session) or /etc/libvirt/storage/... (system).
*/
if
(
virAsprintf
(
&
driver
->
configDir
,
"%s/storage"
,
base
)
==
-
1
)
...
...
@@ -338,7 +339,8 @@ storagePoolLookupByVolume(virStorageVolPtr vol)
if
(
!
pool
)
{
virReportError
(
VIR_ERR_NO_STORAGE_POOL
,
_
(
"no storage pool with matching name '%s'"
),
vol
->
pool
);
_
(
"no storage pool with matching name '%s'"
),
vol
->
pool
);
return
NULL
;
}
...
...
@@ -731,7 +733,9 @@ storagePoolUndefine(virStoragePoolPtr obj)
if
(
virStoragePoolObjDeleteDef
(
pool
)
<
0
)
goto
cleanup
;
if
(
unlink
(
pool
->
autostartLink
)
<
0
&&
errno
!=
ENOENT
&&
errno
!=
ENOTDIR
)
{
if
(
unlink
(
pool
->
autostartLink
)
<
0
&&
errno
!=
ENOENT
&&
errno
!=
ENOTDIR
)
{
char
ebuf
[
1024
];
VIR_ERROR
(
_
(
"Failed to delete autostart link '%s': %s"
),
pool
->
autostartLink
,
virStrerror
(
errno
,
ebuf
,
sizeof
(
ebuf
)));
...
...
@@ -1343,13 +1347,14 @@ storageVolLookupByKey(virConnectPtr conn,
virStorageVolDefFindByKey
(
driver
->
pools
.
objs
[
i
],
key
);
if
(
vol
)
{
if
(
virStorageVolLookupByKeyEnsureACL
(
conn
,
driver
->
pools
.
objs
[
i
]
->
def
,
vol
)
<
0
)
{
virStoragePoolDefPtr
def
=
driver
->
pools
.
objs
[
i
]
->
def
;
if
(
virStorageVolLookupByKeyEnsureACL
(
conn
,
def
,
vol
)
<
0
)
{
virStoragePoolObjUnlock
(
driver
->
pools
.
objs
[
i
]);
goto
cleanup
;
}
ret
=
virGetStorageVol
(
conn
,
d
river
->
pools
.
objs
[
i
]
->
d
ef
->
name
,
def
->
name
,
vol
->
name
,
vol
->
key
,
NULL
,
NULL
);
...
...
@@ -1772,7 +1777,8 @@ storageVolCreateXMLFrom(virStoragePoolPtr obj,
if
((
backend
=
virStorageBackendForType
(
pool
->
def
->
type
))
==
NULL
)
goto
cleanup
;
origvol
=
virStorageVolDefFindByName
(
origpool
?
origpool
:
pool
,
vobj
->
name
);
origvol
=
virStorageVolDefFindByName
(
origpool
?
origpool
:
pool
,
vobj
->
name
);
if
(
!
origvol
)
{
virReportError
(
VIR_ERR_NO_STORAGE_VOL
,
_
(
"no storage vol with matching name '%s'"
),
...
...
@@ -1805,7 +1811,8 @@ storageVolCreateXMLFrom(virStoragePoolPtr obj,
if
(
!
backend
->
buildVolFrom
)
{
virReportError
(
VIR_ERR_NO_SUPPORT
,
"%s"
,
_
(
"storage pool does not support volume creation from an existing volume"
));
"%s"
,
_
(
"storage pool does not support"
" volume creation from an existing volume"
));
goto
cleanup
;
}
...
...
@@ -2330,7 +2337,8 @@ storageConnectListAllStoragePools(virConnectPtr conn,
storageDriverLock
();
ret
=
virStoragePoolObjListExport
(
conn
,
driver
->
pools
,
pools
,
virConnectListAllStoragePoolsCheckACL
,
flags
);
virConnectListAllStoragePoolsCheckACL
,
flags
);
storageDriverUnlock
();
cleanup:
...
...
@@ -2639,7 +2647,8 @@ virStorageFileStat(virStorageSourcePtr src,
* @buf: buffer to read the data into. buffer shall be freed by caller)
*
* Returns the count of bytes read on success and -1 on failure, -2 if the
* function isn't supported by the backend. Libvirt error is reported on failure.
* function isn't supported by the backend.
* Libvirt error is reported on failure.
*/
ssize_t
virStorageFileReadHeader
(
virStorageSourcePtr
src
,
...
...
@@ -2895,7 +2904,8 @@ virStorageFileGetMetadata(virStorageSourcePtr src,
return
-
1
;
if
(
src
->
format
<=
VIR_STORAGE_FILE_NONE
)
src
->
format
=
allow_probe
?
VIR_STORAGE_FILE_AUTO
:
VIR_STORAGE_FILE_RAW
;
src
->
format
=
allow_probe
?
VIR_STORAGE_FILE_AUTO
:
VIR_STORAGE_FILE_RAW
;
ret
=
virStorageFileGetMetadataRecurse
(
src
,
src
,
uid
,
gid
,
allow_probe
,
report_broken
,
cycle
);
...
...
@@ -3110,7 +3120,8 @@ virStorageTranslateDiskSourcePool(virConnectPtr conn,
def
->
src
->
srcpool
->
actualtype
=
VIR_STORAGE_TYPE_NETWORK
;
def
->
src
->
protocol
=
VIR_STORAGE_NET_PROTOCOL_ISCSI
;
if
(
virStorageTranslateDiskSourcePoolAuth
(
def
,
&
pooldef
->
source
)
<
0
)
if
(
virStorageTranslateDiskSourcePoolAuth
(
def
,
&
pooldef
->
source
)
<
0
)
goto
cleanup
;
if
(
virStorageAddISCSIPoolSourceHost
(
def
,
pooldef
)
<
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录