[PULL,1/3] monitor: Remove hardcoded watchdog event names
diff mbox

Message ID 1408389987-27831-2-git-send-email-lcapitulino@redhat.com
State New
Headers show

Commit Message

Luiz Capitulino Aug. 18, 2014, 7:26 p.m. UTC
From: Hani Benhabiles <kroosec@gmail.com>

Signed-off-by: Hani Benhabiles <hani@linux.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 monitor.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Patch
diff mbox

diff --git a/monitor.c b/monitor.c
index cdbaa60..48f0fdc 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4521,16 +4521,15 @@  void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str)
 
 void watchdog_action_completion(ReadLineState *rs, int nb_args, const char *str)
 {
+    int i;
+
     if (nb_args != 2) {
         return;
     }
     readline_set_completion_index(rs, strlen(str));
-    add_completion_option(rs, str, "reset");
-    add_completion_option(rs, str, "shutdown");
-    add_completion_option(rs, str, "poweroff");
-    add_completion_option(rs, str, "pause");
-    add_completion_option(rs, str, "debug");
-    add_completion_option(rs, str, "none");
+    for (i = 0; WatchdogExpirationAction_lookup[i]; i++) {
+        add_completion_option(rs, str, WatchdogExpirationAction_lookup[i]);
+    }
 }
 
 void migrate_set_capability_completion(ReadLineState *rs, int nb_args,