1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-08-03 08:22:34 +03:00

Remove conn parameter from virXPath* functions

It was used for error reporting only.
This commit is contained in:
Matthias Bolte
2010-02-04 22:52:34 +01:00
parent a5ab900d26
commit d5c6183def
17 changed files with 267 additions and 295 deletions

View File

@ -550,7 +550,7 @@ index 6e04112..5b35b60 100644
+{
+ char *s;
+
+ s = virXPathString(conn, xpath, ctxt);
+ s = virXPathString(xpath, ctxt);
+ if (s == NULL) {
+ virNodeDeviceReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ missing_error_fmt,
@ -611,7 +611,7 @@ index 6e04112..5b35b60 100644
goto out;
+ }
+
+ if ((n = virXPathNodeSet(conn, "./capability", ctxt, &nodes)) < 0) {
+ if ((n = virXPathNodeSet("./capability", ctxt, &nodes)) < 0) {
+ virNodeDeviceReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("error parsing SCSI host capabilities for '%s'"),
+ def->name);
@ -713,9 +713,9 @@ index 6e04112..5b35b60 100644
}
/* Extract device name */
- def->name = virXPathString(conn, "string(./name[1])", ctxt);
- def->name = virXPathString("string(./name[1])", ctxt);
+ if (create == EXISTING_DEVICE) {
+ def->name = virXPathString(conn, "string(./name[1])", ctxt);
+ def->name = virXPathString("string(./name[1])", ctxt);
+ } else {
+ def->name = strdup("new device");
+ }