diff options
author | Thomas Haller <thaller@redhat.com> | 2020-11-06 18:22:11 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-11-09 17:53:16 +0100 |
commit | cc35dc3bdf5f76cac5ed37127ca89eef18bb9998 (patch) | |
tree | 8d0aa7b8cd627d125956d5b98c094d96795ce005 /src/devices/ovs/nm-device-ovs-bridge.c | |
parent | 7d5ec103df5209ca7fbf74309df53af87dd42e5e (diff) | |
download | NetworkManager-cc35dc3bdf5f76cac5ed37127ca89eef18bb9998.tar.gz |
device: improve "nm-device-logging.h" to support a self pointer of NMDevice type
"nm-device-logging.h" defines logging macros for a NMDevice instance.
It also expects a "self" variable in the call environment, and that
variable had to be in the type of NMDevice or the NMDevice subclass.
Extend the macro foo, so that @self can be either a NMDevice* pointer
or a NMDevice$SUBTYPE.
Of course, that would have always been possible, if we would simply cast
to "(NMDevice *)" where we need it. The trick is that the macro only
works if @self is one of the two expected types, and not some arbitrary
unrelated type.
Diffstat (limited to 'src/devices/ovs/nm-device-ovs-bridge.c')
-rw-r--r-- | src/devices/ovs/nm-device-ovs-bridge.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/devices/ovs/nm-device-ovs-bridge.c b/src/devices/ovs/nm-device-ovs-bridge.c index a7b7a539e2..6c92544c9c 100644 --- a/src/devices/ovs/nm-device-ovs-bridge.c +++ b/src/devices/ovs/nm-device-ovs-bridge.c @@ -14,8 +14,8 @@ #include "nm-setting-connection.h" #include "nm-setting-ovs-bridge.h" +#define _NMLOG_DEVICE_TYPE NMDeviceOvsBridge #include "devices/nm-device-logging.h" -_LOG_DECLARE_SELF(NMDeviceOvsBridge); /*****************************************************************************/ |