[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] storage: revert bogus raw volumes support check



Commits bb5f2dc and 6682d62 added a check like:

  if (vol->target.format != VIR_STORAGE_FILE_RAW)

to the CreateVol method for zfs and logical storage backends
respectively. However, this check is bogus because
virStorageVolDefParseXML() in conf/storage_conf.c sets target.format
only if volOptions in virStoragePoolTypeInfo has formatFromString set,
and that's not the case for zfs and logical backends. So the check
always fails and breaks volume creation.

Thus, revert those commits.
---
 src/storage/storage_backend_logical.c | 6 ------
 src/storage/storage_backend_zfs.c     | 6 ------
 2 files changed, 12 deletions(-)

diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index 39e8b80..90a194e 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -912,12 +912,6 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn,
     struct stat sb;
     bool created = false;
 
-    if (vol->target.format != VIR_STORAGE_FILE_RAW) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("only RAW volumes are supported by this storage pool"));
-        return -1;
-    }
-
     if (vol->target.encryption != NULL) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        "%s", _("storage pool does not support encrypted "
diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backend_zfs.c
index 5238ecc..c66a808 100644
--- a/src/storage/storage_backend_zfs.c
+++ b/src/storage/storage_backend_zfs.c
@@ -301,12 +301,6 @@ virStorageBackendZFSCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
     int ret = -1;
     int volmode_needed = -1;
 
-    if (vol->target.format != VIR_STORAGE_FILE_RAW) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("only RAW volumes are supported by this storage pool"));
-        return -1;
-    }
-
     if (vol->target.encryption != NULL) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        "%s", _("storage pool does not support encrypted "
-- 
2.7.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]