qapi: Clean up null checking in generated visitors
Visitors get passed a pointer to the visited object. The generatedvisitors try to cope with this pointer being null in some places, forinstance like this:
visit_start_optional(m, obj ? &(*obj)->has_name : NULL, "name", &err);...
qapi: Drop unused code in qapi-commands.py
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: Fix licensing of scripts
The scripts carry this copyright notice:
The sentences contradict each other, as COPYING.LIB contains the LGPL...
qapi: Drop nonsensical header guard in generated qapi-visit.c
qmp: Check for returned data from __json_read in get_events
When QEMU process aborts and socket is closed, qmp client will notdetect it. When this happens, some qemu-iotests scripts will enter anendless loop waiting for qmp events.
It's better we raise an exception in qmp.py to catch this and make the...
QMP: Allow dot separated dict path arguments in qmp-shell
As another convenience to allow using commands that expect a dict asargument, this patch adds support for foo.bar=value syntax, similar tocommand line argument style:
(QEMU) blockdev-add options.driver=file options.id=drive1 options.filename=......
Merge remote-tracking branch 'remotes/bonzini/configure' into staging
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Tracing pull request
module: implement module loading
This patch adds loading, stamp checking and initialization of modules.
The init function of dynamic module is no longer directly called asattribute((constructor)) in static linked version, it is calledonly after passed the checking of presense of stamp symbol:...
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
Modified the tracetool framework for LTTng 2.x
QMP: allow JSON dict arguments in qmp-shell
qmp-shell hides the QMP wire protocol JSON encoding from the user. Mostof the time this is helpful and makes the command-line human-friendly.
Some QMP commands take a dict as an argument. In order to express this...
misc: Fix case Qemu -> QEMU
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Merge remote-tracking branch 'stefanha/tags/tracing-pull-request' into staging
trace: [simple] Do not include "trace/simple.h" in generated tracer headers
The header is not necessary, given that the simple backend does not define anyinlined tracing routines.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
trace: fix simple trace "disable" keyword
The trace-events "disable" keyword turns an event into a nop atcompile-time. This is important for high-frequency events that canimpact performance.
The "disable" keyword is currently broken in the simple trace backend....
configure: add CONFIG_IASL to config-host.h
Acpi unit-tests will extract iasl executablefrom CONFIG_IASL define.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Python-lang gdb script to extract x86_64 guest vmcore from qemu coredump
When qemu dies unexpectedly, for example in response to an explicitabort() call, or (more importantly) when an external signal is deliveredto it that results in a coredump, sometimes it is useful to extract the...
qapi: Add "errno" to the list of polluted words
Using "errno" directly as an identifier results in various syntaxerrors; therefore it should be added to the list of polluted words.
Signed-off-by: Max Reitz <mreitz@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Adjust qapi-visit for python-2.4.3
We say we support python 2.4, but python 2.4.3 does notsupport the "expr if test else expr" syntax used here.
This allows QEMU to compile on RHEL 5.3, the last release for ia64.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pci, pc, acpi fixes, enhancements
This includes some pretty big changes:- pci master abort support by Marcel- pci IRQ API rework by Marcel- acpi generation support by myself
Everything has gone through several revisions, latest versions have been on...
i386: add ACPI table files from seabios
This adds ASL code as well as scripts for processing it,imported from seabios git treecommit 51684b7ced75fb76776e8ee84833fcfb6ecf12dd
Will be used for runtime acpi table generation.
Note:This patch reuses some code from SeaBIOS, which was originally under...
acpi: add rules to compile ASL source
Detect presence of IASL compiler and use itto process ASL source. If not there, use pre-compiledfiles in-tree. Add script to update the in-tree files.
Note: distros are known to silently update iaslso detect correct iasl flags for the installed version on each run as...
Use qemu-project.org domain name
qemu.org is held by a third-party and no core community contributor hasaccess to the DNS configuration. This leaves the website exposed tooutages due to DNS issues or IP address changes. For example, if theweb server IP address needs to change we cannot guarantee qemu.org will...
qapi-types/visit.py: Pass whole expr dict for structs
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
qapi-types/visit.py: Inheritance for structs
This introduces a new 'base' key for struct definitions that refers toanother struct type. On the JSON level, the fields of the base type areincluded directly into the same namespace as the fields of the defined...
roms: rewrite scripts/refresh-pxe-roms.sh
Just use the Makefile in roms/
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
QMP: add scripts/qmp
Populate it with all scripts stored in QMP/. Also fixes trailingwhitespaces in qmp-shell and qmp.py.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
Merge remote-tracking branch 'luiz/queue/qmp' into staging
Message-id: 1378822364-13887-1-git-send-email-lcapitulino@redhat.comSigned-off-by: Anthony Liguori <anthony@codemonkey.ws>
qapi-types.py: Fix enum struct sizes on i686
Unlike other list types, enum wasn't adding any padding, which causeda mismatch between the generated struct size and GenericList structsize. More details in a678e26cbe89f7a27cbce794c2c2784571ee9d21
This crashed qemu if calling qmp query-tpm-types for example, which...
Add c++ keywords to QAPI helper script
Add c++ keywords to avoid errors in compiling with c++ compiler.This also renames class member of PciDeviceInfo to q_class.
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>...
checkpatch.pl: Check .cpp files
Enable checkpatch.pl to apply the same checks as C source files forC++ files with .cpp extensions. It also adds some exceptions for C++sources to suppress errors for: - <> used in C++ template arguments (e.g. template <class T>)...
Add a script to extract VSS SDK headers on POSIX system
VSS SDK setup.exe is only runnable on Windows. This adds a scriptto extract VSS SDK headers on POSIX-systems using msitools.
From: Paolo Bonzini <pbonzini@redhat.com>...
qapi-types.py: Split off generate_struct_fields()
Merge remote-tracking branch 'stefanha/block' into staging
disas: Add disas-objdump.pl
The script massages the output produced for architectures that arenot supported internally by qemu though an external objdump programfor disassembly.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
disas-objdump: Pass --adjust-vma to objdump
This gives the dumped blob its correct address during disassembly,which makes pc-relative insns much easier to interpret.
aio / timers: Add scripts/switch-timer-api
Add scripts/switch-timer-api to programatically rewrite sourcefiles to use the new timer system.
Signed-off-by: Alex Bligh <alex@alex.org.uk>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
scripts/qapi.py: Avoid syntax not supported by Python 2.4
The Python "except Foo as x" syntax was only introduced inPython 2.6, but we aim to support Python 2.4 and later.Use the old-style "except Foo, x" syntax instead, thusfixing configure/compile on systems with older Python....
qapi.py: Reject invalid characters in schema file
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Message-id: 1374939721-7876-6-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi.py: Fix schema parser to check syntax systematically
Fixes at least the following parser bugs:
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
qapi.py: Fix diagnosing non-objects at a schema's top-level
Report syntax error instead of crashing.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Message-id: 1374939721-7876-8-git-send-email-armbru@redhat.com...
qapi.py: Rename expr_eval to expr in parse_schema()
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Message-id: 1374939721-7876-9-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi.py: Permit comments starting anywhere on the line
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Message-id: 1374939721-7876-10-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi.py: Restructure lexer and parser
The parser has a rather unorthodox structure:
Until EOF:
Read a section:
Generator function get_expr() yields one section after the other, as a string. An unindented, non-empty line that...
qapi.py: Decent syntax error reporting
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Message-id: 1374939721-7876-5-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi.py: Maintain a list of union types
qapi: Anonymous unions
The discriminator for anonymous unions is the data type. This allows tohave a union type that allows both of these:
{ 'file': 'my_existing_block_device_id' } { 'file': { 'filename': '/tmp/mydisk.qcow2', 'read-only': true } }...
qapi: Flat unions with arbitrary discriminator
Instead of the rather verbose syntax that distinguishes base andsubclass fields...
{ "type": "file", "read-only": true, "data": { "filename": "test" } }
...we can now have both in the same namespace, allowing a more direct...
qapi-types.py: Implement 'base' for unions
The new 'base' key in a union definition refers to a struct type, whichis inlined into the union definition and can represent fields common toall kinds.
For example the following schema definition...
{ 'type': 'BlockOptionsBase', 'data': { 'read-only': 'bool' } }...
qapi-visit.py: Split off generate_visit_struct_fields()
qapi-visit.py: Implement 'base' for unions
This implements the visitor part of base types for unions. Parsed intoQMP, this example schema definition...
{ 'type': 'BlockOptionsBase', 'data': { 'read-only': 'bool' } } { 'type': 'BlockOptionsQcow2, 'data': { 'lazy-refcounts': 'bool' } }...
Merge remote-tracking branch 'stefanha/tracing' into staging
cleanup-trace-events.pl: New
Simple script to drop unused events and fix up source file comments.The next few commits put it to use.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qapi: qapi-commands: fix possible leaks on visitor dealloc
In qmp-marshal.c the dealloc visitor calls use the same errppointer of the input visitor calls. This means that if any ofthe input visitor calls fails, then the dealloc visitor willreturn early, before freeing the object's memory....
qapi.py: Avoid code duplication
The code that interprets the read JSON expression and appends types tothe respective global variables was duplicated. We can avoid that bysplitting off the part that reads from the file.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
qapi.py: Allow top-level type reference for command definitions
If 'data' for a command definition isn't a dict, but a string, it istaken as a (struct) type name and the fields of this struct are directlyused as parameters.
This is useful for transactionable commands that can use the same type...
main: use TARGET_ARCH only for the target-specific #define
Everything else needs to match the executable name, which isTARGET_NAME.
Before: $ sh4eb-linux-user/qemu-sh4eb --help usage: qemu-sh4 [options] program [arguments...] Linux CPU emulator (compiled for sh4 emulation)...
build: rename TARGET_ARCH2 to TARGET_NAME
Do not introduce any new use yet.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Message-id: 1370349928-20419-3-git-send-email-pbonzini@redhat.comSigned-off-by: Peter Maydell <peter.maydell@linaro.org>
build: do not use TARGET_ARCH
TARGET_ARCH is generally wrong to use, there are better variablesprovided in config-target.mak. The right one is usually TARGET_NAME(previously TARGET_ARCH2), but for bsd-user we can also use TARGET_ABI_DIRfor consistency with linux-user....
block: add block driver read only whitelist
We may want to include a driver in the whitelist for read only taskssuch as diagnosing or exporting guest data (with libguestfs as a goodexample). This patch introduces a readonly whitelist option, and forbackward compatibility, the old configure option --block-drv-whitelist...
qapi: pad GenericList value fields to 64 bits
With the introduction of native list types, we now have types such asint64List where the 'value' field is not a pointer, but the actual64-bit value.
On 32-bit architectures, this can lead to situations where 'next' field...
qapi: qapi-types.py, native list support
Teach type generators about native types so they can generate theappropriate linked list types.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Amos Kong <akong@redhat.com>...
qapi: qapi-visit.py, fix list handling for union types
Currently we assume non-list types when generating visitor routines forunion types. This is broken, since values like ['Type'] need to mappedto 'TypeList'.
We already have a type_name() function to handle this that we use for...
qapi: qapi-visit.py, native list support
Teach visitor generators about native types so they can generate theappropriate visitor routines.
trace: Add ftrace tracing backend
This patch adds a ftrace tracing backend which sends trace event toftrace marker file. You can effectively compare qemu trace data andkernel(especially, kvm.ko when using KVM) trace data.The ftrace backend is restricted to Linux only....
vmxcap: Augment reported information
Parse the Basic VMX Information MSR and add the bit for the new postedinterrupts.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Gleb Natapov <gleb@redhat.com>
vmxcap: Report APIC register emulation and RDTSCP control
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
vmxcap: Update according to SDM of January 2013
This adds reporting of VMCS shadowing, #VE, IA32_SMBASE, unrestrictedVMWRITE and fixes the range of the MSEG revision ID.
vmxcap: Open MSR file in unbuffered mode
Python may otherwise decide to to read larger chunks, applying the seekonly on the software buffer. This will return results from the wrongMSRs.
trace: [tracetool] Explicitly identify public backends
Public backends are those printed by "--list-backends" and thus considered validby the configure script.
trace: Provide a generic tracing event descriptor
Uses tracetool to generate a backend-independent tracing event description(struct TraceEvent).
The values for such structure are generated with the non-public "events" backend ("events-c" frontend).
The generation of the defines to check if an event is statically enabled is also...
trace: [simple] Port to generic event information and new control interface
The backend is forced to dump event numbers using 64 bits, as TraceEventID isan enum.
trace: [stderr] Port to generic event information and new control interface
Revert "make_device_config.sh: Fix target path in generated dependency file"
This reverts commit 23bf49b5eca716aaad073f2b47613434e1515cb5.
While *-softmmu/config-devices.mak.d is included through *.d pattern viaMakefile.target, the make_devices_config.sh call these dependencies are...
make_device_config.sh: Emit dependency file to directory where included
Placing the config-devices.mak.d file alongside the config-devices.makfile in -softmmu/ lead to it getting included into through-softmmu/Makefile in addition to ./Makefile, leading to confusion....
fix scripts/make_device_config.sh
Make it handle multiple include statements in a file:
(1) The printf needs a space so the include files will be separated. (2) Also $f can contain multiple failes, so redirection will not work and we have to use cat to process all files....
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Conflicts: target-i386/kvm.c...
make_device_config.sh: Fix target path in generated dependency file
config-devices.mak.d is included from Makefile.target, i.e. from insidethe *-softmmu/ directory. It included the directory path, so neverapplied to the actual ./config-devices.mak. Symptoms were spurious...
vmxcap: bit 9 of VMX_PROCBASED_CTLS2 is 'virtual interrupt delivery'
Bit 9 of MSR_IA32_VMX_PROCBASED_CTLS2 isvirtual interrupt delivery.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf
qemu-ga: sample fsfreeze hooks
Adds sample hook scripts for --fsfreeze-hook option of qemu-ga. - fsfreeze-hook : execute scripts in fsfreeze-hook.d/ - fsfreeze-hook.d/mysql-flush.sh.sample : quiesce MySQL before snapshot
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>...
powerpc: linux header sync script includes epapr_hcalls.h
epapr_hcalls.h is now referenced by kvm_para.h. so this is needed forQEMU to get compiled on powerpc.
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>Signed-off-by: Alexander Graf <agraf@suse.de>
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>
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>