virDomainDefPtr def = NULL;
if (!xmlStrEqual(root->name, BAD_CAST "domain")) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("incorrect root element"));
+ virDomainReportError(VIR_ERR_XML_ERROR,
+ _("unexpected root element <%s>, "
+ "expecting <domain>"),
+ root->name);
goto cleanup;
}
virDomainObjPtr obj = NULL;
if (!xmlStrEqual(root->name, BAD_CAST "domstatus")) {
- virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("incorrect root element"));
+ virDomainReportError(VIR_ERR_XML_ERROR,
+ _("unexpected root element <%s>, "
+ "expecting <domstatus>"),
+ root->name);
goto cleanup;
}
virInterfaceDefPtr def = NULL;
if (!xmlStrEqual(root->name, BAD_CAST "interface")) {
- virInterfaceReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("incorrect root element"));
+ virInterfaceReportError(VIR_ERR_XML_ERROR,
+ _("unexpected root element <%s>, "
+ "expecting <interface>"),
+ root->name);
return NULL;
}
virNetworkDefPtr def = NULL;
if (!xmlStrEqual(root->name, BAD_CAST "network")) {
- virNetworkReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("incorrect root element"));
+ virNetworkReportError(VIR_ERR_XML_ERROR,
+ _("unexpected root element <%s>, "
+ "expecting <network>"),
+ root->name);
return NULL;
}
virNodeDeviceDefPtr def = NULL;
if (!xmlStrEqual(root->name, BAD_CAST "device")) {
- virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("incorrect root element"));
+ virNodeDeviceReportError(VIR_ERR_XML_ERROR,
+ _("unexpected root element <%s> "
+ "expecting <device>"),
+ root->name);
return NULL;
}
char *uuidstr = NULL;
if (!xmlStrEqual(root->name, BAD_CAST "secret")) {
- virSecretReportError(VIR_ERR_XML_ERROR, "%s",
- _("incorrect root element"));
+ virSecretReportError(VIR_ERR_XML_ERROR,
+ _("unexpected root element <%s>, "
+ "expecting <secret>"),
+ root->name);
goto cleanup;
}
}
if (!xmlStrEqual(ctxt->node->name, BAD_CAST "domain")) {
- vah_error(NULL, 0, _("incorrect root element"));
+ vah_error(NULL, 0, _("unexpected root element, expecting <domain>"));
goto cleanup;
}