提交 99edc443 编写于 作者: D Daniel P. Berrange

Remove virConnectPtr from all node device XML APIs

The virConnectPtr is no longer required for error reporting since
that is recorded in a thread local. Remove use of virConnectPtr
from all APIs in node_device_conf.{h,c} and update all callers to
match
上级 0677e111
此差异已折叠。
...@@ -217,9 +217,9 @@ struct _virDeviceMonitorState { ...@@ -217,9 +217,9 @@ struct _virDeviceMonitorState {
void *privateData; /* driver-specific private data */ void *privateData; /* driver-specific private data */
}; };
#define virNodeDeviceReportError(conn, code, fmt...) \ #define virNodeDeviceReportError(code, fmt...) \
virReportErrorHelper(conn, VIR_FROM_NODEDEV, code, __FILE__, \ virReportErrorHelper(NULL, VIR_FROM_NODEDEV, code, __FILE__, \
__FUNCTION__, __LINE__, fmt) __FUNCTION__, __LINE__, fmt)
int virNodeDeviceHasCap(const virNodeDeviceObjPtr dev, const char *cap); int virNodeDeviceHasCap(const virNodeDeviceObjPtr dev, const char *cap);
...@@ -229,34 +229,27 @@ virNodeDeviceObjPtr ...@@ -229,34 +229,27 @@ virNodeDeviceObjPtr
virNodeDeviceFindBySysfsPath(const virNodeDeviceObjListPtr devs, virNodeDeviceFindBySysfsPath(const virNodeDeviceObjListPtr devs,
const char *sysfs_path); const char *sysfs_path);
virNodeDeviceObjPtr virNodeDeviceAssignDef(virConnectPtr conn, virNodeDeviceObjPtr virNodeDeviceAssignDef(virNodeDeviceObjListPtr devs,
virNodeDeviceObjListPtr devs,
const virNodeDeviceDefPtr def); const virNodeDeviceDefPtr def);
void virNodeDeviceObjRemove(virNodeDeviceObjListPtr devs, void virNodeDeviceObjRemove(virNodeDeviceObjListPtr devs,
const virNodeDeviceObjPtr dev); const virNodeDeviceObjPtr dev);
char *virNodeDeviceDefFormat(virConnectPtr conn, char *virNodeDeviceDefFormat(const virNodeDeviceDefPtr def);
const virNodeDeviceDefPtr def);
virNodeDeviceDefPtr virNodeDeviceDefParseString(virConnectPtr conn, virNodeDeviceDefPtr virNodeDeviceDefParseString(const char *str,
const char *str,
int create); int create);
virNodeDeviceDefPtr virNodeDeviceDefParseFile(virConnectPtr conn, virNodeDeviceDefPtr virNodeDeviceDefParseFile(const char *filename,
const char *filename,
int create); int create);
virNodeDeviceDefPtr virNodeDeviceDefParseNode(virConnectPtr conn, virNodeDeviceDefPtr virNodeDeviceDefParseNode(xmlDocPtr xml,
xmlDocPtr xml,
xmlNodePtr root, xmlNodePtr root,
int create); int create);
int virNodeDeviceGetWWNs(virConnectPtr conn, int virNodeDeviceGetWWNs(virNodeDeviceDefPtr def,
virNodeDeviceDefPtr def,
char **wwnn, char **wwnn,
char **wwpn); char **wwpn);
int virNodeDeviceGetParentHost(virConnectPtr conn, int virNodeDeviceGetParentHost(const virNodeDeviceObjListPtr devs,
const virNodeDeviceObjListPtr devs,
const char *dev_name, const char *dev_name,
const char *parent_name, const char *parent_name,
int *parent_host); int *parent_host);
......
...@@ -203,7 +203,7 @@ static virNodeDevicePtr nodeDeviceLookupByName(virConnectPtr conn, ...@@ -203,7 +203,7 @@ static virNodeDevicePtr nodeDeviceLookupByName(virConnectPtr conn,
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(conn, VIR_ERR_NO_NODE_DEVICE, NULL); virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
goto cleanup; goto cleanup;
} }
...@@ -274,8 +274,8 @@ static char *nodeDeviceDumpXML(virNodeDevicePtr dev, ...@@ -274,8 +274,8 @@ static char *nodeDeviceDumpXML(virNodeDevicePtr dev,
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE, virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE,
_("no node device with matching name '%s'"), _("no node device with matching name '%s'"),
dev->name); dev->name);
goto cleanup; goto cleanup;
} }
...@@ -283,7 +283,7 @@ static char *nodeDeviceDumpXML(virNodeDevicePtr dev, ...@@ -283,7 +283,7 @@ static char *nodeDeviceDumpXML(virNodeDevicePtr dev,
update_driver_name(obj); update_driver_name(obj);
update_caps(obj); update_caps(obj);
ret = virNodeDeviceDefFormat(dev->conn, obj->def); ret = virNodeDeviceDefFormat(obj->def);
cleanup: cleanup:
if (obj) if (obj)
...@@ -303,8 +303,8 @@ static char *nodeDeviceGetParent(virNodeDevicePtr dev) ...@@ -303,8 +303,8 @@ static char *nodeDeviceGetParent(virNodeDevicePtr dev)
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE, virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE,
_("no node device with matching name '%s'"), _("no node device with matching name '%s'"),
dev->name); dev->name);
goto cleanup; goto cleanup;
} }
...@@ -314,7 +314,7 @@ static char *nodeDeviceGetParent(virNodeDevicePtr dev) ...@@ -314,7 +314,7 @@ static char *nodeDeviceGetParent(virNodeDevicePtr dev)
if (!ret) if (!ret)
virReportOOMError(); virReportOOMError();
} else { } else {
virNodeDeviceReportError(dev->conn, VIR_ERR_INTERNAL_ERROR, virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("no parent for this device")); "%s", _("no parent for this device"));
} }
...@@ -338,8 +338,8 @@ static int nodeDeviceNumOfCaps(virNodeDevicePtr dev) ...@@ -338,8 +338,8 @@ static int nodeDeviceNumOfCaps(virNodeDevicePtr dev)
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE, virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE,
_("no node device with matching name '%s'"), _("no node device with matching name '%s'"),
dev->name); dev->name);
goto cleanup; goto cleanup;
} }
...@@ -369,8 +369,8 @@ nodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames) ...@@ -369,8 +369,8 @@ nodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames)
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE, virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE,
_("no node device with matching name '%s'"), _("no node device with matching name '%s'"),
dev->name); dev->name);
goto cleanup; goto cleanup;
} }
...@@ -397,8 +397,7 @@ cleanup: ...@@ -397,8 +397,7 @@ cleanup:
static int static int
nodeDeviceVportCreateDelete(virConnectPtr conn, nodeDeviceVportCreateDelete(const int parent_host,
const int parent_host,
const char *wwpn, const char *wwpn,
const char *wwnn, const char *wwnn,
int operation) int operation)
...@@ -415,7 +414,7 @@ nodeDeviceVportCreateDelete(virConnectPtr conn, ...@@ -415,7 +414,7 @@ nodeDeviceVportCreateDelete(virConnectPtr conn,
operation_file = LINUX_SYSFS_VPORT_DELETE_POSTFIX; operation_file = LINUX_SYSFS_VPORT_DELETE_POSTFIX;
break; break;
default: default:
virNodeDeviceReportError(conn, VIR_ERR_INTERNAL_ERROR, virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid vport operation (%d)"), operation); _("Invalid vport operation (%d)"), operation);
retval = -1; retval = -1;
goto cleanup; goto cleanup;
...@@ -462,13 +461,13 @@ cleanup: ...@@ -462,13 +461,13 @@ cleanup:
static int static int
get_time(virConnectPtr conn, time_t *t) get_time(time_t *t)
{ {
int ret = 0; int ret = 0;
*t = time(NULL); *t = time(NULL);
if (*t == (time_t)-1) { if (*t == (time_t)-1) {
virNodeDeviceReportError(conn, VIR_ERR_INTERNAL_ERROR, virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Could not get current time")); "%s", _("Could not get current time"));
*t = 0; *t = 0;
...@@ -506,7 +505,7 @@ find_new_device(virConnectPtr conn, const char *wwnn, const char *wwpn) ...@@ -506,7 +505,7 @@ find_new_device(virConnectPtr conn, const char *wwnn, const char *wwpn)
* doesn't become invalid. */ * doesn't become invalid. */
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
get_time(conn, &start); get_time(&start);
while ((now - start) < LINUX_NEW_DEVICE_WAIT_TIME) { while ((now - start) < LINUX_NEW_DEVICE_WAIT_TIME) {
...@@ -519,7 +518,7 @@ find_new_device(virConnectPtr conn, const char *wwnn, const char *wwpn) ...@@ -519,7 +518,7 @@ find_new_device(virConnectPtr conn, const char *wwnn, const char *wwpn)
} }
sleep(5); sleep(5);
if (get_time(conn, &now) == -1) { if (get_time(&now) == -1) {
break; break;
} }
} }
...@@ -542,25 +541,23 @@ nodeDeviceCreateXML(virConnectPtr conn, ...@@ -542,25 +541,23 @@ nodeDeviceCreateXML(virConnectPtr conn,
nodeDeviceLock(driver); nodeDeviceLock(driver);
def = virNodeDeviceDefParseString(conn, xmlDesc, CREATE_DEVICE); def = virNodeDeviceDefParseString(xmlDesc, CREATE_DEVICE);
if (def == NULL) { if (def == NULL) {
goto cleanup; goto cleanup;
} }
if (virNodeDeviceGetWWNs(conn, def, &wwnn, &wwpn) == -1) { if (virNodeDeviceGetWWNs(def, &wwnn, &wwpn) == -1) {
goto cleanup; goto cleanup;
} }
if (virNodeDeviceGetParentHost(conn, if (virNodeDeviceGetParentHost(&driver->devs,
&driver->devs,
def->name, def->name,
def->parent, def->parent,
&parent_host) == -1) { &parent_host) == -1) {
goto cleanup; goto cleanup;
} }
if (nodeDeviceVportCreateDelete(conn, if (nodeDeviceVportCreateDelete(parent_host,
parent_host,
wwpn, wwpn,
wwnn, wwnn,
VPORT_CREATE) == -1) { VPORT_CREATE) == -1) {
...@@ -572,7 +569,7 @@ nodeDeviceCreateXML(virConnectPtr conn, ...@@ -572,7 +569,7 @@ nodeDeviceCreateXML(virConnectPtr conn,
* we're returning what we get... */ * we're returning what we get... */
if (dev == NULL) { if (dev == NULL) {
virNodeDeviceReportError(conn, VIR_ERR_NO_NODE_DEVICE, NULL); virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
} }
cleanup: cleanup:
...@@ -598,11 +595,11 @@ nodeDeviceDestroy(virNodeDevicePtr dev) ...@@ -598,11 +595,11 @@ nodeDeviceDestroy(virNodeDevicePtr dev)
nodeDeviceUnlock(driver); nodeDeviceUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE, NULL); virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
goto out; goto out;
} }
if (virNodeDeviceGetWWNs(dev->conn, obj->def, &wwnn, &wwpn) == -1) { if (virNodeDeviceGetWWNs(obj->def, &wwnn, &wwpn) == -1) {
goto out; goto out;
} }
...@@ -620,16 +617,14 @@ nodeDeviceDestroy(virNodeDevicePtr dev) ...@@ -620,16 +617,14 @@ nodeDeviceDestroy(virNodeDevicePtr dev)
goto out; goto out;
} }
if (virNodeDeviceGetParentHost(dev->conn, if (virNodeDeviceGetParentHost(&driver->devs,
&driver->devs,
dev->name, dev->name,
parent_name, parent_name,
&parent_host) == -1) { &parent_host) == -1) {
goto out; goto out;
} }
if (nodeDeviceVportCreateDelete(dev->conn, if (nodeDeviceVportCreateDelete(parent_host,
parent_host,
wwpn, wwpn,
wwnn, wwnn,
VPORT_DELETE) == -1) { VPORT_DELETE) == -1) {
......
...@@ -465,8 +465,7 @@ static void dev_create(const char *udi) ...@@ -465,8 +465,7 @@ static void dev_create(const char *udi)
/* Some devices don't have a path in sysfs, so ignore failure */ /* Some devices don't have a path in sysfs, so ignore failure */
get_str_prop(ctx, udi, "linux.sysfs_path", &devicePath); get_str_prop(ctx, udi, "linux.sysfs_path", &devicePath);
dev = virNodeDeviceAssignDef(NULL, dev = virNodeDeviceAssignDef(&driverState->devs,
&driverState->devs,
def); def);
if (!dev) { if (!dev) {
......
...@@ -1292,7 +1292,7 @@ static int udevAddOneDevice(struct udev_device *device) ...@@ -1292,7 +1292,7 @@ static int udevAddOneDevice(struct udev_device *device)
} }
nodeDeviceLock(driverState); nodeDeviceLock(driverState);
dev = virNodeDeviceAssignDef(NULL, &driverState->devs, def); dev = virNodeDeviceAssignDef(&driverState->devs, def);
nodeDeviceUnlock(driverState); nodeDeviceUnlock(driverState);
if (dev == NULL) { if (dev == NULL) {
...@@ -1534,7 +1534,7 @@ static int udevSetupSystemDev(void) ...@@ -1534,7 +1534,7 @@ static int udevSetupSystemDev(void)
udev_device_unref(device); udev_device_unref(device);
dev = virNodeDeviceAssignDef(NULL, &driverState->devs, def); dev = virNodeDeviceAssignDef(&driverState->devs, def);
if (dev == NULL) { if (dev == NULL) {
VIR_ERROR("Failed to create device for '%s'", def->name); VIR_ERROR("Failed to create device for '%s'", def->name);
virNodeDeviceDefFree(def); virNodeDeviceDefFree(def);
......
...@@ -8377,7 +8377,7 @@ qemudNodeDeviceGetPciInfo (virNodeDevicePtr dev, ...@@ -8377,7 +8377,7 @@ qemudNodeDeviceGetPciInfo (virNodeDevicePtr dev,
if (!xml) if (!xml)
goto out; goto out;
def = virNodeDeviceDefParseString(dev->conn, xml, EXISTING_DEVICE); def = virNodeDeviceDefParseString(xml, EXISTING_DEVICE);
if (!def) if (!def)
goto out; goto out;
......
...@@ -594,9 +594,9 @@ static int testOpenDefault(virConnectPtr conn) { ...@@ -594,9 +594,9 @@ static int testOpenDefault(virConnectPtr conn) {
virStoragePoolObjUnlock(poolobj); virStoragePoolObjUnlock(poolobj);
/* Init default node device */ /* Init default node device */
if (!(nodedef = virNodeDeviceDefParseString(conn, defaultNodeXML, 0))) if (!(nodedef = virNodeDeviceDefParseString(defaultNodeXML, 0)))
goto error; goto error;
if (!(nodeobj = virNodeDeviceAssignDef(conn, &privconn->devs, if (!(nodeobj = virNodeDeviceAssignDef(&privconn->devs,
nodedef))) { nodedef))) {
virNodeDeviceDefFree(nodedef); virNodeDeviceDefFree(nodedef);
goto error; goto error;
...@@ -1061,15 +1061,15 @@ static int testOpenFromFile(virConnectPtr conn, ...@@ -1061,15 +1061,15 @@ static int testOpenFromFile(virConnectPtr conn,
goto error; goto error;
} }
def = virNodeDeviceDefParseFile(conn, absFile, 0); def = virNodeDeviceDefParseFile(absFile, 0);
VIR_FREE(absFile); VIR_FREE(absFile);
if (!def) if (!def)
goto error; goto error;
} else { } else {
if ((def = virNodeDeviceDefParseNode(conn, xml, devs[i], 0)) == NULL) if ((def = virNodeDeviceDefParseNode(xml, devs[i], 0)) == NULL)
goto error; goto error;
} }
if (!(dev = virNodeDeviceAssignDef(conn, &privconn->devs, def))) { if (!(dev = virNodeDeviceAssignDef(&privconn->devs, def))) {
virNodeDeviceDefFree(def); virNodeDeviceDefFree(def);
goto error; goto error;
} }
...@@ -4778,7 +4778,7 @@ testNodeDeviceLookupByName(virConnectPtr conn, const char *name) ...@@ -4778,7 +4778,7 @@ testNodeDeviceLookupByName(virConnectPtr conn, const char *name)
testDriverUnlock(driver); testDriverUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(conn, VIR_ERR_NO_NODE_DEVICE, NULL); virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
goto cleanup; goto cleanup;
} }
...@@ -4803,13 +4803,13 @@ testNodeDeviceDumpXML(virNodeDevicePtr dev, ...@@ -4803,13 +4803,13 @@ testNodeDeviceDumpXML(virNodeDevicePtr dev,
testDriverUnlock(driver); testDriverUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE, virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE,
_("no node device with matching name '%s'"), _("no node device with matching name '%s'"),
dev->name); dev->name);
goto cleanup; goto cleanup;
} }
ret = virNodeDeviceDefFormat(dev->conn, obj->def); ret = virNodeDeviceDefFormat(obj->def);
cleanup: cleanup:
if (obj) if (obj)
...@@ -4829,7 +4829,7 @@ testNodeDeviceGetParent(virNodeDevicePtr dev) ...@@ -4829,7 +4829,7 @@ testNodeDeviceGetParent(virNodeDevicePtr dev)
testDriverUnlock(driver); testDriverUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE, virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE,
_("no node device with matching name '%s'"), _("no node device with matching name '%s'"),
dev->name); dev->name);
goto cleanup; goto cleanup;
...@@ -4840,7 +4840,7 @@ testNodeDeviceGetParent(virNodeDevicePtr dev) ...@@ -4840,7 +4840,7 @@ testNodeDeviceGetParent(virNodeDevicePtr dev)
if (!ret) if (!ret)
virReportOOMError(); virReportOOMError();
} else { } else {
virNodeDeviceReportError(dev->conn, VIR_ERR_INTERNAL_ERROR, virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("no parent for this device")); "%s", _("no parent for this device"));
} }
...@@ -4865,8 +4865,8 @@ testNodeDeviceNumOfCaps(virNodeDevicePtr dev) ...@@ -4865,8 +4865,8 @@ testNodeDeviceNumOfCaps(virNodeDevicePtr dev)
testDriverUnlock(driver); testDriverUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE, virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE,
_("no node device with matching name '%s'"), _("no node device with matching name '%s'"),
dev->name); dev->name);
goto cleanup; goto cleanup;
} }
...@@ -4896,7 +4896,7 @@ testNodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames) ...@@ -4896,7 +4896,7 @@ testNodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames)
testDriverUnlock(driver); testDriverUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE, virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE,
_("no node device with matching name '%s'"), _("no node device with matching name '%s'"),
dev->name); dev->name);
goto cleanup; goto cleanup;
...@@ -4935,18 +4935,17 @@ testNodeDeviceCreateXML(virConnectPtr conn, ...@@ -4935,18 +4935,17 @@ testNodeDeviceCreateXML(virConnectPtr conn,
testDriverLock(driver); testDriverLock(driver);
def = virNodeDeviceDefParseString(conn, xmlDesc, CREATE_DEVICE); def = virNodeDeviceDefParseString(xmlDesc, CREATE_DEVICE);
if (def == NULL) { if (def == NULL) {
goto cleanup; goto cleanup;
} }
/* We run these next two simply for validation */ /* We run these next two simply for validation */
if (virNodeDeviceGetWWNs(conn, def, &wwnn, &wwpn) == -1) { if (virNodeDeviceGetWWNs(def, &wwnn, &wwpn) == -1) {
goto cleanup; goto cleanup;
} }
if (virNodeDeviceGetParentHost(conn, if (virNodeDeviceGetParentHost(&driver->devs,
&driver->devs,
def->name, def->name,
def->parent, def->parent,
&parent_host) == -1) { &parent_host) == -1) {
...@@ -4973,7 +4972,7 @@ testNodeDeviceCreateXML(virConnectPtr conn, ...@@ -4973,7 +4972,7 @@ testNodeDeviceCreateXML(virConnectPtr conn,
} }
if (!(obj = virNodeDeviceAssignDef(conn, &driver->devs, def))) { if (!(obj = virNodeDeviceAssignDef(&driver->devs, def))) {
goto cleanup; goto cleanup;
} }
virNodeDeviceObjUnlock(obj); virNodeDeviceObjUnlock(obj);
...@@ -5003,11 +5002,11 @@ testNodeDeviceDestroy(virNodeDevicePtr dev) ...@@ -5003,11 +5002,11 @@ testNodeDeviceDestroy(virNodeDevicePtr dev)
testDriverUnlock(driver); testDriverUnlock(driver);
if (!obj) { if (!obj) {
virNodeDeviceReportError(dev->conn, VIR_ERR_NO_NODE_DEVICE, NULL); virNodeDeviceReportError(VIR_ERR_NO_NODE_DEVICE, NULL);
goto out; goto out;
} }
if (virNodeDeviceGetWWNs(dev->conn, obj->def, &wwnn, &wwpn) == -1) { if (virNodeDeviceGetWWNs(obj->def, &wwnn, &wwpn) == -1) {
goto out; goto out;
} }
...@@ -5024,8 +5023,7 @@ testNodeDeviceDestroy(virNodeDevicePtr dev) ...@@ -5024,8 +5023,7 @@ testNodeDeviceDestroy(virNodeDevicePtr dev)
virNodeDeviceObjUnlock(obj); virNodeDeviceObjUnlock(obj);
/* We do this just for basic validation */ /* We do this just for basic validation */
if (virNodeDeviceGetParentHost(dev->conn, if (virNodeDeviceGetParentHost(&driver->devs,
&driver->devs,
dev->name, dev->name,
parent_name, parent_name,
&parent_host) == -1) { &parent_host) == -1) {
......
...@@ -1722,7 +1722,7 @@ xenUnifiedNodeDeviceGetPciInfo (virNodeDevicePtr dev, ...@@ -1722,7 +1722,7 @@ xenUnifiedNodeDeviceGetPciInfo (virNodeDevicePtr dev,
if (!xml) if (!xml)
goto out; goto out;
def = virNodeDeviceDefParseString(dev->conn, xml, EXISTING_DEVICE); def = virNodeDeviceDefParseString(xml, EXISTING_DEVICE);
if (!def) if (!def)
goto out; goto out;
......
...@@ -29,10 +29,10 @@ static int testCompareXMLToXMLFiles(const char *xml) { ...@@ -29,10 +29,10 @@ static int testCompareXMLToXMLFiles(const char *xml) {
if (virtTestLoadFile(xml, &xmlPtr, MAX_FILE) < 0) if (virtTestLoadFile(xml, &xmlPtr, MAX_FILE) < 0)
goto fail; goto fail;
if (!(dev = virNodeDeviceDefParseString(NULL, xmlData, EXISTING_DEVICE))) if (!(dev = virNodeDeviceDefParseString(xmlData, EXISTING_DEVICE)))
goto fail; goto fail;
if (!(actual = virNodeDeviceDefFormat(NULL, dev))) if (!(actual = virNodeDeviceDefFormat(dev)))
goto fail; goto fail;
if (STRNEQ(xmlData, actual)) { if (STRNEQ(xmlData, actual)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册