chiark / gitweb /
systemctl: show sub state along active state
[elogind.git] / device.c
index 0a7c967fabb230d280935d4c3b933b94c1491ea7..b00a0f987f6fb227b7192241e9a2d57f30866dc9 100644 (file)
--- a/device.c
+++ b/device.c
@@ -99,6 +99,12 @@ static UnitActiveState device_active_state(Unit *u) {
         return state_translation_table[DEVICE(u)->state];
 }
 
+static const char *device_sub_state_to_string(Unit *u) {
+        assert(u);
+
+        return state_string_table[DEVICE(u)->state];
+}
+
 static int device_add_escaped_name(Unit *u, const char *dn, bool make_id) {
         char *e;
         int r;
@@ -478,6 +484,7 @@ const UnitVTable device_vtable = {
         .dump = device_dump,
 
         .active_state = device_active_state,
+        .sub_state_to_string = device_sub_state_to_string,
 
         .enumerate = device_enumerate,
         .shutdown = device_shutdown