Fix elf loader range checking
[qemu] / monitor.c
index b33fea1..443f6d4 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -27,6 +27,7 @@
 #include "hw/pcmcia.h"
 #include "hw/pc.h"
 #include "hw/pci.h"
+#include "hw/watchdog.h"
 #include "gdbstub.h"
 #include "net.h"
 #include "qemu-char.h"
@@ -580,7 +581,6 @@ static void encrypted_bdrv_it(void *opaque, BlockDriverState *bs)
     }
 }
 
-#ifdef CONFIG_GDBSTUB
 static void do_gdbserver(Monitor *mon, const char *device)
 {
     if (!device)
@@ -595,7 +595,13 @@ static void do_gdbserver(Monitor *mon, const char *device)
                        device);
     }
 }
-#endif
+
+static void do_watchdog_action(Monitor *mon, const char *action)
+{
+    if (select_watchdog_action(action) == -1) {
+        monitor_printf(mon, "Unknown watchdog action '%s'\n", action);
+    }
+}
 
 static void monitor_printc(Monitor *mon, int c)
 {
@@ -1684,10 +1690,8 @@ static const mon_cmd_t mon_cmds[] = {
       "", "stop emulation", },
     { "c|cont", "", do_cont,
       "", "resume emulation", },
-#ifdef CONFIG_GDBSTUB
     { "gdbserver", "s?", do_gdbserver,
       "[device]", "start gdbserver on given device (default 'tcp::1234'), stop with 'none'", },
-#endif
     { "x", "/l", do_memory_dump,
       "/fmt addr", "virtual memory dump starting at 'addr'", },
     { "xp", "/l", do_physical_memory_dump,
@@ -1755,13 +1759,17 @@ static const mon_cmd_t mon_cmds[] = {
     { "host_net_remove", "is", net_host_device_remove,
       "vlan_id name", "remove host VLAN client" },
 #ifdef CONFIG_SLIRP
-    { "host_net_redir", "s", net_slirp_redir,
-      "[tcp|udp]:host-port:[guest-host]:guest-port", "redirect TCP or UDP connections from host to guest (requires -net user)" },
+    { "host_net_redir", "ss?", net_slirp_redir,
+      "[tcp|udp]:host-port:[guest-host]:guest-port", "redirect TCP or UDP connections from host to guest (requires -net user)\n"
+      "host_net_redir remove [tcp:|udp:]host-port -- remove redirection\n"
+      "host_net_redir list -- show all redirections" },
 #endif
     { "balloon", "i", do_balloon,
       "target", "request VM to change it's memory allocation (in MB)" },
     { "set_link", "ss", do_set_link,
       "name up|down", "change the link status of a network adapter" },
+    { "watchdog_action", "s", do_watchdog_action,
+      "[reset|shutdown|poweroff|pause|debug|none]", "change watchdog action" },
     { "acl", "sss?i?", do_acl, "<command> <aclname> [<match> [<index>]]\n",
                                "acl show vnc.username\n"
                                "acl policy vnc.username deny\n"