提交 5d3994d8 编写于 作者: J John Ferlan

nodedev: Remove privateData from virNodeDeviceObj

It was only ever used in node_device_hal.c which really never used it
anyway since the NODE_DEV_UDI was never referenced.  Remove free_udi()
and @privData as well as the references to obj->privateData & obj->privateFree.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 922af89e
...@@ -335,8 +335,6 @@ struct _virNodeDeviceObj { ...@@ -335,8 +335,6 @@ struct _virNodeDeviceObj {
virMutex lock; virMutex lock;
virNodeDeviceDefPtr def; /* device definition */ virNodeDeviceDefPtr def; /* device definition */
void *privateData; /* driver-specific private data */
void (*privateFree)(void *data); /* destructor for private data */
}; };
......
...@@ -246,8 +246,6 @@ virNodeDeviceObjFree(virNodeDeviceObjPtr dev) ...@@ -246,8 +246,6 @@ virNodeDeviceObjFree(virNodeDeviceObjPtr dev)
return; return;
virNodeDeviceDefFree(dev->def); virNodeDeviceDefFree(dev->def);
if (dev->privateFree)
(*dev->privateFree)(dev->privateData);
virMutexDestroy(&dev->lock); virMutexDestroy(&dev->lock);
......
...@@ -52,8 +52,6 @@ VIR_LOG_INIT("node_device.node_device_hal"); ...@@ -52,8 +52,6 @@ VIR_LOG_INIT("node_device.node_device_hal");
#define DRV_STATE_HAL_CTX(ds) ((LibHalContext *)((ds)->privateData)) #define DRV_STATE_HAL_CTX(ds) ((LibHalContext *)((ds)->privateData))
#define NODE_DEV_UDI(obj) ((const char *)((obj)->privateData)
static const char * static const char *
hal_name(const char *udi) hal_name(const char *udi)
...@@ -446,12 +444,6 @@ gather_capabilities(LibHalContext *ctx, const char *udi, ...@@ -446,12 +444,6 @@ gather_capabilities(LibHalContext *ctx, const char *udi,
return rv; return rv;
} }
static void
free_udi(void *udi)
{
VIR_FREE(udi);
}
static void static void
dev_create(const char *udi) dev_create(const char *udi)
{ {
...@@ -462,12 +454,8 @@ dev_create(const char *udi) ...@@ -462,12 +454,8 @@ dev_create(const char *udi)
virNodeDeviceDefPtr objdef; virNodeDeviceDefPtr objdef;
const char *name = hal_name(udi); const char *name = hal_name(udi);
int rv; int rv;
char *privData;
char *devicePath = NULL; char *devicePath = NULL;
if (VIR_STRDUP(privData, udi) < 0)
return;
nodeDeviceLock(); nodeDeviceLock();
ctx = DRV_STATE_HAL_CTX(driver); ctx = DRV_STATE_HAL_CTX(driver);
...@@ -500,8 +488,6 @@ dev_create(const char *udi) ...@@ -500,8 +488,6 @@ dev_create(const char *udi)
} }
objdef = virNodeDeviceObjGetDef(dev); objdef = virNodeDeviceObjGetDef(dev);
dev->privateData = privData;
dev->privateFree = free_udi;
objdef->sysfs_path = devicePath; objdef->sysfs_path = devicePath;
virNodeDeviceObjUnlock(dev); virNodeDeviceObjUnlock(dev);
...@@ -512,7 +498,6 @@ dev_create(const char *udi) ...@@ -512,7 +498,6 @@ dev_create(const char *udi)
failure: failure:
VIR_DEBUG("FAILED TO ADD dev %s", name); VIR_DEBUG("FAILED TO ADD dev %s", name);
cleanup: cleanup:
VIR_FREE(privData);
virNodeDeviceDefFree(def); virNodeDeviceDefFree(def);
nodeDeviceUnlock(); nodeDeviceUnlock();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册