[libvirt] [libvirt-glib] Fix GVirConfigDomainTimerPit parent class/object

Christophe Fergeau cfergeau at redhat.com
Fri Jan 17 15:12:26 UTC 2014

GVirConfigDomainTimerPit is correctly define as inheriting from
GVirConfigDomainTimer in the G_DEFINE_TYPE macro, but it only
embeds GVirConfigObject/GVirConfigObjectClass structs.

This is an ABI break as this changes the size of the
GVirConfigDomainTimerPit/GVirConfigDomainTimerPitClass structs
However, since these structs only have non-public members, users of the
library will not be trying to access fields of the struct past the first
field (which is the one which changed size). This would also be an issue
if anything had subclassed GVirConfigDomainTimerPit, which is unlikely at
this point.
All in all, it's imo more convenient to silently fix this without an soname
bump. I've tested that GNOME Boxes built with an older version of
libvirt-gconfig still generates the correct GVirConfigDomainTimerPit
elements when using a version of libvirt-gconfig with this patch.
 libvirt-gconfig/libvirt-gconfig-domain-timer-pit.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libvirt-gconfig/libvirt-gconfig-domain-timer-pit.h b/libvirt-gconfig/libvirt-gconfig-domain-timer-pit.h
index b644c52..7802ac4 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-timer-pit.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-timer-pit.h
@@ -42,7 +42,7 @@ typedef struct _GVirConfigDomainTimerPitClass GVirConfigDomainTimerPitClass;
 struct _GVirConfigDomainTimerPit
-    GVirConfigObject parent;
+    GVirConfigDomainTimer parent;
     GVirConfigDomainTimerPitPrivate *priv;
@@ -51,7 +51,7 @@ struct _GVirConfigDomainTimerPit
 struct _GVirConfigDomainTimerPitClass
-    GVirConfigObjectClass parent_class;
+    GVirConfigDomainTimerClass parent_class;
     gpointer padding[20];

More information about the libvir-list mailing list