Error messages which contain any additional info should be using VIR_ERR_XML_CONFIG instead of VIR_ERR_XML_ERROR. --- src/conf/cpu_conf.c | 2 +- src/conf/domain_conf.c | 44 +++++++++++++++--------------- src/conf/interface_conf.c | 48 ++++++++++++++++---------------- src/conf/network_conf.c | 12 ++++---- src/conf/nwfilter_conf.c | 8 +++--- src/conf/secret_conf.c | 6 ++-- src/conf/storage_conf.c | 52 ++++++++++++++++++------------------ src/conf/storage_encryption_conf.c | 10 +++--- 8 files changed, 91 insertions(+), 91 deletions(-) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 9ea11cb..b18c2c4 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -133,7 +133,7 @@ virCPUDefParseXML(const xmlNodePtr node, if (mode == VIR_CPU_TYPE_AUTO) { if (virXPathBoolean("boolean(./arch)", ctxt)) { if (virXPathBoolean("boolean(./@match)", ctxt)) { - virCPUReportError(VIR_ERR_XML_ERROR, "%s", + virCPUReportError(VIR_ERR_XML_CONFIG, "%s", _("'arch' element element cannot be used inside 'cpu'" " element with 'match' attribute'")); goto error; diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ac3d955..66cd07d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2855,7 +2855,7 @@ virDomainNetDefParseXML(virCapsPtr caps, if (ret >= 0) { def->tune.sndbuf_specified = true; } else if (ret == -2) { - virDomainReportError(VIR_ERR_XML_ERROR, "%s", + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("sndbuf must be a positive integer")); goto error; } @@ -2895,7 +2895,7 @@ virDomainChrDefaultTargetType(virCapsPtr caps, int devtype) { switch (devtype) { case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: - virDomainReportError(VIR_ERR_XML_ERROR, + virDomainReportError(VIR_ERR_XML_CONFIG, _("target type must be specified for %s device"), virDomainChrDeviceTypeToString(devtype)); break; @@ -2977,7 +2977,7 @@ virDomainChrDefParseTargetXML(virCapsPtr caps, portStr = virXMLPropString(cur, "port"); if (addrStr == NULL) { - virDomainReportError(VIR_ERR_XML_ERROR, "%s", + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("guestfwd channel does not " "define a target address")); goto error; @@ -2999,14 +2999,14 @@ virDomainChrDefParseTargetXML(virCapsPtr caps, } if (portStr == NULL) { - virDomainReportError(VIR_ERR_XML_ERROR, "%s", + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("guestfwd channel does " "not define a target port")); goto error; } if (virStrToLong_ui(portStr, NULL, 10, &port) < 0) { - virDomainReportError(VIR_ERR_XML_ERROR, + virDomainReportError(VIR_ERR_XML_CONFIG, _("Invalid port number: %s"), portStr); goto error; @@ -3030,7 +3030,7 @@ virDomainChrDefParseTargetXML(virCapsPtr caps, } if (virStrToLong_ui(portStr, NULL, 10, &port) < 0) { - virDomainReportError(VIR_ERR_XML_ERROR, + virDomainReportError(VIR_ERR_XML_CONFIG, _("Invalid port number: %s"), portStr); goto error; @@ -3388,7 +3388,7 @@ virDomainSmartcardDefParseXML(xmlNodePtr node, mode = virXMLPropString(node, "mode"); if (mode == NULL) { - virDomainReportError(VIR_ERR_XML_ERROR, "%s", + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("missing smartcard device mode")); goto error; } @@ -3410,7 +3410,7 @@ virDomainSmartcardDefParseXML(xmlNodePtr node, if (cur->type == XML_ELEMENT_NODE && xmlStrEqual(cur->name, BAD_CAST "certificate")) { if (i == 3) { - virDomainReportError(VIR_ERR_XML_ERROR, "%s", + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("host-certificates mode needs " "exactly three certificates")); goto error; @@ -3430,7 +3430,7 @@ virDomainSmartcardDefParseXML(xmlNodePtr node, goto error; } if (*def->data.cert.database != '/') { - virDomainReportError(VIR_ERR_XML_ERROR, + virDomainReportError(VIR_ERR_XML_CONFIG, _("expecting absolute path: %s"), def->data.cert.database); goto error; @@ -3439,7 +3439,7 @@ virDomainSmartcardDefParseXML(xmlNodePtr node, cur = cur->next; } if (i < 3) { - virDomainReportError(VIR_ERR_XML_ERROR, "%s", + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("host-certificates mode needs " "exactly three certificates")); goto error; @@ -3449,7 +3449,7 @@ virDomainSmartcardDefParseXML(xmlNodePtr node, case VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH: type = virXMLPropString(node, "type"); if (type == NULL) { - virDomainReportError(VIR_ERR_XML_ERROR, "%s", + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("passthrough mode requires a character " "device type attribute")); goto error; @@ -4237,7 +4237,7 @@ virSysinfoParseXML(const xmlNodePtr node, char *type; if (!xmlStrEqual(node->name, BAD_CAST "sysinfo")) { - virDomainReportError(VIR_ERR_XML_ERROR, "%s", + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("XML does not contain expected 'sysinfo' element")); return(NULL); } @@ -4791,7 +4791,7 @@ virSecurityLabelDefParseXML(const virDomainDefPtr def, p = virXPathStringLimit("string(./seclabel/@type)", VIR_SECURITY_LABEL_BUFLEN-1, ctxt); if (p == NULL) { - virDomainReportError(VIR_ERR_XML_ERROR, + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("missing security type")); goto error; } @@ -4811,7 +4811,7 @@ virSecurityLabelDefParseXML(const virDomainDefPtr def, p = virXPathStringLimit("string(./seclabel/@model)", VIR_SECURITY_MODEL_BUFLEN-1, ctxt); if (p == NULL) { - virDomainReportError(VIR_ERR_XML_ERROR, + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("missing security model")); goto error; } @@ -4820,7 +4820,7 @@ virSecurityLabelDefParseXML(const virDomainDefPtr def, p = virXPathStringLimit("string(./seclabel/label[1])", VIR_SECURITY_LABEL_BUFLEN-1, ctxt); if (p == NULL) { - virDomainReportError(VIR_ERR_XML_ERROR, + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("security label is missing")); goto error; } @@ -4834,7 +4834,7 @@ virSecurityLabelDefParseXML(const virDomainDefPtr def, p = virXPathStringLimit("string(./seclabel/imagelabel[1])", VIR_SECURITY_LABEL_BUFLEN-1, ctxt); if (p == NULL) { - virDomainReportError(VIR_ERR_XML_ERROR, + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("security imagelabel is missing")); goto error; } @@ -4929,7 +4929,7 @@ virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps, if (!(dev->data.graphics = virDomainGraphicsDefParseXML(node, flags))) goto error; } else { - virDomainReportError(VIR_ERR_XML_ERROR, + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("unknown device type")); goto error; } @@ -5418,7 +5418,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps, n = virXPathULong("string(./vcpu[1])", ctxt, &count); if (n == -2) { - virDomainReportError(VIR_ERR_XML_ERROR, "%s", + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("maximum vcpus must be an integer")); goto error; } else if (n < 0) { @@ -5426,7 +5426,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps, } else { def->maxvcpus = count; if (count == 0) { - virDomainReportError(VIR_ERR_XML_ERROR, + virDomainReportError(VIR_ERR_XML_CONFIG, _("invalid maxvcpus %lu"), count); goto error; } @@ -5434,7 +5434,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps, n = virXPathULong("string(./vcpu[1]/@current)", ctxt, &count); if (n == -2) { - virDomainReportError(VIR_ERR_XML_ERROR, "%s", + virDomainReportError(VIR_ERR_XML_CONFIG, "%s", _("current vcpus must be an integer")); goto error; } else if (n < 0) { @@ -5442,7 +5442,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps, } else { def->vcpus = count; if (count == 0) { - virDomainReportError(VIR_ERR_XML_ERROR, + virDomainReportError(VIR_ERR_XML_CONFIG, _("invalid current vcpus %lu"), count); goto error; } @@ -9013,7 +9013,7 @@ virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr, xml = virXMLParse(NULL, xmlStr, "domainsnapshot.xml"); if (!xml) { - virDomainReportError(VIR_ERR_XML_ERROR, + virDomainReportError(VIR_ERR_XML_CONFIG, "%s",_("failed to parse snapshot xml document")); return NULL; } diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index c07ffc8..6f20843 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -122,7 +122,7 @@ virInterfaceDefParseName(virInterfaceDefPtr def, tmp = virXPathString("string(./@name)", ctxt); if (tmp == NULL) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("interface has no name")); return(-1); } @@ -138,7 +138,7 @@ virInterfaceDefParseMtu(virInterfaceDefPtr def, ret = virXPathULong("string(./mtu/@size)", ctxt, &mtu); if ((ret == -2) || ((ret == 0) && (mtu > 100000))) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("interface mtu value is improper")); return(-1); } else if (ret == 0) { @@ -162,7 +162,7 @@ virInterfaceDefParseStartMode(virInterfaceDefPtr def, else if (STREQ(tmp, "none")) def->startmode = VIR_INTERFACE_START_NONE; else { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, _("unknown interface startmode %s"), tmp); VIR_FREE(tmp); return(-1); @@ -194,7 +194,7 @@ virInterfaceDefParseBondMode(xmlXPathContextPtr ctxt) { else if (STREQ(tmp, "balance-alb")) ret = VIR_INTERFACE_BOND_BALALB; else { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, _("unknown bonding mode %s"), tmp); ret = -1; } @@ -215,7 +215,7 @@ virInterfaceDefParseBondMiiCarrier(xmlXPathContextPtr ctxt) { else if (STREQ(tmp, "netif")) ret = VIR_INTERFACE_BOND_MII_NETIF; else { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, _("unknown mii bonding carrier %s"), tmp); ret = -1; } @@ -238,7 +238,7 @@ virInterfaceDefParseBondArpValid(xmlXPathContextPtr ctxt) { else if (STREQ(tmp, "all")) ret = VIR_INTERFACE_BOND_ARP_ALL; else { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, _("unknown arp bonding validate %s"), tmp); ret = -1; } @@ -264,7 +264,7 @@ virInterfaceDefParseDhcp(virInterfaceProtocolDefPtr def, else if (STREQ(tmp, "no")) def->peerdns = 0; else { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, _("unknown dhcp peerdns value %s"), tmp); ret = -1; } @@ -290,7 +290,7 @@ virInterfaceDefParseIp(virInterfaceIpDefPtr def, if (ret == 0) def->prefix = (int) l; else if (ret == -2) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("Invalid ip address prefix value")); return(-1); } @@ -447,7 +447,7 @@ virInterfaceDefParseIfAdressing(virInterfaceDefPtr def, ctxt->node = protoNodes[pp]; tmp = virXPathString("string(./@family)", ctxt); if (tmp == NULL) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("protocol misses the family attribute")); virInterfaceProtocolDefFree(proto); goto error; @@ -466,7 +466,7 @@ virInterfaceDefParseIfAdressing(virInterfaceDefPtr def, goto error; } } else { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, _("unsupported protocol family '%s'"), tmp); virInterfaceProtocolDefFree(proto); goto error; @@ -537,7 +537,7 @@ virInterfaceDefParseBondItfs(virInterfaceDefPtr def, nbItf = virXPathNodeSet("./interface", ctxt, &interfaces); if (nbItf <= 0) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("bond has no interfaces")); ret = -1; goto error; @@ -585,7 +585,7 @@ virInterfaceDefParseBond(virInterfaceDefPtr def, ret = virXPathULong("string(./miimon/@freq)", ctxt, &tmp); if ((ret == -2) || (ret == -1)) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("bond interface miimon freq missing or invalid")); goto error; } @@ -593,7 +593,7 @@ virInterfaceDefParseBond(virInterfaceDefPtr def, ret = virXPathULong("string(./miimon/@downdelay)", ctxt, &tmp); if (ret == -2) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("bond interface miimon downdelay invalid")); goto error; } else if (ret == 0) { @@ -602,7 +602,7 @@ virInterfaceDefParseBond(virInterfaceDefPtr def, ret = virXPathULong("string(./miimon/@updelay)", ctxt, &tmp); if (ret == -2) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("bond interface miimon updelay invalid")); goto error; } else if (ret == 0) { @@ -621,7 +621,7 @@ virInterfaceDefParseBond(virInterfaceDefPtr def, ret = virXPathULong("string(./arpmon/@interval)", ctxt, &tmp); if ((ret == -2) || (ret == -1)) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("bond interface arpmon interval missing or invalid")); goto error; } @@ -630,7 +630,7 @@ virInterfaceDefParseBond(virInterfaceDefPtr def, def->data.bond.target = virXPathString("string(./arpmon/@target)", ctxt); if (def->data.bond.target == NULL) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("bond interface arpmon target missing")); ret = -1; goto error; @@ -651,7 +651,7 @@ virInterfaceDefParseVlan(virInterfaceDefPtr def, xmlXPathContextPtr ctxt) { def->data.vlan.tag = virXPathString("string(./@tag)", ctxt); if (def->data.vlan.tag == NULL) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("vlan interface misses the tag attribute")); return(-1); } @@ -659,7 +659,7 @@ virInterfaceDefParseVlan(virInterfaceDefPtr def, def->data.vlan.devname = virXPathString("string(./interface/@name)", ctxt); if (def->data.vlan.devname == NULL) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("vlan interface misses name attribute")); return(-1); } @@ -676,7 +676,7 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType) { /* check @type */ tmp = virXPathString("string(./@type)", ctxt); if (tmp == NULL) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("interface misses the type attribute")); return(NULL); } @@ -703,7 +703,7 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType) { || (parentIfType == VIR_INTERFACE_TYPE_ETHERNET) || (parentIfType == VIR_INTERFACE_TYPE_VLAN)) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("interface has unsupported type '%s'"), virInterfaceTypeToString(type)); goto error; @@ -740,7 +740,7 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType) { bridge = virXPathNode("./bridge[1]", ctxt); if (bridge == NULL) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("bridge interface misses the bridge element")); goto error; } @@ -752,7 +752,7 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType) { } else if (STREQ(tmp, "off")) { def->data.bridge.stp = 0; } else { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, _("bridge interface stp should be on or off got %s"), tmp); VIR_FREE(tmp); @@ -782,7 +782,7 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType) { bond = virXPathNode("./bond[1]", ctxt); if (bond == NULL) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("bond interface misses the bond element")); goto error; } @@ -803,7 +803,7 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType) { goto error; vlan = virXPathNode("./vlan[1]", ctxt); if (vlan == NULL) { - virInterfaceReportError(VIR_ERR_XML_ERROR, + virInterfaceReportError(VIR_ERR_XML_CONFIG, "%s", _("vlan interface misses the vlan element")); goto error; } diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 88848ee..41c545e 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -333,7 +333,7 @@ virNetworkDHCPRangeDefParseXML(const char *networkName, range = virSocketGetRange(&saddr, &eaddr); if (range < 0) { - virNetworkReportError(VIR_ERR_XML_ERROR, + virNetworkReportError(VIR_ERR_XML_CONFIG, _("Invalid dhcp range '%s' to '%s' in network '%s'"), start, end, networkName); VIR_FREE(start); @@ -375,7 +375,7 @@ virNetworkDHCPRangeDefParseXML(const char *networkName, * You need at least one MAC address or one host name */ if ((mac == NULL) && (name == NULL)) { - virNetworkReportError(VIR_ERR_XML_ERROR, + virNetworkReportError(VIR_ERR_XML_CONFIG, _("Static host definition in network '%s' must have mac or name attribute"), networkName); return -1; @@ -383,7 +383,7 @@ virNetworkDHCPRangeDefParseXML(const char *networkName, ip = virXMLPropString(cur, "ip"); if ((ip == NULL) || (virSocketParseAddr(ip, &inaddr, AF_UNSPEC) < 0)) { - virNetworkReportError(VIR_ERR_XML_ERROR, + virNetworkReportError(VIR_ERR_XML_CONFIG, _("Missing IP address in static host definition for network '%s'"), networkName); VIR_FREE(ip); @@ -465,7 +465,7 @@ virNetworkIPParseXML(const char *networkName, if (address) { if (virSocketParseAddr(address, &def->address, AF_UNSPEC) < 0) { - virNetworkReportError(VIR_ERR_XML_ERROR, + virNetworkReportError(VIR_ERR_XML_CONFIG, _("Bad address '%s' in definition of network '%s'"), address, networkName); goto error; @@ -497,7 +497,7 @@ virNetworkIPParseXML(const char *networkName, goto error; } } else { - virNetworkReportError(VIR_ERR_XML_ERROR, + virNetworkReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unrecognized family '%s' in definition of network '%s'"), def->family, networkName); goto error; @@ -631,7 +631,7 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt) tmp = virXPathString("string(./mac[1]/@address)", ctxt); if (tmp) { if (virParseMacAddr(tmp, def->mac) < 0) { - virNetworkReportError(VIR_ERR_XML_ERROR, + virNetworkReportError(VIR_ERR_XML_CONFIG, _("Invalid bridge mac address '%s' in network '%s'"), tmp, def->name); VIR_FREE(tmp); diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index 0aee8a4..62812b3 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c @@ -2018,7 +2018,7 @@ virNWFilterDefParseXML(xmlXPathContextPtr ctxt) { } } else { if (virUUIDParse(uuid, ret->uuid) < 0) { - virNWFilterReportError(VIR_ERR_XML_ERROR, + virNWFilterReportError(VIR_ERR_XML_CONFIG, "%s", _("malformed uuid element")); goto cleanup; } @@ -2094,7 +2094,7 @@ virNWFilterDefParseNode(xmlDocPtr xml, virNWFilterDefPtr def = NULL; if (STRNEQ((const char *)root->name, "filter")) { - virNWFilterReportError(VIR_ERR_XML_ERROR, + virNWFilterReportError(VIR_ERR_XML_CONFIG, "%s", _("unknown root element for nw filter")); goto cleanup; @@ -2145,7 +2145,7 @@ virNWFilterDefParse(virConnectPtr conn, if (!xml) { if (conn && conn->err.code == VIR_ERR_NONE) - virNWFilterReportError(VIR_ERR_XML_ERROR, + virNWFilterReportError(VIR_ERR_XML_CONFIG, "%s",_("failed to parse xml document")); goto cleanup; } @@ -2537,7 +2537,7 @@ virNWFilterObjLoad(virConnectPtr conn, } if (!virFileMatchesNameSuffix(file, def->name, ".xml")) { - virNWFilterReportError(VIR_ERR_XML_ERROR, + virNWFilterReportError(VIR_ERR_XML_CONFIG, _("network filter config filename '%s' does not match name '%s'"), path, def->name); virNWFilterDefFree(def); diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c index 37a513b..ffc5a76 100644 --- a/src/conf/secret_conf.c +++ b/src/conf/secret_conf.c @@ -68,7 +68,7 @@ virSecretDefParseUsage(xmlXPathContextPtr ctxt, type_str = virXPathString("string(./usage/@type)", ctxt); if (type_str == NULL) { - virSecretReportError(VIR_ERR_XML_ERROR, "%s", + virSecretReportError(VIR_ERR_XML_CONFIG, "%s", _("unknown secret usage type")); return -1; } @@ -138,7 +138,7 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root) else if (STREQ(prop, "no")) def->ephemeral = 0; else { - virSecretReportError(VIR_ERR_XML_ERROR, "%s", + virSecretReportError(VIR_ERR_XML_CONFIG, "%s", _("invalid value of 'ephemeral'")); goto cleanup; } @@ -152,7 +152,7 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root) else if (STREQ(prop, "no")) def->private = 0; else { - virSecretReportError(VIR_ERR_XML_ERROR, "%s", + virSecretReportError(VIR_ERR_XML_CONFIG, "%s", _("invalid value of 'private'")); goto cleanup; } diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 76ea103..79527ec 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -371,14 +371,14 @@ virStoragePoolDefParseAuthChap(xmlXPathContextPtr ctxt, virStoragePoolAuthChapPtr auth) { auth->login = virXPathString("string(./auth/@login)", ctxt); if (auth->login == NULL) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("missing auth host attribute")); return -1; } auth->passwd = virXPathString("string(./auth/@passwd)", ctxt); if (auth->passwd == NULL) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("missing auth passwd attribute")); return -1; } @@ -415,7 +415,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, source->format = options->formatFromString(format); if (source->format < 0) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown pool format type %s"), format); VIR_FREE(format); goto cleanup; @@ -427,7 +427,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, port = virXPathString("string(./host/@port)", ctxt); if (port) { if (virStrToLong_i(port, NULL, 10, &source->host.port) < 0) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, _("Invalid port number: %s"), port); goto cleanup; @@ -449,7 +449,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, char *path = virXMLPropString(nodeset[i], "path"); if (path == NULL) { VIR_FREE(nodeset); - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("missing storage pool source device path")); goto cleanup; } @@ -468,7 +468,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, if (STREQ(authType, "chap")) { source->authType = VIR_STORAGE_POOL_AUTH_CHAP; } else { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown auth type '%s'"), (const char *)authType); goto cleanup; @@ -507,7 +507,7 @@ virStoragePoolDefParseSourceString(const char *srcSpec, XML_PARSE_NOERROR | XML_PARSE_NOWARNING); if (doc == NULL) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("bad <source> spec")); goto cleanup; } @@ -525,7 +525,7 @@ virStoragePoolDefParseSourceString(const char *srcSpec, node = virXPathNode("/source", xpath_ctxt); if (!node) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("root element was not source")); goto cleanup; } @@ -576,7 +576,7 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt, perms->mode = strtol(mode, &end, 8); if (*end || perms->mode < 0 || perms->mode > 0777) { VIR_FREE(mode); - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("malformed octal mode")); goto error; } @@ -587,7 +587,7 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt, perms->uid = -1; } else { if (virXPathLong("number(./owner)", ctxt, &v) < 0) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("malformed owner element")); goto error; } @@ -598,7 +598,7 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt, perms->gid = -1; } else { if (virXPathLong("number(./group)", ctxt, &v) < 0) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("malformed group element")); goto error; } @@ -654,7 +654,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) { options->flags & VIR_STORAGE_POOL_SOURCE_NAME) ret->name = ret->source.name; if (ret->name == NULL) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("missing pool source name element")); goto cleanup; } @@ -668,7 +668,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) { } } else { if (virUUIDParse(uuid, ret->uuid) < 0) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("malformed uuid element")); goto cleanup; } @@ -677,7 +677,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) { if (options->flags & VIR_STORAGE_POOL_SOURCE_HOST) { if (!ret->source.host.name) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("missing storage pool source host name")); goto cleanup; @@ -686,7 +686,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) { if (options->flags & VIR_STORAGE_POOL_SOURCE_DIR) { if (!ret->source.dir) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("missing storage pool source path")); goto cleanup; } @@ -704,7 +704,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) { if (options->flags & VIR_STORAGE_POOL_SOURCE_ADAPTER) { if (!ret->source.adapter) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("missing storage pool source adapter name")); goto cleanup; } @@ -713,14 +713,14 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) { /* If DEVICE is the only source type, then its required */ if (options->flags == VIR_STORAGE_POOL_SOURCE_DEVICE) { if (!ret->source.ndevice) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("missing storage pool source device name")); goto cleanup; } } if ((tmppath = virXPathString("string(./target/path)", ctxt)) == NULL) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("missing storage pool target path")); goto cleanup; } @@ -988,19 +988,19 @@ virStorageSize(const char *unit, break; default: - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, _("unknown size units '%s'"), unit); return -1; } } if (virStrToLong_ull (val, &end, 10, ret) < 0) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("malformed capacity element")); return -1; } if (*ret > (ULLONG_MAX / mult)) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("capacity element value too large")); return -1; } @@ -1031,7 +1031,7 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool, ret->name = virXPathString("string(./name)", ctxt); if (ret->name == NULL) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("missing volume name element")); goto cleanup; } @@ -1042,7 +1042,7 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool, capacity = virXPathString("string(./capacity)", ctxt); unit = virXPathString("string(./capacity/@unit)", ctxt); if (capacity == NULL) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("missing capacity element")); goto cleanup; } @@ -1071,7 +1071,7 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool, ret->target.format = (options->formatFromString)(format); if (ret->target.format < 0) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown volume format type %s"), format); VIR_FREE(format); goto cleanup; @@ -1102,7 +1102,7 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool, ret->backingStore.format = (options->formatFromString)(format); if (ret->backingStore.format < 0) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown volume format type %s"), format); VIR_FREE(format); goto cleanup; @@ -1427,7 +1427,7 @@ virStoragePoolObjLoad(virStoragePoolObjListPtr pools, } if (!virFileMatchesNameSuffix(file, def->name, ".xml")) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, _("Storage pool config filename '%s' does not match pool name '%s'"), path, def->name); virStoragePoolDefFree(def); diff --git a/src/conf/storage_encryption_conf.c b/src/conf/storage_encryption_conf.c index 4414817..dcc16dd 100644 --- a/src/conf/storage_encryption_conf.c +++ b/src/conf/storage_encryption_conf.c @@ -88,7 +88,7 @@ virStorageEncryptionSecretParse(xmlXPathContextPtr ctxt, type_str = virXPathString("string(./@type)", ctxt); if (type_str == NULL) { - virStorageReportError(VIR_ERR_XML_ERROR, "%s", + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("unknown volume encryption secret type")); goto cleanup; } @@ -106,14 +106,14 @@ virStorageEncryptionSecretParse(xmlXPathContextPtr ctxt, uuidstr = virXPathString("string(./@uuid)", ctxt); if (uuidstr) { if (virUUIDParse(uuidstr, ret->uuid) < 0) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, _("malformed volume encryption uuid '%s'"), uuidstr); goto cleanup; } VIR_FREE(uuidstr); } else { - virStorageReportError(VIR_ERR_XML_ERROR, "%s", + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("missing volume encryption uuid")); goto cleanup; } @@ -142,7 +142,7 @@ virStorageEncryptionParseXML(xmlXPathContextPtr ctxt) format_str = virXPathString("string(./@format)", ctxt); if (format_str == NULL) { - virStorageReportError(VIR_ERR_XML_ERROR, "%s", + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("unknown volume encryption format")); goto cleanup; } @@ -190,7 +190,7 @@ virStorageEncryptionParseNode(xmlDocPtr xml, xmlNodePtr root) virStorageEncryptionPtr enc = NULL; if (STRNEQ((const char *) root->name, "encryption")) { - virStorageReportError(VIR_ERR_XML_ERROR, + virStorageReportError(VIR_ERR_XML_CONFIG, "%s", _("unknown root element for volume " "encryption information")); goto cleanup; -- 1.7.4.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list