This prepares for multiple connection objects since each object will
have different path based on the driver name.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/connect.c | 3 ++-
src/connect.h | 1 +
src/events.c | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/connect.c b/src/connect.c
index 314277f..3aec99e 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -247,12 +247,13 @@ virtDBusConnectNew(virtDBusConnect **connectp,
connect->bus = sd_bus_ref(bus);
connect->uri = uri;
+ connect->connectPath = "/org/libvirt/Connect";
connect->enumerateDomains = virtDBusConnectEnumarateDomains;
r = sd_bus_add_object_vtable(connect->bus,
NULL,
- "/org/libvirt/Connect",
+ connect->connectPath,
"org.libvirt.Connect",
virt_connect_vtable,
connect);
diff --git a/src/connect.h b/src/connect.h
index de1aae7..489ce84 100644
--- a/src/connect.h
+++ b/src/connect.h
@@ -8,6 +8,7 @@
struct virtDBusConnect {
sd_bus *bus;
const char *uri;
+ const char *connectPath;
virConnectPtr connection;
sd_bus_node_enumerator_t enumerateDomains;
diff --git a/src/events.c b/src/events.c
index 92f280d..d2d7f6b 100644
--- a/src/events.c
+++ b/src/events.c
@@ -53,7 +53,7 @@ virtDBusEventsDomainLifecycle(virConnectPtr connection VIR_ATTR_UNUSED,
r = sd_bus_message_new_signal(connect->bus,
&message,
- "/org/libvirt/Connect",
+ connect->connectPath,
"org.libvirt.connect",
signal);
if (r < 0)
--
2.14.3