summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* trace: add tracetool simpletrace_stap formatStefan Hajnoczi2014-08-121-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>
* trace: extract stap_escape() function for reuseStefan Hajnoczi2014-08-121-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>
* checker: ignore fields marked unusedAmit Shah2014-08-041-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>
* vmstate static checker: whitelist additionsAmit Shah2014-07-221-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>
* vmstate static checker: detect section renamesAmit Shah2014-07-161-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.
* qapi script: clean up in scriptsWenchao Xia2014-06-272-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>
* Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20140623' ↵Peter Maydell2014-06-241-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>
| * vmstate-static-checker: script to validate vmstate changesAmit Shah2014-06-231-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>
* | qapi script: add event supportWenchao Xia2014-06-232-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>
* | qapi: Suppress unwanted space between type and identifierAmos Kong2014-06-232-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>
* | qapi: add const prefix to 'char *' insider c_type()Amos Kong2014-06-232-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>
* | qapi: fix coding style in parameters listAmos Kong2014-06-231-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>
* linux-headers: include psci.hAlexander Graf2014-06-161-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>
* trace: Multi-backend tracingLluís Vilanova2014-06-093-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>
* simpletrace: add support for trace record pid fieldStefan Hajnoczi2014-06-091-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>
* Merge remote-tracking branch 'remotes/kvm/uq/master' into stagingPeter Maydell2014-06-051-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>
| * kvm_stat: allow choosing between tracepoints and old statsPaolo Bonzini2014-05-211-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>
* | qapi: zero-initialize all QMP command parametersMichael Roth2014-05-211-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>
* | scripts/qapi.py: Avoid syntax not supported by Python 2.4Luiz Capitulino2014-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | The Python "except Foo as x" syntax was only introduced in Python 2.6, but we aim to support Python 2.4 and later. Use the old-style "except Foo, x" syntax instead, thus fixing configure/compile on systems with older Python. Reported-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | qapi: skip redundant includesBenoît Canet2014-05-161-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of this change is to help create a json file containing common definitions; each bit of generated C code must be emitted only one time. A second history global to all QAPISchema instances has been added to detect when a file is included more than one time and skip these includes. It does not act as a stack and the changes made to it by the __init__ function are propagated back to the caller so it's really a global state. Signed-off-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | qapi: Replace uncommon use of the error API by the common oneMarkus Armbruster2014-05-152-100/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We commonly use the error API like this: err = NULL; foo(..., &err); if (err) { goto out; } bar(..., &err); Every error source is checked separately. The second function is only called when the first one succeeds. Both functions are free to pass their argument to error_set(). Because error_set() asserts no error has been set, this effectively means they must not be called with an error set. The qapi-generated code uses the error API differently: // *errp was initialized to NULL somewhere up the call chain frob(..., errp); gnat(..., errp); Errors accumulate in *errp: first error wins, subsequent errors get dropped. To make this work, the second function does nothing when called with an error set. Requires non-null errp, or else the second function can't see the first one fail. This usage has also bled into visitor tests, and two device model object property getters rtc_get_date() and balloon_stats_get_all(). With the "accumulate" technique, you need fewer error checks in callers, and buy that with an error check in every callee. Can be nice. However, mixing the two techniques is confusing. You can't use the "accumulate" technique with functions designed for the "check separately" technique. You can use the "check separately" technique with functions designed for the "accumulate" technique, but then error_set() can't catch you setting an error more than once. Standardize on the "check separately" technique for now, because it's overwhelmingly prevalent. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | qapi: Un-inline visit of implicit structMarkus Armbruster2014-05-151-14/+34
| | | | | | | | | | | | | | | | | | In preparation of error handling changes. Bonus: generates less duplicated code. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | qapi-visit.py: Clean up a sloppy use of field prefixMarkus Armbruster2014-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | generate_visit_struct_fields() generates the base type's struct member name both with and without the field prefix. Harmless, because the field prefix is always empty there: only unboxed complex members have a prefix, and those can't have a base type. Clean it up anyway. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | qapi: Clean up shadowing of parameters and locals in inner scopesMarkus Armbruster2014-05-151-3/+17
| | | | | | | | | | | | | | | | By un-inlining the visit of nested complex types. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | qapi-visit.py: Clean up confusing push_indent() / pop_indent() useMarkus Armbruster2014-05-151-18/+14
| | | | | | | | | | | | | | | | | | Changing implicit indentation in the middle of generating a block makes following the code being generated unnecessarily hard. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | qapi: Replace start_optional()/end_optional() by optional()Markus Armbruster2014-05-152-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semantics of end_optional() differ subtly from the other end_FOO() callbacks: when start_FOO() succeeds, the matching end_FOO() gets called regardless of what happens in between. end_optional() gets called only when everything in between succeeds as well. Entirely undocumented, like all of the visitor API. The only user of Visitor Callback end_optional() never did anything, and was removed in commit 9f9ab46. I'm about to clean up error handling in the generated visitor code, and end_optional() is in my way. No users mean no test cases, and making non-trivial cleanup transformations without test cases doesn't strike me as a good idea. Drop end_optional(), and rename start_optional() to optional(). We can always go back to a pair of callbacks when we have an actual need. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | qapi: Normalize marshalling's visitor initialization and cleanupMarkus Armbruster2014-05-151-15/+12
|/ | | | | | | | | | | | | | | Input and output marshalling functions do it differently. Change them to work the same: initialize the I/O visitor, use it, clean it up, initialize the dealloc visitor, use it, clean it up. This delays dealloc visitor initialization in output marshalling functions, and input visitor cleanup in input marshalling functions. No functional change, but the latter will be convenient when I change the error handling. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into stagingPeter Maydell2014-05-094-23/+73
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remotes/qmp-unstable/queue/qmp: (38 commits) Revert "qapi: Clean up superfluous null check in qapi_dealloc_type_str()" qapi: Document optional arguments' backwards compatibility qmp: use valid JSON in transaction example qmp: Don't use error_is_set() to suppress additional errors dump: Drop pointless error_is_set(), DumpState member errp qemu-option: Clean up fragile use of error_is_set() qga: Drop superfluous error_is_set() qga: Clean up fragile use of error_is_set() qapi: Clean up fragile use of error_is_set() tests/qapi-schema: Drop superfluous error_is_set() qapi: Drop redundant, unclean error_is_set() hmp: Guard against misuse of hmp_handle_error() qga: Use return values instead of error_is_set(errp) error: Consistently name Error ** objects errp, and not err qmp: Consistently name Error ** objects errp, and not err qga: Consistently name Error ** objects errp, and not err qmp hmp: Consistently name Error * objects err, and not errp pci-assign: assigned_initfn(): set monitor error in common error handler pci-assign: propagate errors from assign_intx() pci-assign: propagate errors from assign_device() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * qapi: Add a primitive to include other files from a QAPI schema fileLluís Vilanova2014-05-081-12/+52
| | | | | | | | | | | | | | | | | | | | | | The primitive uses JSON syntax, and include paths are relative to the file using the directive: { 'include': 'path/to/file.json' } Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * qapi: Use an explicit input fileLluís Vilanova2014-05-084-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | Use an explicit input file on the command-line instead of reading from standard input. It also outputs the proper file name when there's an error. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | trace: [tracetool] Minimize the amount of per-backend codeLluís Vilanova2014-05-0718-400/+308
| | | | | | | | | | | | | | Backends now only contain the essential backend-specific code, and most of the work is moved to frontend code. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | trace: [simple] Bump up log version numberLluís Vilanova2014-05-071-5/+5
| | | | | | | | | | | | | | The following tracetool cleanup changes the event numbering policy. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | trace: [tracetool] Change format docs to point to the generated fileLluís Vilanova2014-05-077-11/+11
| | | | | | | | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | trace: [tracetool] Show list of frontends and backends sorted by nameLluís Vilanova2014-05-072-3/+3
| | | | | | | | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | trace: [tracetool] Cosmetic changesLluís Vilanova2014-05-071-7/+7
| | | | | | | | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | trace: [tracetool] Spacing changesLluís Vilanova2014-05-071-3/+4
| | | | | | | | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | trace: [tracetool] Add methods 'Event.copy' and 'Arguments.copy'Lluís Vilanova2014-05-071-0/+9
| | | | | | | | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | trace: [tracetool] Add method 'Event.api' to build event namesLluís Vilanova2014-05-076-17/+27
|/ | | | | | | Makes it easier to ensure proper naming across the different frontends and backends. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* scripts: add sample model file for Coverity ScanPaolo Bonzini2014-04-181-0/+183
| | | | | | | | | | | | | | This is the model file that is being used for the QEMU project's scans on scan.coverity.com. It fixed about 30 false positives (10% of the total) and exposed about 60 new memory leaks. The file is not automatically used; changes to it must be propagated to the website manually by an admin (right now Markus, Peter and me are admins). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* make-release: Record SeaBIOS versionAndreas Färber2014-03-311-0/+1
| | | | | | | | | | Before deleting .git, determine the version and save it in .version file. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1395277315-7806-1-git-send-email-afaerber@suse.de Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* scripts/qemu-binfmt-conf.sh: Add AArch64 registrationPeter Maydell2014-03-171-0/+3
| | | | | | | | | Add the binfmt-misc magic needed to register QEMU for handling AArch64 ELF binaries. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Message-id: 1394822294-14837-26-git-send-email-peter.maydell@linaro.org
* scripts/make-release: Don't distribute .git directoriesCole Robinson2014-03-151-1/+1
| | | | | | | | | | | | [crobinso@localhost qemu-2.0.0-rc0]$ find . -name .git ./dtc/.git ./pixman/.git This is already done for the rom submodules. https://bugs.launchpad.net/qemu/+bug/1224414 Signed-off-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* qapi script: do not add "_" for every capitalized char in enumWenchao Xia2014-03-111-7/+19
| | | | | | | | | | Now "enum AIOContext" will generate AIO_CONTEXT instead of A_I_O_CONTEXT, "X86CPU" will generate X86_CPU instead of X86_C_P_U. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qapi script: do not allow string discriminatorWenchao Xia2014-03-111-0/+5
| | | | | | | | | | | Since enum based discriminators provide better type-safety and ensure that future qapi additions do not forget to adjust dependent unions, forbid using string as discriminator from now on. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qapi script: support enum type as discriminator in unionWenchao Xia2014-03-113-14/+60
| | | | | | | | | | | | By default, any union will automatically generate a enum type as "[UnionName]Kind" in C code, and it is duplicated when the discriminator is specified as a pre-defined enum type in schema. After this patch, the pre-defined enum type will be really used as the switch case condition in generated C code, if discriminator is an enum field. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qapi script: use same function to generate enum stringWenchao Xia2014-03-113-13/+25
| | | | | | | | | | | | Prior to this patch, qapi-visit.py used custom code to generate enum names used for handling a qapi union. Fix it to instead reuse common code, with identical generated results, and allowing future updates to generation to only need to touch one place. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qapi script: code move for generate_enum_name()Wenchao Xia2014-03-112-10/+10
| | | | | | | | | | Later both qapi-types.py and qapi-visit.py need a common function for enum name generation. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qapi script: check correctness of unionWenchao Xia2014-03-111-2/+86
| | | | | | | | | | | | | | | Since line info is remembered as QAPISchema.line now, this patch uses it as additional info for every expr in QAPISchema inside qapi.py, then improves error message with it in checking of exprs. For common union the patch will check whether base is a valid complex type if specified. For flat union it will check whether base presents, whether discriminator is found in base, whether the key of every branch is correct when discriminator is an enum type. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qapi script: remember line number in schema parsingWenchao Xia2014-03-111-6/+8
| | | | | | | | | | | | Before this patch, 'QAPISchemaError' scans whole input until 'pos' to get error line number. After this patch, the scan is avoided since line number is remembered in schema parsing. This patch also benefits other error report functions, which would be introduced later. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* qapi script: add check for duplicated keyWenchao Xia2014-03-111-0/+2
| | | | | | | | | | It is bad that same key was specified twice, especially when a union has two branches with same condition. This patch can prevent it. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
OpenPOWER on IntegriCloud