summaryrefslogtreecommitdiffstats
path: root/monitor.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori2011-10-101-248/+33
|\
| * qapi: Convert system_resetLuiz Capitulino2011-10-041-10/+0
| | | | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi: Convert stopLuiz Capitulino2011-10-041-9/+0
| | | | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi: Convert quitLuiz Capitulino2011-10-041-12/+0
| | | | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi: Convert query-commandsLuiz Capitulino2011-10-041-25/+15
| | | | | | | | Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi: Convert query-chardevLuiz Capitulino2011-10-041-10/+1
| | | | | | | | | | | | | | Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi: Convert query-uuidLuiz Capitulino2011-10-041-27/+1
| | | | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi: Convert query-statusLuiz Capitulino2011-10-041-40/+1
| | | | | | | | | | | | | | | | | | Please, note that the RunState type as defined in sysemu.h and its runstate_as_string() function are being dropped in favor of the RunState type generated by the QAPI. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * RunState: Rename enum values as generated by the QAPILuiz Capitulino2011-10-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Next commit will convert the query-status command to use the RunState type as generated by the QAPI. In order to "transparently" replace the current enum by the QAPI one, we have to make some changes to some enum values. As the changes are simple renames, I'll do them in one shot. The changes are: - Rename the prefix from RSTATE_ to RUN_STATE_ - RUN_STATE_SAVEVM to RUN_STATE_SAVE_VM - RUN_STATE_IN_MIGRATE to RUN_STATE_INMIGRATE - RUN_STATE_PANICKED to RUN_STATE_INTERNAL_ERROR - RUN_STATE_POST_MIGRATE to RUN_STATE_POSTMIGRATE - RUN_STATE_PRE_LAUNCH to RUN_STATE_PRELAUNCH - RUN_STATE_PRE_MIGRATE to RUN_STATE_PREMIGRATE - RUN_STATE_RESTORE to RUN_STATE_RESTORE_VM - RUN_STATE_PRE_MIGRATE to RUN_STATE_FINISH_MIGRATE Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi: Convert query-kvmLuiz Capitulino2011-10-041-35/+1
| | | | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi: Convert query-versionLuiz Capitulino2011-10-041-43/+3
| | | | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi: convert query-nameAnthony Liguori2011-10-041-28/+3
| | | | | | | | | | | | | | | | A simple example conversion 'info name'. This also adds the new files for QMP and HMP. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi: use middle mode in QMP serverAnthony Liguori2011-10-041-5/+4
| | | | | | | | | | | | | | Use the new middle mode within the existing QMP server. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | Merge branch 'tracing' of git://repo.or.cz/qemu/stefanhaBlue Swirl2011-10-081-2/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | * 'tracing' of git://repo.or.cz/qemu/stefanha: trace: add arguments to bdrv_co_io_em() trace event trace: trace monitor qmp dispatch/completion trace: trace bdrv_open_common() hmp: re-enable trace-file command
| * | trace: trace monitor qmp dispatch/completionStefan Hajnoczi2011-10-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add trace events for handle_qmp_command(), which dispatches qmp commands, and monitor_protocol_emitter(), which produces the reply to a qmp command. Also remove duplicate #include "trace/control.h". Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * | hmp: re-enable trace-file commandMichael Roth2011-10-031-1/+1
| |/ | | | | | | | | | | | | | | | | Commit 31965ae27bc11e90674be12584bb201b83df5aef reverted a previous renaming of CONFIG_SIMPLE_TRACE->CONFIG_TRACE_SIMPLE in a couple spots, leading to trace-file currently being unavailable. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | ppc: booke206: add "info tlb" supportScott Wood2011-10-061-2/+3
|/ | | | | Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* memory: simple memory tree printerBlue Swirl2011-10-021-0/+13
| | | | | | | | Add a monitor command 'info mtree' to show the memory hierarchy much like /proc/iomem in Linux. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* HMP: info status: Print the VM stateLuiz Capitulino2011-09-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Today our printf format for the "info status" command is: VM status: %s Where the string can be "running", "running (single step mode)" or "paused". This commit extends it to: VM status: %s (%s) The second string corresponds to the "status" field as returned by the query-status QMP command and it's only printed if "status" is not "running" or "paused". Example: VM status: paused (shutdown) PS: libvirt uses "info status" when using HMP, but the new format should not break it. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* QMP: query-status: Introduce 'status' keyLuiz Capitulino2011-09-151-2/+1
| | | | | | | This new key reports the current VM status to clients. Please, check the documentation being added in this commit for more details. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Monitor/QMP: Don't allow cont on bad VM stateLuiz Capitulino2011-09-151-0/+5
| | | | | | | | | | | | | | We have two states where issuing cont before system_reset can cause problems: RSTATE_SHUTDOWN (when -no-shutdown is used) and RSTATE_PANICKED (which only happens with kvm). This commit fixes that by doing the following when state is RSTATE_SHUTDOWN or RSTATE_PANICKED: 1. returning an error to the user/client if cont is issued 2. automatically transition to RSTATE_PAUSED during system_reset Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Drop the vm_running global variableLuiz Capitulino2011-09-151-2/+2
| | | | | | Use runstate_is_running() instead, which is introduced by this commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Drop the incoming_expected global variableLuiz Capitulino2011-09-151-1/+1
| | | | | | | | | | | Test against RSTATE_IN_MIGRATE instead. Please, note that the RSTATE_IN_MIGRATE state is only set when all the initial VM setup is done, while 'incoming_expected' was set right in the beginning when parsing command-line options. Shouldn't be a problem as far as I could check. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Replace the VMSTOP macros with a proper state typeLuiz Capitulino2011-09-151-2/+2
| | | | | | | | | | | | | | | Today, when notifying a VM state change with vm_state_notify(), we pass a VMSTOP macro as the 'reason' argument. This is not ideal because the VMSTOP macros tell why qemu stopped and not exactly what the current VM state is. One example to demonstrate this problem is that vm_start() calls vm_state_notify() with reason=0, which turns out to be VMSTOP_USER. This commit fixes that by replacing the VMSTOP macros with a proper state type called RunState. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* SPARC: Trivial patch to clean up npc monitor outputNathan Kunkee2011-09-091-1/+1
| | | | | | | | This patch fixes the spacing of the PC output from 'info cpus' for SPARC. Signed-off-by: Nathan Kunkee <nkunkee42@hotmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* trace: always compile support for controlling and querying trace event statesLluís2011-09-011-4/+5
| | | | | | | | The current interface is generic for this small set of operations, and thus other backends can easily modify the "trace/control.c" file to add their own implementation. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
* trace: separate trace event control and query routines from the simple backendLluís2011-09-011-5/+6
| | | | | | | | Generalize the 'st_print_trace_events' and 'st_change_trace_event_state' into backend-specific 'trace_print_events' and 'trace_event_set_state' (respectively) in the "trace/control.h" file. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
* trace: [configure] rename CONFIG_*_TRACE into CONFIG_TRACE_*Lluís2011-09-011-4/+4
| | | | | | | | | | | Provides a more hierarchical view of the variable domain. Also adds the CONFIG_TRACE_* variables for all backends. [Stefan added missing 'test' in stap if statement] Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* monitor: fix build breakage for !CONFIG_VNCJamie Iles2011-08-251-1/+1
| | | | | | | | | | | Commit c62f6d1 (monitor: fix build breakage with --disable-vnc) conditionalised some VNC setup code but left an unused variable. Move the variable into the conditional code to fix the build breakage. Cc: Luiz Capitulino <lcapitulino@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Jamie Iles <jamie@jamieiles.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* char: rename qemu_chr_get_msgfd() -> qemu_chr_fe_get_msgfd()Anthony Liguori2011-08-221-1/+1
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: rename qemu_chr_set_echo() -> qemu_chr_fe_set_echo()Anthony Liguori2011-08-221-1/+1
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: rename qemu_chr_write() -> qemu_chr_fe_write()Anthony Liguori2011-08-221-1/+1
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* monitor: Prevent sign-extension of 32-bit addresses printed by info tlbAustin Clements2011-08-211-2/+2
| | | | | | | | | | | | | | | | | | | | This is the same fix that was recently applied to info mem. Before this change, info tlb output looked like: ffffffffffffc000: 000000000fffc000 --------W ffffffffffffd000: 000000000fffd000 --------W ffffffffffffe000: 000000000fffe000 --------W fffffffffffff000: 000000000ffff000 --------W With this change, it looks like 00000000ffffc000: 000000000fffc000 --------W 00000000ffffd000: 000000000fffd000 --------W 00000000ffffe000: 000000000fffe000 --------W 00000000fffff000: 000000000ffff000 --------W Signed-off-by: Austin Clements <amdragon@mit.edu> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* monitor: Show combined protection bits in "info mem"Austin Clements2011-08-211-3/+7
| | | | | | | | | | Previously, "info mem" considered and displayed only the last-level protection bits for a memory range, which doesn't accurrately represent the protection of that range. Now it shows the combined protection. Signed-off-by: Austin Clements <amdragon@mit.edu> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* monitor: Fix "info mem" to print the last memory rangeAustin Clements2011-08-211-0/+6
| | | | | | | | "info mem" groups its output into contiguous ranges with identical protection bits, but previously forgot to print the last range. Signed-off-by: Austin Clements <amdragon@mit.edu> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* monitor: Prevent sign-extension of 32-bit addresses printed by info memAustin Clements2011-08-211-2/+4
| | | | | | | | | | | | | | | | | | | | Previously, on 32-bit i386, info mem used signed 32-bit int's to store the page table indexes. As a result, address calculation was done in 32 bits and then incorrectly sign-extended to 64 bits, yielding output like ffffffffef000000-ffffffffef031000 0000000000031000 ur- ffffffffef7bc000-ffffffffef7bd000 0000000000001000 urw ffffffffef7bd000-ffffffffef7be000 0000000000001000 ur- This makes these indexes unsigned, which yields correct output 00000000ef000000-00000000ef031000 0000000000031000 ur- 00000000ef7bc000-00000000ef7bd000 0000000000001000 urw 00000000ef7bd000-00000000ef7be000 0000000000001000 ur- Signed-off-by: Austin Clements <amdragon@mit.edu> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-201-22/+22
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* monitor: fix build breakage with --disable-vncTeLeMan2011-07-291-0/+2
| | | | | | | The breakage was introduced by the commit 13661089810d3e59931f3e80d7cb541b99af7071 Signed-off-by: TeLeMan <geleman@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce a 'client_add' monitor command accepting an open FDDaniel P. Berrange2011-07-231-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow client connections for VNC and socket based character devices to be passed in over the monitor using SCM_RIGHTS. One intended usage scenario is to start QEMU with VNC on a UNIX domain socket. An unprivileged user which cannot access the UNIX domain socket, can then connect to QEMU's VNC server by passing an open FD to libvirt, which passes it onto QEMU. { "execute": "get_fd", "arguments": { "fdname": "myclient" } } { "return": {} } { "execute": "add_client", "arguments": { "protocol": "vnc", "fdname": "myclient", "skipauth": true } } { "return": {} } In this case 'protocol' can be 'vnc' or 'spice', or the name of a character device (eg from -chardev id=XXXX) The 'skipauth' parameter can be used to skip any configured VNC authentication scheme, which is useful if the mgmt layer talking to the monitor has already authenticated the client in another way. * console.h: Define 'vnc_display_add_client' method * monitor.c: Implement 'client_add' command * qemu-char.c, qemu-char.h: Add 'qemu_char_add_client' method * qerror.c, qerror.h: Add QERR_ADD_CLIENT_FAILED * qmp-commands.hx: Declare 'client_add' command * ui/vnc.c: Implement 'vnc_display_add_client' method Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Remove exec-all.h include directivesBlue Swirl2011-06-261-1/+1
| | | | | | Most exec-all.h include directives are now useless, remove them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* HMP: Use QMP inject nmi implementationLuiz Capitulino2011-06-011-14/+2
| | | | | | | | | | | This **CHANGES** the human monitor "nmi" command behavior. Currently it accepts an CPU argument which, when provided, will send the NMI to the specified CPU. This feature is of discussable value though and HMP shouldn't have more features than QMP, so let's use QMP's instead (it's also simpler). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* QMP: add inject-nmi qmp commandLai Jiangshan2011-06-011-0/+17
| | | | | | | | inject-nmi command injects an NMI on all CPUs of guest. It is only supported for x86 guest currently, it will returns "Unsupported" error for non-x86 guest. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: add PPC BookE SPRsScott Wood2011-05-091-1/+70
| | | | | | | | | | Read them via KVM_GET_SREGS in kvm_arch_get_registers(), and display them in "info registers". Also get CR and PID from the existing KVM_GET_REGS. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* Replace cpu_physical_memory_rw were possibleStefan Weil2011-04-121-5/+4
| | | | | | | | | | | | Using cpu_physical_memory_read, cpu_physical_memory_write and ldub_phys improves readability and allows removing some type casts. lduw_phys and ldl_phys were not used because both require aligned addresses. Therefore it is not possible to simply replace existing calls by one of these functions. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* monitor: Remove some type casts which are no longer neededStefan Weil2011-04-121-30/+18
| | | | | | | | | All other type casts in calls of cpu_physical_memory_read are used by hardware emulations and will be fixed by separate patches. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Parse SDR1 on mtspr instead of at translate timeDavid Gibson2011-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | On ppc machines with hash table MMUs, the special purpose register SDR1 contains both the base address of the encoded size (hashed) page tables. At present, we interpret the SDR1 value within the address translation path. But because the encodings of the size for 32-bit and 64-bit are different this makes for a confusing branch on the MMU type with a bunch of curly shifts and masks in the middle of the translate path. This patch cleans things up by moving the interpretation on SDR1 into the helper function handling the write to the register. This leaves a simple pre-sanitized base address and mask for the hash table in the CPUState structure which is easier to work with in the translation path. This makes the translation path more readable. It addresses the FIXME comment currently in the mtsdr1 helper, by validating the SDR1 value during interpretation. Finally it opens the way for emulating a pSeries-style partition where the hash table used for translation is not mapped into the guests's RAM. Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* Make VNC support optionalJes Sorensen2011-03-221-12/+10
| | | | | | | Per default VNC is enabled. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote branch 'qemu-kvm/uq/master' into stagingAnthony Liguori2011-03-211-4/+11
|\
| * Expose thread_id in info cpusJan Kiszka2011-03-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | Based on patch by Glauber Costa: To allow management applications like libvirt to apply CPU affinities to the VCPU threads, expose their ID via info cpus. This patch provides the pre-existing and used interface from qemu-kvm. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * x86: Optionally avoid injecting AO MCEs while others are pendingJan Kiszka2011-03-151-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Allow to tell cpu_x86_inject_mce that it should ignore Action Optional MCE events when the target VCPU is still processing another one. This will be used by KVM soon. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> CC: Huang Ying <ying.huang@intel.com> CC: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> CC: Jin Dongming <jin.dongming@np.css.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
OpenPOWER on IntegriCloud