From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Those functions talk to system bus and have a special handling of
system bus missing.
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
src/util/virdbus.c | 12 ++++++------
src/util/virdbus.h | 4 ++--
src/util/virfirewalld.c | 2 +-
src/util/virsystemd.c | 8 ++++----
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/util/virdbus.c b/src/util/virdbus.c
index 77691cd2b0..858291e2ba 100644
--- a/src/util/virdbus.c
+++ b/src/util/virdbus.c
@@ -1700,12 +1700,12 @@ static int virDBusIsServiceInList(const char *listMethod, const
char *name)
}
/**
- * virDBusIsServiceEnabled:
+ * virDBusSystemIsServiceEnabled:
* @name: service name
*
* Returns 0 if service is available, -1 on fatal error, or -2 if service is not
available
*/
-int virDBusIsServiceEnabled(const char *name)
+int virDBusSystemIsServiceEnabled(const char *name)
{
int ret = virDBusIsServiceInList("ListActivatableNames", name);
@@ -1715,12 +1715,12 @@ int virDBusIsServiceEnabled(const char *name)
}
/**
- * virDBusIsServiceRegistered
+ * virDBusSystemIsServiceRegistered
* @name: service name
*
* Returns 0 if service is registered, -1 on fatal error, or -2 if service is not
registered
*/
-int virDBusIsServiceRegistered(const char *name)
+int virDBusSystemIsServiceRegistered(const char *name)
{
int ret = virDBusIsServiceInList("ListNames", name);
@@ -1843,13 +1843,13 @@ int virDBusMessageDecode(DBusMessage* msg G_GNUC_UNUSED,
return -1;
}
-int virDBusIsServiceEnabled(const char *name G_GNUC_UNUSED)
+int virDBusSystemIsServiceEnabled(const char *name G_GNUC_UNUSED)
{
VIR_DEBUG("DBus support not compiled into this binary");
return -2;
}
-int virDBusIsServiceRegistered(const char *name G_GNUC_UNUSED)
+int virDBusSystemIsServiceRegistered(const char *name G_GNUC_UNUSED)
{
VIR_DEBUG("DBus support not compiled into this binary");
return -2;
diff --git a/src/util/virdbus.h b/src/util/virdbus.h
index 083c074d59..b3b0260a4e 100644
--- a/src/util/virdbus.h
+++ b/src/util/virdbus.h
@@ -70,7 +70,7 @@ int virDBusMessageDecode(DBusMessage *msg,
const char *types, ...);
void virDBusMessageUnref(DBusMessage *msg);
-int virDBusIsServiceEnabled(const char *name);
-int virDBusIsServiceRegistered(const char *name);
+int virDBusSystemIsServiceEnabled(const char *name);
+int virDBusSystemIsServiceRegistered(const char *name);
bool virDBusErrorIsUnknownMethod(virErrorPtr err);
diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c
index c14a6b6e65..499f925b7e 100644
--- a/src/util/virfirewalld.c
+++ b/src/util/virfirewalld.c
@@ -66,7 +66,7 @@ VIR_ENUM_IMPL(virFirewallDBackend,
int
virFirewallDIsRegistered(void)
{
- return virDBusIsServiceRegistered(VIR_FIREWALL_FIREWALLD_SERVICE);
+ return virDBusSystemIsServiceRegistered(VIR_FIREWALL_FIREWALLD_SERVICE);
}
/**
diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index 1d41ed34f7..9a659dad84 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -157,13 +157,13 @@ virSystemdHasMachined(void)
if (val != -1)
return val;
- if ((ret = virDBusIsServiceEnabled("org.freedesktop.machine1")) < 0) {
+ if ((ret = virDBusSystemIsServiceEnabled("org.freedesktop.machine1")) <
0) {
if (ret == -2)
g_atomic_int_set(&virSystemdHasMachinedCachedValue, -2);
return ret;
}
- if ((ret = virDBusIsServiceRegistered("org.freedesktop.systemd1")) == -1)
+ if ((ret = virDBusSystemIsServiceRegistered("org.freedesktop.systemd1")) ==
-1)
return ret;
g_atomic_int_set(&virSystemdHasMachinedCachedValue, ret);
return ret;
@@ -179,14 +179,14 @@ virSystemdHasLogind(void)
if (val != -1)
return val;
- ret = virDBusIsServiceEnabled("org.freedesktop.login1");
+ ret = virDBusSystemIsServiceEnabled("org.freedesktop.login1");
if (ret < 0) {
if (ret == -2)
g_atomic_int_set(&virSystemdHasLogindCachedValue, -2);
return ret;
}
- if ((ret = virDBusIsServiceRegistered("org.freedesktop.login1")) == -1)
+ if ((ret = virDBusSystemIsServiceRegistered("org.freedesktop.login1")) ==
-1)
return ret;
g_atomic_int_set(&virSystemdHasLogindCachedValue, ret);
--
2.26.0.rc2.42.g98cedd0233