]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: FS backend adjust error message on error path
authorJohn Ferlan <jferlan@redhat.com>
Tue, 2 Jun 2015 20:25:58 +0000 (16:25 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 5 Jun 2015 10:25:19 +0000 (06:25 -0400)
https://bugzilla.redhat.com/show_bug.cgi?id=1181087

Currently the assumption on the error message is that there are
no source device paths defined when the number of devices check
fails, but in reality the XML could have had none or it could have
had more than the value supported. Adjust the error message accordingly
to make it clearer what the error really is.

src/storage/storage_backend_fs.c

index c9f25de18223e6eb9d32bf29d8bdebb89908ea40..ed3964bbbd9acce34ac5fe934b5fe399670f3298 100644 (file)
@@ -362,8 +362,13 @@ virStorageBackendFileSystemIsValid(virStoragePoolObjPtr pool)
         }
     } else {
         if (pool->def->source.ndevice != 1) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           "%s", _("missing source device"));
+            if (pool->def->source.ndevice == 0)
+                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                               _("missing source device"));
+            else
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("expected exactly 1 device for the "
+                                 "storage pool"));
             return -1;
         }
     }