mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
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.
This commit is contained in:
parent
f23814e0cd
commit
fd06fd1442
@ -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,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user