mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 06:35:24 +00:00
Fix virsystemdtest without SYSTEMD_DAEMON
Commit 4897698
fixed the build without dbus by only building
the virSystemdPMSupportTarget with SYSTEMD_DAEMON.
Introduce a virDBusMessageUnref wrapper for dbus_message_unref
to let virsystemd.c build without dbus, while still allowing
virsystemdtest to run without SYSTEM_DAEMON.
This commit is contained in:
parent
4897698110
commit
6077be466e
@ -1614,6 +1614,11 @@ int virDBusIsServiceRegistered(const char *name)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void virDBusMessageUnref(DBusMessage *msg)
|
||||||
|
{
|
||||||
|
dbus_message_unref(msg);
|
||||||
|
}
|
||||||
|
|
||||||
#else /* ! WITH_DBUS */
|
#else /* ! WITH_DBUS */
|
||||||
void virDBusSetSharedBus(bool shared ATTRIBUTE_UNUSED)
|
void virDBusSetSharedBus(bool shared ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
@ -1751,4 +1756,8 @@ int virDBusIsServiceRegistered(const char *name ATTRIBUTE_UNUSED)
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void virDBusMessageUnref(DBusMessage *msg ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
/* nothing */
|
||||||
|
}
|
||||||
#endif /* ! WITH_DBUS */
|
#endif /* ! WITH_DBUS */
|
||||||
|
@ -74,6 +74,7 @@ int virDBusCall(DBusConnection *conn,
|
|||||||
DBusError *error);
|
DBusError *error);
|
||||||
int virDBusMessageRead(DBusMessage *msg,
|
int virDBusMessageRead(DBusMessage *msg,
|
||||||
const char *types, ...);
|
const char *types, ...);
|
||||||
|
void virDBusMessageUnref(DBusMessage *msg);
|
||||||
|
|
||||||
int virDBusIsServiceEnabled(const char *name);
|
int virDBusIsServiceEnabled(const char *name);
|
||||||
int virDBusIsServiceRegistered(const char *name);
|
int virDBusIsServiceRegistered(const char *name);
|
||||||
|
@ -326,7 +326,6 @@ virSystemdNotifyStartup(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_SYSTEMD_DAEMON
|
|
||||||
static int
|
static int
|
||||||
virSystemdPMSupportTarget(const char *methodName, bool *result)
|
virSystemdPMSupportTarget(const char *methodName, bool *result)
|
||||||
{
|
{
|
||||||
@ -365,19 +364,11 @@ virSystemdPMSupportTarget(const char *methodName, bool *result)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
dbus_message_unref(message);
|
virDBusMessageUnref(message);
|
||||||
VIR_FREE(response);
|
VIR_FREE(response);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#else /* ! WITH_SYSTEMD_DAEMON */
|
|
||||||
static int
|
|
||||||
virSystemdPMSupportTarget(const char *methodName ATTRIBUTE_UNUSED,
|
|
||||||
bool *result ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
#endif /* ! WITH_SYSTEMD_DAEMON */
|
|
||||||
|
|
||||||
int virSystemdCanSuspend(bool *result)
|
int virSystemdCanSuspend(bool *result)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user