[libvirt] [dbus PATCH v2 0/2] improve annotation of properties

Pavel Hrdina (2): Change the default annotation for emitting changed properties to false Annotate properties that will never change during the object lifecycle data/org.libvirt.Connect.xml | 3 +++ data/org.libvirt.Domain.xml | 2 ++ data/org.libvirt.Network.xml | 3 +++ 3 files changed, 8 insertions(+) -- 2.14.3

For some of these properties there is no libvirt event to detect the change. For some of the remaining properties we could somehow detect the change but it would be a lot of code for nothing and it can be added later if someone asks for that. We could change the properties to methods but with the annotation we can keep them as properties in order to allow to get them by single D-Bus call. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- changes in v2: - annotation was moved to <interface> scope to make it the default one data/org.libvirt.Connect.xml | 1 + data/org.libvirt.Domain.xml | 1 + data/org.libvirt.Network.xml | 1 + 3 files changed, 3 insertions(+) diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml index 3bda461..69bbc84 100644 --- a/data/org.libvirt.Connect.xml +++ b/data/org.libvirt.Connect.xml @@ -3,6 +3,7 @@ <node name="/org/libvirt/connect"> <interface name="org.libvirt.Connect"> + <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> <property name="Encrypted" type="b" access="read"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-host.html#virConnectIsEncrypted diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index eae6d97..089b896 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -3,6 +3,7 @@ <node name="/org/libvirt/domain"> <interface name="org.libvirt.Domain"> + <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> <property name="Active" type="b" access="read"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainIsActive"/> diff --git a/data/org.libvirt.Network.xml b/data/org.libvirt.Network.xml index 81bf081..5b6823e 100644 --- a/data/org.libvirt.Network.xml +++ b/data/org.libvirt.Network.xml @@ -3,6 +3,7 @@ <node name="/org/libvirt/network"> <interface name="org.libvirt.Network"> + <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/> <property name="Active" type="b" access="read"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkIsActive"/> -- 2.14.3

These can be annotated as 'const' properties because they will never change. Reviewed-by: Katerina Koukiou <kkoukiou@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- data/org.libvirt.Connect.xml | 2 ++ data/org.libvirt.Domain.xml | 1 + data/org.libvirt.Network.xml | 2 ++ 3 files changed, 5 insertions(+) diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml index 69bbc84..d7a9b5f 100644 --- a/data/org.libvirt.Connect.xml +++ b/data/org.libvirt.Connect.xml @@ -8,6 +8,7 @@ <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-host.html#virConnectIsEncrypted Note that monitoring of traffic on the D-Bus message bus is out of the scope of this property"/> + <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="Hostname" type="s" access="read"> <annotation name="org.gtk.GDBus.DocString" @@ -21,6 +22,7 @@ <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-host.html#virConnectIsSecure Note that monitoring of traffic on the D-Bus message bus is out of the scope of this property"/> + <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="Version" type="t" access="read"> <annotation name="org.gtk.GDBus.DocString" diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 089b896..bc55545 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -44,6 +44,7 @@ <property name="UUID" type="s" access="read"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetUUIDString"/> + <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <method name="AbortJob"> <annotation name="org.gtk.GDBus.DocString" diff --git a/data/org.libvirt.Network.xml b/data/org.libvirt.Network.xml index 5b6823e..c53ce0b 100644 --- a/data/org.libvirt.Network.xml +++ b/data/org.libvirt.Network.xml @@ -16,6 +16,7 @@ <property name="Name" type="s" access="read"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetName"/> + <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <property name="Persistent" type="b" access="read"> <annotation name="org.gtk.GDBus.DocString" @@ -24,6 +25,7 @@ <property name="UUID" type="s" access="read"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetUUIDString"/> + <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/> </property> <method name="Create"> <annotation name="org.gtk.GDBus.DocString" -- 2.14.3

On Fri, 2018-05-04 at 14:28 +0200, Pavel Hrdina wrote:
Pavel Hrdina (2): Change the default annotation for emitting changed properties to false Annotate properties that will never change during the object lifecycle
data/org.libvirt.Connect.xml | 3 +++ data/org.libvirt.Domain.xml | 2 ++ data/org.libvirt.Network.xml | 3 +++ 3 files changed, 8 insertions(+)
ACK both patches in the series. Katerina
participants (2)
-
Katerina Koukiou
-
Pavel Hrdina