Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
6727bfd7
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看板
提交
6727bfd7
编写于
5月 26, 2015
作者:
J
John Ferlan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "storage: Don't duplicate efforts of backend driver"
This reverts commit
2ac0e647
.
上级
e983e625
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
24 deletion
+6
-24
src/storage/storage_driver.c
src/storage/storage_driver.c
+6
-24
未找到文件。
src/storage/storage_driver.c
浏览文件 @
6727bfd7
...
...
@@ -1634,7 +1634,6 @@ storageVolDeleteInternal(virStorageVolPtr obj,
{
size_t
i
;
int
ret
=
-
1
;
unsigned
long
long
orig_pool_available
,
orig_pool_allocation
;
if
(
!
backend
->
deleteVol
)
{
virReportError
(
VIR_ERR_NO_SUPPORT
,
...
...
@@ -1643,9 +1642,6 @@ storageVolDeleteInternal(virStorageVolPtr obj,
goto
cleanup
;
}
orig_pool_available
=
pool
->
def
->
available
;
orig_pool_allocation
=
pool
->
def
->
allocation
;
if
(
backend
->
deleteVol
(
obj
->
conn
,
pool
,
vol
,
flags
)
<
0
)
goto
cleanup
;
...
...
@@ -1653,10 +1649,8 @@ storageVolDeleteInternal(virStorageVolPtr obj,
* in this module since the allocation/available weren't adjusted yet
*/
if
(
updateMeta
)
{
if
(
orig_pool_allocation
==
pool
->
def
->
allocation
)
pool
->
def
->
allocation
-=
vol
->
target
.
allocation
;
if
(
orig_pool_available
==
pool
->
def
->
available
)
pool
->
def
->
available
+=
vol
->
target
.
allocation
;
pool
->
def
->
allocation
-=
vol
->
target
.
allocation
;
pool
->
def
->
available
+=
vol
->
target
.
allocation
;
}
for
(
i
=
0
;
i
<
pool
->
volumes
.
count
;
i
++
)
{
...
...
@@ -1775,7 +1769,6 @@ storageVolCreateXML(virStoragePoolPtr obj,
virStorageVolDefPtr
voldef
=
NULL
;
virStorageVolPtr
ret
=
NULL
,
volobj
=
NULL
;
virStorageVolDefPtr
buildvoldef
=
NULL
;
unsigned
long
long
orig_pool_available
,
orig_pool_allocation
;
virCheckFlags
(
VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA
,
NULL
);
...
...
@@ -1823,9 +1816,6 @@ storageVolCreateXML(virStoragePoolPtr obj,
goto
cleanup
;
}
orig_pool_available
=
pool
->
def
->
available
;
orig_pool_allocation
=
pool
->
def
->
allocation
;
/* Wipe any key the user may have suggested, as volume creation
* will generate the canonical key. */
VIR_FREE
(
voldef
->
key
);
...
...
@@ -1883,10 +1873,8 @@ storageVolCreateXML(virStoragePoolPtr obj,
goto
cleanup
;
/* Update pool metadata */
if
(
orig_pool_allocation
==
pool
->
def
->
allocation
)
pool
->
def
->
allocation
+=
buildvoldef
->
target
.
allocation
;
if
(
orig_pool_available
==
pool
->
def
->
available
)
pool
->
def
->
available
-=
buildvoldef
->
target
.
allocation
;
pool
->
def
->
allocation
+=
buildvoldef
->
target
.
allocation
;
pool
->
def
->
available
-=
buildvoldef
->
target
.
allocation
;
VIR_INFO
(
"Creating volume '%s' in storage pool '%s'"
,
volobj
->
name
,
pool
->
def
->
name
);
...
...
@@ -1914,7 +1902,6 @@ storageVolCreateXMLFrom(virStoragePoolPtr obj,
virStorageVolDefPtr
origvol
=
NULL
,
newvol
=
NULL
;
virStorageVolPtr
ret
=
NULL
,
volobj
=
NULL
;
unsigned
long
long
allocation
;
unsigned
long
long
orig_pool_available
,
orig_pool_allocation
;
int
buildret
;
virCheckFlags
(
VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA
|
...
...
@@ -2017,9 +2004,6 @@ storageVolCreateXMLFrom(virStoragePoolPtr obj,
pool
->
volumes
.
count
+
1
)
<
0
)
goto
cleanup
;
orig_pool_available
=
pool
->
def
->
available
;
orig_pool_allocation
=
pool
->
def
->
allocation
;
/* 'Define' the new volume so we get async progress reporting.
* Wipe any key the user may have suggested, as volume creation
* will generate the canonical key. */
...
...
@@ -2073,10 +2057,8 @@ storageVolCreateXMLFrom(virStoragePoolPtr obj,
newvol
=
NULL
;
/* Updating pool metadata */
if
(
orig_pool_allocation
==
pool
->
def
->
allocation
)
pool
->
def
->
allocation
+=
allocation
;
if
(
orig_pool_available
==
pool
->
def
->
available
)
pool
->
def
->
available
-=
allocation
;
pool
->
def
->
allocation
+=
allocation
;
pool
->
def
->
available
-=
allocation
;
VIR_INFO
(
"Creating volume '%s' in storage pool '%s'"
,
volobj
->
name
,
pool
->
def
->
name
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录