[dbus PATCH] gdbus: Don't report libvirt errors for GetAll method on properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



According to D-Bus specification if some property is not accessible
it may be omitted in the returned list of properties.  However, such
error needs to be reported for Get method on that property.

In libvirt-dbus this can happen for Domain.SchedulerType property
for QEMU session connection.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/gdbus.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/gdbus.c b/src/gdbus.c
index 2cce6ff..4e35477 100644
--- a/src/gdbus.c
+++ b/src/gdbus.c
@@ -163,20 +163,19 @@ virtDBusGDBusHandlePropertyGetAll(GDBusMethodInvocation *invocation,
 {
     GVariant *value;
     g_auto(GVariantBuilder) builder;
-    g_autoptr(GError) error = NULL;
 
     g_variant_builder_init(&builder, G_VARIANT_TYPE("(a{sv})"));
 
     g_variant_builder_open(&builder, G_VARIANT_TYPE("a{sv}"));
 
     for (gint i = 0; data->properties[i].name; i++) {
+        g_autoptr(GError) error = NULL;
+
         data->properties[i].getFunc(objectPath, data->userData,
                                     &value, &error);
 
-        if (error) {
-            g_dbus_method_invocation_return_gerror(invocation, error);
-            return;
-        }
+        if (error)
+            continue;
 
         g_return_if_fail(value);
 
-- 
2.17.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux