Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
6cb9f504
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看板
提交
6cb9f504
编写于
4月 09, 2015
作者:
J
Ján Tomko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove feature formating funcs from pool-specific options
We only have one formatting function for the features.
上级
755ec23c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
4 addition
and
16 deletion
+4
-16
src/conf/storage_conf.c
src/conf/storage_conf.c
+4
-16
未找到文件。
src/conf/storage_conf.c
浏览文件 @
6cb9f504
...
...
@@ -104,8 +104,6 @@ VIR_ENUM_IMPL(virStoragePoolSourceAdapter,
typedef
const
char
*
(
*
virStorageVolFormatToString
)(
int
format
);
typedef
int
(
*
virStorageVolFormatFromString
)(
const
char
*
format
);
typedef
const
char
*
(
*
virStorageVolFeatureToString
)(
int
feature
);
typedef
int
(
*
virStorageVolFeatureFromString
)(
const
char
*
feature
);
typedef
const
char
*
(
*
virStoragePoolFormatToString
)(
int
format
);
typedef
int
(
*
virStoragePoolFormatFromString
)(
const
char
*
format
);
...
...
@@ -116,8 +114,6 @@ struct _virStorageVolOptions {
int
defaultFormat
;
virStorageVolFormatToString
formatToString
;
virStorageVolFormatFromString
formatFromString
;
virStorageVolFeatureToString
featureToString
;
virStorageVolFeatureFromString
featureFromString
;
};
/* Flags to indicate mandatory components in the pool source */
...
...
@@ -172,8 +168,6 @@ static virStoragePoolTypeInfo poolTypeInfo[] = {
.
defaultFormat
=
VIR_STORAGE_FILE_RAW
,
.
formatFromString
=
virStorageVolumeFormatFromString
,
.
formatToString
=
virStorageFileFormatTypeToString
,
.
featureFromString
=
virStorageFileFeatureTypeFromString
,
.
featureToString
=
virStorageFileFeatureTypeToString
,
},
},
{.
poolType
=
VIR_STORAGE_POOL_FS
,
...
...
@@ -187,8 +181,6 @@ static virStoragePoolTypeInfo poolTypeInfo[] = {
.
defaultFormat
=
VIR_STORAGE_FILE_RAW
,
.
formatFromString
=
virStorageVolumeFormatFromString
,
.
formatToString
=
virStorageFileFormatTypeToString
,
.
featureFromString
=
virStorageFileFeatureTypeFromString
,
.
featureToString
=
virStorageFileFeatureTypeToString
,
},
},
{.
poolType
=
VIR_STORAGE_POOL_NETFS
,
...
...
@@ -203,8 +195,6 @@ static virStoragePoolTypeInfo poolTypeInfo[] = {
.
defaultFormat
=
VIR_STORAGE_FILE_RAW
,
.
formatFromString
=
virStorageVolumeFormatFromString
,
.
formatToString
=
virStorageFileFormatTypeToString
,
.
featureFromString
=
virStorageFileFeatureTypeFromString
,
.
featureToString
=
virStorageFileFeatureTypeToString
,
},
},
{.
poolType
=
VIR_STORAGE_POOL_ISCSI
,
...
...
@@ -258,8 +248,6 @@ static virStoragePoolTypeInfo poolTypeInfo[] = {
.
defaultFormat
=
VIR_STORAGE_FILE_RAW
,
.
formatToString
=
virStorageFileFormatTypeToString
,
.
formatFromString
=
virStorageVolumeFormatFromString
,
.
featureFromString
=
virStorageFileFeatureTypeFromString
,
.
featureToString
=
virStorageFileFeatureTypeToString
,
}
},
{.
poolType
=
VIR_STORAGE_POOL_MPATH
,
...
...
@@ -1404,7 +1392,7 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool,
if
(
virXPathNode
(
"./target/nocow"
,
ctxt
))
ret
->
target
.
nocow
=
true
;
if
(
options
->
featureFromString
&&
virXPathNode
(
"./target/features"
,
ctxt
))
{
if
(
virXPathNode
(
"./target/features"
,
ctxt
))
{
if
((
n
=
virXPathNodeSet
(
"./target/features/*"
,
ctxt
,
&
nodes
))
<
0
)
goto
error
;
...
...
@@ -1415,7 +1403,7 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool,
goto
error
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
int
f
=
options
->
featur
eFromString
((
const
char
*
)
nodes
[
i
]
->
name
);
int
f
=
virStorageFileFeatureTyp
eFromString
((
const
char
*
)
nodes
[
i
]
->
name
);
if
(
f
<
0
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"unsupported feature %s"
),
...
...
@@ -1576,7 +1564,7 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
virBufferEscapeString
(
buf
,
"<compat>%s</compat>
\n
"
,
def
->
compat
);
if
(
options
->
featureToString
&&
def
->
features
)
{
if
(
def
->
features
)
{
size_t
i
;
bool
empty
=
virBitmapIsAllClear
(
def
->
features
);
...
...
@@ -1590,7 +1578,7 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
for
(
i
=
0
;
i
<
VIR_STORAGE_FILE_FEATURE_LAST
;
i
++
)
{
if
(
virBitmapIsBitSet
(
def
->
features
,
i
))
virBufferAsprintf
(
buf
,
"<%s/>
\n
"
,
options
->
featur
eToString
(
i
));
virStorageFileFeatureTyp
eToString
(
i
));
}
if
(
!
empty
)
{
virBufferAdjustIndent
(
buf
,
-
2
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录