Go to quiesce state on checkstop/watchdog error
This change alters the behavior on a host
checkstop or watchdog error. Instead of simply
rebooting, go to the new quiesce state.
Change-Id: I4dd3a3d7a91607fc56a684873115d5f32de18f6a
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
diff --git a/hostcheckstop/host_checkstop_obj.c b/hostcheckstop/host_checkstop_obj.c
index 587896a..1782483 100644
--- a/hostcheckstop/host_checkstop_obj.c
+++ b/hostcheckstop/host_checkstop_obj.c
@@ -77,27 +77,28 @@
gpio_close(&checkstop);
if ((!gpio) && (is_host_booted(connection)))
{
- printf("Host Checkstop, rebooting host\n");
+ printf("Host Checkstop, going to quiesce\n");
error = NULL;
proxy = g_dbus_proxy_new_sync((GDBusConnection*)connection,
G_DBUS_PROXY_FLAGS_NONE,
NULL, /* GDBusInterfaceInfo* */
- "org.openbmc.control.Chassis", /* name */
- "/org/openbmc/control/chassis0", /* object path */
- "org.openbmc.control.Chassis", /* interface name */
+ "org.freedesktop.systemd1", /* name */
+ "/org/freedesktop/systemd1", /* object path */
+ "org.freedesktop.systemd1.Manager", /* interface name */
NULL, /* GCancellable */
&error);
g_assert_no_error(error);
error = NULL;
result = g_dbus_proxy_call_sync(proxy,
- "reboot",
- parm,
+ "StartUnit",
+ g_variant_new("(ss)", "obmc-quiesce-host@0.target", "replace"),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
&error);
g_assert_no_error(error);
+ g_variant_unref(result);
}
return FALSE;
@@ -200,4 +201,3 @@
g_main_loop_unref(loop);
return 0;
}
-