summaryrefslogtreecommitdiffstats
path: root/monitor.c
Commit message (Collapse)AuthorAgeFilesLines
* serial: poll the serial console with G_IO_HUPRoger Pau Monne2014-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On FreeBSD polling a master pty while the other end is not connected with G_IO_OUT only results in an endless wait. This is different from the Linux behaviour, that returns immediately. In order to demonstrate this, I have the following example code: http://xenbits.xen.org/people/royger/test_poll.c When executed on Linux: $ ./test_poll In callback On FreeBSD instead, the callback never gets called: $ ./test_poll So, in order to workaround this, poll the source with G_IO_HUP (which makes the code behave the same way on both Linux and FreeBSD). Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Cc: Michael Tokarev <mjt@tls.msk.ru> Cc: "Andreas Färber" <afaerber@suse.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: xen-devel@lists.xenproject.org [Add hw/char/cadence_uart.c too. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* mc146818rtc: add rtc-reset-reinjection QMP commandMarcelo Tosatti2014-06-291-0/+7
| | | | | | | | | | | | | It is necessary to reset RTC interrupt reinjection backlog if guest time is synchronized via a different mechanism, such as QGA's guest-set-time command. Failing to do so causes both corrections to be applied (summed), resulting in an incorrect guest time. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* virtio-serial: report frontend connection state via monitorLaszlo Ersek2014-06-271-0/+1
| | | | | | | | | | | | Libvirt wants to know about the guest-side connection state of some virtio-serial ports (in particular the one(s) assigned to guest agent(s)). Report such states with a new monitor event. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1080376 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qapi event: clean up in callersWenchao Xia2014-06-271-1/+1
| | | | | | | | | This patch improves docs and address small issues in event callers. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into stagingPeter Maydell2014-06-241-135/+92
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remotes/qmp-unstable/queue/qmp: (43 commits) monitor: protect event emission monitor: protect outbuf and mux_out with mutex qemu-char: make writes thread-safe qemu-char: move pty_chr_update_read_handler around qemu-char: do not call chr_write directly qemu-char: introduce qemu_chr_alloc qapi event: clean up qapi event: convert QUORUM events qapi event: convert GUEST_PANICKED qapi event: convert BALLOON_CHANGE qmp: convert ACPI_DEVICE_OST event qapi event: convert SPICE events qapi event: convert VNC events qapi event: convert NIC_RX_FILTER_CHANGED qapi event: convert other BLOCK_JOB events qapi event: convert BLOCK_IMAGE_CORRUPTED qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR qapi event: convert DEVICE_TRAY_MOVED qapi event: convert DEVICE_DELETED qapi event: convert WATCHDOG ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * monitor: protect event emissionPaolo Bonzini2014-06-231-0/+16
| | | | | | | | | | | | | | | | | | | | Event emission must be protected by a mutex because of access to the shared rate-limiting state, and to guard against concurrent monitor "hot-plug" by means of human-monitor-command. Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * monitor: protect outbuf and mux_out with mutexPaolo Bonzini2014-06-231-9/+36
| | | | | | | | | | | | | | | | This lets the block layer emit QMP events from outside the I/O thread. Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi event: clean upWenchao Xia2014-06-231-216/+4
| | | | | | | | | | | | | | Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi event: convert QUORUM eventsWenchao Xia2014-06-231-3/+3
| | | | | | | | | | | | | | Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi event: convert BALLOON_CHANGEWenchao Xia2014-06-231-2/+1
| | | | | | | | | | | | | | Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qmp: convert ACPI_DEVICE_OST eventIgor Mammedov2014-06-231-1/+0
| | | | | | | | | | | | | | ... using new QAPI event infrastructure Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi event: convert WATCHDOGWenchao Xia2014-06-231-1/+1
| | | | | | | | | | | | | | Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi event: convert RTC_CHANGEWenchao Xia2014-06-231-1/+3
| | | | | | | | | | | | | | | | | | | | This patch also eliminates build time warning caused by no caller of monitor_qapi_event_throttle(). Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * monitor: add an implemention of qapi event emit methodWenchao Xia2014-06-231-1/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The monitor is now hooked on the new event mechanism, so that later patches can convert event callers one by one. Most code are copied from old monitor_protocol_* functions with some modification. Note that two build time warnings will be raised after this patch. One is caused by no caller of monitor_qapi_event_throttle(), the other one is caused by QAPI_EVENT_MAX = 0. They will be fixed automatically after full event conversion later. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | qapi/hmp: use 'backend' instead of 'device' with memory backendIgor Mammedov2014-06-231-1/+1
|/ | | | | | | | | | | | | fixup documentation comments and HMP message/help text Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* qmp: add ACPI_DEVICE_OST event handlingIgor Mammedov2014-06-191-0/+1
| | | | | | | | | | emits event when ACPI OSPM evaluates _OST method of ACPI device. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hmp: add info memdevHu Tao2014-06-191-0/+7
| | | | | | | | | | | This is the hmp counterpart of qmp query-memdev. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> MST: fix build on 32 bit
* NUMA: Add numa_info structure to contain numa nodes infoWanlong Gao2014-06-191-1/+1
| | | | | | | | | | | | | | | | Add the numa_info structure to contain the numa nodes memory, VCPUs information and the future added numa nodes host memory policies. Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> [Fix hw/ppc/spapr.c - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* monitor: QEMU Monitor Instruction Disassembly Incorrect for PowerPC LE ModeTom Musta2014-06-161-0/+4
| | | | | | | | | | | | | | | | | The monitor support for disassembling instructions does not honor the MSR[LE] bit for PowerPC processors. This change enhances the monitor_disas() routine by supporting a flag bit for Little Endian mode. Bit 16 is used since that bit was used in the analagous guest disassembly routine target_disas(). Also, to be consistent with target_disas(), the disassembler bfd_mach field can be passed in the flags argument. Reported-by: Anton Blanchard <anton@samba.org> Signed-off-by: Tom Musta <tommusta@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* monitor: Add delvm and loadvm argument completionHani Benhabiles2014-06-111-0/+48
| | | | | Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add host_net_remove arguments completionHani Benhabiles2014-06-111-0/+38
| | | | | | | | | Relies on readline unique completion strings patch to make the added vlan/hub completion values unique, instead of using something like a hash table. Signed-off-by: Hani Benhabiles <hani@linux.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add host_net_add device argument completionHani Benhabiles2014-06-111-0/+16
| | | | | | | | Also fix the parameters documentation. Signed-off-by: Hani Benhabiles <hani@linux.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add migrate_set_capability completionHani Benhabiles2014-06-111-0/+21
| | | | | Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add watchdog_action argument completionHani Benhabiles2014-06-111-0/+14
| | | | | Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add ringbuf_write and ringbuf_read argument completionHani Benhabiles2014-06-111-0/+39
| | | | | | | | Export chr_is_ringbuf() function. Also remove left-over function prototypes while at it. Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* softmmu: introduce cpu_ldst.hPaolo Bonzini2014-06-051-0/+1
| | | | | | | | | | This will collect all load and store helpers soon. For now it is just a replacement for softmmu_exec.h, which this patch stops including directly, but we also include it where this will be necessary in order to simplify the next patch. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* monitor: Add netdev_del id argument completion.Hani Benhabiles2014-05-151-0/+26
| | | | | | Signed-off-by: Hani Benhabiles <hani@linux.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add netdev_add type argument completion.Hani Benhabiles2014-05-151-0/+15
| | | | | | | | Also update the command's documentation. Signed-off-by: Hani Benhabiles <hani@linux.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add set_link arguments completion.Hani Benhabiles2014-05-151-0/+34
| | | | | | | | | | | | Make it possible to query all net clients without specifying an ID when calling qemu_find_net_clients_except(). This also adds the add_completion_option() function which is to be used for other commands completions as well. Signed-off-by: Hani Benhabiles <hani@linux.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add chardev-add backend argument completion.Hani Benhabiles2014-05-151-0/+23
| | | | | Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add chardev-remove command completion.Hani Benhabiles2014-05-151-0/+23
| | | | | Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Convert sendkey to use command_completion.Hani Benhabiles2014-05-151-9/+23
| | | | | Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: add Error-propagating monitor_handle_fd_param2()Laszlo Ersek2014-05-081-5/+22
| | | | | | | | | | | and rebase monitor_handle_fd_param() to it. (Note that this will slightly change the behavior when the qemu_parse_fd() branch is selected and it fails: we now report (and in case of QMP, set) the error immediately, rather than allowing the caller to set its own error message (if any)). Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add missing 'static' attributeStefan Weil2014-05-071-1/+1
| | | | | | | This fixes a warning from the static code analysis (smatch). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* monitor: fix qmp_getfd() fd leak in error caseStefan Hajnoczi2014-04-251-0/+1
| | | | | | | | | | qemu_chr_fe_get_msgfd() transfers ownership of the file descriptor to the caller. Therefore all code paths in qmp_getfd() should either register the file descriptor somewhere or close it. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add device_add and device_del completion.Hani Benhabiles2014-04-251-14/+24
| | | | | | | Also fix device_add completion including non-hotpluggable devices. Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add command_completion callback to mon_cmd_t.Hani Benhabiles2014-04-251-6/+13
| | | | | | | Convert object_add and object_del commands to use the new callback. Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Remove unused monitor_print_filenameCole Robinson2014-04-251-27/+0
| | | | | | | | Cc: Luiz Capitulino <lcapitulino@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* input: mouse: switch monitor to new coreGerd Hoffmann2014-03-051-5/+26
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* monitor: Remove left-over code in do_info_profile.Hani Benhabiles2014-02-281-4/+0
| | | | | | | This is a left-over from 4a1418e. Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* quorum: Add quorum_open() and quorum_close().Benoît Canet2014-02-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Example of command line: -drive if=virtio,driver=quorum,\ children.0.file.filename=1.raw,\ children.0.node-name=1.raw,\ children.0.driver=raw,\ children.1.file.filename=2.raw,\ children.1.node-name=2.raw,\ children.1.driver=raw,\ children.2.file.filename=3.raw,\ children.2.node-name=3.raw,\ children.2.driver=raw,\ vote-threshold=2 blkverify=on with vote-threshold=2 and two files can be passed to emulate blkverify. Signed-off-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* quorum: Add quorum mechanism.Benoît Canet2014-02-211-0/+2
| | | | | | | | | | | | | | | | | This patchset enables the core of the quorum mechanism. The num_children reads are compared to get the majority version and if this version exists more than threshold times the guest won't see the error at all. If a block is corrupted or if an error occurs during an IO or if the quorum cannot be established QMP events are used to report to the management. Use gnutls's SHA-256 to compare versions. --enable-quorum must be used to enable the feature. Signed-off-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* monitor: Add object_add class argument completion.Hani Benhabiles2014-02-171-0/+23
| | | | | Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add object_del id argument completion.Hani Benhabiles2014-02-171-0/+23
| | | | | Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add device_add device argument completion.Hani Benhabiles2014-02-171-0/+26
| | | | | Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* monitor: Add device_del id argument completion.Hani Benhabiles2014-02-171-0/+23
| | | | | Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* exec: Make ldq/ldub_*_phys input an AddressSpaceEdgar E. Iglesias2014-02-111-1/+1
| | | | | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
* Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-02-02' ↵Peter Maydell2014-02-051-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging trivial patches for 2014-02-02 # gpg: Signature made Sun 02 Feb 2014 16:11:37 GMT using RSA key ID 74F0C838 # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: E190 8639 3B10 B51B AC2C 8B73 5253 C5AD 74F0 C838 * remotes/mjt/tags/trivial-patches-2014-02-02: tests/.gitignore: Ignore tests/check-qom-interface hw/ppc: Remove unused defines readline: Add missing GCC_FMT_ATTR tcg/s390: Remove sigill_handler i386: Add missing include file for QEMU_PACKED osdep: drop unused #include "trace.h" qemu 1.7.0 does not build on NetBSD Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * readline: Add missing GCC_FMT_ATTRStefan Weil2014-02-011-1/+2
| | | | | | | | | | | | | | | | | | This fixes a compiler warning with -Werror=missing-format-attribute and allows improved compiler checks for variable argument lists. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* | monitor: Cleanup mon->outbuf on write errorStratos Psomadakis2014-01-281-2/+2
|/ | | | | | | | | | | | | In case monitor_flush() fails to write the contents of mon->outbuf to the output device, mon->outbuf is not cleaned up properly. Check the return code of the qemu_chr_fe_write() function and cleanup the outbuf if it fails. References: http://lists.nongnu.org/archive/html/qemu-devel/2014-01/msg02890.html Signed-off-by: Stratos Psomadakis <psomas@grnet.gr> Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
OpenPOWER on IntegriCloud