summaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2014-11-18Tracing: Fix simpletrace.py error on tcg enabled binary tracesChristoph Seifert1-34/+33
simpletrace.py does not recognize the tcg option while reading trace-events file. In result simpletrace does not work on binary traces and tcg enabled events. Moved transformation of tcg enabled events to _read_events() which is used by simpletrace. Signed-off-by: Christoph Seifert <christoph.seifert@posteo.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-11-03Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell1-9/+14
pc, virtio, misc bugfixes A bunch of minor bugfixes all over the place. changes from v2: added cpu hotplug rework added default vga type switch more fixes changes from v1: fix for test re-generation script add missing acks to two patches Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 03 Nov 2014 16:33:13 GMT using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: (28 commits) vga: flip qemu 2.2 pc machine types from cirrus to stdvga vga: add default display to machine class vhost-user: fix mmap offset calculation hw/i386/acpi-build.c: Fix memory leak in acpi_build_tables_cleanup() smbios: Encode UUID according to SMBIOS specification pc: Add pc_compat_2_1() function hw/virtio/vring/event_idx: fix the vring_avail_event error hw/pci: fixed hotplug crash when using rombar=0 with devices having romfile hw/pci: fixed error flow in pci_qdev_init -machine vmport=off: Allow disabling of VMWare ioport emulation acpi/cpu-hotplug: introduce helper function to keep bit setting in one place cpu-hotplug: rename function for better readability qom/cpu: remove the unused CPU hot-plug notifier pc: Update rtc_cmos in pc_cpu_plug pc: add cpu hotplug handler to PC_MACHINE acpi:piix4: convert cpu hotplug to hotplug_handler API acpi:ich9: convert cpu hotplug to hotplug_handler API acpi/cpu: add cpu hotplug callback function to match hotplug_handler API acpi: create separate file for TCPA log tests: fix rebuild-expected-aml.sh for acpi-test rename ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-11-02i386: Add an ACPI_EXTRACT_NAME_BUFFER16 directive.Gal Hammer1-9/+14
Add a 16-bytes buffer to allow storing a 128-bit UUID value in an ACPI table. Signed-off-by: Gal Hammer <ghammer@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-10-31kvm_stat: Add powerpc supportMichael Ellerman1-2/+16
Add support for powerpc platforms. We use uname -m, which allows us to detect ppc, ppc64 and ppc64le/el. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-31kvm_stat: Abstract ioctl numbersMichael Ellerman1-3/+9
Unfortunately ioctl numbers are platform specific, so abstract them out of the code so they can be overridden. As it happens x86 and s390 share the same values, so nothing needs to change yet. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-31kvm_stat: Rework platform detectionMichael Ellerman1-14/+27
The current platform detection is a little bit messy. We look for lines in /proc/cpuinfo starting with 'flags' OR 'vendor-id', and scan both for values we know will only occur in one or the other. We also keep scanning once we've found a value, which could be a feature, but isn't in this case. We'd also like to add another platform, powerpc, which will just make it worse. So clean it up in preparation. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-31kvm_stat: Fix the non-x86 exit reasonsMichael Ellerman1-27/+30
In kvm_stat we have a dictionary of exit reasons for s390. Firstly these are not s390 specific, they are the generic exit reasons. So rename the dictionary to reflect that, and add it separately to filters[]. Secondly, the values are defined using hex, but in the kernel header they are decimal. That means values above 9 in kvm_stat are incorrect. While we're there, fix the whitespace to match the rest of the file. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-31kvm_stat: Only consider online cpusMichael Ellerman1-6/+18
In kvm_stat we grovel through /sys to find out how many cpus are in the system. However if a cpu is offline it will still be present in /sys, and the perf_event_open() will fail. Modify the logic to only return online cpus. We need to be careful on systems which don't support cpu hotplug, the online file will not be present at all. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-23get_maintainer.pl: restrict cases where it falls back to --gitPaolo Bonzini1-0/+9
The list emitted by --git-fallback often leads inexperienced contributors to add pointless CCs. While not discouraging usage of --git-fallback, we want to: 1) disable the fallback if only some files lack a maintainer $ scripts/get_maintainer.pl -f util/cutils.c hw/ide/core.c Kevin Wolf <kwolf@redhat.com> (odd fixer:IDE) Stefan Hajnoczi <stefanha@redhat.com> (odd fixer:IDE) This behavior is taken even if --git-fallback is specified. 2) warn the contributors about what we're doing, asking them to use their common sense: $ scripts/get_maintainer.pl -f util/cutils.c get_maintainer.pl: No maintainers found, printing recent contributors. get_maintainer.pl: Do not blindly cc: them on patches! Use common sense. Luiz Capitulino <lcapitulino@redhat.com> (commit_signer:1/2=50%) ... $ Explicitly disabling the fallback will not result in the warning message: $ scripts/get_maintainer.pl -f util/cutils.c --no-git-fallback $ echo $? 0 (Returning 1 would break usage of scripts/get_maintainer.pl as a cccmd for git-send-email). Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-10-23get_maintainer.pl: move git loop under "if ($email) {"Paolo Bonzini1-10/+9
All checks in the loop are guarded by that condition, and there is a handy "if" just below. Simplify the code. Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-29Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into stagingPeter Maydell1-0/+6
* remotes/qmp-unstable/queue/qmp: Add HMP command "info memory-devices" qemu-socket: Eliminate silly QERR_ macros qemu-socket: Polish errors for connect() and listen() failure qemu-iotests: Test missing "driver" key for blockdev-add tests: add QMP input visitor test for unions with no discriminator qapi: dealloc visitor, implement visit_start_union qapi: add visit_start_union and visit_end_union virtio-balloon: fix integer overflow in memory stats feature monitor: Reset HMP mon->rs in CHR_EVENT_OPEN Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-26qapi: add visit_start_union and visit_end_unionMichael Roth1-0/+6
In some cases an input visitor might bail out on filling out a struct for various reasons, such as missing fields when running in strict mode. In the case of a QAPI Union type, this may lead to cases where the .kind field which encodes the union type is uninitialized. Subsequently, other visitors, such as the dealloc visitor, may use this .kind value as if it were initialized, leading to assumptions about the union type which in this case may lead to segfaults. For example, freeing an integer value. However, we can generally rely on the fact that the always-present .data void * field that we generate for these union types will always be NULL in cases where .kind is uninitialized (at least, there shouldn't be a reason where we'd do this purposefully). So pass this information on to Visitor implementation via these optional start_union/end_union interfaces so this information can be used to guard against the situation above. We will make use of this information in a subsequent patch for the dealloc visitor. Cc: qemu-stable@nongnu.org Reported-by: Fam Zheng <famz@redhat.com> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-09-26vmxcap: Update according to SDM of September 2014Adrian-Ken Rueegsegger1-4/+6
This adds reporting of RDSEED exiting and XSAVES/XRSTORS #UD and fixes the range of VMCS revision as well as some typos. Signed-off-by: Adrian-Ken Rueegsegger <ken@codelabs.ch> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-09-26scripts/tracetool: don't barf on formats with precisionAlex Bennée1-1/+1
This only affects lttng user space tracing at the moment. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-26cleanup-trace-events.pl: Tighten search for trace event callMarkus Armbruster1-1/+1
The script can get fooled too easily. For instance, it finds trace_megasas_io_read_start when looking for trace_megasas_io_read, and incorrectly concludes that event megasas_io_read is used. Supply -w to git-grep to tighten the search. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1411476811-24251-2-git-send-email-armbru@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-26trace: tighten up trace-events regex to fix bad parseStefan Hajnoczi1-2/+2
Use \w for properties and trace event names since they are both drawn from [a-zA-Z0-9_] character sets. The .* for matching properties was too aggressive and caused the following failure with foo(int rc) "(this is a test)": Traceback (most recent call last): File "scripts/tracetool.py", line 139, in <module> main(sys.argv) File "scripts/tracetool.py", line 134, in main binary=binary, probe_prefix=probe_prefix) File "scripts/tracetool/__init__.py", line 334, in generate events = _read_events(fevents) File "scripts/tracetool/__init__.py", line 262, in _read_events res.append(Event.build(line)) File "scripts/tracetool/__init__.py", line 225, in build return Event(name, props, fmt, args, arg_fmts) File "scripts/tracetool/__init__.py", line 185, in __init__ % ", ".join(unknown_props)) ValueError: Unknown properties: foo(int, rc) Cc: Lluís Vilanova <vilanova@ac.upc.edu> Reported-by: Eric Auger <eric.auger@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1411468626-20450-1-git-send-email-stefanha@redhat.com
2014-09-26trace: [ust] Fix format string computation in tcg-enabled eventsLluís Vilanova2-10/+11
TCG-enabled events start with two format strings. Delay per-argument format computation until requested ('Event.formats'). Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22qapi: Allow enums in anonymous unionsMax Reitz2-1/+4
Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1408557576-14574-3-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-02scripts: Remove scripts/qtestFam Zheng1-5/+0
This is a dummy file with no user, drop it. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-08-28Merge remote-tracking branch 'remotes/kvm/tags/for-upstream' into stagingPeter Maydell1-2/+6
Mostly bugfixes + Alexey's interface-based implementation of the NMI monitor command. # gpg: Signature made Thu 28 Aug 2014 15:07:22 BST using RSA key ID 9B4D86F2 # gpg: Good signature from "Paolo Bonzini <pbonzini@redhat.com>" # gpg: aka "Paolo Bonzini <bonzini@gnu.org>" * remotes/kvm/tags/for-upstream: mc146818rtc: reinitialize irq_reinject_on_ack_count on reset target-i386: Add "tsc_adjust" CPU feature name target-i386: Add "mpx" CPU feature name vl: process -object after other backend options checkpatch.pl: adjust typedef definition to QEMU coding style x86: Clear MTRRs on vCPU reset x86: kvm: Add MTRR support for kvm_get|put_msrs() x86: Use common variable range MTRR counts target-i386: Don't forbid NX bit on PAE PDEs and PTEs spapr: Add support for new NMI interface s390x: Migrate to new NMI interface s390x: Convert QEMUMachine to MachineClass cpus: Define callback for QEMU "nmi" command kvm: run cpu state synchronization on target vcpu thread Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-08-28trace: avoid Python 2.5 all() in tracetoolStefan Hajnoczi1-1/+2
Red Hat Enterprise Linux 5 ships Python 2.4.3. The all() function was added in Python 2.5 so we cannot use it. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Benoît Canet <benoit.canet@nodalink.com>
2014-08-28qapi.py: avoid Python 2.5+ any() functionStefan Hajnoczi1-4/+4
There is one instance of any() in qapi.py that breaks builds on older distros that ship Python 2.4 (like RHEL5): GEN qmp-commands.h Traceback (most recent call last): File "build/scripts/qapi-commands.py", line 445, in ? exprs = parse_schema(input_file) File "build/scripts/qapi.py", line 329, in parse_schema schema = QAPISchema(open(input_file, "r")) File "build/scripts/qapi.py", line 110, in __init__ if any(include_path == elem[1] NameError: global name 'any' is not defined Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Benoît Canet <benoit.canet@nodalink.com>
2014-08-26checkpatch.pl: adjust typedef definition to QEMU coding stylePaolo Bonzini1-2/+6
Most QEMU typedefs are camelcase, starting with one uppercase letter and containing at least one lowercase letter. There are a few all-uppercase types, add the most common too. This fixes recognition of types in lines such as static __attribute__((unused)) inline void tcg_out8(TCGContext *s, uint8_t v) (Example provided by Peter Maydell). Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Markus Armbruster <armbru@redhat.com> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Stefan Weil <sw@weilnetz.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-08-12trace: teach lttng backend to use format stringsAlex Bennée2-6/+21
This makes the UST backend pay attention to the format string arguments that are defined when defining payload data. With this you can now ensure integers are reported in hex mode if you want. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-12trace: [tcg] Generate TCG tracing routinesLluís Vilanova1-0/+57
Generate header "trace/generated-tcg-tracers.h" with the necessary routines for tracing events in guest code: * trace_${event}_tcg Convenience wrapper that calls the translation-time tracer 'trace_${event}_trans', and calls 'gen_helper_trace_${event}_exec to generate the TCG code to later trace the event at execution time. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-12trace: [tcg] Define TCG tracing helper routine wrappersLluís Vilanova1-0/+70
Generates header "trace/generated-helpers-wrappers.h" with definitions for TCG helper wrappers. These wrappers ('gen_helper_trace_${event}_exec_wrapper') transform mixed native and TCG argument types to TCG types and call the actual TCG helpers ('gen_helper_trace_${event}_exec_proxy'). Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-12trace: [tcg] Define TCG tracing helper routinesLluís Vilanova1-0/+50
Generates file "trace/generated-helpers.c" with TCG helper definitions to trace events in guest code at execution time. The helpers ('helper_trace_${event}_exec_proxy') cast the TCG-compatible native argument types to their original types (as defined in "trace-events") and call the tracing routine ('trace_${event}_exec'). Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-12trace: [tcg] Declare TCG tracing helper routinesLluís Vilanova2-0/+51
Generates file "trace/generated-helpers.h" with TCG helper declarations to trace events in guest code at execution time ('trace_${event}_exec_proxy'). Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-12trace: [tcg] Add 'tcg' event propertyLluís Vilanova2-5/+64
Transforms event: tcg name(...) "...", "..." into two internal events: tcg-trans name_trans(...) "..." tcg-exec name_exec(...) "..." Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-12trace: [tcg] Argument type transformation machineryLluís Vilanova1-1/+29
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-12trace: [tcg] Argument type transformation rulesLluís Vilanova1-0/+166
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-12simpletrace: add simpletrace.py --no-header optionStefan Hajnoczi1-7/+17
It can be useful to read simpletrace files that have no header. For example, a ring buffer may not have a header record but can still be processed if the user is sure the file format version is compatible. $ scripts/simpletrace.py --no-header trace-events trace-file Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-12trace: add tracetool simpletrace_stap formatStefan Hajnoczi1-0/+71
This new tracetool "format" generates a SystemTap .stp file that outputs simpletrace binary trace data. In contrast to simpletrace or ftrace, SystemTap does not define its own trace format. All output from SystemTap is generated by .stp files. This patch lets us generate a .stp file that outputs in the simpletrace binary format. This makes it possible to reuse simpletrace.py to analyze traces recorded using SystemTap. The simpletrace binary format is especially useful for long-running traces like flight-recorder mode where string formatting can be expensive. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-12trace: extract stap_escape() function for reuseStefan Hajnoczi1-3/+8
SystemTap reserved words sometimes conflict with QEMU variable names. We escape them to prevent conflicts. Move escaping into its own function so the next patch can reuse it. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-04checker: ignore fields marked unusedAmit Shah1-4/+50
While comparing qemu-1.0 json output with qemu-2.1, a few fields got marked unused. These need to be skipped over, and not flagged as mismatches. For handling unused fields, the exact number of bytes need to be skipped over as the size of the unused field. Currently, only the term "unused" is matched. When more field names turn up, this will have to be updated based on the whitelist matching method to match more such terms. Signed-off-by: Amit Shah <amit.shah@redhat.com>
2014-07-22vmstate static checker: whitelist additionsAmit Shah1-1/+15
Comparing json outputs from qemu-1.0 with qemu-2.1 turned up a few description name changes; whitelist them here. Signed-off-by: Amit Shah <amit.shah@redhat.com>
2014-07-16vmstate static checker: detect section renamesAmit Shah1-5/+22
Commit 292b1634 changed the section name of "ICH9 LPC" to "ICH9-LPC", and that causes the static checker to flag this: Section "ICH9 LPC" does not exist in dest This patch introduces a function that checks for section renames and also a dictionary that maps those renames. Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> --- This is a small patch to a script; doesn't break qemu and helps with the static checker, so it's a very low-risk patch for 2.1.
2014-06-27qapi script: clean up in scriptsWenchao Xia2-4/+3
This patch improve docs and uses c_type(argentry, is_param=True) in script. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-06-24Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20140623' ↵Peter Maydell1-0/+345
into staging migration/next for 20140623 # gpg: Signature made Mon 23 Jun 2014 18:18:57 BST using RSA key ID 5872D723 # gpg: Can't check signature: public key not found * remotes/juanquintela/tags/migration/20140623: (22 commits) vmstate: Refactor & increase tests for primitive types vmstate: Return error in case of error migration: Remove unneeded minimum_version_id_old tests: vmstate static checker: add size mismatch inside substructure tests: vmstate static checker: add substructure for usb-kbd for hid section tests: vmstate static checker: remove Subsections tests: vmstate static checker: remove a subsection tests: vmstate static checker: remove Description inside Fields tests: vmstate static checker: remove Description tests: vmstate static checker: remove Fields tests: vmstate static checker: change description name tests: vmstate static checker: remove last field in a struct tests: vmstate static checker: remove a field tests: vmstate static checker: remove a section tests: vmstate static checker: minimum_version_id check tests: vmstate static checker: version mismatch inside a Description tests: vmstate static checker: add version error in main section tests: vmstate static checker: incompat machine types tests: vmstate static checker: add dump1 and dump2 files vmstate-static-checker: script to validate vmstate changes ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-23vmstate-static-checker: script to validate vmstate changesAmit Shah1-0/+345
This script compares the vmstate dumps in JSON format as output by QEMU with the -dump-vmstate option. It flags various errors, like version mismatch, sections going away, size mismatches, etc. This script is tolerant of a few changes that do not change the on-wire format, like embedding a few fields within substructs. The script takes -s/--src and -d/--dest parameters, to which filenames are given as arguments. Example: (in a qemu 2.0 tree): ./x86_64-softmmu/qemu-system-x86_64 -dump-vmstate qemu-2.0.json (in a qemu 2.2 tree:) ./x86_64-softmmu/qemu-system-x86_64 -dump-vmstate -M pc-i440fx-2.0 \ qemu-2.2-m2.0.json ./scripts/vmstate-static-checker.py -s qemu-2.0.json -d qemu-2.2-m2.0.json The script also takes a --reverse parameter to switch the src and dest jsons. This is just a shorthand for reversing the src and dest. The --help parameter shows usage information. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2014-06-23qapi script: add event supportWenchao Xia2-0/+381
qapi-event.py will parse the schema and generate qapi-event.c, then the API in qapi-event.c can be used to handle events in qemu code. All API have prefix "qapi_event". The script mainly includes two parts: generate API for each event define, generate an enum type for all defined events. Since in some cases the real emit behavior may change, for example, qemu-img would not send a event, a callback layer is used to control the behavior. As a result, the stubs at compile time can be saved, the binding of block layer code and monitor code will become looser. 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>
2014-06-23qapi: Suppress unwanted space between type and identifierAmos Kong2-8/+19
We always generate a space between type and identifier in parameter and variable declarations, even when idiomatic C style doesn't have a space there. Suppress it. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-06-23qapi: add const prefix to 'char *' insider c_type()Amos Kong2-4/+4
It's ugly to add const prefix for parameter type by an if statement outside c_type(). This patch adds a parameter to do it. Signed-off-by: Amos Kong <akong@redhat.com> Suggested-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-06-23qapi: fix coding style in parameters listAmos Kong1-10/+10
A space after * when declaring a pointer type is redundant. Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-06-16linux-headers: include psci.hAlexander Graf1-1/+2
The kvm headers now have a dependency on psci.h, sync it into our linux header copy as well. Signed-off-by: Alexander Graf <agraf@suse.de>
2014-06-09trace: Multi-backend tracingLluís Vilanova3-41/+41
Adds support to compile QEMU with multiple tracing backends at the same time. For example, you can compile QEMU with: $ ./configure --enable-trace-backends=ftrace,dtrace Where 'ftrace' can be handy for having an in-flight record of events, and 'dtrace' can be later used to extract more information from the system. This patch allows having both available without recompiling QEMU. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-06-09simpletrace: add support for trace record pid fieldStefan Hajnoczi1-11/+15
Extract the pid field from the trace record and print it. Change the trace record tuple from: (event_num, timestamp, arg1, ..., arg6) to: (event_num, timestamp, pid, arg1, ..., arg6) Trace event methods now support 3 prototypes: 1. <event-name>(arg1, arg2, arg3) 2. <event-name>(timestamp, arg1, arg2, arg3) 3. <event-name>(timestamp, pid, arg1, arg2, arg3) Existing script continue to work without changes, they only know about prototypes 1 and 2. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-06-05Merge remote-tracking branch 'remotes/kvm/uq/master' into stagingPeter Maydell1-19/+41
* remotes/kvm/uq/master: kvm: Fix eax for cpuid leaf 0x40000000 kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation kvm: Enable -cpu option to hide KVM kvm: Ensure negative return value on kvm_init() error handling path target-i386: set CC_OP to CC_OP_EFLAGS in cpu_load_eflags target-i386: get CPL from SS.DPL target-i386: rework CPL checks during task switch, preparing for next patch target-i386: fix segment flags for SMM and VM86 mode target-i386: Fix vm86 mode regression introduced in fd460606fd6f. kvm_stat: allow choosing between tracepoints and old stats kvmclock: Ensure time in migration never goes backward Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-05-21kvm_stat: allow choosing between tracepoints and old statsPaolo Bonzini1-19/+41
The old stats contain information not available in the tracepoints. By default, keep the old behavior, but allow choosing which set of stats to present, or even both. Inspired by a patch from Marcelo Tosatti. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-05-21qapi: zero-initialize all QMP command parametersMichael Roth1-1/+1
In general QMP command parameter values are specified by consumers of the QMP/HMP interface, but in the case of optional parameters these values may be left uninitialized. It is considered a bug for code to make use of optional parameters that have not been flagged as being present by the marshalling code (via corresponding has_<parameter> parameter), however our marshalling code will still pass these uninitialized values on to the corresponding QMP function (to then be ignored). Some compilers (clang in particular) consider this unsafe however, and generate warnings as a result. As reported by Peter Maydell: This is something clang's -fsanitize=undefined spotted. The code generated by qapi-commands.py in qmp-marshal.c for qmp_marshal_* functions where there are some optional arguments looks like this: bool has_force = false; bool force; mi = qmp_input_visitor_new_strict(QOBJECT(args)); v = qmp_input_get_visitor(mi); visit_type_str(v, &device, "device", errp); visit_start_optional(v, &has_force, "force", errp); if (has_force) { visit_type_bool(v, &force, "force", errp); } visit_end_optional(v, errp); qmp_input_visitor_cleanup(mi); if (error_is_set(errp)) { goto out; } qmp_eject(device, has_force, force, errp); In the case where has_force is false, we never initialize force, but then we use it by passing it to qmp_eject. I imagine we don't then actually use the value, but clang complains in particular for 'bool' variables because the value that ends up being loaded from memory for 'force' is not either 0 or 1 (being uninitialized stack contents). Fix this by initializing all QMP command parameters to {0} in the marshalling code prior to passing them on to the QMP functions. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Reported-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>