From: Jim Fehlig Date: Wed, 9 May 2012 17:12:38 +0000 (-0600) Subject: Report error when parsing character device target type X-Git-Tag: v0.9.11.4~89 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6884836d95b780f082cf4e4d46bc5abda181170a;p=thirdparty%2Flibvirt.git Report error when parsing character device target type No useful error was being reported when an invalid character device target type is specified in the domainXML. E.g. ... ... resulted in error: Failed to define domain from x.xml error: An error occurred, but the cause is unknown With this small patch, the error is more helpful error: Failed to define domain from x.xml error: XML error: unknown target type 'kvm' specified for character device (cherry picked from commit 10a87145f73068e572d14d82a13df46c95960273) --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f3828c362a..8a39721acd 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4857,6 +4857,9 @@ virDomainChrDefParseTargetXML(virCapsPtr caps, if ((def->targetType = virDomainChrTargetTypeFromString(caps, vmdef, def->deviceType, targetType)) < 0) { + virDomainReportError(VIR_ERR_XML_ERROR, + _("unknown target type '%s' specified for character device"), + targetType); goto error; }