aboutsummaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)Author
2012-08-15Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori
* stefanha/trivial-patches: ivshmem, qdev-monitor: fix order of qerror parameters iov_send_recv(): Handle zero bytes case even if OS does not framebuffer: Fix spelling in comment (leight -> height) Spelling fix in comment (peripherans -> peripherals) docs: Fix spelling (propery -> property) trace: Fix "Qemu" -> "QEMU" cputlb.c: Fix out of date comment ehci: fix assertion typo Makefile: Avoid explicit list of directories in clean target
2012-08-15Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori
* qemu-kvm/uq/master: update-linux-headers.sh: Pull in asm-generic/kvm_para.h kvmvapic: Disable if there is insufficient memory kvm: i8254: Finish time conversion fix kvm: i8254: Cache kernel clock offset in KVMPITState
2012-08-15trace: Fix "Qemu" -> "QEMU"Stefan Weil
Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-08-14update-linux-headers.sh: Pull in asm-generic/kvm_para.hPeter Maydell
Add asm-generic/kvm_para.h to the set of non-architecture specific KVM kernel headers we copy into QEMU. This header may be included by an architecture's kvm_para.h header. Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2012-08-14trace/simple: Fix compiler warning for 32 bit hostsStefan Weil
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>
2012-08-13scripts: qapi-commands.py: qmp-commands.h: include qdict.hLuiz Capitulino
qmp-commands.h declares several functions that have arguments of type QDict. However, qdict.h is not included. This will cause a build breakage when a file includes qmp-commands.h but doesn't include qdict.h. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-08-13qapi: don't convert enum strings to lowercaseLuiz Capitulino
Next commit will introduce enum strings in camel case. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2012-08-13qapi: generate correct enum names for camel case enumsLuiz Capitulino
An enum like GenericError in the schema, should generate GENERIC_ERROR and not GENERICERROR. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2012-08-13qapi: qapi-types.h: don't include qapi/qapi-types-core.hLuiz Capitulino
qapi-types.h needs only qemu-common.h. Including qapi-types-core.h causes problems when qerror.h or error.h includes qapi-types.h. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2012-08-09qapi: avoid reserved keywordsBlue Swirl
Clang compiler complained about use of reserved word 'restrict' in SLIRP and QAPI. Prefix C keywords with "q_", adjust SLIRP accordingly. Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-01qapi: qapi.py: allow the "'" character to be escapedLuiz Capitulino
Support escaping the escape character, and make more robust (don't die for '', handle ' without matching '. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-07-23Merge remote-tracking branch 'stefanha/net' into stagingAnthony Liguori
* stefanha/net: remove unused QemuOpts parameter from net init functions convert net_init_bridge() to NetClientOptions convert net_init_tap() to NetClientOptions convert net_init_vde() to NetClientOptions convert net_init_socket() to NetClientOptions convert net_init_slirp() to NetClientOptions convert net_init_dump() to NetClientOptions convert net_init_nic() to NetClientOptions convert net_client_init() to OptsVisitor hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated) qapi schema: add Netdev types qapi schema: remove trailing whitespace qapi: introduce OptsVisitor expose QemuOpt and QemuOpts struct definitions to interested parties qapi: introduce "size" type qapi: generate C types for fixed-width integers qapi: add test case for deallocating traversal of incomplete structure qapi: fix error propagation MAINTAINERS: Replace net maintainer Mark McLoughlin with Stefan Hajnoczi
2012-07-23qapi: introduce "size" typeLaszlo Ersek
v1->v2: - fall back to uint64 rather than int Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23qapi: generate C types for fixed-width integersLaszlo Ersek
(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>
2012-07-23qapi: fix error propagationPaolo Bonzini
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 error_set() - allow visitors to set a NULL struct pointer successfully, so traversal of incomplete objects can continue - check for a NULL "obj" before accessing "(*obj)->has_XXX" (this is not a typo, "obj != NULL" implies "*obj != NULL" here) - fix start_struct / end_struct balance for unions as well Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-19Update simpletrace.py for new log formatHarsh Prateek Bora
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>
2012-07-19Simpletrace v2: Support multiple arguments, strings.Harsh Prateek Bora
Existing simpletrace backend allows to trace at max 6 args and does not support strings. This newer tracelog format gets rid of fixed size records and therefore allows to trace variable number of args including strings. Sample trace with strings: v9fs_version 0.000 tag=0xffff id=0x64 msize=0x2000 version=9P2000.L v9fs_version_return 6.705 tag=0xffff id=0x64 msize=0x2000 version=9P2000.L Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-17build: add make dist target (v2)Anthony Liguori
Let's stop screwing up releases by having a script do the work that Anthony's fat 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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-06-26Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori
* stefanha/trivial-patches: tci: Support INDEX_op_bswap64_i64 target-i386: Use QEMU instead of Qemu Makefile.hw: avoid overly large 'make clean' rm command configure: Fix typo arm_gic: Send dbg msgs to stderr not stdout checkpatch: Add QEMU specific rule qemu-config: Use QEMU instead of Qemu libqtest: Fix socket_accept() to pass address_len Makefile.user: Define CONFIG_USER_ONLY for libuser/ Makefile: Remove macro qapi-dir Makefile: Remove BUILD_DIR from qapi-dir Install 'bepo' keymap already included in Qemu source
2012-06-22checkpatch: Add QEMU specific ruleStefan Weil
The new rule detects two wrong variants of QEMU. It was tested with commit b5a8fe5e. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-06-18s390: make kvm_stat work on s390Jens Freimann
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> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-06-03Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori
* qemu-kvm/uq/master: virtio/vhost: Add support for KVM in-kernel MSI injection msix: Add msix_nr_vectors_allocated kvm: Enable use of kvm_irqchip_in_kernel in hwlib code kvm: Introduce kvm_irqchip_add/remove_irqfd kvm: Make kvm_irqchip_commit_routes an internal service kvm: Publicize kvm_irqchip_release_virq kvm: Introduce kvm_irqchip_add_msi_route kvm: Rename kvm_irqchip_add_route to kvm_irqchip_add_irq_route msix: Introduce vector notifiers msix: Invoke msix_handle_mask_update on msix_mask_all msix: Factor out msix_get_message kvm: update vmxcap for EPT A/D, INVPCID, RDRAND, VMFUNC kvm: Enable in-kernel irqchip support by default kvm: Add support for direct MSI injections kvm: Update kernel headers kvm: x86: Wire up MSI support for in-kernel irqchip pc: Enable MSI support at APIC level kvm: Introduce basic MSI support for in-kernel irqchips Introduce MSIMessage structure kvm: Refactor KVMState::max_gsi to gsi_count
2012-05-17kvm: update vmxcap for EPT A/D, INVPCID, RDRAND, VMFUNCAvi Kivity
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2012-05-15qapi: add support for command optionsLuiz Capitulino
Options allow for changes in commands behavior. This commit introduces the QCO_NO_SUCCESS_RESP option, which causes a command to not emit a success response. This is needed by commands such as qemu-ga's guest-shutdown, which may not be able to complete before the VM vanishes. In this case, it's useful and simpler not to bother sending a success response. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-05-08scripts/qemu-binfmt-conf.sh: Fix shell syntaxAndreas Färber
The script is organized as a sequence of binfmt registrations, with a check whether the to be registered architecture matches the host. Add a missing fi for the SuperH section. Reported-by: Alexander Graf <agraf@suse.de> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-05-01tracetool: avoid pkgutil.iter_modules() Python 2.7 functionStefan Hajnoczi
The pkgutil.iter_modules() function provides a way to enumerate child modules. Unfortunately it's missing in Python <2.7 so we must implement similar behavior ourselves. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-05-01tracetool: avoid str.rpartition() Python 2.5 functionStefan Hajnoczi
The str.rpartition() function is related to str.split() and is used for splitting strings. It was introduced in Python 2.5 and therefore cannot be used in tracetool as Python 2.4 compatibility is required. Replace the code using str.rsplit(). Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-05-01tracetool: use Python 2.4-compatible __import__() argumentsStefan Hajnoczi
In Python 2.5 keyword arguments were added to __import__(). Avoid using them 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>
2012-05-01tracetool: use Python 2.4-compatible exception handling syntaxStefan Hajnoczi
The newer "except <exception-type> as <exception>:" syntax is not supported by Python 2.4, we need to use "except <exception-type>, <exception>:". Tested all trace backends with Python 2.4. Reported-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-04-24create_config: simplify prefix=* block, remove CONFIG_QEMU_PREFIXEduardo Habkost
As now that block handles only the prefix variable, the code can be much simpler. This also removes the CONFIG_QEMU_PREFIX define as it is not used by any C code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-04-24create_config: remove *dir blockEduardo Habkost
Now only the qemu_*dir variables will become #defines. The other directory 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 - CONFIG_QEMU_INCLUDEDIR - CONFIG_QEMU_MANDIR - CONFIG_QEMU_SYSCONFDIR - CONFIG_QEMU_LIBEXECDIR The following #defines are going to be kept because they are handled by the qemu_* block on create_config: - CONFIG_QEMU_CONFDIR - CONFIG_QEMU_DATADIR - CONFIG_QEMU_DOCDIR This one will be kept because it is set directly by ./configure: - CONFIG_QEMU_HELPERDIR This patch keeps the 'prefix=*' (CONFIG_QEMU_PREFIX) pattern because other variables may use $prefix on their config-host.mak definitions. The remaining code will be simplified on a further patch. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-04-24create_config: separate section for qemu_*dir variables (v2)Eduardo Habkost
The generic *dir section will eventually go away and be replaced with qemu_* section. By now, both sections will be kept, while the variables get renamed on config-host.mak. With this patch, a XXXdir variable will become a CONFIG_QEMU_XXXDIR define, and a qemu_XXXdir variable will become CONFIG_QEMU_XXXDIR as well (instead of becoming a CONFIG_QEMU_QEMU_XXXDIR define). Changes v1 -> v2: - Rebase on top of newer qemu.git changes, that changed "tr '[:lower:]' '[:upper:]'" to "LC_ALL=C tr '[a-z]' '[A-Z]'". Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-04-18tracetool: handle DTrace keywords 'in', 'next', 'self'Stefan Hajnoczi
Language keywords cannot be used as argument names. The DTrace backend appends an underscore to the argument name in order to make the argument name legal. This patch adds 'in', 'next', and 'self' keywords to dtrace.py. Also drop the unnecessary argument name lstrip() call. The Arguments.build() method already ensures there is no space around argument names. Furthermore it is misleading to do the lstrip() *after* checking against keywords because the keyword check would not match if spaces were in the name. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Alon Levy <alevy@redhat.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-04-18tracetool: Add support for the 'dtrace' backendLluís Vilanova
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18tracetool: Add support for the 'ust' backendLluís Vilanova
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18tracetool: Add support for the 'simple' backendLluís Vilanova
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18tracetool: Add support for the 'stderr' backendLluís Vilanova
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18tracetool: Add module for the 'h' formatLluís Vilanova
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18tracetool: Add module for the 'c' formatLluís Vilanova
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-18tracetool: Rewrite infrastructure as python modulesLluís Vilanova
The tracetool script is written in shell and has hit several portability problems due to shell quirks or external tools across host platforms. Additionally the amount of string processing and lack of real data structures makes it tough to implement code generator backends for tracers that are more complex. This patch replaces the shell version of tracetool with a Python version. The new tracetool design is: scripts/tracetool.py - top-level script scripts/tracetool/backend/ - tracer backends live here (simple, ust) scripts/tracetool/format/ - output formats live here (.c, .h) There is common code for trace-events definition parsing so that backends can focus on generating code rather than parsing input. Support for all existing backends (nop, stderr, simple, ust, and dtrace) is added back in follow-up patches. [Commit description written by Stefan Hajnoczi] Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-04-16signrom: Rewrite as python scriptJan Kiszka
Now that we have a hard dependency on python anyway, we can replace the slow shell script to calculate the option ROM checksum with a fast AND portable python version. Tested both with python 2.7 and 3.1. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-04-12kvm: add flightrecorder scriptStefan Hajnoczi
The kvm kernel module includes a number of trace events which can be useful when debugging system behavior. Even on production systems these trace events can be used to observe guest behavior and identify the source of problems. The kvm_flightrecorder script is a command-line wrapper for the /sys/kernel/debug/tracing interface. Kernel symbols do not need to be installed. This script captures a fixed-size buffer of KVM trace events. Recent events overwrite the oldest events when the buffer size is exceeded and it is possible to leave KVM tracing enabled for any period of time with just a fixed-size buffer. If the buffer is large enough this script is a useful tool for collecting detailed information after an issue occurs with a guest. Hence the name "flight recorder". The script can also be used in 'tail' mode to simply view KVM trace events as they occur. This is handy for development and to ensure that the guest is indeed running. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2012-04-05tracetool: Forbid argument name 'next'Kevin Wolf
It has happened more than once that patches that look perfectly sane and work with simpletrace broke systemtap because they use 'next' as an argument name for a tracing function. However, 'next' is a keyword for systemtap, so we shouldn't use it. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-02Merge remote-tracking branch 'stefanha/tracing' into stagingAnthony Liguori
* stefanha/tracing: tracetool: dtrace: handle in and next reserved words tracetool: dtrace disabled-events fix Makefile.target: code stp dependency on trace-events
2012-03-31Fix conversion from lower to upper case with Turkish localeStefan Weil
Some locale settings let make fail or create wrong results because tr '[:lower:]' '[:upper:]' which is used to convert from lower to upper case depends on the locale. With locale tr_TR.UTF-8, lower case 'i' is not converted to 'I'. This results in wrong entries in config-host.h like these ones: #define CONFIG_QEMU_PREFiX "/usr/local" #define CONFIG_QEMU_BiNDiR "/usr/local/bin" This problem was reported by Emre Ersin. The same problem occurs when configure creates the target specific files config-target.mak. They get wrong declarations: TARGET_CRiS=y TARGET_i386=y TARGET_MiCROBLAZE=y TARGET_MiPS64=y TARGET_MiPS=y TARGET_UNiCORE32=y It is sufficient to restrict the conversion to the characters a-z. Using this explicit range avoids the dependency on the locale settings and is also shorter. v2: POSIX says that 'tr a-z' is unspecified outside of the POSIX locale, so we must set LC_ALL=C to make sure that we are using POSIX (hint from Eric Blake, thanks). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-30qtest: add test frameworkAnthony Liguori
The idea behind qtest is pretty simple. Instead of executing a CPU via TCG or KVM, rely on an external process to send events to the device model that the CPU would normally generate. qtest presents itself as an accelerator. In addition, a new option is added to establish a qtest server (-qtest) that takes a character device. This is what allows the external process to send CPU events to the device model. qtest uses a simple line based protocol to send the events. Documentation of that protocol is in qtest.c. I considered reusing the monitor for this job. Adding interrupts would be a bit difficult. In addition, logging would also be difficult. qtest has extensive logging support. All protocol commands are logged with time stamps using a new command line option (-qtest-log). Logging is important since ultimately, this is a feature for debugging. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-30test makefile overhaulPaolo Bonzini
This introduces new test reporting infrastructure based on gtester and gtester-report. Also, all existing tests are moved to tests/, and tests/Makefile is reorganized to factor out the commonalities in the rules. Signed-off-by: Anthony Liguori <aliguori@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-30tracetool: dtrace: handle in and next reserved wordsAlon Levy
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-30tracetool: dtrace disabled-events fixLee Essen
If there are "disabled" entries in the trace-events file then linetod_nop() is called if the backend is dtrace, it's currently not present. Also equivalent fix for stap. Signed-off-by: Lee Essen <lee.essen@nowonline.co.uk> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-27qmp: parse commands in strict modePaolo Bonzini
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>