X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=monitor.c;h=7620bdebfe8623e5ab14a892ea138d6c2e2e83f3;hb=2313086addaf609c5f64636591818eebc213fd53;hp=ca1c11c478110e2503802dae292524f6c05b22b9;hpb=1b530a6dfcfe4510f66cb90a1717698063ac7a4f;p=qemu diff --git a/monitor.c b/monitor.c index ca1c11c..7620bde 100644 --- a/monitor.c +++ b/monitor.c @@ -23,10 +23,12 @@ */ #include #include "hw/hw.h" +#include "hw/qdev.h" #include "hw/usb.h" #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" @@ -273,7 +275,7 @@ static void do_info(Monitor *mon, const char *item) static void do_info_version(Monitor *mon) { - monitor_printf(mon, "%s\n", QEMU_VERSION); + monitor_printf(mon, "%s\n", QEMU_VERSION QEMU_PKGVERSION); } static void do_info_name(Monitor *mon) @@ -580,7 +582,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 +596,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) { @@ -1368,7 +1375,7 @@ static void tlb_info(Monitor *mon) static void do_info_kqemu(Monitor *mon) { -#ifdef USE_KQEMU +#ifdef CONFIG_KQEMU CPUState *env; int val; val = 0; @@ -1409,6 +1416,25 @@ static void do_info_kvm(Monitor *mon) #endif } +static void do_info_numa(Monitor *mon) +{ + int i; + CPUState *env; + + monitor_printf(mon, "%d nodes\n", nb_numa_nodes); + for (i = 0; i < nb_numa_nodes; i++) { + monitor_printf(mon, "node %d cpus:", i); + for (env = first_cpu; env != NULL; env = env->next_cpu) { + if (env->numa_node == i) { + monitor_printf(mon, " %d", env->cpu_index); + } + } + monitor_printf(mon, "\n"); + monitor_printf(mon, "node %d size: %" PRId64 " MB\n", i, + node_mem[i] >> 20); + } +} + #ifdef CONFIG_PROFILER int64_t kqemu_time; @@ -1445,7 +1471,7 @@ static void do_info_profile(Monitor *mon) kqemu_ret_int_count = 0; kqemu_ret_excp_count = 0; kqemu_ret_intr_count = 0; -#ifdef USE_KQEMU +#ifdef CONFIG_KQEMU kqemu_record_dump(); #endif } @@ -1470,6 +1496,7 @@ static void do_info_capture(Monitor *mon) } } +#ifdef HAS_AUDIO static void do_stop_capture(Monitor *mon, int n) { int i; @@ -1485,7 +1512,6 @@ static void do_stop_capture(Monitor *mon, int n) } } -#ifdef HAS_AUDIO static void do_wav_capture(Monitor *mon, const char *path, int has_freq, int freq, int has_bits, int bits, @@ -1633,122 +1659,12 @@ static void do_acl(Monitor *mon, } } -/* Please update qemu-doc.texi when adding or changing commands */ static const mon_cmd_t mon_cmds[] = { - { "help|?", "s?", help_cmd, - "[cmd]", "show the help" }, - { "commit", "s", do_commit, - "device|all", "commit changes to the disk images (if -snapshot is used) or backing files" }, - { "info", "s?", do_info, - "subcommand", "show various information about the system state" }, - { "q|quit", "", do_quit, - "", "quit the emulator" }, - { "eject", "-fB", do_eject, - "[-f] device", "eject a removable medium (use -f to force it)" }, - { "change", "BFs?", do_change, - "device filename [format]", "change a removable medium, optional format" }, - { "screendump", "F", do_screen_dump, - "filename", "save screen into PPM image 'filename'" }, - { "logfile", "F", do_logfile, - "filename", "output logs to 'filename'" }, - { "log", "s", do_log, - "item1[,...]", "activate logging of the specified items to '/tmp/qemu.log'" }, - { "savevm", "s?", do_savevm, - "tag|id", "save a VM snapshot. If no tag or id are provided, a new snapshot is created" }, - { "loadvm", "s", do_loadvm, - "tag|id", "restore a VM snapshot from its tag or id" }, - { "delvm", "s", do_delvm, - "tag|id", "delete a VM snapshot from its tag or id" }, - { "singlestep", "s?", do_singlestep, - "[on|off]", "run emulation in singlestep mode or switch to normal mode", }, - { "stop", "", do_stop, - "", "stop emulation", }, - { "c|cont", "", do_cont, - "", "resume emulation", }, -#ifdef CONFIG_GDBSTUB - { "gdbserver", "s?", do_gdbserver, - "[port]", "start gdbserver session (default port=1234)", }, -#endif - { "x", "/l", do_memory_dump, - "/fmt addr", "virtual memory dump starting at 'addr'", }, - { "xp", "/l", do_physical_memory_dump, - "/fmt addr", "physical memory dump starting at 'addr'", }, - { "p|print", "/l", do_print, - "/fmt expr", "print expression value (use $reg for CPU register access)", }, - { "i", "/ii.", do_ioport_read, - "/fmt addr", "I/O port read" }, - - { "sendkey", "si?", do_sendkey, - "keys [hold_ms]", "send keys to the VM (e.g. 'sendkey ctrl-alt-f1', default hold time=100 ms)" }, - { "system_reset", "", do_system_reset, - "", "reset the system" }, - { "system_powerdown", "", do_system_powerdown, - "", "send system power down event" }, - { "sum", "ii", do_sum, - "addr size", "compute the checksum of a memory region" }, - { "usb_add", "s", do_usb_add, - "device", "add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')" }, - { "usb_del", "s", do_usb_del, - "device", "remove USB device 'bus.addr'" }, - { "cpu", "i", do_cpu_set, - "index", "set the default CPU" }, - { "mouse_move", "sss?", do_mouse_move, - "dx dy [dz]", "send mouse move events" }, - { "mouse_button", "i", do_mouse_button, - "state", "change mouse button state (1=L, 2=M, 4=R)" }, - { "mouse_set", "i", do_mouse_set, - "index", "set which mouse device receives events" }, -#ifdef HAS_AUDIO - { "wavcapture", "si?i?i?", do_wav_capture, - "path [frequency bits channels]", - "capture audio to a wave file (default frequency=44100 bits=16 channels=2)" }, -#endif - { "stopcapture", "i", do_stop_capture, - "capture index", "stop capture" }, - { "memsave", "lis", do_memory_save, - "addr size file", "save to disk virtual memory dump starting at 'addr' of size 'size'", }, - { "pmemsave", "lis", do_physical_memory_save, - "addr size file", "save to disk physical memory dump starting at 'addr' of size 'size'", }, - { "boot_set", "s", do_boot_set, - "bootdevice", "define new values for the boot device list" }, -#if defined(TARGET_I386) - { "nmi", "i", do_inject_nmi, - "cpu", "inject an NMI on the given CPU", }, -#endif - { "migrate", "-ds", do_migrate, - "[-d] uri", "migrate to URI (using -d to not wait for completion)" }, - { "migrate_cancel", "", do_migrate_cancel, - "", "cancel the current VM migration" }, - { "migrate_set_speed", "s", do_migrate_set_speed, - "value", "set maximum speed (in bytes) for migrations" }, -#if defined(TARGET_I386) - { "drive_add", "ss", drive_hot_add, "pci_addr=[[:]:]\n" - "[file=file][,if=type][,bus=n]\n" - "[,unit=m][,media=d][index=i]\n" - "[,cyls=c,heads=h,secs=s[,trans=t]]\n" - "[snapshot=on|off][,cache=on|off]", - "add drive to PCI storage controller" }, - { "pci_add", "sss", pci_device_hot_add, "pci_addr=auto|[[:]:] nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]...", "hot-add PCI device" }, - { "pci_del", "s", pci_device_hot_remove, "pci_addr=[[:]:]", "hot remove PCI device" }, - { "host_net_add", "ss", net_host_device_add, - "[tap,user,socket,vde] options", "add host VLAN client" }, - { "host_net_remove", "is", net_host_device_remove, - "vlan_id name", "remove host VLAN client" }, -#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" }, - { "acl", "sss?i?", do_acl, " [] []\n", - "acl show vnc.username\n" - "acl policy vnc.username deny\n" - "acl allow vnc.username fred\n" - "acl deny vnc.username bob\n" - "acl reset vnc.username\n" }, +#include "qemu-monitor.h" { NULL, NULL, }, }; -/* Please update qemu-doc.texi when adding or changing commands */ +/* Please update qemu-monitor.hx when adding or changing commands */ static const mon_cmd_t info_cmds[] = { { "version", "", do_info_version, "", "show the version of QEMU" }, @@ -1788,6 +1704,8 @@ static const mon_cmd_t info_cmds[] = { "", "show KQEMU information", }, { "kvm", "", do_info_kvm, "", "show KVM information", }, + { "numa", "", do_info_numa, + "", "show NUMA information", }, { "usb", "", usb_info, "", "show guest USB devices", }, { "usbhost", "", usb_host_info, @@ -1821,6 +1739,8 @@ static const mon_cmd_t info_cmds[] = { { "migrate", "", do_info_migrate, "", "show migration status" }, { "balloon", "", do_info_balloon, "", "show balloon information" }, + { "qtree", "", do_info_qtree, + "", "show device tree" }, { NULL, NULL, }, };