mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
virobject: Introduce VIR_CLASS_NEW() macro
So far we are repeating the following lines over and over: if (!(virSomeObjectClass = virClassNew(virClassForObject(), "virSomeObject", sizeof(virSomeObject), virSomeObjectDispose))) return -1; While this works, it is impossible to do some checking. Firstly, the class name (the 2nd argument) doesn't match the name in the code in all cases (the 3rd argument). Secondly, the current style is needlessly verbose. This commit turns example into following: if (!(VIR_CLASS_NEW(virSomeObject, virClassForObject))) return -1; Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
4e42981b36
commit
10f94828ea
@ -54,10 +54,7 @@ static void virAccessManagerDispose(void *obj);
|
|||||||
|
|
||||||
static int virAccessManagerOnceInit(void)
|
static int virAccessManagerOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virAccessManagerClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virAccessManager, virClassForObjectLockable()))
|
||||||
"virAccessManagerClass",
|
|
||||||
sizeof(virAccessManager),
|
|
||||||
virAccessManagerDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -36,10 +36,7 @@ static void virBhyveDriverConfigDispose(void *obj);
|
|||||||
|
|
||||||
static int virBhyveConfigOnceInit(void)
|
static int virBhyveConfigOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virBhyveDriverConfigClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virBhyveDriverConfig, virClassForObject()))
|
||||||
"virBhyveDriverConfig",
|
|
||||||
sizeof(virBhyveDriverConfig),
|
|
||||||
virBhyveDriverConfigDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -62,10 +62,7 @@ static void virCapsDispose(void *obj);
|
|||||||
|
|
||||||
static int virCapabilitiesOnceInit(void)
|
static int virCapabilitiesOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virCapsClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virCaps, virClassForObject()))
|
||||||
"virCaps",
|
|
||||||
sizeof(virCaps),
|
|
||||||
virCapsDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -40,17 +40,10 @@ static void virDomainCapsCPUModelsDispose(void *obj);
|
|||||||
|
|
||||||
static int virDomainCapsOnceInit(void)
|
static int virDomainCapsOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virDomainCapsClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virDomainCaps, virClassForObjectLockable()))
|
||||||
"virDomainCapsClass",
|
|
||||||
sizeof(virDomainCaps),
|
|
||||||
virDomainCapsDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virDomainCapsCPUModelsClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virDomainCapsCPUModels, virClassForObject()))
|
||||||
"virDomainCapsCPUModelsClass",
|
|
||||||
sizeof(virDomainCapsCPUModels),
|
|
||||||
virDomainCapsCPUModelsDispose);
|
|
||||||
if (!virDomainCapsCPUModelsClass)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -938,16 +938,10 @@ static void virDomainXMLOptionDispose(void *obj);
|
|||||||
|
|
||||||
static int virDomainObjOnceInit(void)
|
static int virDomainObjOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virDomainObjClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virDomainObj, virClassForObjectLockable()))
|
||||||
"virDomainObj",
|
|
||||||
sizeof(virDomainObj),
|
|
||||||
virDomainObjDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virDomainXMLOptionClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virDomainXMLOption, virClassForObject()))
|
||||||
"virDomainXMLOption",
|
|
||||||
sizeof(virDomainXMLOption),
|
|
||||||
virDomainXMLOptionDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -12223,14 +12217,10 @@ static virClassPtr virDomainChrSourceDefClass;
|
|||||||
static int
|
static int
|
||||||
virDomainChrSourceDefOnceInit(void)
|
virDomainChrSourceDefOnceInit(void)
|
||||||
{
|
{
|
||||||
virDomainChrSourceDefClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virDomainChrSourceDef, virClassForObject()))
|
||||||
"virDomainChrSourceDef",
|
|
||||||
sizeof(virDomainChrSourceDef),
|
|
||||||
virDomainChrSourceDefDispose);
|
|
||||||
if (!virDomainChrSourceDefClass)
|
|
||||||
return -1;
|
return -1;
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_ONCE_GLOBAL_INIT(virDomainChrSourceDef);
|
VIR_ONCE_GLOBAL_INIT(virDomainChrSourceDef);
|
||||||
|
@ -295,131 +295,47 @@ typedef virDomainEventBlockThreshold *virDomainEventBlockThresholdPtr;
|
|||||||
static int
|
static int
|
||||||
virDomainEventsOnceInit(void)
|
virDomainEventsOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virDomainEventClass =
|
if (!VIR_CLASS_NEW(virDomainEvent, virClassForObjectEvent()))
|
||||||
virClassNew(virClassForObjectEvent(),
|
|
||||||
"virDomainEvent",
|
|
||||||
sizeof(virDomainEvent),
|
|
||||||
virDomainEventDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventLifecycleClass =
|
if (!VIR_CLASS_NEW(virDomainEventLifecycle, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventLifecycle",
|
|
||||||
sizeof(virDomainEventLifecycle),
|
|
||||||
virDomainEventLifecycleDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventRTCChangeClass =
|
if (!VIR_CLASS_NEW(virDomainEventRTCChange, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventRTCChange",
|
|
||||||
sizeof(virDomainEventRTCChange),
|
|
||||||
virDomainEventRTCChangeDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventWatchdogClass =
|
if (!VIR_CLASS_NEW(virDomainEventWatchdog, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventWatchdog",
|
|
||||||
sizeof(virDomainEventWatchdog),
|
|
||||||
virDomainEventWatchdogDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventIOErrorClass =
|
if (!VIR_CLASS_NEW(virDomainEventIOError, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventIOError",
|
|
||||||
sizeof(virDomainEventIOError),
|
|
||||||
virDomainEventIOErrorDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventGraphicsClass =
|
if (!VIR_CLASS_NEW(virDomainEventGraphics, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventGraphics",
|
|
||||||
sizeof(virDomainEventGraphics),
|
|
||||||
virDomainEventGraphicsDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventBlockJobClass =
|
if (!VIR_CLASS_NEW(virDomainEventBlockJob, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventBlockJob",
|
|
||||||
sizeof(virDomainEventBlockJob),
|
|
||||||
virDomainEventBlockJobDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventDiskChangeClass =
|
if (!VIR_CLASS_NEW(virDomainEventDiskChange, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventDiskChange",
|
|
||||||
sizeof(virDomainEventDiskChange),
|
|
||||||
virDomainEventDiskChangeDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventTrayChangeClass =
|
if (!VIR_CLASS_NEW(virDomainEventTrayChange, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventTrayChange",
|
|
||||||
sizeof(virDomainEventTrayChange),
|
|
||||||
virDomainEventTrayChangeDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventBalloonChangeClass =
|
if (!VIR_CLASS_NEW(virDomainEventBalloonChange, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventBalloonChange",
|
|
||||||
sizeof(virDomainEventBalloonChange),
|
|
||||||
virDomainEventBalloonChangeDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventDeviceRemovedClass =
|
if (!VIR_CLASS_NEW(virDomainEventDeviceRemoved, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventDeviceRemoved",
|
|
||||||
sizeof(virDomainEventDeviceRemoved),
|
|
||||||
virDomainEventDeviceRemovedDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventDeviceAddedClass =
|
if (!VIR_CLASS_NEW(virDomainEventDeviceAdded, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventDeviceAdded",
|
|
||||||
sizeof(virDomainEventDeviceAdded),
|
|
||||||
virDomainEventDeviceAddedDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventPMClass =
|
if (!VIR_CLASS_NEW(virDomainEventPM, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventPM",
|
|
||||||
sizeof(virDomainEventPM),
|
|
||||||
virDomainEventPMDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainQemuMonitorEventClass =
|
if (!VIR_CLASS_NEW(virDomainQemuMonitorEvent, virClassForObjectEvent()))
|
||||||
virClassNew(virClassForObjectEvent(),
|
|
||||||
"virDomainQemuMonitorEvent",
|
|
||||||
sizeof(virDomainQemuMonitorEvent),
|
|
||||||
virDomainQemuMonitorEventDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventTunableClass =
|
if (!VIR_CLASS_NEW(virDomainEventTunable, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventTunable",
|
|
||||||
sizeof(virDomainEventTunable),
|
|
||||||
virDomainEventTunableDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventAgentLifecycleClass =
|
if (!VIR_CLASS_NEW(virDomainEventAgentLifecycle, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventAgentLifecycle",
|
|
||||||
sizeof(virDomainEventAgentLifecycle),
|
|
||||||
virDomainEventAgentLifecycleDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventMigrationIterationClass =
|
if (!VIR_CLASS_NEW(virDomainEventMigrationIteration, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventMigrationIteration",
|
|
||||||
sizeof(virDomainEventMigrationIteration),
|
|
||||||
virDomainEventMigrationIterationDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventJobCompletedClass =
|
if (!VIR_CLASS_NEW(virDomainEventJobCompleted, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventJobCompleted",
|
|
||||||
sizeof(virDomainEventJobCompleted),
|
|
||||||
virDomainEventJobCompletedDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventDeviceRemovalFailedClass =
|
if (!VIR_CLASS_NEW(virDomainEventDeviceRemovalFailed, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventDeviceRemovalFailed",
|
|
||||||
sizeof(virDomainEventDeviceRemovalFailed),
|
|
||||||
virDomainEventDeviceRemovalFailedDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventMetadataChangeClass =
|
if (!VIR_CLASS_NEW(virDomainEventMetadataChange, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventMetadataChange",
|
|
||||||
sizeof(virDomainEventMetadataChange),
|
|
||||||
virDomainEventMetadataChangeDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virDomainEventBlockThresholdClass =
|
if (!VIR_CLASS_NEW(virDomainEventBlockThreshold, virDomainEventClass))
|
||||||
virClassNew(virDomainEventClass,
|
|
||||||
"virDomainEventBlockThreshold",
|
|
||||||
sizeof(virDomainEventBlockThreshold),
|
|
||||||
virDomainEventBlockThresholdDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -57,18 +57,12 @@ static void virNetworkEventLifecycleDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
virNetworkEventsOnceInit(void)
|
virNetworkEventsOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetworkEventClass =
|
if (!VIR_CLASS_NEW(virNetworkEvent, virClassForObjectEvent()))
|
||||||
virClassNew(virClassForObjectEvent(),
|
|
||||||
"virNetworkEvent",
|
|
||||||
sizeof(virNetworkEvent),
|
|
||||||
virNetworkEventDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virNetworkEventLifecycleClass =
|
|
||||||
virClassNew(virNetworkEventClass,
|
if (!VIR_CLASS_NEW(virNetworkEventLifecycle, virNetworkEventClass))
|
||||||
"virNetworkEventLifecycle",
|
|
||||||
sizeof(virNetworkEventLifecycle),
|
|
||||||
virNetworkEventLifecycleDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,24 +66,15 @@ static void virNodeDeviceEventUpdateDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
virNodeDeviceEventsOnceInit(void)
|
virNodeDeviceEventsOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNodeDeviceEventClass =
|
if (!VIR_CLASS_NEW(virNodeDeviceEvent, virClassForObjectEvent()))
|
||||||
virClassNew(virClassForObjectEvent(),
|
|
||||||
"virNodeDeviceEvent",
|
|
||||||
sizeof(virNodeDeviceEvent),
|
|
||||||
virNodeDeviceEventDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virNodeDeviceEventLifecycleClass =
|
|
||||||
virClassNew(virNodeDeviceEventClass,
|
if (!VIR_CLASS_NEW(virNodeDeviceEventLifecycle, virNodeDeviceEventClass))
|
||||||
"virNodeDeviceEventLifecycle",
|
|
||||||
sizeof(virNodeDeviceEventLifecycle),
|
|
||||||
virNodeDeviceEventLifecycleDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virNodeDeviceEventUpdateClass =
|
|
||||||
virClassNew(virNodeDeviceEventClass,
|
if (!VIR_CLASS_NEW(virNodeDeviceEventUpdate, virNodeDeviceEventClass))
|
||||||
"virNodeDeviceEventUpdate",
|
|
||||||
sizeof(virNodeDeviceEventUpdate),
|
|
||||||
virNodeDeviceEventUpdateDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,18 +92,10 @@ static void virObjectEventStateDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
virObjectEventOnceInit(void)
|
virObjectEventOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virObjectEventStateClass =
|
if (!VIR_CLASS_NEW(virObjectEventState, virClassForObjectLockable()))
|
||||||
virClassNew(virClassForObjectLockable(),
|
|
||||||
"virObjectEventState",
|
|
||||||
sizeof(virObjectEventState),
|
|
||||||
virObjectEventStateDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virObjectEventClass =
|
if (!VIR_CLASS_NEW(virObjectEvent, virClassForObject()))
|
||||||
virClassNew(virClassForObject(),
|
|
||||||
"virObjectEvent",
|
|
||||||
sizeof(virObjectEvent),
|
|
||||||
virObjectEventDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -65,24 +65,15 @@ static void virSecretEventValueChangedDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
virSecretEventsOnceInit(void)
|
virSecretEventsOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virSecretEventClass =
|
if (!VIR_CLASS_NEW(virSecretEvent, virClassForObjectEvent()))
|
||||||
virClassNew(virClassForObjectEvent(),
|
|
||||||
"virSecretEvent",
|
|
||||||
sizeof(virSecretEvent),
|
|
||||||
virSecretEventDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virSecretEventLifecycleClass =
|
|
||||||
virClassNew(virSecretEventClass,
|
if (!VIR_CLASS_NEW(virSecretEventLifecycle, virSecretEventClass))
|
||||||
"virSecretEventLifecycle",
|
|
||||||
sizeof(virSecretEventLifecycle),
|
|
||||||
virSecretEventLifecycleDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virSecretEventValueChangedClass =
|
|
||||||
virClassNew(virSecretEventClass,
|
if (!VIR_CLASS_NEW(virSecretEventValueChanged, virSecretEventClass))
|
||||||
"virSecretEventValueChanged",
|
|
||||||
sizeof(virSecretEventValueChanged),
|
|
||||||
virSecretEventValueChangedDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,24 +66,15 @@ static void virStoragePoolEventRefreshDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
virStoragePoolEventsOnceInit(void)
|
virStoragePoolEventsOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virStoragePoolEventClass =
|
if (!VIR_CLASS_NEW(virStoragePoolEvent, virClassForObjectEvent()))
|
||||||
virClassNew(virClassForObjectEvent(),
|
|
||||||
"virStoragePoolEvent",
|
|
||||||
sizeof(virStoragePoolEvent),
|
|
||||||
virStoragePoolEventDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virStoragePoolEventLifecycleClass =
|
|
||||||
virClassNew(virStoragePoolEventClass,
|
if (!VIR_CLASS_NEW(virStoragePoolEventLifecycle, virStoragePoolEventClass))
|
||||||
"virStoragePoolEventLifecycle",
|
|
||||||
sizeof(virStoragePoolEventLifecycle),
|
|
||||||
virStoragePoolEventLifecycleDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
if (!(virStoragePoolEventRefreshClass =
|
|
||||||
virClassNew(virStoragePoolEventClass,
|
if (!VIR_CLASS_NEW(virStoragePoolEventRefresh, virStoragePoolEventClass))
|
||||||
"virStoragePoolEventRefresh",
|
|
||||||
sizeof(virStoragePoolEventRefresh),
|
|
||||||
virStoragePoolEventRefreshDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,10 +56,7 @@ struct _virDomainObjList {
|
|||||||
|
|
||||||
static int virDomainObjListOnceInit(void)
|
static int virDomainObjListOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virDomainObjListClass = virClassNew(virClassForObjectRWLockable(),
|
if (!VIR_CLASS_NEW(virDomainObjList, virClassForObjectRWLockable()))
|
||||||
"virDomainObjList",
|
|
||||||
sizeof(virDomainObjList),
|
|
||||||
virDomainObjListDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -58,16 +58,10 @@ static void virInterfaceObjListDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
virInterfaceObjOnceInit(void)
|
virInterfaceObjOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virInterfaceObjClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virInterfaceObj, virClassForObjectLockable()))
|
||||||
"virInterfaceObj",
|
|
||||||
sizeof(virInterfaceObj),
|
|
||||||
virInterfaceObjDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virInterfaceObjListClass = virClassNew(virClassForObjectRWLockable(),
|
if (!VIR_CLASS_NEW(virInterfaceObjList, virClassForObjectRWLockable()))
|
||||||
"virInterfaceObjList",
|
|
||||||
sizeof(virInterfaceObjList),
|
|
||||||
virInterfaceObjListDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -74,17 +74,12 @@ static void virNetworkObjListDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
virNetworkObjOnceInit(void)
|
virNetworkObjOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetworkObjClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetworkObj, virClassForObjectLockable()))
|
||||||
"virNetworkObj",
|
|
||||||
sizeof(virNetworkObj),
|
|
||||||
virNetworkObjDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virNetworkObjListClass = virClassNew(virClassForObjectRWLockable(),
|
if (!VIR_CLASS_NEW(virNetworkObjList, virClassForObjectRWLockable()))
|
||||||
"virNetworkObjList",
|
|
||||||
sizeof(virNetworkObjList),
|
|
||||||
virNetworkObjListDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,16 +58,10 @@ static bool virNodeDeviceObjHasCap(const virNodeDeviceObj *obj, int type);
|
|||||||
static int
|
static int
|
||||||
virNodeDeviceObjOnceInit(void)
|
virNodeDeviceObjOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNodeDeviceObjClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNodeDeviceObj, virClassForObjectLockable()))
|
||||||
"virNodeDeviceObj",
|
|
||||||
sizeof(virNodeDeviceObj),
|
|
||||||
virNodeDeviceObjDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virNodeDeviceObjListClass = virClassNew(virClassForObjectRWLockable(),
|
if (!VIR_CLASS_NEW(virNodeDeviceObjList, virClassForObjectRWLockable()))
|
||||||
"virNodeDeviceObjList",
|
|
||||||
sizeof(virNodeDeviceObjList),
|
|
||||||
virNodeDeviceObjListDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -68,16 +68,10 @@ struct virSecretSearchData {
|
|||||||
static int
|
static int
|
||||||
virSecretObjOnceInit(void)
|
virSecretObjOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virSecretObjClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virSecretObj, virClassForObjectLockable()))
|
||||||
"virSecretObj",
|
|
||||||
sizeof(virSecretObj),
|
|
||||||
virSecretObjDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virSecretObjListClass = virClassNew(virClassForObjectRWLockable(),
|
if (!VIR_CLASS_NEW(virSecretObjList, virClassForObjectRWLockable()))
|
||||||
"virSecretObjList",
|
|
||||||
sizeof(virSecretObjList),
|
|
||||||
virSecretObjListDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -110,16 +110,10 @@ struct _virStoragePoolObjList {
|
|||||||
static int
|
static int
|
||||||
virStorageVolObjOnceInit(void)
|
virStorageVolObjOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virStorageVolObjClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virStorageVolObj, virClassForObjectLockable()))
|
||||||
"virStorageVolObj",
|
|
||||||
sizeof(virStorageVolObj),
|
|
||||||
virStorageVolObjDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virStorageVolObjListClass = virClassNew(virClassForObjectRWLockable(),
|
if (!VIR_CLASS_NEW(virStorageVolObjList, virClassForObjectRWLockable()))
|
||||||
"virStorageVolObjList",
|
|
||||||
sizeof(virStorageVolObjList),
|
|
||||||
virStorageVolObjListDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -207,16 +201,10 @@ virStorageVolObjListDispose(void *opaque)
|
|||||||
static int
|
static int
|
||||||
virStoragePoolObjOnceInit(void)
|
virStoragePoolObjOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virStoragePoolObjClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virStoragePoolObj, virClassForObjectLockable()))
|
||||||
"virStoragePoolObj",
|
|
||||||
sizeof(virStoragePoolObj),
|
|
||||||
virStoragePoolObjDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virStoragePoolObjListClass = virClassNew(virClassForObjectRWLockable(),
|
if (!VIR_CLASS_NEW(virStoragePoolObjList, virClassForObjectRWLockable()))
|
||||||
"virStoragePoolObjList",
|
|
||||||
sizeof(virStoragePoolObjList),
|
|
||||||
virStoragePoolObjListDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -74,10 +74,7 @@ static int
|
|||||||
virDataTypesOnceInit(void)
|
virDataTypesOnceInit(void)
|
||||||
{
|
{
|
||||||
#define DECLARE_CLASS_COMMON(basename, parent) \
|
#define DECLARE_CLASS_COMMON(basename, parent) \
|
||||||
if (!(basename ## Class = virClassNew(parent, \
|
if (!(VIR_CLASS_NEW(basename, parent))) \
|
||||||
#basename, \
|
|
||||||
sizeof(basename), \
|
|
||||||
basename ## Dispose))) \
|
|
||||||
return -1;
|
return -1;
|
||||||
#define DECLARE_CLASS(basename) \
|
#define DECLARE_CLASS(basename) \
|
||||||
DECLARE_CLASS_COMMON(basename, virClassForObject())
|
DECLARE_CLASS_COMMON(basename, virClassForObject())
|
||||||
|
@ -55,11 +55,9 @@ static void virNetcfDriverStateDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
virNetcfDriverStateOnceInit(void)
|
virNetcfDriverStateOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetcfDriverStateClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetcfDriverState, virClassForObjectLockable()))
|
||||||
"virNetcfDriverState",
|
|
||||||
sizeof(virNetcfDriverState),
|
|
||||||
virNetcfDriverStateDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,10 +67,7 @@ virAdmGlobalInit(void)
|
|||||||
if (!bindtextdomain(PACKAGE, LOCALEDIR))
|
if (!bindtextdomain(PACKAGE, LOCALEDIR))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!(remoteAdminPrivClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(remoteAdminPriv, virClassForObjectLockable()))
|
||||||
"remoteAdminPriv",
|
|
||||||
sizeof(remoteAdminPriv),
|
|
||||||
remoteAdminPrivDispose)))
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -63,10 +63,7 @@ static void libxlDriverConfigDispose(void *obj);
|
|||||||
|
|
||||||
static int libxlConfigOnceInit(void)
|
static int libxlConfigOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(libxlDriverConfigClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(libxlDriverConfig, virClassForObject()))
|
||||||
"libxlDriverConfig",
|
|
||||||
sizeof(libxlDriverConfig),
|
|
||||||
libxlDriverConfigDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -58,10 +58,7 @@ libxlDomainObjPrivateDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
libxlDomainObjPrivateOnceInit(void)
|
libxlDomainObjPrivateOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(libxlDomainObjPrivateClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(libxlDomainObjPrivate, virClassForObjectLockable()))
|
||||||
"libxlDomainObjPrivate",
|
|
||||||
sizeof(libxlDomainObjPrivate),
|
|
||||||
libxlDomainObjPrivateDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -244,10 +244,7 @@ libxlMigrationDstArgsDispose(void *obj)
|
|||||||
static int
|
static int
|
||||||
libxlMigrationDstArgsOnceInit(void)
|
libxlMigrationDstArgsOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(libxlMigrationDstArgsClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(libxlMigrationDstArgs, virClassForObject()))
|
||||||
"libxlMigrationDstArgs",
|
|
||||||
sizeof(libxlMigrationDstArgs),
|
|
||||||
libxlMigrationDstArgsDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -76,10 +76,7 @@ static void virLogHandlerDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
virLogHandlerOnceInit(void)
|
virLogHandlerOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virLogHandlerClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virLogHandler, virClassForObjectLockable()))
|
||||||
"virLogHandler",
|
|
||||||
sizeof(virLogHandler),
|
|
||||||
virLogHandlerDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -48,10 +48,7 @@ static void virLXCDriverConfigDispose(void *obj);
|
|||||||
|
|
||||||
static int virLXCConfigOnceInit(void)
|
static int virLXCConfigOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virLXCDriverConfigClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virLXCDriverConfig, virClassForObject()))
|
||||||
"virLXCDriverConfig",
|
|
||||||
sizeof(virLXCDriverConfig),
|
|
||||||
virLXCDriverConfigDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -51,10 +51,7 @@ static void virLXCMonitorDispose(void *obj);
|
|||||||
|
|
||||||
static int virLXCMonitorOnceInit(void)
|
static int virLXCMonitorOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virLXCMonitorClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virLXCMonitor, virClassForObjectLockable()))
|
||||||
"virLXCMonitor",
|
|
||||||
sizeof(virLXCMonitor),
|
|
||||||
virLXCMonitorDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -93,10 +93,7 @@ udevEventDataDispose(void *obj)
|
|||||||
static int
|
static int
|
||||||
udevEventDataOnceInit(void)
|
udevEventDataOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(udevEventDataClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(udevEventData, virClassForObjectLockable()))
|
||||||
"udevEventData",
|
|
||||||
sizeof(udevEventData),
|
|
||||||
udevEventDataDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -138,10 +138,7 @@ static void qemuAgentDispose(void *obj);
|
|||||||
|
|
||||||
static int qemuAgentOnceInit(void)
|
static int qemuAgentOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(qemuAgentClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(qemuAgent, virClassForObjectLockable()))
|
||||||
"qemuAgent",
|
|
||||||
sizeof(qemuAgent),
|
|
||||||
qemuAgentDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -552,10 +552,7 @@ static void virQEMUCapsDispose(void *obj);
|
|||||||
|
|
||||||
static int virQEMUCapsOnceInit(void)
|
static int virQEMUCapsOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virQEMUCapsClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virQEMUCaps, virClassForObject()))
|
||||||
"virQEMUCaps",
|
|
||||||
sizeof(virQEMUCaps),
|
|
||||||
virQEMUCapsDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -80,15 +80,10 @@ static void virQEMUDriverConfigDispose(void *obj);
|
|||||||
|
|
||||||
static int virQEMUConfigOnceInit(void)
|
static int virQEMUConfigOnceInit(void)
|
||||||
{
|
{
|
||||||
virQEMUDriverConfigClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virQEMUDriverConfig, virClassForObject()))
|
||||||
"virQEMUDriverConfig",
|
|
||||||
sizeof(virQEMUDriverConfig),
|
|
||||||
virQEMUDriverConfigDispose);
|
|
||||||
|
|
||||||
if (!virQEMUDriverConfigClass)
|
|
||||||
return -1;
|
return -1;
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_ONCE_GLOBAL_INIT(virQEMUConfig)
|
VIR_ONCE_GLOBAL_INIT(virQEMUConfig)
|
||||||
|
@ -131,16 +131,10 @@ static void qemuDomainSaveCookieDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
qemuDomainOnceInit(void)
|
qemuDomainOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(qemuDomainLogContextClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(qemuDomainLogContext, virClassForObject()))
|
||||||
"qemuDomainLogContext",
|
|
||||||
sizeof(qemuDomainLogContext),
|
|
||||||
qemuDomainLogContextDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(qemuDomainSaveCookieClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(qemuDomainSaveCookie, virClassForObject()))
|
||||||
"qemuDomainSaveCookie",
|
|
||||||
sizeof(qemuDomainSaveCookie),
|
|
||||||
qemuDomainSaveCookieDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -992,14 +986,10 @@ static void qemuDomainDiskPrivateDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
qemuDomainDiskPrivateOnceInit(void)
|
qemuDomainDiskPrivateOnceInit(void)
|
||||||
{
|
{
|
||||||
qemuDomainDiskPrivateClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(qemuDomainDiskPrivate, virClassForObject()))
|
||||||
"qemuDomainDiskPrivate",
|
|
||||||
sizeof(qemuDomainDiskPrivate),
|
|
||||||
qemuDomainDiskPrivateDispose);
|
|
||||||
if (!qemuDomainDiskPrivateClass)
|
|
||||||
return -1;
|
return -1;
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_ONCE_GLOBAL_INIT(qemuDomainDiskPrivate)
|
VIR_ONCE_GLOBAL_INIT(qemuDomainDiskPrivate)
|
||||||
@ -1032,14 +1022,10 @@ static void qemuDomainStorageSourcePrivateDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
qemuDomainStorageSourcePrivateOnceInit(void)
|
qemuDomainStorageSourcePrivateOnceInit(void)
|
||||||
{
|
{
|
||||||
qemuDomainStorageSourcePrivateClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(qemuDomainStorageSourcePrivate, virClassForObject()))
|
||||||
"qemuDomainStorageSourcePrivate",
|
|
||||||
sizeof(qemuDomainStorageSourcePrivate),
|
|
||||||
qemuDomainStorageSourcePrivateDispose);
|
|
||||||
if (!qemuDomainStorageSourcePrivateClass)
|
|
||||||
return -1;
|
return -1;
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_ONCE_GLOBAL_INIT(qemuDomainStorageSourcePrivate)
|
VIR_ONCE_GLOBAL_INIT(qemuDomainStorageSourcePrivate)
|
||||||
@ -1075,14 +1061,10 @@ static void qemuDomainVcpuPrivateDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
qemuDomainVcpuPrivateOnceInit(void)
|
qemuDomainVcpuPrivateOnceInit(void)
|
||||||
{
|
{
|
||||||
qemuDomainVcpuPrivateClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(qemuDomainVcpuPrivate, virClassForObject()))
|
||||||
"qemuDomainVcpuPrivate",
|
|
||||||
sizeof(qemuDomainVcpuPrivate),
|
|
||||||
qemuDomainVcpuPrivateDispose);
|
|
||||||
if (!qemuDomainVcpuPrivateClass)
|
|
||||||
return -1;
|
return -1;
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_ONCE_GLOBAL_INIT(qemuDomainVcpuPrivate)
|
VIR_ONCE_GLOBAL_INIT(qemuDomainVcpuPrivate)
|
||||||
@ -1119,15 +1101,10 @@ static void qemuDomainChrSourcePrivateDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
qemuDomainChrSourcePrivateOnceInit(void)
|
qemuDomainChrSourcePrivateOnceInit(void)
|
||||||
{
|
{
|
||||||
qemuDomainChrSourcePrivateClass =
|
if (!VIR_CLASS_NEW(qemuDomainChrSourcePrivate, virClassForObject()))
|
||||||
virClassNew(virClassForObject(),
|
|
||||||
"qemuDomainChrSourcePrivate",
|
|
||||||
sizeof(qemuDomainChrSourcePrivate),
|
|
||||||
qemuDomainChrSourcePrivateDispose);
|
|
||||||
if (!qemuDomainChrSourcePrivateClass)
|
|
||||||
return -1;
|
return -1;
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_ONCE_GLOBAL_INIT(qemuDomainChrSourcePrivate)
|
VIR_ONCE_GLOBAL_INIT(qemuDomainChrSourcePrivate)
|
||||||
|
@ -165,10 +165,7 @@ static void qemuMonitorDispose(void *obj);
|
|||||||
|
|
||||||
static int qemuMonitorOnceInit(void)
|
static int qemuMonitorOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(qemuMonitorClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(qemuMonitor, virClassForObjectLockable()))
|
||||||
"qemuMonitor",
|
|
||||||
sizeof(qemuMonitor),
|
|
||||||
qemuMonitorDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -58,10 +58,7 @@ static void virKeepAliveDispose(void *obj);
|
|||||||
|
|
||||||
static int virKeepAliveOnceInit(void)
|
static int virKeepAliveOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virKeepAliveClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virKeepAlive, virClassForObjectLockable()))
|
||||||
"virKeepAlive",
|
|
||||||
sizeof(virKeepAlive),
|
|
||||||
virKeepAliveDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -120,10 +120,7 @@ static void virNetClientDispose(void *obj);
|
|||||||
|
|
||||||
static int virNetClientOnceInit(void)
|
static int virNetClientOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetClientClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetClient, virClassForObjectLockable()))
|
||||||
"virNetClient",
|
|
||||||
sizeof(virNetClient),
|
|
||||||
virNetClientDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -54,10 +54,7 @@ static void virNetClientProgramDispose(void *obj);
|
|||||||
|
|
||||||
static int virNetClientProgramOnceInit(void)
|
static int virNetClientProgramOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetClientProgramClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virNetClientProgram, virClassForObject()))
|
||||||
"virNetClientProgram",
|
|
||||||
sizeof(virNetClientProgram),
|
|
||||||
virNetClientProgramDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -71,10 +71,7 @@ static void virNetClientStreamDispose(void *obj);
|
|||||||
|
|
||||||
static int virNetClientStreamOnceInit(void)
|
static int virNetClientStreamOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetClientStreamClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetClientStream, virClassForObjectLockable()))
|
||||||
"virNetClientStream",
|
|
||||||
sizeof(virNetClientStream),
|
|
||||||
virNetClientStreamDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -110,10 +110,7 @@ virNetDaemonDispose(void *obj)
|
|||||||
static int
|
static int
|
||||||
virNetDaemonOnceInit(void)
|
virNetDaemonOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetDaemonClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetDaemon, virClassForObjectLockable()))
|
||||||
"virNetDaemon",
|
|
||||||
sizeof(virNetDaemon),
|
|
||||||
virNetDaemonDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -161,10 +161,7 @@ virNetLibsshSessionOnceInit(void)
|
|||||||
{
|
{
|
||||||
const char *dbgLevelStr;
|
const char *dbgLevelStr;
|
||||||
|
|
||||||
if (!(virNetLibsshSessionClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetLibsshSession, virClassForObjectLockable()))
|
||||||
"virNetLibsshSession",
|
|
||||||
sizeof(virNetLibsshSession),
|
|
||||||
virNetLibsshSessionDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (ssh_init() < 0) {
|
if (ssh_init() < 0) {
|
||||||
|
@ -57,16 +57,10 @@ static void virNetSASLSessionDispose(void *obj);
|
|||||||
|
|
||||||
static int virNetSASLContextOnceInit(void)
|
static int virNetSASLContextOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetSASLContextClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetSASLContext, virClassForObjectLockable()))
|
||||||
"virNetSASLContext",
|
|
||||||
sizeof(virNetSASLContext),
|
|
||||||
virNetSASLContextDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virNetSASLSessionClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetSASLSession, virClassForObjectLockable()))
|
||||||
"virNetSASLSession",
|
|
||||||
sizeof(virNetSASLSession),
|
|
||||||
virNetSASLSessionDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -93,10 +93,7 @@ static inline size_t virNetServerTrackCompletedAuthLocked(virNetServerPtr srv);
|
|||||||
|
|
||||||
static int virNetServerOnceInit(void)
|
static int virNetServerOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetServerClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetServer, virClassForObjectLockable()))
|
||||||
"virNetServer",
|
|
||||||
sizeof(virNetServer),
|
|
||||||
virNetServerDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -129,10 +129,7 @@ static void virNetServerClientDispose(void *obj);
|
|||||||
|
|
||||||
static int virNetServerClientOnceInit(void)
|
static int virNetServerClientOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetServerClientClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetServerClient, virClassForObjectLockable()))
|
||||||
"virNetServerClient",
|
|
||||||
sizeof(virNetServerClient),
|
|
||||||
virNetServerClientDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -51,10 +51,7 @@ static void virNetServerProgramDispose(void *obj);
|
|||||||
|
|
||||||
static int virNetServerProgramOnceInit(void)
|
static int virNetServerProgramOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetServerProgramClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virNetServerProgram, virClassForObject()))
|
||||||
"virNetServerProgram",
|
|
||||||
sizeof(virNetServerProgram),
|
|
||||||
virNetServerProgramDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -57,10 +57,7 @@ static void virNetServerServiceDispose(void *obj);
|
|||||||
|
|
||||||
static int virNetServerServiceOnceInit(void)
|
static int virNetServerServiceOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetServerServiceClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virNetServerService, virClassForObject()))
|
||||||
"virNetServerService",
|
|
||||||
sizeof(virNetServerService),
|
|
||||||
virNetServerServiceDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -124,10 +124,7 @@ static void virNetSocketDispose(void *obj);
|
|||||||
|
|
||||||
static int virNetSocketOnceInit(void)
|
static int virNetSocketOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetSocketClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetSocket, virClassForObjectLockable()))
|
||||||
"virNetSocket",
|
|
||||||
sizeof(virNetSocket),
|
|
||||||
virNetSocketDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -167,10 +167,7 @@ static virClassPtr virNetSSHSessionClass;
|
|||||||
static int
|
static int
|
||||||
virNetSSHSessionOnceInit(void)
|
virNetSSHSessionOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetSSHSessionClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetSSHSession, virClassForObjectLockable()))
|
||||||
"virNetSSHSession",
|
|
||||||
sizeof(virNetSSHSession),
|
|
||||||
virNetSSHSessionDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -90,16 +90,10 @@ static void virNetTLSSessionDispose(void *obj);
|
|||||||
|
|
||||||
static int virNetTLSContextOnceInit(void)
|
static int virNetTLSContextOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virNetTLSContextClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetTLSContext, virClassForObjectLockable()))
|
||||||
"virNetTLSContext",
|
|
||||||
sizeof(virNetTLSContext),
|
|
||||||
virNetTLSContextDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virNetTLSSessionClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virNetTLSSession, virClassForObjectLockable()))
|
||||||
"virNetTLSSession",
|
|
||||||
sizeof(virNetTLSSession),
|
|
||||||
virNetTLSSessionDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -59,10 +59,7 @@ void virSecurityManagerDispose(void *obj)
|
|||||||
static int
|
static int
|
||||||
virSecurityManagerOnceInit(void)
|
virSecurityManagerOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virSecurityManagerClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virSecurityManager, virClassForObjectLockable()))
|
||||||
"virSecurityManagerClass",
|
|
||||||
sizeof(virSecurityManager),
|
|
||||||
virSecurityManagerDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -53,15 +53,10 @@ static void virCloseCallbacksDispose(void *obj);
|
|||||||
|
|
||||||
static int virCloseCallbacksOnceInit(void)
|
static int virCloseCallbacksOnceInit(void)
|
||||||
{
|
{
|
||||||
virCloseCallbacksClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virCloseCallbacks, virClassForObjectLockable()))
|
||||||
"virCloseCallbacks",
|
|
||||||
sizeof(virCloseCallbacks),
|
|
||||||
virCloseCallbacksDispose);
|
|
||||||
|
|
||||||
if (!virCloseCallbacksClass)
|
|
||||||
return -1;
|
return -1;
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_ONCE_GLOBAL_INIT(virCloseCallbacks)
|
VIR_ONCE_GLOBAL_INIT(virCloseCallbacks)
|
||||||
|
@ -641,12 +641,8 @@ dnsmasqCapsDispose(void *obj)
|
|||||||
|
|
||||||
static int dnsmasqCapsOnceInit(void)
|
static int dnsmasqCapsOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(dnsmasqCapsClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(dnsmasqCaps, virClassForObject()))
|
||||||
"dnsmasqCaps",
|
|
||||||
sizeof(dnsmasqCaps),
|
|
||||||
dnsmasqCapsDispose))) {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -129,10 +129,7 @@ virFDStreamDataDispose(void *obj)
|
|||||||
|
|
||||||
static int virFDStreamDataOnceInit(void)
|
static int virFDStreamDataOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virFDStreamDataClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virFDStreamData, virClassForObjectLockable()))
|
||||||
"virFDStreamData",
|
|
||||||
sizeof(virFDStreamData),
|
|
||||||
virFDStreamDataDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -86,10 +86,7 @@ virFileCacheDispose(void *obj)
|
|||||||
static int
|
static int
|
||||||
virFileCacheOnceInit(void)
|
virFileCacheOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virFileCacheClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virFileCache, virClassForObjectLockable()))
|
||||||
"virFileCache",
|
|
||||||
sizeof(virFileCache),
|
|
||||||
virFileCacheDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -77,15 +77,12 @@ static void virHashAtomicDispose(void *obj);
|
|||||||
|
|
||||||
static int virHashAtomicOnceInit(void)
|
static int virHashAtomicOnceInit(void)
|
||||||
{
|
{
|
||||||
virHashAtomicClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virHashAtomic, virClassForObjectLockable()))
|
||||||
"virHashAtomic",
|
|
||||||
sizeof(virHashAtomic),
|
|
||||||
virHashAtomicDispose);
|
|
||||||
if (!virHashAtomicClass)
|
|
||||||
return -1;
|
return -1;
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_ONCE_GLOBAL_INIT(virHashAtomic)
|
VIR_ONCE_GLOBAL_INIT(virHashAtomic)
|
||||||
|
|
||||||
|
|
||||||
|
@ -120,10 +120,7 @@ static int virHostdevIsPCINodeDeviceUsed(virPCIDeviceAddressPtr devAddr, void *o
|
|||||||
|
|
||||||
static int virHostdevManagerOnceInit(void)
|
static int virHostdevManagerOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virHostdevManagerClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virHostdevManager, virClassForObject()))
|
||||||
"virHostdevManager",
|
|
||||||
sizeof(virHostdevManager),
|
|
||||||
virHostdevManagerDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(manager = virHostdevManagerNew()))
|
if (!(manager = virHostdevManagerNew()))
|
||||||
|
@ -54,10 +54,7 @@ static void virIdentityDispose(void *obj);
|
|||||||
|
|
||||||
static int virIdentityOnceInit(void)
|
static int virIdentityOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virIdentityClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virIdentity, virClassForObject()))
|
||||||
"virIdentity",
|
|
||||||
sizeof(virIdentity),
|
|
||||||
virIdentityDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virThreadLocalInit(&virIdentityCurrent,
|
if (virThreadLocalInit(&virIdentityCurrent,
|
||||||
|
@ -74,10 +74,7 @@ virMacMapDispose(void *obj)
|
|||||||
|
|
||||||
static int virMacMapOnceInit(void)
|
static int virMacMapOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virMacMapClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virMacMap, virClassForObjectLockable()))
|
||||||
"virMacMapClass",
|
|
||||||
sizeof(virMacMap),
|
|
||||||
virMacMapDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -58,10 +58,7 @@ virMediatedDeviceListDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
virMediatedOnceInit(void)
|
virMediatedOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virMediatedDeviceListClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virMediatedDeviceList, virClassForObjectLockable()))
|
||||||
"virMediatedDeviceList",
|
|
||||||
sizeof(virMediatedDeviceList),
|
|
||||||
virMediatedDeviceListDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -81,16 +81,10 @@ virObjectOnceInit(void)
|
|||||||
NULL)))
|
NULL)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virObjectLockableClass = virClassNew(virObjectClass,
|
if (!VIR_CLASS_NEW(virObjectLockable, virObjectClass))
|
||||||
"virObjectLockable",
|
|
||||||
sizeof(virObjectLockable),
|
|
||||||
virObjectLockableDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virObjectRWLockableClass = virClassNew(virObjectClass,
|
if (!VIR_CLASS_NEW(virObjectRWLockable, virObjectClass))
|
||||||
"virObjectRWLockable",
|
|
||||||
sizeof(virObjectRWLockable),
|
|
||||||
virObjectRWLockableDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -74,6 +74,10 @@ virClassPtr virClassForObjectRWLockable(void);
|
|||||||
# ifndef VIR_PARENT_REQUIRED
|
# ifndef VIR_PARENT_REQUIRED
|
||||||
# define VIR_PARENT_REQUIRED ATTRIBUTE_NONNULL(1)
|
# define VIR_PARENT_REQUIRED ATTRIBUTE_NONNULL(1)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# define VIR_CLASS_NEW(name, prnt) \
|
||||||
|
(name##Class = virClassNew(prnt, #name, sizeof(name), name##Dispose))
|
||||||
|
|
||||||
virClassPtr
|
virClassPtr
|
||||||
virClassNew(virClassPtr parent,
|
virClassNew(virClassPtr parent,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
@ -204,10 +204,7 @@ static void virPCIDeviceListDispose(void *obj);
|
|||||||
|
|
||||||
static int virPCIOnceInit(void)
|
static int virPCIOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virPCIDeviceListClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virPCIDeviceList, virClassForObjectLockable()))
|
||||||
"virPCIDeviceList",
|
|
||||||
sizeof(virPCIDeviceList),
|
|
||||||
virPCIDeviceListDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -80,10 +80,7 @@ virPortAllocatorNew(void)
|
|||||||
static int
|
static int
|
||||||
virPortAllocatorOnceInit(void)
|
virPortAllocatorOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virPortAllocatorClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virPortAllocator, virClassForObjectLockable()))
|
||||||
"virPortAllocator",
|
|
||||||
sizeof(virPortAllocator),
|
|
||||||
virPortAllocatorDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(virPortAllocatorInstance = virPortAllocatorNew()))
|
if (!(virPortAllocatorInstance = virPortAllocatorNew()))
|
||||||
|
@ -133,10 +133,7 @@ virResctrlInfoDispose(void *obj)
|
|||||||
static int
|
static int
|
||||||
virResctrlInfoOnceInit(void)
|
virResctrlInfoOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virResctrlInfoClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virResctrlInfo, virClassForObject()))
|
||||||
"virResctrlInfo",
|
|
||||||
sizeof(virResctrlInfo),
|
|
||||||
virResctrlInfoDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -271,10 +268,7 @@ virResctrlAllocDispose(void *obj)
|
|||||||
static int
|
static int
|
||||||
virResctrlAllocOnceInit(void)
|
virResctrlAllocOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virResctrlAllocClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(virResctrlAlloc, virClassForObject()))
|
||||||
"virResctrlAlloc",
|
|
||||||
sizeof(virResctrlAlloc),
|
|
||||||
virResctrlAllocDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -85,10 +85,7 @@ static void virSCSIDeviceListDispose(void *obj);
|
|||||||
static int
|
static int
|
||||||
virSCSIOnceInit(void)
|
virSCSIOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virSCSIDeviceListClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virSCSIDeviceList, virClassForObjectLockable()))
|
||||||
"virSCSIDeviceList",
|
|
||||||
sizeof(virSCSIDeviceList),
|
|
||||||
virSCSIDeviceListDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -70,10 +70,7 @@ virSCSIVHostDeviceListDispose(void *obj)
|
|||||||
static int
|
static int
|
||||||
virSCSIVHostOnceInit(void)
|
virSCSIVHostOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virSCSIVHostDeviceListClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virSCSIVHostDeviceList, virClassForObjectLockable()))
|
||||||
"virSCSIVHostDeviceList",
|
|
||||||
sizeof(virSCSIVHostDeviceList),
|
|
||||||
virSCSIVHostDeviceListDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -80,10 +80,7 @@ static void virUSBDeviceListDispose(void *obj);
|
|||||||
|
|
||||||
static int virUSBOnceInit(void)
|
static int virUSBOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(virUSBDeviceListClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(virUSBDeviceList, virClassForObjectLockable()))
|
||||||
"virUSBDeviceList",
|
|
||||||
sizeof(virUSBDeviceList),
|
|
||||||
virUSBDeviceListDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -118,10 +118,7 @@ vboxDriverDispose(void *obj)
|
|||||||
static int
|
static int
|
||||||
vboxDriverOnceInit(void)
|
vboxDriverOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(vboxDriverClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(vboxDriver, virClassForObjectLockable()))
|
||||||
"vboxDriver",
|
|
||||||
sizeof(vboxDriver),
|
|
||||||
vboxDriverDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -161,10 +161,7 @@ static void vzDriverDispose(void * obj)
|
|||||||
|
|
||||||
static int vzDriverOnceInit(void)
|
static int vzDriverOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(vzDriverClass = virClassNew(virClassForObjectLockable(),
|
if (!VIR_CLASS_NEW(vzDriver, virClassForObjectLockable()))
|
||||||
"vzDriver",
|
|
||||||
sizeof(vzDriver),
|
|
||||||
vzDriverDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -49,10 +49,7 @@ testFileCacheObjDispose(void *opaque)
|
|||||||
static int
|
static int
|
||||||
testFileCacheObjOnceInit(void)
|
testFileCacheObjOnceInit(void)
|
||||||
{
|
{
|
||||||
if (!(testFileCacheObjClass = virClassNew(virClassForObject(),
|
if (!VIR_CLASS_NEW(testFileCacheObj, virClassForObject()))
|
||||||
"testFileCacheObj",
|
|
||||||
sizeof(testFileCacheObj),
|
|
||||||
testFileCacheObjDispose)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user