aboutsummaryrefslogtreecommitdiffstats
path: root/monitor.c
AgeCommit message (Collapse)AuthorFilesLines
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
2009-04-18monitor: Update command help (Jan Kiszka)aliguori1-6/+6
Align some monitor help texts to the related command parameter definitions. host_net_add is skipped intentionally, will be slightly reworked in a separate patch later. 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@7180 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-07Add --with-pkgversion.pbrook1-1/+1
Allows distributors to identify their builds without needing to hack the sources. Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7036 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-05Add new command line option -singlestep for tcg single stepping.aurel321-3/+20
This replaces a compile time option for some targets and adds this feature to targets which did not have a compile time option. Add monitor command to enable or disable single step mode. Modify monitor command "info status" to display single step mode. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7004 c046a42c-6fe2-441c-8c8c-71466251a162
2009-04-05gdbstub: Rework configuration via command line and monitor (Jan Kiszka)aliguori1-9/+10
Introduce a more canonical gdbstub configuration (system emulation only) via the new switch '-gdb dev'. Keep '-s' as shorthand for '-gdb tcp::1234'. Use the same syntax also for the corresponding monitor command 'gdbserver'. Its default remains to listen on TCP port 1234. Changes in v4: - Rebased over new command line switches meta file Changes in v3: - Fix documentation Changes in v2: - Support for pipe-based like to gdb (target remote | qemu -gdb stdio) - Properly update the qemu-doc 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@6992 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-28gdbstub: Allow re-instantiation (Jan Kiszka)aliguori1-0/+2
[ Note: depends on char closing fixes ] Properly clean up the gdbstub when the user tries to re-open it (possibly under a different address). Moreover, allow to shut it down from the monitor via 'gdbserver none'. 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@6913 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-12monitor: sync from kvm state before generating output (Jan Kiszka)aliguori1-0/+2
Ported from the KVM tree: Synchronize the qemu cpu state with kvm's before invoking various monitor info commands (like 'info registers'). 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@6826 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-08Multi-key completion for sendkeyblueswir11-0/+3
Allow completion of concatenated key strings for the sendkey command. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6784 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-07Sparse fixes: NULL use, header order, ANSI prototypes, staticblueswir11-1/+1
Fix Sparse warnings: * use NULL instead of plain 0 * rearrange header include order to avoid redefining types accidentally * ANSIfy SLIRP * avoid "restrict" keyword * add static git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6736 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-06Remove tabs introduced from VNC ACL seriesaliguori1-86/+86
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6727 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-06Support ACLs for controlling VNC access ("Daniel P. Berrange")aliguori1-0/+96
This patch introduces a generic internal API for access control lists to be used by network servers in QEMU. It adds support for checking these ACL in the VNC server, in two places. The first ACL is for the SASL authentication mechanism, checking the SASL username. This ACL is called 'vnc.username'. The second is for the TLS authentication mechanism, when x509 client certificates are turned on, checking against the Distinguished Name of the client. This ACL is called 'vnc.x509dname' The internal API provides for an ACL with the following characteristics - A unique name, eg vnc.username, and vnc.x509dname. - A default policy, allow or deny - An ordered series of match rules, with allow or deny policy If none of the match rules apply, then the default policy is used. There is a monitor API to manipulate the ACLs, which I'll describe via examples (qemu) acl show vnc.username policy: allow (qemu) acl policy vnc.username denya acl: policy set to 'deny' (qemu) acl allow vnc.username fred acl: added rule at position 1 (qemu) acl allow vnc.username bob acl: added rule at position 2 (qemu) acl allow vnc.username joe 1 acl: added rule at position 1 (qemu) acl show vnc.username policy: deny 0: allow fred 1: allow joe 2: allow bob (qemu) acl show vnc.x509dname policy: allow (qemu) acl policy vnc.x509dname deny acl: policy set to 'deny' (qemu) acl allow vnc.x509dname C=GB,O=ACME,L=London,CN=* acl: added rule at position 1 (qemu) acl allow vnc.x509dname C=GB,O=ACME,L=Boston,CN=bob acl: added rule at position 2 (qemu) acl show vnc.x509dname policy: deny 0: allow C=GB,O=ACME,L=London,CN=* 1: allow C=GB,O=ACME,L=Boston,CN=bob By default the VNC server will not use any ACLs, allowing access to the server if the user successfully authenticates. To enable use of ACLs to restrict user access, the ',acl' flag should be given when starting QEMU. The initial ACL activated will be a 'deny all' policy and should be customized using monitor commands. eg enable SASL auth and ACLs qemu .... -vnc localhost:1,sasl,acl The next patch will provide a way to load a pre-defined ACL when starting up Makefile | 6 + b/acl.c | 185 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ b/acl.h | 74 ++++++++++++++++++++++ configure | 18 +++++ monitor.c | 95 ++++++++++++++++++++++++++++ qemu-doc.texi | 49 ++++++++++++++ vnc-auth-sasl.c | 16 +++- vnc-auth-sasl.h | 7 ++ vnc-tls.c | 19 +++++ vnc-tls.h | 3 vnc.c | 21 ++++++ vnc.h | 3 12 files changed, 491 insertions(+), 5 deletions(-) Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6726 c046a42c-6fe2-441c-8c8c-71466251a162
2009-03-05monitor: Introduce MONITOR_USE_READLINE flag (Jan Kiszka)aliguori1-10/+37
This allows to create monitor terminals that do not make use of the interactive readline back-end but rather send complete commands. The pass-through monitor interface of the gdbstub will be an example. 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@6717 c046a42c-6fe2-441c-8c8c-71466251a162