libvirt/src/node_device
Michal Privoznik 10f94828ea 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>
2018-04-18 10:04:55 +02:00
..
Makefile.inc.am make: split nodedev driver build rules into node_device/Makefile.inc.am 2018-03-05 17:09:48 +00:00
node_device_driver.c datatypes: Rename @parent to @parentName in virNodeDevice 2018-04-18 10:04:55 +02:00
node_device_driver.h nodedev: allow opening with nodedev:///system and nodedev:///session URIs 2018-01-31 17:46:09 +00:00
node_device_hal.c driver: declare supported URI schemes in virConnectDriver struct 2018-04-12 16:52:02 +01:00
node_device_hal.h
node_device_udev.c virobject: Introduce VIR_CLASS_NEW() macro 2018-04-18 10:04:55 +02:00
node_device_udev.h nodedev: udev: Convert udev private data to a lockable object 2017-10-19 08:54:53 +02:00