]> xenbits.xensource.com Git - libvirt.git/commitdiff
VMX: Improve disk parse error for unknown values
authorDoug Goldstein <cardoe@cardoe.com>
Mon, 12 Aug 2013 20:42:42 +0000 (15:42 -0500)
committerDoug Goldstein <cardoe@cardoe.com>
Thu, 22 Aug 2013 03:19:27 +0000 (22:19 -0500)
Previously the error message showed the following:

error: internal error: Invalid or not yet handled value 'auto detect'
for VMX entry 'ide0:0.fileName'

This left the user unsure if it was a CD-ROM or a disk device that they
needed to fix. Now the error shows:

error: internal error: Invalid or not yet handled value 'auto detect'
for VMX entry 'ide0:0.fileName' for device type 'cdrom-raw'

Which should hopefully make it easier to see the issue with the VMX
configuration.

src/vmx/vmx.c

index 28a6f103b22f7e47a7cbd861dcdea145b59b4291..35afe26dea1b564da4d46ed1316a57004bce4b37 100644 (file)
@@ -2184,8 +2184,10 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
             goto ignore;
         } else {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Invalid or not yet handled value '%s' for VMX entry "
-                             "'%s'"), fileName, fileName_name);
+                           _("Invalid or not yet handled value '%s' "
+                             "for VMX entry '%s' for device type '%s'"),
+                             fileName, fileName_name,
+                             deviceType ? deviceType : "unknown");
             goto cleanup;
         }
     } else if (device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
@@ -2220,8 +2222,10 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
             fileName = NULL;
         } else {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Invalid or not yet handled value '%s' for VMX entry "
-                             "'%s'"), fileName, fileName_name);
+                           _("Invalid or not yet handled value '%s' "
+                             "for VMX entry '%s' for device type '%s'"),
+                             fileName, fileName_name,
+                             deviceType ? deviceType : "unknown");
             goto cleanup;
         }
     } else if (device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
@@ -2248,8 +2252,10 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
             fileName = NULL;
         } else {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Invalid or not yet handled value '%s' for VMX entry "
-                             "'%s'"), fileName, fileName_name);
+                           _("Invalid or not yet handled value '%s' "
+                             "for VMX entry '%s' for device type '%s'"),
+                             fileName, fileName_name,
+                             deviceType ? deviceType : "unknown");
             goto cleanup;
         }
     } else {