]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
domain: conf: Better errors on bad os <type> values
authorCole Robinson <crobinso@redhat.com>
Thu, 16 Apr 2015 22:08:17 +0000 (18:08 -0400)
committerCole Robinson <crobinso@redhat.com>
Mon, 20 Apr 2015 20:35:29 +0000 (16:35 -0400)
If no <os><type> was specified:
  before: unknown OS type no OS type
  after : xml error: an os <type> must be specified

If an <os><type> is specified that's not in our capabiliities data:
  before: unknown OS type: $type
  after : unsupported configuration: no support found for os <type> '$type'

VIR_ERR_OS_TYPE is now unused (as it should be frankly) so drop its strings
as well to save our translators some effort.

src/conf/domain_conf.c

index ab4f2bf703b009e2cb65124f6b1f0ac7c7f6c477..8458f5b2245b447159aa3583d76b7e55096c496c 100644 (file)
@@ -14638,8 +14638,8 @@ virDomainDefParseXML(xmlDocPtr xml,
             if (VIR_STRDUP(def->os.type, "xen") < 0)
                 goto error;
         } else {
-            virReportError(VIR_ERR_OS_TYPE,
-                           "%s", _("no OS type"));
+            virReportError(VIR_ERR_XML_ERROR, "%s",
+                           _("an os <type> must be specified"));
             goto error;
         }
     }
@@ -14656,8 +14656,9 @@ virDomainDefParseXML(xmlDocPtr xml,
     }
 
     if (!virCapabilitiesSupportsGuestOSType(caps, def->os.type)) {
-        virReportError(VIR_ERR_OS_TYPE,
-                       "%s", def->os.type);
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("no support found for os <type> '%s'"),
+                       def->os.type);
         goto error;
     }