提交 cbbbe7b4 编写于 作者: M Michal Privoznik

datatypes: Rename @parent to @parentName in virNodeDevice

In next patches this name will be needed for a different memeber.
Also, it makes sense to rename the variable because it does not
contain reference to parent device, just its name.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 2a7845b5
...@@ -870,7 +870,7 @@ virNodeDeviceObjListExportCallback(void *payload, ...@@ -870,7 +870,7 @@ virNodeDeviceObjListExportCallback(void *payload,
virNodeDeviceMatch(obj, data->flags)) { virNodeDeviceMatch(obj, data->flags)) {
if (data->devices) { if (data->devices) {
if (!(device = virGetNodeDevice(data->conn, def->name)) || if (!(device = virGetNodeDevice(data->conn, def->name)) ||
VIR_STRDUP(device->parent, def->parent) < 0) { VIR_STRDUP(device->parentName, def->parent) < 0) {
virObjectUnref(device); virObjectUnref(device);
data->error = true; data->error = true;
goto cleanup; goto cleanup;
......
...@@ -653,7 +653,7 @@ virNodeDeviceDispose(void *obj) ...@@ -653,7 +653,7 @@ virNodeDeviceDispose(void *obj)
VIR_DEBUG("release dev %p %s", dev, dev->name); VIR_DEBUG("release dev %p %s", dev, dev->name);
VIR_FREE(dev->name); VIR_FREE(dev->name);
VIR_FREE(dev->parent); VIR_FREE(dev->parentName);
virObjectUnref(dev->conn); virObjectUnref(dev->conn);
} }
......
...@@ -618,7 +618,7 @@ struct _virNodeDevice { ...@@ -618,7 +618,7 @@ struct _virNodeDevice {
virObject object; virObject object;
virConnectPtr conn; /* pointer back to the connection */ virConnectPtr conn; /* pointer back to the connection */
char *name; /* device name (unique on node) */ char *name; /* device name (unique on node) */
char *parent; /* parent device name */ char *parentName; /* parent device name */
}; };
/** /**
......
...@@ -346,16 +346,16 @@ virNodeDeviceGetParent(virNodeDevicePtr dev) ...@@ -346,16 +346,16 @@ virNodeDeviceGetParent(virNodeDevicePtr dev)
virCheckNodeDeviceReturn(dev, NULL); virCheckNodeDeviceReturn(dev, NULL);
if (!dev->parent) { if (!dev->parentName) {
if (dev->conn->nodeDeviceDriver && dev->conn->nodeDeviceDriver->nodeDeviceGetParent) { if (dev->conn->nodeDeviceDriver && dev->conn->nodeDeviceDriver->nodeDeviceGetParent) {
dev->parent = dev->conn->nodeDeviceDriver->nodeDeviceGetParent(dev); dev->parentName = dev->conn->nodeDeviceDriver->nodeDeviceGetParent(dev);
} else { } else {
virReportUnsupportedError(); virReportUnsupportedError();
virDispatchError(dev->conn); virDispatchError(dev->conn);
return NULL; return NULL;
} }
} }
return dev->parent; return dev->parentName;
} }
......
...@@ -256,7 +256,7 @@ nodeDeviceLookupByName(virConnectPtr conn, ...@@ -256,7 +256,7 @@ nodeDeviceLookupByName(virConnectPtr conn,
goto cleanup; goto cleanup;
if ((device = virGetNodeDevice(conn, name))) { if ((device = virGetNodeDevice(conn, name))) {
if (VIR_STRDUP(device->parent, def->parent) < 0) { if (VIR_STRDUP(device->parentName, def->parent) < 0) {
virObjectUnref(device); virObjectUnref(device);
device = NULL; device = NULL;
} }
...@@ -290,7 +290,7 @@ nodeDeviceLookupSCSIHostByWWN(virConnectPtr conn, ...@@ -290,7 +290,7 @@ nodeDeviceLookupSCSIHostByWWN(virConnectPtr conn,
goto cleanup; goto cleanup;
if ((device = virGetNodeDevice(conn, def->name))) { if ((device = virGetNodeDevice(conn, def->name))) {
if (VIR_STRDUP(device->parent, def->parent) < 0) { if (VIR_STRDUP(device->parentName, def->parent) < 0) {
virObjectUnref(device); virObjectUnref(device);
device = NULL; device = NULL;
} }
......
...@@ -3805,7 +3805,7 @@ remoteDispatchNodeDeviceGetParent(virNetServerPtr server ATTRIBUTE_UNUSED, ...@@ -3805,7 +3805,7 @@ remoteDispatchNodeDeviceGetParent(virNetServerPtr server ATTRIBUTE_UNUSED,
parent = virNodeDeviceGetParent(dev); parent = virNodeDeviceGetParent(dev);
if (parent == NULL) { if (parent == NULL) {
ret->parent = NULL; ret->parentName = NULL;
} else { } else {
/* remoteDispatchClientRequest will free this. */ /* remoteDispatchClientRequest will free this. */
char **parent_p; char **parent_p;
...@@ -3815,7 +3815,7 @@ remoteDispatchNodeDeviceGetParent(virNetServerPtr server ATTRIBUTE_UNUSED, ...@@ -3815,7 +3815,7 @@ remoteDispatchNodeDeviceGetParent(virNetServerPtr server ATTRIBUTE_UNUSED,
VIR_FREE(parent_p); VIR_FREE(parent_p);
goto cleanup; goto cleanup;
} }
ret->parent = parent_p; ret->parentName = parent_p;
} }
rv = 0; rv = 0;
......
...@@ -2028,7 +2028,7 @@ struct remote_node_device_get_parent_args { ...@@ -2028,7 +2028,7 @@ struct remote_node_device_get_parent_args {
}; };
struct remote_node_device_get_parent_ret { struct remote_node_device_get_parent_ret {
remote_string parent; remote_string parentName;
}; };
struct remote_node_device_num_of_caps_args { struct remote_node_device_num_of_caps_args {
......
...@@ -1541,7 +1541,7 @@ struct remote_node_device_get_parent_args { ...@@ -1541,7 +1541,7 @@ struct remote_node_device_get_parent_args {
remote_nonnull_string name; remote_nonnull_string name;
}; };
struct remote_node_device_get_parent_ret { struct remote_node_device_get_parent_ret {
remote_string parent; remote_string parentName;
}; };
struct remote_node_device_num_of_caps_args { struct remote_node_device_num_of_caps_args {
remote_nonnull_string name; remote_nonnull_string name;
......
...@@ -5416,7 +5416,7 @@ testNodeDeviceLookupByName(virConnectPtr conn, const char *name) ...@@ -5416,7 +5416,7 @@ testNodeDeviceLookupByName(virConnectPtr conn, const char *name)
def = virNodeDeviceObjGetDef(obj); def = virNodeDeviceObjGetDef(obj);
if ((ret = virGetNodeDevice(conn, name))) { if ((ret = virGetNodeDevice(conn, name))) {
if (VIR_STRDUP(ret->parent, def->parent) < 0) { if (VIR_STRDUP(ret->parentName, def->parent) < 0) {
virObjectUnref(ret); virObjectUnref(ret);
ret = NULL; ret = NULL;
} }
...@@ -5641,8 +5641,8 @@ testNodeDeviceCreateXML(virConnectPtr conn, ...@@ -5641,8 +5641,8 @@ testNodeDeviceCreateXML(virConnectPtr conn,
if (!(dev = virGetNodeDevice(conn, objdef->name))) if (!(dev = virGetNodeDevice(conn, objdef->name)))
goto cleanup; goto cleanup;
VIR_FREE(dev->parent); VIR_FREE(dev->parentName);
if (VIR_STRDUP(dev->parent, def->parent) < 0) if (VIR_STRDUP(dev->parentName, def->parent) < 0)
goto cleanup; goto cleanup;
ret = dev; ret = dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册