summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-02-25 00:50:38 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-25 00:50:38 +0100
commit7452394e2ecb1dc994c1e9215592bcef28681396 (patch)
tree7e9b873ddc3a64a0b27b3f6227d5e16257666ea5
parent085afe36cb823e7d5b8c5f3ef21ebb9639bac78b (diff)
core: expose architecture as a bus property, so that we can easily query it remotely
-rw-r--r--src/core/dbus-manager.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 86816f69ca..f1e344c180 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -31,6 +31,7 @@
#include "hwclock.h"
#include "path-util.h"
#include "virt.h"
+#include "architecture.h"
#include "env-util.h"
#include "dbus.h"
#include "dbus-manager.h"
@@ -89,6 +90,21 @@ static int property_get_virtualization(
return sd_bus_message_append(reply, "s", id);
}
+static int property_get_architecture(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ const char *property,
+ sd_bus_message *reply,
+ void *userdata,
+ sd_bus_error *error) {
+
+ assert(bus);
+ assert(reply);
+
+ return sd_bus_message_append(reply, "s", architecture_to_string(uname_architecture()));
+}
+
static int property_get_tainted(
sd_bus *bus,
const char *path,
@@ -1549,6 +1565,7 @@ const sd_bus_vtable bus_manager_vtable[] = {
SD_BUS_PROPERTY("Version", "s", property_get_version, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Features", "s", property_get_features, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Virtualization", "s", property_get_virtualization, 0, SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("Architecture", "s", property_get_architecture, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Tainted", "s", property_get_tainted, 0, SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("FirmwareTimestamp", offsetof(Manager, firmware_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),
BUS_PROPERTY_DUAL_TIMESTAMP("LoaderTimestamp", offsetof(Manager, loader_timestamp), SD_BUS_VTABLE_PROPERTY_CONST),