From: John Ferlan Date: Fri, 16 Sep 2016 12:05:10 +0000 (-0400) Subject: rbd: Move the encryption check in build X-Git-Tag: v2.4.0-rc1~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8546f723db0b8d3a7e3deb86deb9cc7063f247f6;p=thirdparty%2Flibvirt.git 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 --- diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c index c442b50f5c..718c4d6be6 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -696,15 +696,15 @@ virStorageBackendRBDBuildVol(virConnectPtr conn, goto cleanup; } - if (!(ptr = virStorageBackendRBDNewState(conn, pool))) - goto cleanup; - if (vol->target.encryption != NULL) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("storage pool does not support encrypted volumes")); goto cleanup; } + if (!(ptr = virStorageBackendRBDNewState(conn, pool))) + goto cleanup; + if ((r = virStorageBackendRBDCreateImage(ptr->ioctx, vol->name, vol->target.capacity)) < 0) { virReportSystemError(-r, _("failed to create volume '%s/%s'"),