summaryrefslogtreecommitdiff
path: root/monitor.c
AgeCommit message (Collapse)AuthorFilesLines
2009-09-04monitor: Port handler_7 to use QDictLuiz Capitulino1-12/+10
This commit ports command handlers that receive seven arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_6 to use QDictLuiz Capitulino1-8/+6
This commit ports command handlers that receive six arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_5 to use QDictLuiz Capitulino1-21/+28
This commit ports command handlers that receive five arguments to use the new monitor's dictionary. Note that GET_TLONG() and GET_TPHYSADDR() macros are not used anymore. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_4 to use QDictLuiz Capitulino1-13/+9
This commit ports command handlers that receive four arguments to use the new monitor's dictionary. Note that GET_TLONG() and GET_TPHYSADDR() macros are not used anymore. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_3 to use QDictLuiz Capitulino1-11/+13
This commit ports command handlers that receive three arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_2 to use QDictLuiz Capitulino1-10/+13
This commit ports command handlers that receive two arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_1 to use QDictLuiz Capitulino1-28/+41
This commit ports command handlers that receive one argument to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Port handler_0 to use QDictLuiz Capitulino1-9/+9
This commit ports command handlers that receive no arguments to use the new monitor's dictionary. It might seem no sense to do this, as the handlers have no arguments, but at the end of this porting work all handlers will have the same structure. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: Setup a QDict with arguments to handlersLuiz Capitulino1-0/+18
With this commit monitor_handle_command() will be able to setup a QDict with arguments to command handlers. However, the current 'args[]' method is still being used, next changes will port commands to get their arguments from the dictionary. Two changes are worth noting: 1. The '/' argument type always adds the following standard keys in the dictionary: 'count', 'format' and 'size'. This way, the argument name used in the 'args_type' string doesn't matter 2. The optional argument type '?' doesn't need to pass the additional 'has_arg' argument, hanlders can do the same check with qdict_haskey() Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04monitor: New format for handlers argument typesLuiz Capitulino1-5/+43
Current handlers argument types, as defined in qemu-monitor.hx file, are a sequence of chars where each one represents one argument type of the command handler. The number of chars is also used to know how many arguments a given handler accepts. This commit defines a new format, which makes mandatory the use of a name for each argument. For example, do_eject() command handler is currently defined as: { "eject", "-fB", do_eject, ... } With the new format it becomes: { "eject", "force:-f,filename:B", do_eject, ... } This way the Monitor will be capable of setting up a dictionary, using each argument's name as the key and the argument itself as the value. This commit also adds two new functions: key_get_info() and next_arg_type(), both are used to parse the new format. Currently key_get_info() consumes the 'key' part of the new format and discards it, this way the current parsing code is not affected by this change. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04Add wrappers to functions used by the MonitorLuiz Capitulino1-0/+5
Some functions exported to be used by the Monitor as command handlers are also called in other places as regular functions. When those functions got ported to use the Monitor dictionary to pass argments, the callers will have to setup a dictionary to be able to call them. To avoid this problem, this commit add wrappers to those functions, so that we change the wrapper to accept the dictionary, letting the current functions as is. The following wrappers are being added: - do_help_cmd() - do_pci_device_hot_remove() Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-31Fix breakage due to __threadBlue Swirl1-1/+1
Thread-local storage is not supported on all hosts. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-27add qemu_error() + friendsGerd Hoffmann1-1/+70
This patch adds some functions for error reporting to address the problem that error messages should be routed to different destinations depending on the context of the caller, i.e. monitor command errors should go to the monitor, command line errors to stderr. qemu_error() is a printf-like function to report errors. qemu_errors_to_file() and qemu_errors_to_mon() switch the destination for the error message to the specified file or monitor. When setting a new destination the old one will be kept. One can switch back using qemu_errors_to_previous(). i.e. it works like a stack. main() calls qemu_errors_to_file(stderr), so errors go to stderr by default. monitor callbacks are wrapped into qemu_errors_to_mon() + qemu_errors_to_previous(), so any errors triggered by monitor commands will go to the monitor. Each thread has its own error message destination. qemu-kvm probably should add a qemu_errors_to_file(stderr) call to the i/o-thread initialization code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27kvm: Simplify cpu_synchronize_state()Avi Kivity1-2/+2
cpu_synchronize_state() is a little unreadable since the 'modified' argument isn't self-explanatory. Simplify it by making it always synchronize the kernel state into qemu, and automatically flush the registers back to the kernel if they've been synchronized on this exit. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27make load_vmstate() return errorsJuan Quintela1-2/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27move do_loadvm() to monitor.cJuan Quintela1-0/+11
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24Unbreak large mem support by removing kqemuAnthony Liguori1-57/+0
kqemu introduces a number of restrictions on the i386 target. The worst is that it prevents large memory from working in the default build. Furthermore, kqemu is fundamentally flawed in a number of ways. It relies on the TSC as a time source which will not be reliable on a multiple processor system in userspace. Since most modern processors are multicore, this severely limits the utility of kqemu. kvm is a viable alternative for people looking to accelerate qemu and has the benefit of being supported by the upstream Linux kernel. If someone can implement work arounds to remove the restrictions introduced by kqemu, I'm happy to avoid and/or revert this patch. N.B. kqemu will still function in the 0.11 series but this patch removes it from the 0.12 series. Paul, please Ack or Nack this patch. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-23Fix device name completion for 'eject'Blue Swirl1-0/+3
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-10rename "info qdrv" to "info qdm"Gerd Hoffmann1-2/+2
As requested by avi: driver != device model. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
2009-08-10Fix do_commit() behaviorLuiz Capitulino1-1/+1
Commit 751c6a17042b5d011013d6963c0505d671cf708e changed the monitor's 'commit' command to this behavior: 1. Any string you type as argument will cause do_commit() to call bdrv_commit() to all devices 2. If you enter a device name, it will be the only one ignored by do_commit() :) The fix is to call bdrv_commit() to the specified device only and ignore the others (when 'all' is not specified). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
2009-07-31Fix Sparse warnings: "Using plain integer as NULL pointer"Blue Swirl1-1/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-30qdev/core: add monitor command to list all driversGerd Hoffmann1-0/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27kill drives_tableGerd Hoffmann1-5/+7
First step cleaning up the drives handling. This one does nothing but removing drives_table[], still it became seriously big. drive_get_index() is gone and is replaced by drives_get() which hands out DriveInfo pointers instead of a table index. This needs adaption in *tons* of places all over. The drives are now maintained as linked list. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27Add monitor_get_fd() command for fetching named fdsMark McLoughlin1-0/+24
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27Add getfd and closefd monitor commandsMark McLoughlin1-0/+69
Add monitor commands to support passing file descriptors via SCM_RIGHTS. getfd assigns the passed file descriptor a name for use with other monitor commands. closefd allows passed file descriptors to be closed. If a monitor command actually uses a named file descriptor, closefd will not be required. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16monitor: Add port write commandJan Kiszka1-0/+19
Useful for testing hardware emulations or manipulating its state to stress guest drivers. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-16Move boot_set callback backendJan Kiszka1-18/+5
Move registration function for the boot_set callback handler and provide qemu_boot_set so that it can also be used outside the monitor code. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09use constant IOPORTS_MASK instead of 0xffff.Isaku Yamahata1-1/+1
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09QEMU: MCE: Add MCE simulation to qemu/tcgHuang Ying1-0/+46
- MCE features are initialized when VCPU is intialized according to CPUID. - A monitor command "mce" is added to inject a MCE. - A new interrupt mask: CPU_INTERRUPT_MCE is added to inject the MCE. aliguori: fix build for linux-user Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29monitor: Refactor acl commndsJan Kiszka1-39/+57
Refactor the ACL monitor interface to make full use of the monitor command dispatcher. This also gives proper help formatting and command completion. Note that 'acl allow' and 'acl deny' were combined to 'acl_add aclname match allow|deny [index]' for consistency reasons. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29monitor: Add completion for help commandJan Kiszka1-0/+5
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29slirp: Drop statistic codeJan Kiszka1-2/+0
As agreed on the mailing list, there is no interest in keeping the usually disabled slirp statistics in the tree. So this patch removes them. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-29slirp: Add info usernet for dumping connection statesJan Kiszka1-0/+2
Break out sockstats from the slirp statistics and present them under the new info category "usernet". This patch also improves the current output /wrt proper reporting connection source and destination. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-10monitor: Introduce get_command_name()Luiz Capitulino1-14/+30
Move code to extract command name into a function of its own, this clearifies the code and let us remove two variables from monitor_handle_command(). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2009-06-10monitor: Remove unused variableLuiz Capitulino1-2/+0
The local pointer 'q' is not used by monitor_handle_command(). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2009-06-10monitor: Remove uneeded 'return' statementLuiz Capitulino1-1/+0
The 'return' statement at the of monitor_handle_command() is not needed and can be removed. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2009-06-10monitor: Remove uneeded gotoLuiz Capitulino1-4/+6
The 'found' goto in monitor_handle_command() can be dropped if we check for 'cmd->name' after looking up for the command to execute. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2009-06-06Use hxtool to generate monitor documentation and C structuresBlue Swirl1-119/+3
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-06-05qdev: add monitor command to dump the tree.Gerd Hoffmann1-0/+3
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-28User networking: Show active connectionsAlexander Graf1-1/+2
In case you're wondering what connections exactly you have open or maybe redir'ed in the past, you can't really find out from qemu right now. This patch enables you to see all current connections the host only networking holds open, so you can kill them using the previous patch. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-27User Networking: Enable removal of redirectionsAlexander Graf1-2/+3
Using the new host_net_redir command you can easily create redirections on the fly while your VM is running. While that's great, it's missing the removal of redirections, in case you want to have a port closed again at a later point in time. This patch adds support for removal of redirections. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-08Drop CONFIG_GDBSTUBJan Kiszka1-4/+0
This is no user-flippable switch, and no arch makes use of disabling gdbstub support. So it's pointless to keep the related #ifdefs and configure hunks around - and risking breakages like 711c410fdd again. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2009-05-01Hardware watchdogRichard W.M. Jones1-0/+10
Here is an updated hardware watchdog patch, which should fix everything that was raised about the previous version ... Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-04-22monitor: Fix warning in do_info_numa (Jan Kiszka)aliguori1-1/+1
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7232 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-21add info numa command to monitor (Andre Przywara)aliguori1-0/+21
adds an "info numa" command to the monitor to output the current topology. Since NUMA is advertised via static ACPI tables, no changes are possible during runtime. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7211 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-21slirp: Enhance host-guest redirection setup (Jan Kiszka)aliguori1-0/+4
Allow to establish a TCP/UDP connection redirection also via a monitor command 'host_net_redir'. Moreover, assume TCP as connection type if that parameter is omitted. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7204 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-21monitor: Allow host_net_add/remove for all targets (Jan Kiszka)aliguori1-1/+1
There is nothing x86-specific in host_net_add/remove, so allow them for all targets. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7202 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-21monitor: Improve host_net_add (Jan Kiszka)aliguori1-2/+2
Fix the documentation of the host_net_add monitor command and allow the user to pass no options at all. Moreover, inform the user on the monitor terminal if a request failed. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7201 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-21net: Add support for capturing VLANs (Jan Kiszka)aliguori1-1/+1
This patch is derived from Tristan Gingold's patch. It adds a new VLAN client type that writes all traffic on the VLAN it is attached to into a pcap file. Such a file can then be analyzed offline with Wireshark or tcpdump. Besides rebasing and some minor cleanups, the major differences to the original version are: - support for enabling/disabling via the monitor (host_net_add/remove) - no special ordering of VLAN client list, qemu_send_packet now takes care of properly ordered packets - 64k default capturing limit (I hate tcpdump's default) Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7200 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-19kqemu: merge CONFIG_KQEMU and USE_KQEMUblueswir11-2/+2
Basically a recursive ":%s/USE_KQEMU/CONFIG_KQEMU/g". Signed-off-by: Paul Bolle <pebolle@tiscali.nl> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7189 c046a42c-6fe2-441c-8c8c-71466251a162