From e8fb46f7e9ce1a74695456464ebd124f1d103bc9 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Thu, 16 Apr 2015 18:08:17 -0400 Subject: [PATCH] domain: conf: Better errors on bad os values If no was specified: before: unknown OS type no OS type after : xml error: an os must be specified If an is specified that's not in our capabiliities data: before: unknown OS type: $type after : unsupported configuration: no support found for os '$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. (cherry picked from commit 3700c065cde30ff3f70cc3a029279c79c2337a54) --- src/conf/domain_conf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9b7ae3f2ae..d9435233f8 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13951,8 +13951,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 must be specified")); goto error; } } @@ -13969,8 +13969,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 '%s'"), + def->os.type); goto error; }