mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-13 16:15:19 +00:00
rbd: Move the encryption check in build
No sense opening a connection only to fail because we don't support the type of build being attempted. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
15118aca28
commit
8546f723db
@ -696,15 +696,15 @@ virStorageBackendRBDBuildVol(virConnectPtr conn,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(ptr = virStorageBackendRBDNewState(conn, pool)))
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (vol->target.encryption != NULL) {
|
if (vol->target.encryption != NULL) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("storage pool does not support encrypted volumes"));
|
_("storage pool does not support encrypted volumes"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(ptr = virStorageBackendRBDNewState(conn, pool)))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
if ((r = virStorageBackendRBDCreateImage(ptr->ioctx, vol->name,
|
if ((r = virStorageBackendRBDCreateImage(ptr->ioctx, vol->name,
|
||||||
vol->target.capacity)) < 0) {
|
vol->target.capacity)) < 0) {
|
||||||
virReportSystemError(-r, _("failed to create volume '%s/%s'"),
|
virReportSystemError(-r, _("failed to create volume '%s/%s'"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user