build: Use separate makefile for "trace/"
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>--Changes in v2:
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qapi: move include files to include/qobject/
exec: move include files to include/exec/
qapi: move inclusions of qemu-common.h from headers to .c files
qapi: remove qapi/qapi-types-core.h
The file is only including error.h and qerror.h. Prefer explicitinclusion of whatever files are needed.Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
get_maintainer.pl: update from linix 3.8
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Merge remote-tracking branch 'stefanha/tracing' into staging
Avoid all systemtap reserved words
Over time various systemtap reserved words have been blacklistedin the trace backend generator. The list is not complete though,so there is continued risk of problems in the future. Preemptsuch problems by specifying the full list of systemtap keywords...
qapi-types.h: Don't include qemu-common.h
Needed to prevent build breakage when CPUState becomes a child ofDeviceState.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>[ehabkost: include <stdbool.h> too]Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>...
update-linux-headers.sh: Handle new kernel uapi/ directories
Recent kernels have moved to keeping the userspace headersin uapi/ subdirectories. This breaks the detection of whether anarchitecture has KVM support in the kernel because kvm.h hasmoved in the kernel source tree. Update the check to support...
s390/kvm_stat: correct sys_perf_event_open syscall number
Correct sys_perf_event_open syscall number for s390 architecture - the hardcoded syscall number 298 is for x86 but should be different for other architectures. In case we figure out via /proc/cpuinfo that we are running...
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Update kernel header script to include vfio
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi: do not protect enum values from namespace pollution
Enum values are always preceded by the uppercase name of the enum, sothey do not conflict with reserved words.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: add "unix" to the set of reserved words
It is #defined to 1.
dtrace backend: add function to reserved words
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
update-linux-headers.sh: Don't hard code list of architectures
Rather than hardcoding the list of architectures in the kernelheader update script, just import headers for every architecturewhich supports KVM (with a blacklist exception for ia64 whichhas KVM headers but is dead). This reduces the number of QEMU...
Merge branch 'queue/qmp' of git://repo.or.cz/qemu/qmp-unstable
CHECKPATCH: Add --debug adv_dcs
Add debug options to find this issue. They were not listedin the help because the are not simple to understand the output of.
Signed-off-by: Don Slutz <Don@CloudSwitch.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
CHECKPATCH: Add --debug adv_checking
CHECKPATCH: Add --debug adv_apw
CHECKPATCH: Add warning for single else statement.
For an example:
WARNING: braces {} are necessary even for single statement blocks+ } else+ return env->regs[R_EAX];
total: 0 errors, 1 warnings, 41 lines checkedSigned-off-by: Don Slutz <Don@CloudSwitch.com>...
qapi: Fix potential NULL pointer segfault
Report from smatch:
qapi-visit.c:1640 visit_type_BlockdevAction(8) error: we previously assumed 'obj' could be null (see line 1639)qapi-visit.c:2432 visit_type_NetClientOptions(8) error: we previously assumed 'obj' could be null (see line 2431)...
qapi: generate list struct and visit_list for enum
Currently, if we define an 'enum' and use it in one command'sdata, list struct for enum could not be generated, but it'sused in qmp function.
For example: KeyCodesList could not be generated.
qapi-schema.json:...
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
trace: Fix "Qemu" -> "QEMU"
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
update-linux-headers.sh: Pull in asm-generic/kvm_para.h
Add asm-generic/kvm_para.h to the set of non-architecture specificKVM kernel headers we copy into QEMU. This header may be includedby an architecture's kvm_para.h header.
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>...
trace/simple: Fix compiler warning for 32 bit hosts
gcc complains when a 32 bit pointer is casted to a 64 bit integer.
Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
scripts: qapi-commands.py: qmp-commands.h: include qdict.h
qmp-commands.h declares several functions that have arguments oftype QDict. However, qdict.h is not included. This will cause abuild breakage when a file includes qmp-commands.h but doesn'tinclude qdict.h....
qapi: don't convert enum strings to lowercase
Next commit will introduce enum strings in camel case.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>
qapi: generate correct enum names for camel case enums
An enum like GenericError in the schema, should generateGENERIC_ERROR and not GENERICERROR.
qapi: qapi-types.h: don't include qapi/qapi-types-core.h
qapi-types.h needs only qemu-common.h. Including qapi-types-core.hcauses problems when qerror.h or error.h includes qapi-types.h.
qapi: avoid reserved keywords
Clang compiler complained about use of reserved word 'restrict' in SLIRPand QAPI.
Prefix C keywords with "q_", adjust SLIRP accordingly.
Reviewed-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qapi: qapi.py: allow the "'" character to be escaped
Support escaping the escape character, and make more robust (don't diefor '', handle ' without matching '.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
Merge remote-tracking branch 'stefanha/net' into staging
qapi: fix error propagation
Don't overwrite / leak previously set errors.Make traversal cope with missing mandatory sub-structs.Don't try to end a container that could not be started.
v1->v2:- unchanged
v2->v3:- instead of examining, assert that we never overwrite errors with...
qapi: generate C types for fixed-width integers
(Long line folded using parens:<http://www.python.org/dev/peps/pep-0008/#maximum-line-length>.)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qapi: introduce "size" type
v1->v2:- fall back to uint64 rather than int
Simpletrace v2: Support multiple arguments, strings.
Existing simpletrace backend allows to trace at max 6 args and does notsupport strings. This newer tracelog format gets rid of fixed size recordsand therefore allows to trace variable number of args including strings....
Update simpletrace.py for new log format
Support new tracelog format for multiple arguments and strings.
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
build: add make dist target (v2)
Let's stop screwing up releases by having a script do the work that Anthony'sfat fingers can't seem to get right.
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>Reviewed-by: Eric Blake <eblake@redhat.com>Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>...
checkpatch: Add QEMU specific rule
The new rule detects two wrong variants of QEMU.It was tested with commit b5a8fe5e.
s390: make kvm_stat work on s390
Add s390_exit_reasons so kvm_stat doesn't crash when called on s390.Look for 'vendor_id' in /proc/cpuinfo as well, instead of just for'flags', so we can determine if we run on S390.
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>...
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....
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....
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);
......