mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 21:15:20 +00:00
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: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
922af89e44
commit
5d3994d822
@ -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)
|
|||||||
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");
|
|||||||
|
|
||||||
#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,
|
|||||||
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)
|
|||||||
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)
|
|||||||
}
|
}
|
||||||
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)
|
|||||||
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();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user