Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
kvm: update vmxcap for EPT A/D, INVPCID, RDRAND, VMFUNC
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
qapi: add support for command options
Options allow for changes in commands behavior. This commit introducesthe QCO_NO_SUCCESS_RESP option, which causes a command to not emit asuccess response.
This is needed by commands such as qemu-ga's guest-shutdown, which...
scripts/qemu-binfmt-conf.sh: Fix shell syntax
The script is organized as a sequence of binfmt registrations, with acheck whether the to be registered architecture matches the host.
Add a missing fi for the SuperH section.
Reported-by: Alexander Graf <agraf@suse.de>...
tracetool: use Python 2.4-compatible exception handling syntax
The newer "except <exception-type> as <exception>:" syntax is notsupported by Python 2.4, we need to use "except <exception-type>,<exception>:".
Tested all trace backends with Python 2.4....
tracetool: use Python 2.4-compatible import() arguments
In Python 2.5 keyword arguments were added to import(). Avoid usingthem to achieve Python 2.4 compatibility.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
tracetool: avoid str.rpartition() Python 2.5 function
The str.rpartition() function is related to str.split() and is used forsplitting strings. It was introduced in Python 2.5 and therefore cannotbe used in tracetool as Python 2.4 compatibility is required....
tracetool: avoid pkgutil.iter_modules() Python 2.7 function
The pkgutil.iter_modules() function provides a way to enumerate childmodules. Unfortunately it's missing in Python <2.7 so we must implementsimilar behavior ourselves.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
create_config: remove *dir block
Now only the qemu_*dir variables will become #defines. The otherdirectory names aren't used by the C code.
That means the following #defines won't be available in C code anymore:
- CONFIG_QEMU_BINDIR - CONFIG_QEMU_LIBDIR...
create_config: simplify prefix=* block, remove CONFIG_QEMU_PREFIX
As now that block handles only the prefix variable, the code can be muchsimpler. This also removes the CONFIG_QEMU_PREFIX define as it is notused by any C code.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>...
create_config: separate section for qemu_*dir variables (v2)
The generic dir section will eventually go away and be replaced withqemu_ section. By now, both sections will be kept, while the variablesget renamed on config-host.mak.
With this patch, a XXXdir variable will become a CONFIG_QEMU_XXXDIR...
tracetool: Add support for the 'stderr' backend
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
tracetool: Add support for the 'simple' backend
tracetool: Add support for the 'ust' backend
tracetool: Add support for the 'dtrace' backend
tracetool: handle DTrace keywords 'in', 'next', 'self'
Language keywords cannot be used as argument names. The DTrace backendappends an underscore to the argument name in order to make the argumentname legal.
This patch adds 'in', 'next', and 'self' keywords to dtrace.py....
tracetool: Rewrite infrastructure as python modules
The tracetool script is written in shell and has hit several portabilityproblems due to shell quirks or external tools across host platforms.Additionally the amount of string processing and lack of real data...
tracetool: Add module for the 'c' format
tracetool: Add module for the 'h' format
signrom: Rewrite as python script
Now that we have a hard dependency on python anyway, we can replace theslow shell script to calculate the option ROM checksum with a fast ANDportable python version. Tested both with python 2.7 and 3.1.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
kvm: add flightrecorder script
The kvm kernel module includes a number of trace events which can beuseful when debugging system behavior. Even on production systems thesetrace events can be used to observe guest behavior and identify thesource of problems....
tracetool: Forbid argument name 'next'
It has happened more than once that patches that look perfectly saneand work with simpletrace broke systemtap because they use 'next' as anargument name for a tracing function. However, 'next' is a keyword forsystemtap, so we shouldn't use it....
Merge remote-tracking branch 'stefanha/tracing' into staging
Fix conversion from lower to upper case with Turkish locale
Some locale settings let make fail or create wrong resultsbecause tr '[:lower:]' '[:upper:]' which is used to convertfrom lower to upper case depends on the locale.
With locale tr_TR.UTF-8, lower case 'i' is not converted to 'I'....
test makefile overhaul
This introduces new test reporting infrastructure based ongtester and gtester-report.
Also, all existing tests are moved to tests/, and tests/Makefileis reorganized to factor out the commonalities in the rules.
Signed-off-by: Anthony Liguori <aliguori@linux.vnet.ibm.com>...
qtest: add test framework
The idea behind qtest is pretty simple. Instead of executing a CPU via TCG orKVM, rely on an external process to send events to the device model that the CPUwould normally generate.
qtest presents itself as an accelerator. In addition, a new option is added to...
tracetool: dtrace disabled-events fix
If there are "disabled" entries in the trace-events file thenlinetod_nop() is called if the backend is dtrace, it's currentlynot present. Also equivalent fix for stap.
Signed-off-by: Lee Essen <lee.essen@nowonline.co.uk>...
tracetool: dtrace: handle in and next reserved words
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qmp: parse commands in strict mode
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: untangle next_list
Right now, the semantics of next_list are complicated. The caller must:
qapi: allow freeing partially-allocated objects
Objects going through the dealloc visitor can be only partially allocated.Detect the situation and avoid a segfault. This also helps with theinput visitor, when there are errors.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qapi: shortcut visits on errors
We can exit very soon if we enter a visitor with a preexisting error.This simplifies some cases because we will not have to deal withobj being non-NULL while *obj is NULL.
qapi: add c_fun to escape function names
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Support utf8 chars in pod docs
We've at least one UTF8 char in the qemu texi doc:
$ grep Tibor qemu-doc.texi by Tibor "TS" Schütz. $ man ./qemu.1 | grep Tibor by Tibor "TS" SchA~Xtz.
This patch allows utf8 in man/pod docs.
Initially it was split into two parts and sent on 2012-02-02....
scripts: add gdb support script
Add a script that enhances gdb to be aware of QEMU data structures.
This patch adds a single gdb command, 'qemu mtree'. The command issimilar to the monitor's 'info mtree', except that it prints MemoryRegionaddresses, and except for working from a core dump as well as a live instance....
Merge remote-tracking branch 'kwolf/for-anthony' into staging
qapi: complete implementation of unions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Acked-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
trace: Provide a per-event status define for conditional compilation
Adds a 'TRACE_${NAME}_ENABLED' preprocessor define for each tracing event in"trace.h".
This lets the user conditionally compile code with a relatively high executioncost that is only necessary when producing the tracing information for an event...
tracetool: Omit useless QEMU_*_ENABLED() check
SystemTap provides a "semaphore" that can optionally be tested beforeexecuting a trace event. The purpose of this mechanism is to skipexpensive tracing code when the trace event is disabled.
For example, some applications may have trace events that format or...
qerror: add check-qerror.sh to verify alphabetical order
We're supposed to keep qerror definitions and table entries inalphabetical order. In practice this is not checked.
I haven't found a nice way to integrate this into the makefile yet butwe can at least have this script which verifies that qerrors are in...
Fix qapi code generation fix
The fixes to qapi code generation had multiple bugs:- the Null class used to drop output was missing some methods- in some scripts it was never instantiated, leading to a None return, which is missing even more methods- the --source and --header options were swapped...
Fix qapi code generation wrt parallel build
Make's multiple output syntax
x.c x.h: x.template gen < x.template
actually invokes the command once for x.c and once for x.h (with differing $@in each invocation). During a parallel build, the two commands may be invoked...
scripts/analyse-9p-simpletrace.py: Add symbolic names for 9p operations.
Currently, we just print the numerical value of 9p operation identifier incase of RERROR which is less meaningful for readability. Mapping 9poperation ids to symbolic names provides a better tracelog:...
vl.c: In qemu -h output, only print options for the arch we are running as
Only print options in the help output that are accepted by our arch.This is less confusing for users and also for other programs thatconsume the help output.
The options affected are:...
qapi: allow a 'gen' key to suppress code generation
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix spelling in comments, documentation and messages
accidently->accidentallyannother->anotherchoosen->chosenconsideres->considersdecriptor->descriptordevelopement->developmentparamter->parameterpreceed->precedepreceeding->precedingpriviledge->privilege...
fix spelling in scripts sub directory
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qapi: fix guardname generation
Fix a bug in handling dotted paths, and exclude directory prefixesfrom generated guardnames to avoid odd/pseudo-random guardnames ingenerated headers.
checkpatch.pl: fix CAST detection
We should only claim that something is a cast if we did not encouter atoken before, that did set av_pending.
This fixes the operator * in the line below to be detected as binary (vsunary).
kmalloc(sizeof(struct alphatrack_ocmd) * true_size, GFP_KERNEL);...
checkpatch: remove rule on non-indented labels
There are 508 non-indented (non-default) labels, and 511 that areindented. So the rule is debatable at least. Actually, in thecommon case of labels at the outermost scope, there is really justone place where to put the label, so the rule is just wrong IMHO....
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Conflicts: ui/spice-core.c
Merge remote-tracking branch 'qemu-kvm-tmp/uq/master' into staging
hw/9pfs: Make VirtFS tracing work correctly
this patch fix multiple issues with VirtFS tracing.a) Add tracepoint to the correct code path. We handle error in complete_pdub) Fix indentation in python scriptc) Fix variable naming issue in python script...
qapi-commands.py: Don't call the output marshal on error
Today we generate something like this:
int qmp_marshal_input_query_foo(...)
...
retval = qmp_query_foo(errp); qmp_marshal_output_query_foo(retval, ret, errp);
......
kvm: Add tool for querying VMX capabilities
Taken from original qemu-kvm/kvm/scripts/vmxcap.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Avi Kivity <avi@redhat.com>
kvm: Add top-like kvm statistics script
Taken from original qemu-kvm/kvm/kvm_stat.
scripts: Simpletrace log analysis script for pretty-printing 9p log.
This python script allows to pretty print 9p simpletrace logs and can befurther enhanced to filter 9p logs based on command line arguments.
Sample output: TGETATTR (tag = 1 , fid = 0 , request_mask = 0x7ff )...
qapi: Automatically generate a _MAX value for enums
It's the last value in the enum and is very useful for the Cimplementation.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: add code generation support for middle mode
To get the ball rolling merging QAPI, this patch introduces a "middle mode" tothe code generator. In middle mode, the code generator generates marshallingfunctions that are compatible with the current QMP server. We absolutely need...
qapi: fixup command generation for functions that return list types
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: generate qapi_free_* functions for *List types
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: modify visitor code generation for list iteration
Modify logic such that we never assign values to the list head argumentto progress through the list on subsequent iterations, instead rely onlyon having our return value passed back in as an argument on the next...
qapi: Don't use c_var() on enum strings
Otherwise if we have something like 'foo-bar' in the schema,it will be generated as 'foo_bar' in the string lookup table.
c_var() is good for C variables, but not for enum strings.
trace: allow PRI*64 at beginning and ending of format string
The tracetool parser only picks up PRI*64 and other format string macroswhen enclosed between double quoted strings. Lift this restriction byextracting everything after the closing ')' as the format string:...
trace: generalize the "property" concept in the trace-events file
This adds/modifies the following functions:
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
trace: always use the "nop" backend on events with the "disable" keyword
Any event with the keyword/property "disable" generates an empty trace eventusing the "nop" backend, regardless of the current backend.
trace: [simple] disable all trace points by default
Note that this refers to the backend-specific state (whether the output must begenerated), not the event "disabled" property (which always uses the "nop" backend).
trace: [stderr] add support for dynamically enabling/disabling events
Uses the generic interface provided in "trace/control.h" in order to providea programmatic interface as well as command line and monitor controls.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>...
simpletrace: fix process() argument count
The simpletrace.process() function invokes analyzer methods with thewrong number of arguments if a timestamp should be included. This patchfixes the issue so that trace analysis scripts can make use oftimestamps....
trace: move backend-specific code into the trace/ directory
checkpatch: fix braces {} handling
checkpatch.pl doesn't report warning for if/else statements with missing'else' braces:
if (something) { foo;} else bar;
The patch has been tested using the last 100 commits.
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>...
qapi: fix build issue due to missing newline in generated header
Fixes a build issue on RHEL5, and potentially other distros, where gccwill generate an error due to us not writing a trailing "\n" whengenerating *qmp-commands.h
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>...
qapi: add ordereddict.py helper library
We need this to parse dictionaries with schema ordering intact so that Cprototypes can be generated deterministically.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
qapi: add qapi.py helper libraries
qapi: add qapi-types.py code generator
This is the code generator for qapi types. It will generation thefollowing files:
$(prefix)qapi-types.h - C types corresponding to types defined in the schema you pass in $(prefix)qapi-types.c - Cleanup functions for the above C types...
qapi: add qapi-visit.py code generator
This is the code generator for qapi visiter functions used tomarshal/unmarshal/dealloc qapi types. It generates the following 2files:
$(prefix)qapi-visit.c: visiter function for a particular c type, used to automagically convert qobjects into the...
qapi: add qapi-commands.py code generator
This is the code generator for qapi command marshaling/dispatch.Currently only generators for synchronous qapi/qmp functions aresupported. This script generates the following files:
$(prefix)qmp-marshal.c: command marshal/dispatch functions for each...
checkpatch: Fix bracing false positives on #if
789f88d0b21fedfd4251d56bb7a9fbfbda7a4ac7 only fixed #else,fix also #if.
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
checkpatch: don't error out on },{ lines
When having code like this:
static PCIDeviceInfo piix_ide_info[] = { { .qdev.name = "piix3-ide", .qdev.size = sizeof(PCIIDEState), .qdev.no_user = 1, .no_hotplug = 1,...
Add kernel header update script
This helper pulls the required kernel headers for KVM and vhost into aspecified directory. The update is triggered via
scripts/update-linux-headers.sh LINUX_PATH
and will place the output under linux-headers/linux and linux-headers/asm-*....
get_maintainer: update to match qemu tree
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
get_maintainer.pl: copy utility from Linux
Our MAINTAINERS file format matches Linux soget the utility to parse it from there.Updated as of linux 3.0-rc3
s390x: s390x-linux-user support
This patch adds support for running s390x binaries in the linux-user emulationcode.
Signed-off-by: Ulrich Hecht <uli@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
tracetool: allow ) in trace output string
Be greedy in matching the trailing "\)*" pattern. Otherwise, all thetext in the trace string up to the last closed parenthesis is taken aspart of the prototype.
trace: [ust] fix generation of 'trace.c' on events without args
PXE: Refresh all PXE ROMs from the ipxe submodule
Add script to make this easy to repeat later.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
simpletrace: Thread-safe tracing
Trace events outside the global mutex cannot be used with the simpletrace backend since it is not thread-safe. There is no check to preventthem being enabled so people sometimes learn this the hard way.
This patch restructures the simple trace backend with a ring buffer...
tracetool: Add optional argument to specify dtrace probe names
Optional feature allowing a user to generate the probe list to matchthe name of the binary, in case they wish to install qemu under adifferent name than qemu-{system,user},<arch>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>...
simpletrace: Make simpletrace.py a Python module
The simpletrace.py script pretty-prints a binary trace file. Most ofthe code can be reused by trace file analysis scripts, so turn it into amodule.
Here is an example script that uses the new simpletrace module:...
checkpatch.pl: don't complain about old lines with tabs
Don't complain when the patch includes lines with tabsonly in the hunk's untouched context.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
New trace-event backend: stderr
This backend sends trace events to standard error output during the emulation.
Also add a "--list-backends" option to tracetool, so configure script candisplay the list of available backends.
gdbstub-xml: avoid a warning from sparse
Include a header to get the declaration for xml_builtin. Thisavoids a warning from sparse: CC m68k-softmmu/gdbstub-xml.ogdbstub-xml.c:244:12: warning: symbol 'xml_builtin' was not declared. Should it be static?...
checkpatch: Fix bracing false positives on #else
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
checkpatch: adjust to QEMUisms
Change checkpatch.pl for QEMU use: - Root directory detection - Forbid tabs - Indent at 4 spaces - Allow typedefs - Enforce brace use even for single statement blocks - Don't suggest nonexistent cleanup tools
Mention the script in CODING_STYLE....
Add checkpatch.pl from Linux kernel
Unchanged import fromhttp://www.kernel.org/pub/linux/kernel/people/apw/checkpatch/checkpatch.pl-0.31
Add scripts directory
Move build and user scripts into scripts directory.