提交 fd06fd14 编写于 作者: C Cole Robinson

storage: Implement CreateVolFrom for logical and disk backend.

With the previous refactoring, this is a simple process, since the global
'CreateBlockFrom' in storage_backend does all the work.
上级 f23814e0
......@@ -592,6 +592,20 @@ virStorageBackendDiskCreateVol(virConnectPtr conn,
return 0;
}
static int
virStorageBackendDiskBuildVolFrom(virConnectPtr conn,
virStorageVolDefPtr vol,
virStorageVolDefPtr inputvol,
unsigned int flags)
{
virStorageBackendBuildVolFrom build_func;
build_func = virStorageBackendGetBuildVolFromFunction(conn, vol, inputvol);
if (!build_func)
return -1;
return build_func(conn, vol, inputvol, flags);
}
static int
virStorageBackendDiskDeleteVol(virConnectPtr conn,
......@@ -660,4 +674,5 @@ virStorageBackend virStorageBackendDisk = {
.createVol = virStorageBackendDiskCreateVol,
.deleteVol = virStorageBackendDiskDeleteVol,
.buildVolFrom = virStorageBackendDiskBuildVolFrom,
};
......@@ -653,6 +653,21 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn,
return -1;
}
static int
virStorageBackendLogicalBuildVolFrom(virConnectPtr conn,
virStorageVolDefPtr vol,
virStorageVolDefPtr inputvol,
unsigned int flags)
{
virStorageBackendBuildVolFrom build_func;
build_func = virStorageBackendGetBuildVolFromFunction(conn, vol, inputvol);
if (!build_func)
return -1;
return build_func(conn, vol, inputvol, flags);
}
static int
virStorageBackendLogicalDeleteVol(virConnectPtr conn,
virStoragePoolObjPtr pool ATTRIBUTE_UNUSED,
......@@ -679,6 +694,8 @@ virStorageBackend virStorageBackendLogical = {
.refreshPool = virStorageBackendLogicalRefreshPool,
.stopPool = virStorageBackendLogicalStopPool,
.deletePool = virStorageBackendLogicalDeletePool,
.buildVol = NULL,
.buildVolFrom = virStorageBackendLogicalBuildVolFrom,
.createVol = virStorageBackendLogicalCreateVol,
.deleteVol = virStorageBackendLogicalDeleteVol,
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册