]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: Alter error message in probe/empty checks v3.0.0-rc2
authorJohn Ferlan <jferlan@redhat.com>
Fri, 13 Jan 2017 12:33:02 +0000 (07:33 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Sat, 14 Jan 2017 15:13:05 +0000 (10:13 -0500)
For case VIR_STORAGE_BLKID_PROBE_DIFFERENT, clean up the message to
avoid using the virsh like --overwrite syntax. Additionally provide
a different error message when not writing the label to avoid confusion.

src/storage/storage_backend.c

index 79482e62212e36add5e77903d1c976065111094b..dc8f20c119d44657ff84a22f530491319f7c4095 100644 (file)
@@ -2808,10 +2808,17 @@ virStorageBackendBLKIDFindEmpty(const char *device,
         break;
 
     case VIR_STORAGE_BLKID_PROBE_DIFFERENT:
-        virReportError(VIR_ERR_STORAGE_POOL_BUILT,
-                       _("Device '%s' formatted cannot overwrite using '%s', "
-                         "requires build --overwrite"),
-                       device, format);
+        if (writelabel)
+            virReportError(VIR_ERR_STORAGE_POOL_BUILT,
+                           _("Format of device '%s' does not match the "
+                             "expected format '%s', forced overwrite is "
+                             "necessary"),
+                           device, format);
+        else
+            virReportError(VIR_ERR_OPERATION_INVALID,
+                           _("Format of device '%s' does not match the "
+                             "expected format '%s'"),
+                           device, format);
         break;
     }