[libvirt] [dbus PATCH 03/18] util: introduce VIRT_DBUS_ERROR_INTERFACE

Pavel Hrdina posted 18 patches 7 years, 2 months ago
[libvirt] [dbus PATCH 03/18] util: introduce VIRT_DBUS_ERROR_INTERFACE
Posted by Pavel Hrdina 7 years, 2 months ago
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 src/util.c | 4 ++--
 src/util.h | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/util.c b/src/util.c
index 962eaab..3e6be4e 100644
--- a/src/util.c
+++ b/src/util.c
@@ -66,14 +66,14 @@ virtDBusUtilSetLastVirtError(sd_bus_error *error)
     if (!vir_error)
         return 0;
 
-    return sd_bus_error_set(error, "org.libvirt.Error", vir_error->message);
+    return sd_bus_error_set(error, VIRT_DBUS_ERROR_INTERFACE, vir_error->message);
 }
 
 int
 virtDBusUtilSetError(sd_bus_error *error,
                      const char *message)
 {
-    return sd_bus_error_set(error, "org.libvirt.Error", message);
+    return sd_bus_error_set(error, VIRT_DBUS_ERROR_INTERFACE, message);
 }
 
 char *
diff --git a/src/util.h b/src/util.h
index a772ffe..c92674f 100644
--- a/src/util.h
+++ b/src/util.h
@@ -5,6 +5,8 @@
 #include <systemd/sd-bus.h>
 #include <unistd.h>
 
+#define VIRT_DBUS_ERROR_INTERFACE "org.libvirt.Error"
+
 #define _cleanup_(_x) __attribute__((__cleanup__(_x)))
 
 #define VIRT_ATTR_UNUSED __attribute__((__unused__))
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [dbus PATCH 03/18] util: introduce VIRT_DBUS_ERROR_INTERFACE
Posted by Daniel P. Berrangé 7 years, 2 months ago
On Mon, Mar 12, 2018 at 05:21:33PM +0100, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---
>  src/util.c | 4 ++--
>  src/util.h | 2 ++
>  2 files changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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