Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
b6d6635e
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看板
提交
b6d6635e
编写于
3月 18, 2014
作者:
M
Martin Kletzander
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use K&R style for curly braces in src/storage/
Signed-off-by:
N
Martin Kletzander
<
mkletzan@redhat.com
>
上级
b1d5f6c6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
60 addition
and
30 deletion
+60
-30
src/storage/storage_backend_fs.c
src/storage/storage_backend_fs.c
+8
-4
src/storage/storage_driver.c
src/storage/storage_driver.c
+52
-26
未找到文件。
src/storage/storage_backend_fs.c
浏览文件 @
b6d6635e
...
...
@@ -330,7 +330,8 @@ virStorageBackendFileSystemNetFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSE
* Return 0 if not mounted, 1 if mounted, -1 on error
*/
static
int
virStorageBackendFileSystemIsMounted
(
virStoragePoolObjPtr
pool
)
{
virStorageBackendFileSystemIsMounted
(
virStoragePoolObjPtr
pool
)
{
FILE
*
mtab
;
struct
mntent
ent
;
char
buf
[
1024
];
...
...
@@ -363,7 +364,8 @@ virStorageBackendFileSystemIsMounted(virStoragePoolObjPtr pool) {
* Returns 0 if successfully mounted, -1 on error
*/
static
int
virStorageBackendFileSystemMount
(
virStoragePoolObjPtr
pool
)
{
virStorageBackendFileSystemMount
(
virStoragePoolObjPtr
pool
)
{
char
*
src
=
NULL
;
/* 'mount -t auto' doesn't seem to auto determine nfs (or cifs),
* while plain 'mount' does. We have to craft separate argvs to
...
...
@@ -467,7 +469,8 @@ cleanup:
* Returns 0 if successfully unmounted, -1 on error
*/
static
int
virStorageBackendFileSystemUnmount
(
virStoragePoolObjPtr
pool
)
{
virStorageBackendFileSystemUnmount
(
virStoragePoolObjPtr
pool
)
{
virCommandPtr
cmd
=
NULL
;
int
ret
=
-
1
;
int
rc
;
...
...
@@ -562,7 +565,8 @@ virStorageBackendFileSystemStart(virConnectPtr conn ATTRIBUTE_UNUSED,
#if WITH_BLKID
static
virStoragePoolProbeResult
virStorageBackendFileSystemProbe
(
const
char
*
device
,
const
char
*
format
)
{
const
char
*
format
)
{
virStoragePoolProbeResult
ret
=
FILESYSTEM_PROBE_ERROR
;
blkid_probe
probe
=
NULL
;
...
...
src/storage/storage_driver.c
浏览文件 @
b6d6635e
...
...
@@ -68,7 +68,8 @@ static void storageDriverUnlock(virStorageDriverStatePtr driver)
}
static
void
storageDriverAutostart
(
virStorageDriverStatePtr
driver
)
{
storageDriverAutostart
(
virStorageDriverStatePtr
driver
)
{
size_t
i
;
virConnectPtr
conn
=
NULL
;
...
...
@@ -217,7 +218,8 @@ storageStateAutoStart(void)
* files and update its state
*/
static
int
storageStateReload
(
void
)
{
storageStateReload
(
void
)
{
if
(
!
driverState
)
return
-
1
;
...
...
@@ -238,7 +240,8 @@ storageStateReload(void) {
* Shutdown the storage driver, it will stop all active storage pools
*/
static
int
storageStateCleanup
(
void
)
{
storageStateCleanup
(
void
)
{
if
(
!
driverState
)
return
-
1
;
...
...
@@ -260,7 +263,8 @@ storageStateCleanup(void) {
static
virStoragePoolPtr
storagePoolLookupByUUID
(
virConnectPtr
conn
,
const
unsigned
char
*
uuid
)
{
const
unsigned
char
*
uuid
)
{
virStorageDriverStatePtr
driver
=
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
virStoragePoolPtr
ret
=
NULL
;
...
...
@@ -289,7 +293,8 @@ cleanup:
static
virStoragePoolPtr
storagePoolLookupByName
(
virConnectPtr
conn
,
const
char
*
name
)
{
const
char
*
name
)
{
virStorageDriverStatePtr
driver
=
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
virStoragePoolPtr
ret
=
NULL
;
...
...
@@ -317,7 +322,8 @@ cleanup:
}
static
virStoragePoolPtr
storagePoolLookupByVolume
(
virStorageVolPtr
vol
)
{
storagePoolLookupByVolume
(
virStorageVolPtr
vol
)
{
virStorageDriverStatePtr
driver
=
vol
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
virStoragePoolPtr
ret
=
NULL
;
...
...
@@ -359,13 +365,15 @@ storageOpen(virConnectPtr conn,
}
static
int
storageClose
(
virConnectPtr
conn
)
{
storageClose
(
virConnectPtr
conn
)
{
conn
->
storagePrivateData
=
NULL
;
return
0
;
}
static
int
storageConnectNumOfStoragePools
(
virConnectPtr
conn
)
{
storageConnectNumOfStoragePools
(
virConnectPtr
conn
)
{
virStorageDriverStatePtr
driver
=
conn
->
storagePrivateData
;
size_t
i
;
int
nactive
=
0
;
...
...
@@ -390,7 +398,8 @@ storageConnectNumOfStoragePools(virConnectPtr conn) {
static
int
storageConnectListStoragePools
(
virConnectPtr
conn
,
char
**
const
names
,
int
nnames
)
{
int
nnames
)
{
virStorageDriverStatePtr
driver
=
conn
->
storagePrivateData
;
int
got
=
0
;
size_t
i
;
...
...
@@ -424,7 +433,8 @@ storageConnectListStoragePools(virConnectPtr conn,
}
static
int
storageConnectNumOfDefinedStoragePools
(
virConnectPtr
conn
)
{
storageConnectNumOfDefinedStoragePools
(
virConnectPtr
conn
)
{
virStorageDriverStatePtr
driver
=
conn
->
storagePrivateData
;
size_t
i
;
int
nactive
=
0
;
...
...
@@ -449,7 +459,8 @@ storageConnectNumOfDefinedStoragePools(virConnectPtr conn) {
static
int
storageConnectListDefinedStoragePools
(
virConnectPtr
conn
,
char
**
const
names
,
int
nnames
)
{
int
nnames
)
{
virStorageDriverStatePtr
driver
=
conn
->
storagePrivateData
;
int
got
=
0
;
size_t
i
;
...
...
@@ -686,7 +697,8 @@ cleanup:
}
static
int
storagePoolUndefine
(
virStoragePoolPtr
obj
)
{
storagePoolUndefine
(
virStoragePoolPtr
obj
)
{
virStorageDriverStatePtr
driver
=
obj
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
int
ret
=
-
1
;
...
...
@@ -795,7 +807,8 @@ cleanup:
static
int
storagePoolBuild
(
virStoragePoolPtr
obj
,
unsigned
int
flags
)
{
unsigned
int
flags
)
{
virStorageDriverStatePtr
driver
=
obj
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
virStorageBackendPtr
backend
;
...
...
@@ -837,7 +850,8 @@ cleanup:
static
int
storagePoolDestroy
(
virStoragePoolPtr
obj
)
{
storagePoolDestroy
(
virStoragePoolPtr
obj
)
{
virStorageDriverStatePtr
driver
=
obj
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
virStorageBackendPtr
backend
;
...
...
@@ -899,7 +913,8 @@ cleanup:
static
int
storagePoolDelete
(
virStoragePoolPtr
obj
,
unsigned
int
flags
)
{
unsigned
int
flags
)
{
virStorageDriverStatePtr
driver
=
obj
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
virStorageBackendPtr
backend
;
...
...
@@ -1016,7 +1031,8 @@ cleanup:
static
int
storagePoolGetInfo
(
virStoragePoolPtr
obj
,
virStoragePoolInfoPtr
info
)
{
virStoragePoolInfoPtr
info
)
{
virStorageDriverStatePtr
driver
=
obj
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
int
ret
=
-
1
;
...
...
@@ -1092,7 +1108,8 @@ cleanup:
static
int
storagePoolGetAutostart
(
virStoragePoolPtr
obj
,
int
*
autostart
)
{
int
*
autostart
)
{
virStorageDriverStatePtr
driver
=
obj
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
int
ret
=
-
1
;
...
...
@@ -1125,7 +1142,8 @@ cleanup:
static
int
storagePoolSetAutostart
(
virStoragePoolPtr
obj
,
int
autostart
)
{
int
autostart
)
{
virStorageDriverStatePtr
driver
=
obj
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
int
ret
=
-
1
;
...
...
@@ -1187,7 +1205,8 @@ cleanup:
static
int
storagePoolNumOfVolumes
(
virStoragePoolPtr
obj
)
{
storagePoolNumOfVolumes
(
virStoragePoolPtr
obj
)
{
virStorageDriverStatePtr
driver
=
obj
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
int
ret
=
-
1
;
...
...
@@ -1227,7 +1246,8 @@ cleanup:
static
int
storagePoolListVolumes
(
virStoragePoolPtr
obj
,
char
**
const
names
,
int
maxnames
)
{
int
maxnames
)
{
virStorageDriverStatePtr
driver
=
obj
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
size_t
i
;
...
...
@@ -1278,7 +1298,8 @@ storagePoolListVolumes(virStoragePoolPtr obj,
static
int
storagePoolListAllVolumes
(
virStoragePoolPtr
pool
,
virStorageVolPtr
**
vols
,
unsigned
int
flags
)
{
unsigned
int
flags
)
{
virStorageDriverStatePtr
driver
=
pool
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
obj
;
size_t
i
;
...
...
@@ -1351,7 +1372,8 @@ storagePoolListAllVolumes(virStoragePoolPtr pool,
static
virStorageVolPtr
storageVolLookupByName
(
virStoragePoolPtr
obj
,
const
char
*
name
)
{
const
char
*
name
)
{
virStorageDriverStatePtr
driver
=
obj
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
virStorageVolDefPtr
vol
;
...
...
@@ -1397,7 +1419,8 @@ cleanup:
static
virStorageVolPtr
storageVolLookupByKey
(
virConnectPtr
conn
,
const
char
*
key
)
{
const
char
*
key
)
{
virStorageDriverStatePtr
driver
=
conn
->
storagePrivateData
;
size_t
i
;
virStorageVolPtr
ret
=
NULL
;
...
...
@@ -1436,7 +1459,8 @@ cleanup:
static
virStorageVolPtr
storageVolLookupByPath
(
virConnectPtr
conn
,
const
char
*
path
)
{
const
char
*
path
)
{
virStorageDriverStatePtr
driver
=
conn
->
storagePrivateData
;
size_t
i
;
virStorageVolPtr
ret
=
NULL
;
...
...
@@ -2459,7 +2483,8 @@ storageVolWipe(virStorageVolPtr obj,
static
int
storageVolGetInfo
(
virStorageVolPtr
obj
,
virStorageVolInfoPtr
info
)
{
virStorageVolInfoPtr
info
)
{
virStorageDriverStatePtr
driver
=
obj
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
virStorageBackendPtr
backend
;
...
...
@@ -2572,7 +2597,8 @@ cleanup:
}
static
char
*
storageVolGetPath
(
virStorageVolPtr
obj
)
{
storageVolGetPath
(
virStorageVolPtr
obj
)
{
virStorageDriverStatePtr
driver
=
obj
->
conn
->
storagePrivateData
;
virStoragePoolObjPtr
pool
;
virStorageVolDefPtr
vol
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录