History | View | Annotate | Download (142.8 kB)
x86: Small cleanups of MCE helpers
Fix some code style issues, use proper headers, and align to cpu_x86naming scheme. No functional changes.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>CC: Huang Ying <ying.huang@intel.com>CC: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>...
x86: Refine error reporting of MCE injection services
As this service is used by the human monitor, make sure that errors getreported to the right channel, and also raise the verbosity.
This requires to move Monitor typedef in qemu-common.h to resolve the...
x86: Optionally avoid injecting AO MCEs while others are pending
Allow to tell cpu_x86_inject_mce that it should ignore Action OptionalMCE events when the target VCPU is still processing another one. Thiswill be used by KVM soon.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Improve vm_stop reason declarations
Define and use dedicated constants for vm_stop reasons, they actuallyhave nothing to do with the EXCP_* defines used so far. At this chance,specify more detailed reasons so that VM state change handlers canevaluate them....
add qemu_chr_set_echo
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote branch 'qemu-kvm/uq/master' into staging
aliguori: fix build with !defined(KVM_CAP_ASYNC_PF)
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote branch 'spice/spice.v29.pull' into staging
Conflicts: trace-events
vnc: Fix password expiration through 'change vnc ""' (v2)
commit 52c18be9e99dabe295321153fda7fce9f76647ac introduced a regression in thechange vnc password command that changed the behavior of setting the VNCpassword to an empty string from disabling login to disabling authentication....
monitor: use after free in do_wav_capture()
use after free in do_wav_capture() on the error path.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
spice/vnc: client migration.
Handle spice client migration, i.e. inform a spice client connectedabout the new host and connection parameters, so it can move over theconnection automatically.
The monitor command has a not-yet used protocol argument simliar to...
vnc/spice: fix "never" and "now" expire_time
Make strtosz() return int64_t instead of ssize_t
strtosz() needs to return a 64 bit type even on 32 bitarchitectures. Otherwise qemu-img will fail to create diskimages >= 2GB
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Add "broadcast" option for mce command
When the following test case is injected with mce command, maybe user could notget the expected result. DATA command cpu bank status mcg_status addr misc (qemu) mce 1 1 0xbd00000000000000 0x05 0x1234 0x8c...
monitor: fix a typo
Fix usage of wrong variable, spotted by clang:/src/qemu/monitor.c:2278:36: warning: The left operand of '&' is a garbage value prot = pde & (PG_USER_MASK | PG_RW_MASK |
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu
Sparc: implement monitor command 'info tlb'
Use existing dump_mmu() to implement monitor command 'info tlb'.
Merge remote branch 'qmp/for-anthony' into staging
monitor: implement x86 info mem for PAE and long modes
'info mem' didn't show correct information for PAE mode andx86_64 long mode.
Fix by implementing the output for missing modes.
monitor: implement x86 info tlb for PAE and long modes
'info tlb' didn't show correct information for PAE mode andx86_64 long mode.
Implement the missing modes. Also print NX bit for PAE and long modes.Fix off-by-one error in 32 bit mode mask.
vnc/spice: add set_passwd monitor command.
This patch adds new set_password and expire_password monitor commandswhich allows to change and expire the password for spice and vncconnections. See the doc update patch chunk for details.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
spice: connection events.
This patch adds support for connection events to spice. The events arequite simliar to the vnc events. Unlike vnc spice uses multiple tcpchannels though. qemu will report every single tcp connection (akaspice channel). If you want track spice sessions only you can filter...
spice: add qmp 'query-spice' and hmp 'info spice' commands.
The patch adds a 'query-spice' monitor command which returnsinformations about the spice server configuration and also a list ofchannel connections.
QMP: Fix default response regression
Commit 030db6e89d dropped do_info() usage from QMP and introducedqmp_call_query_cmd(). However, the new function doesn't emit QMP'sdefault OK response when the handler doesn't return data.
Fix that by also calling monitor_protocol_emitter() when...
QMP: Drop dead code
The first if/else clause in handler_audit() makes no sense for tworeasons:
1. this function is now called only by QMP code, so testing if it's a QMP call makes no sense anymore
2. the else clause first asserts that there's no error in the...
QMP: Simplify monitor_json_emitter()
Use the ternary operator instead of an if (also fixes bad indentation).
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
QMP: Introduce Human Monitor passthrough command
This command allows QMP clients to execute HMP commands.
Please, check the documentation added to the qmp-commands.hx filefor additional details about the interface and its limitations.
Add support for 'o' octet (bytes) format as monitor parameter.
Octet format relies on strtosz which supports K/k, M/m, G/g, T/tsuffixes and unit support for humans, like 1.3G
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove obsolete 'f' double parameter type
'f' double is no longer used, and we should be using floating pointvariables to store byte sizes. Remove it.
monitor: Ignore "." and ".." when completing file name.
Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
trace: print a warning if user tries to enable an unknown trace event
There was no warning if a bad trace event name was given to'trace-event' command, thus the user could think that the commandwas successful even if this was not the case.
Print a warning if the user tries to enable a trace event which is not...
Use GCC_FMT_ATTR (format checking)
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Monitor: Rename monitor_handler_is_async()
Let's follow the convention introduced by the previous commit andcall it handler_is_async().
Monitor: Directly call QObject handlers
This avoids handle_user_command() calling monitor_call_handler(),which is currently shared with QMP.
QMP: Introduce qmp_call_cmd()
Calls a QObject handler and emits the QMP response, also dropsmonitor_call_handler() which is now unused.
Monitor: Rename the qemu-monitor.hx file
Let's be consistent and call it hmp-commands.hx, so that we haveqmp-commands.hx for QMP and hmp-commands.hx for HMP.
Please, note that this commit doesn't touch qemu-monitor.texi. Alltexi files have the qemu- prefix and I don't think it's worth...
Monitor: Introduce search_dispatch_table()
It's a generic version of monitor_find_command() which searchesthe dispatch table passed as an argument.
Future commits will introduce new dispatch tables, so we needcommon code to search them.
QMP: handle_qmp_command(): Move 'cmd' sanity check
Next commit will change how query commands are handled in away that the 'cmd' sanity check is also going to be neededfor query commands handling.
Let's move it out of the else body then.
QMP: Don't use do_info()
Since its inception, QMP has been using HMP's do_info() functionto run query commands.
This was a bad choice, as it made do_info() more complex andcontributed to couple QMP and HMP.
This commit fixes that by doing the following changes:...
Monitor: Drop QMP bits from do_info()
As of last commit, QMP doesn't use do_info() anymore. Simplify it.
Monitor: Drop is_async_return()
If I understood it correcty, the is_async_return() logic was onlyused to prevent QMP from issuing duplicated success responsesfor asynchronous handlers.
However, QMP doesn't use do_info() anymore so this is dead logicand (hopefully) can be safely dropped....
Monitor: Convert do_info() back to HMP
This is a HMP specific handler, it makes no sense to have itunder QMP.
QMP: Introduce qmp_find_cmd()
Next commit needs this new function: it will introduce thethe QMP's command dispatch table and qmp_find_cmd() will beused to search on it.
QMP: Introduce command dispatch table
Also update QMP functions to use it. The table is generatedfrom the qmp-commands.hx file.
From now on, QMP and HMP have different command dispatchtables.
QMP: Introduce query commands dispatch table
The new table is a copy of HMP's table, containing only QObjecthandlers.
In the near future HMP will be making QMP calls and then we willbe able to drop QObject handlers from HMP's table.
From now on, QMP and HMP have different query command dispatch...
QMP: Simplify do_info_commands()
We now iterate over QMP's dispatch tables, no need to check forQMP-only handlers anymore.
QMP: Small cleanup in handle_qmp_command()
QMP has its own dispatch tables, we can now drop the followingchecks:
o 'info' command: this command doesn't exist in QMP's dispatch table, the right thing will happen when it's issued by a client (ie. command not found error)...
Monitor: Drop QMP info from the qemu-monitor.hx file
QMP has its own dispatch table and documentation file(qmp-commands.hx), we can now drop the following QMP specific infofrom qemu-monitor.hx:
o SQMP/EQMP sections o The qmp_capabilities command...
Monitor: Drop monitor_cmd_user_only()
This function was only needed when QMP and HMP were sharing dispatchtables, this is no longer true so just drop it.
Monitor: Rename monitor_handler_ported()
That name makes no sense anymore, as dispatch tables have been split,a better name is handler_is_qobject(), which really communicatesthe handler's type.
Add option to turn on JSON pretty printing in monitor
Expaned '-mon' arg to allow a 'pretty=on' flag. This makes themonitor pretty print its replies to easy human debugging / reading
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
trace: Support for dynamically enabling/disabling trace events
This patch adds support for dynamically enabling/disabling of trace events.This is done by internally maintaining each trace event's state, andpermitting logging of data from a trace event only if it is in an...
trace: Add trace-file command to open/close/flush trace file
This patch adds the trace-file command:
trace-file [on|off|flush]
Open, close, or flush the trace file. If no argument is given, the status of the trace file is displayed.
The trace file is turned on by default but is only written out when the...
QMP/monitor: update do_info_version() to output broken down version string
This code was originally developed by Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>...
loadvm: improve tests before bdrv_snapshot_goto()
This patch improves the resilience of the load_vmstate() function, doingfurther and better ordered tests.
In load_vmstate(), if there is any error on bdrv_snapshot_goto(), except if theerror is on VM state device, load_vmstate() will return zero and the VM will be...
migration: Accept 'cont' only after successful incoming migration
When a 'cont' is issued on a VM that's just waiting for an incomingmigration, the VM reboots and boots into the guest, possibly corruptingits storage since it could be shared with another VM running elsewhere....
remove exec-all.h inclusion from cpu.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
QMP: handle_qmp_command(): Small cleanup
Drop a unneeded label and QDECREF call.
monitor: Allow to exclude commands from QMP
Ported commands that are marked 'user_only' will not be considered forQMP monitor sessions. This allows to implement new commands that do not(yet) provide a sufficiently stable interface for QMP use.
QMP: Fix error reporting in the async API
The current asynchronous command API doesn't return a QMP responsewhen the async command fails.
This is easy to reproduce with the balloon command (the sole asynccommand we have so far): run qemu w/o the '-balloon virtio' option...
Monitor: handle optional '-' arg as a bool
Historically, user monitor arguments beginning with '-' (eg. '-f')were passed as integers down to handlers.
I've maintained this behavior in the new monitor because we didn'thave a boolean type at the very beginning of QMP. Today we have it...
QMP: New argument checker (first part)
Current QMP's argument checker is more complex than it should beand has (at least) one serious bug: it ignores unknown arguments.
To solve both problems we introduce a new argument checker. It'sadded on top of the existing one, so that there are no regressions...
QMP: New argument checker (second part)
This commit introduces the second (and last) part of QMP's newargument checker.
The job is done by check_client_args_type(), it iterates overthe client's argument qdict and for for each argument it checksif it exists and if its type is valid....
QMP: Drop old client argument checker
Previous two commits added qmp_check_client_args(), whichfully replaces this code and is way better.
It's important to note that the new checker doesn't supportthe '/' arg type. As we don't have any of those handlers...
QMP: Introduce qmp_check_input_obj()
This is similar to qmp_check_client_args(), but it checks ifthe input object follows the specification (QMP/qmp-spec.txtsection 2.3).
As we're limited to three keys, the work here is quite simple:we iterate over the input object, checking each time if the...
QMP: Drop old input object checking
Previous commit added qmp_check_input_obj(), it does all thechecking we need.
monitor: Fix leakage during completion processing
Given too many arguments or an invalid command, we were leaking theduplicated argument strings.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor: Fix command completion vs. boolean switches
We now have to move forward to the next argument type via next_arg_type.This patch fixes completion for 'eject' and maybe also other commands.
monitor: Establish cmd flags and convert the async tag
As we want to add more flags to monitor commands, convert the only sofar existing one accordingly.
Extra scan codes for missing keys
The code comes fromhttp://lists.gnu.org/archive/html/qemu-devel/2010-05/msg02788.html
Without this patch it is not possible to send at least 10 specialcharacters (\|'"`~:;[]{}) via the monitor sendkey command.
Signed-off-by: Bernhard M. Wiedemann <qemudevbmw@lsmod.de>...
Merge remote branch 'kwolf/for-anthony' into staging
Conflicts: hw/pc.c
monitor/QMP: Drop info hpet / query-hpet
This command was of minimal use before, now it is useless as the hpetbecome a qdev device and is thus easily discoverable. We shoulddefinitely not set query-hpet in QMP's stone, and there is also no goodreason to keep it for the interactive monitor....
blockdev: Collect block device code in new blockdev.c
Anything that moves hundreds of lines out of vl.c can't be all bad.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Monitor: Drop QMP documentation from code
Previous commit added QMP documentation to the qemu-monitor.hxfile, it's is a copy of this information.
While it's good to keep it near code, maintaining two copies ofthe same information is too hard and has little benefit as we...
Monitor: Return before exiting with 'quit'
This is a new version of the (now reverted) following commit:
0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d
The 'quit' Monitor command (implemented by do_quit()) callsexit() directly, this is problematic under QMP because QEMU...
Revert "Monitor: Return before exiting with 'quit'"
This reverts commit 0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d.
Next commits will do the same thing in a better way.
sparc: Fix lazy flag calculation on interrupts, refactor
Recalculate Sparc64 CPU flags on interrupts, otherwise some earlierflags could be stored to pstate.
Refactor PSR/CCR/CWP handling: concentrate the actualfunctions to op_helper.c.
Thanks to Igor Kovalenko for reporting....
block: read-only: open cdrom as read-only when using monitor's change command
Current code of monitor command: 'change', used to open file for read-writeuncoditionally. Change to open it as read-only for CDROM, and read-write for all others.
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>...
QMP: Introduce RESUME event
It's emitted when the Virtual Machine resumes execution.
We currently have the STOP event but don't have the matchingRESUME one, this means that clients are notified when the VMis stopped but don't get anything when it resumes....
stash away SCM_RIGHTS fd until a getfd command arrives
If there is already a fd in s->msgfd before recvmsg it isclosed by parts that this patch does not touch. So, onlyone descriptor can be "leaked" by attaching it to a commandother than getfd.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
The 'quit' Monitor command (implemented by do_quit()) callsexit() directly, this is problematic under QMP because QEMUexits before having a chance to send the ok response.
Clients don't know if QEMU exited because of a problem or...
QMP: Check "arguments" member's type
Otherwise the following input crashes QEMU:
{ "execute": "migrate", "arguments": "tcp:0:4446" }
QMP: Use QERR_QMP_BAD_INPUT_OBJECT_MEMBER
The QERR_QMP_BAD_INPUT_OBJECT error is going to be used onlyfor two problems: the input is not an object or the "execute" key is missing.
Replace calls of old bdrv_open
What is known today as bdrv_open2 becomes the new bdrv_open. All remainingcallers of the old function are converted to the new one. In some places theyeven know the right format, so they should have used bdrv_open2 from the...
monitor: Rename argument type 'b' to 'f'
To make 'b' available for boolean argument.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor: New argument type 'b'
This is a boolean value. Human monitor accepts "on" or "off".Consistent with option parsing (see parse_option_bool()).
Monitor: Convert do_screen_dump() to QObject
Trivial, as it never fails, doesn't have output nor returnany data.
Note that it's also available under QMP, as kvm-autotestneeds this.
error: Use QERR_INVALID_PARAMETER_VALUE instead of QERR_INVALID_PARAMETER
Add qerror message if the 'change' target filename can't be opened
Currently when using the change command to switch the file in the cd drivethe command doesn't complain if the file doesn't exit or can't be openedand the drive keeps the existing image. This patch adds a qerror_report...
move balloon handling to balloon.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
error: Trim includes after "Move qemu_error & friends..."
Missed in commit 2f792016.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Wrong error message in block_passwd command
Signed-off-by: Shahar Havivi <shaharh@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
monitor: New argument type 'O'
In the human monitor, it declares a single optional argument to beparsed according to the QemuOptsList given by its name.
In QMP, it declares an optional argument for each member of theQemuOptsList.
Restriction: only lists with empty desc are supported for now. Good...
monitor: New monitor_cur_is_qmp()
error: Let converted handlers print in human monitor
While fully converted handlers are not supposed to print anything whenrunning in a QMP monitor, they are free to print in a human monitor.For instance, device_add (not yet converted) prints help, and will...
error: Rename qemu_error_new() to qerror_report()
monitor: Factor monitor_set_error() out of qemu_error_internal()
This separates the monitor part from the QError part.
error: Move qemu_error() & friends from monitor.c to own file
They're about reporting errors, not about the monitor.
error: Simplify error sink setup
qemu_error_sink can either point to a monitor or a file. In practice,it always points to the current monitor if we have one, else tostderr. Simply route errors to the current monitor or else to stderr,and remove qemu_error_sink along with the functions to control it....