aboutsummaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2013-07-22Merge remote-tracking branch 'stefanha/tracing' into stagingAnthony Liguori1-0/+51
# By Markus Armbruster # Via Stefan Hajnoczi * stefanha/tracing: trace-events: Fix up source file comments trace-events: Drop unused events milkymist-minimac2: Fix minimac2_read/_write tracepoints slavio_misc: Fix slavio_led_mem_readw/_writew tracepoints cleanup-trace-events.pl: New Message-id: 1374119369-26496-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-18cleanup-trace-events.pl: NewMarkus Armbruster1-0/+51
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>
2013-07-16qapi: qapi-commands: fix possible leaks on visitor deallocLuiz Capitulino1-7/+10
In qmp-marshal.c the dealloc visitor calls use the same errp pointer of the input visitor calls. This means that if any of the input visitor calls fails, then the dealloc visitor will return early, before freeing the object's memory. Here's an example, consider this code: int qmp_marshal_input_block_passwd(Monitor *mon, const QDict *qdict, QObject **ret) { [...] char * device = NULL; char * password = NULL; mi = qmp_input_visitor_new_strict(QOBJECT(args)); v = qmp_input_get_visitor(mi); visit_type_str(v, &device, "device", errp); visit_type_str(v, &password, "password", errp); qmp_input_visitor_cleanup(mi); if (error_is_set(errp)) { goto out; } qmp_block_passwd(device, password, errp); out: md = qapi_dealloc_visitor_new(); v = qapi_dealloc_get_visitor(md); visit_type_str(v, &device, "device", errp); visit_type_str(v, &password, "password", errp); qapi_dealloc_visitor_cleanup(md); [...] return 0; } Consider errp != NULL when the out label is reached, we're going to leak device and password. This patch fixes this by always passing errp=NULL for dealloc visitors, meaning that we always try to free them regardless of any previous failure. The above example would then be: out: md = qapi_dealloc_visitor_new(); v = qapi_dealloc_get_visitor(md); visit_type_str(v, &device, "device", NULL); visit_type_str(v, &password, "password", NULL); qapi_dealloc_visitor_cleanup(md); Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-07-10qapi.py: Allow top-level type reference for command definitionsKevin Wolf1-0/+19
If 'data' for a command definition isn't a dict, but a string, it is taken as a (struct) type name and the fields of this struct are directly used as parameters. This is useful for transactionable commands that can use the same type definition for both the transaction action and the arguments of the standalone command. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-07-10qapi.py: Avoid code duplicationKevin Wolf1-9/+9
The code that interprets the read JSON expression and appends types to the respective global variables was duplicated. We can avoid that by splitting off the part that reads from the file. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-06-14main: use TARGET_ARCH only for the target-specific #definePaolo Bonzini1-9/+4
Everything else needs to match the executable name, which is TARGET_NAME. Before: $ sh4eb-linux-user/qemu-sh4eb --help usage: qemu-sh4 [options] program [arguments...] Linux CPU emulator (compiled for sh4 emulation) After: $ sh4eb-linux-user/qemu-sh4eb --help usage: qemu-sh4eb [options] program [arguments...] Linux CPU emulator (compiled for sh4eb emulation) Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1370349928-20419-5-git-send-email-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-06-14build: do not use TARGET_ARCHPaolo Bonzini1-9/+9
TARGET_ARCH is generally wrong to use, there are better variables provided in config-target.mak. The right one is usually TARGET_NAME (previously TARGET_ARCH2), but for bsd-user we can also use TARGET_ABI_DIR for consistency with linux-user. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1370349928-20419-4-git-send-email-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-06-14build: rename TARGET_ARCH2 to TARGET_NAMEPaolo Bonzini1-1/+1
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.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-06-04block: add block driver read only whitelistFam Zheng1-2/+9
We may want to include a driver in the whitelist for read only tasks such as diagnosing or exporting guest data (with libguestfs as a good example). This patch introduces a readonly whitelist option, and for backward compatibility, the old configure option --block-drv-whitelist is now an alias to rw whitelist. Drivers in readonly list is only permitted to open file readonly, and returns -ENOTSUP for RW opening. E.g. To include vmdk readonly, and others read+write: ./configure --target-list=x86_64-softmmu \ --block-drv-rw-whitelist=qcow2,raw,file,qed \ --block-drv-ro-whitelist=vmdk Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-30qapi: pad GenericList value fields to 64 bitsMichael Roth1-2/+8
With the introduction of native list types, we now have types such as int64List where the 'value' field is not a pointer, but the actual 64-bit value. On 32-bit architectures, this can lead to situations where 'next' field offset in GenericList does not correspond to the 'next' field in the types that we cast to GenericList when using the visit_next_list() interface, causing issues when we attempt to traverse linked list structures of these types. To fix this, pad the 'value' field of GenericList and other schema-defined/native *List types out to 64-bits. This is less memory-efficient for 32-bit architectures, but allows us to continue to rely on list-handling interfaces that target GenericList to simply visitor implementations. In the future we can improve efficiency by defaulting to using native C array backends to handle list of non-pointer types, which would be more memory efficient in itself and allow us to roll back this change. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-05-23qapi: qapi-visit.py, native list supportMichael Roth1-5/+29
Teach visitor generators about native types so they can generate the appropriate visitor routines. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-05-23qapi: qapi-visit.py, fix list handling for union typesMichael Roth1-1/+1
Currently we assume non-list types when generating visitor routines for union types. This is broken, since values like ['Type'] need to mapped to 'TypeList'. We already have a type_name() function to handle this that we use for generating struct visitors, so use that here as well. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-05-23qapi: qapi-types.py, native list supportMichael Roth2-3/+65
Teach type generators about native types so they can generate the appropriate 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> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-05-03trace: Add ftrace tracing backendEiichi Tsukata1-0/+54
This patch adds a ftrace tracing backend which sends trace event to ftrace marker file. You can effectively compare qemu trace data and kernel(especially, kvm.ko when using KVM) trace data. The ftrace backend is restricted to Linux only. To try out the ftrace backend: $ ./configure --trace-backend=ftrace $ make if you use KVM, enable kvm events in ftrace: # sudo echo 1 > /sys/kernel/debug/tracing/events/kvm/enable After running qemu by root user, you can get the trace: # cat /sys/kernel/debug/tracing/trace Signed-off-by: Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-04-17vmxcap: Update according to SDM of January 2013Jan Kiszka1-1/+5
This adds reporting of VMCS shadowing, #VE, IA32_SMBASE, unrestricted VMWRITE and fixes the range of the MSEG revision ID. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2013-04-17vmxcap: Report APIC register emulation and RDTSCP controlJan Kiszka1-0/+2
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2013-04-17vmxcap: Augment reported informationJan Kiszka1-0/+14
Parse the Basic VMX Information MSR and add the bit for the new posted interrupts. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-04-17vmxcap: Open MSR file in unbuffered modeJan Kiszka1-2/+2
Python may otherwise decide to to read larger chunks, applying the seek only on the software buffer. This will return results from the wrong MSRs. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
2013-03-28trace: [stderr] Port to generic event information and new control interfaceLluís Vilanova1-19/+8
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-03-28trace: [simple] Port to generic event information and new control interfaceLluís Vilanova1-13/+5
The backend is forced to dump event numbers using 64 bits, as TraceEventID is an enum. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-03-28trace: Provide a generic tracing event descriptorLluís Vilanova4-8/+113
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 moved to the "events" backend ("events-h" frontend). Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-03-28trace: [tracetool] Explicitly identify public backendsLluís Vilanova6-3/+30
Public backends are those printed by "--list-backends" and thus considered valid by the configure script. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-03-09make_device_config.sh: Emit dependency file to directory where includedAndreas Färber1-1/+1
Placing the config-devices.mak.d file alongside the config-devices.mak file in *-softmmu/ lead to it getting included into through *-softmmu/Makefile in addition to ./Makefile, leading to confusion. Instead, emit it to ./%-config-devices.mak.d, where it is included. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-03-09Revert "make_device_config.sh: Fix target path in generated dependency file"Andreas Färber1-1/+1
This reverts commit 23bf49b5eca716aaad073f2b47613434e1515cb5. While *-softmmu/config-devices.mak.d is included through *.d pattern via Makefile.target, the make_devices_config.sh call these dependencies are for is in ./Makefile. Therefore revert to original behavior. This should unbreak pci.mak dependencies not propagating. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-02-19fix scripts/make_device_config.shGerd Hoffmann1-1/+1
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. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-29Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori1-0/+1
* qemu-kvm/uq/master: target-i386: kvm: prevent buffer overflow if -cpu foo, [x]level is too big vmxcap: bit 9 of VMX_PROCBASED_CTLS2 is 'virtual interrupt delivery' Conflicts: target-i386/kvm.c Trivial merge resolution due to lack of context. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-26make_device_config.sh: Fix target path in generated dependency fileAndreas Färber1-1/+1
config-devices.mak.d is included from Makefile.target, i.e. from inside the *-softmmu/ directory. It included the directory path, so never applied to the actual ./config-devices.mak. Symptoms were spurious build failures due to missing dependency on default-configs/pci.mak. Fix this by using `basename` to strip the directory path. Reported-by: Gerhard Wiesinger <lists@wiesinger.com> Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-21vmxcap: bit 9 of VMX_PROCBASED_CTLS2 is 'virtual interrupt delivery'Marcelo Tosatti1-0/+1
Bit 9 of MSR_IA32_VMX_PROCBASED_CTLS2 is virtual interrupt delivery. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2013-01-12Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agrafBlue Swirl1-0/+3
* 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf: (31 commits) PPC: linux-user: Calculate context pointer explicitly target-ppc: Error out for -cpu host on unknown PVR target-ppc: Slim conversion of model definitions to QOM subclasses PPC: Bring EPR support closer to reality PPC: KVM: set has-idle in guest device tree kvm: Update kernel headers openpic: fix CTPR and de-assertion of interrupts openpic: move IACK to its own function openpic: IRQ_check: search the queue a word at a time openpic: fix sense and priority bits openpic: add some bounds checking for IRQ numbers openpic: use standard bitmap operations Revert "openpic: Accelerate pending irq search" openpic: always call IRQ_check from IRQ_get_next openpic/fsl: critical interrupts ignore mask before v4.1 openpic: make ctpr signed openpic: rework critical interrupt support openpic: make register names correspond better with hw docs ppc/booke: fix crit/mcheck/debug exceptions openpic: lower interrupt when reading the MSI register ...
2013-01-08qemu-ga: sample fsfreeze hooksTomoki Sekiyama2-0/+89
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> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-01-07powerpc: linux header sync script includes epapr_hcalls.hBharat Bhushan1-0/+3
epapr_hcalls.h is now referenced by kvm_para.h. so this is needed for QEMU to get compiled on powerpc. Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-12-23build: Use separate makefile for "trace/"Lluís Vilanova2-4/+4
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> -- Changes in v2: * Do not depend on "qemu-timer-common.o". * Use "$(obj)" in rules to refer to the build sub-directory. * Remove dependencies against "$(GENERATED_HEADERS)". Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-19misc: move include files to include/qemu/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19exec: move include files to include/exec/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qapi: move include files to include/qobject/Paolo Bonzini3-9/+9
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qapi: remove qapi/qapi-types-core.hPaolo Bonzini1-0/+2
The file is only including error.h and qerror.h. Prefer explicit inclusion of whatever files are needed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19qapi: move inclusions of qemu-common.h from headers to .c filesPaolo Bonzini2-0/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-12get_maintainer.pl: update from linix 3.8Michael S. Tsirkin1-9/+16
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-11-19Merge remote-tracking branch 'stefanha/tracing' into stagingAnthony Liguori1-1/+10
* stefanha/tracing: trace: Remove "info trace" from documents trace: document '-' syntax for disabling events trace: allow disabling events in events file Avoid all systemtap reserved words Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-11-16Avoid all systemtap reserved wordsDaniel P. Berrange1-1/+10
Over time various systemtap reserved words have been blacklisted in the trace backend generator. The list is not complete though, so there is continued risk of problems in the future. Preempt such problems by specifying the full list of systemtap keywords listed in its parser as identified here: http://sourceware.org/ml/systemtap/2012-q4/msg00157.html Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-11-15qapi-types.h: Don't include qemu-common.hIgor Mammedov1-1/+2
Needed to prevent build breakage when CPUState becomes a child of DeviceState. Signed-off-by: Igor Mammedov <imammedo@redhat.com> [ehabkost: include <stdbool.h> too] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-10-30update-linux-headers.sh: Handle new kernel uapi/ directoriesPeter Maydell1-1/+2
Recent kernels have moved to keeping the userspace headers in uapi/ subdirectories. This breaks the detection of whether an architecture has KVM support in the kernel because kvm.h has moved in the kernel source tree. Update the check to support both the old and new locations. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2012-10-29s390/kvm_stat: correct sys_perf_event_open syscall numberHeinz Graalfs1-2/+9
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 on s390 the appropriate syscall number is used from map syscall_numbers; other architectures can extend this. Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-10-04Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori3-7/+9
* qmp/queue/qmp: block: live snapshot documentation tweaks input: index_from_key(): drop unused code qmp: qmp_send_key(): accept key codes in hex input: qmp_send_key(): simplify hmp: dump-guest-memory: hardcode protocol argument to "file:" qmp: dump-guest-memory: don't spin if non-blocking fd would block qmp: dump-guest-memory: improve schema doc (again) qapi: convert add_client monitor: add Error * argument to monitor_get_fd pci-assign: use monitor_handle_fd_param qapi: add "unix" to the set of reserved words qapi: do not protect enum values from namespace pollution Add qemu-ga-client script Support settimeout in QEMUMonitorProtocol Make negotiation optional in QEMUMonitorProtocol
2012-10-01Update kernel header script to include vfioAlex Williamson1-1/+1
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>
2012-09-26qapi: add "unix" to the set of reserved wordsPaolo Bonzini1-1/+3
It is #defined to 1. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-09-26qapi: do not protect enum values from namespace pollutionPaolo Bonzini3-7/+7
Enum values are always preceded by the uppercase name of the enum, so they do not conflict with reserved words. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-09-23dtrace backend: add function to reserved wordsAlon Levy1-1/+1
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2012-09-11update-linux-headers.sh: Don't hard code list of architecturesPeter Maydell1-1/+15
Rather than hardcoding the list of architectures in the kernel header update script, just import headers for every architecture which supports KVM (with a blacklist exception for ia64 which has KVM headers but is dead). This reduces the number of QEMU files which need to be updated to add support for a new KVM architecture. Acked-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-09-10Merge branch 'queue/qmp' of git://repo.or.cz/qemu/qmp-unstableAurelien Jarno2-3/+29
* 'queue/qmp' of git://repo.or.cz/qemu/qmp-unstable: tcx: tcx_screen_dump(): add error handling tcx: tcx24_screen_dump(): add error handling g364fb: g364fb_screen_dump(): add error handling omap_lcdc: omap_ppm_save(): add error handling omap_lcdc: rename ppm_save() to omap_ppm_save() vga: ppm_save(): add error handling qapi: convert screendump console: vga_hw_screen_dump_ptr: take Error argument error: add error_setg() json-parser: Fix potential NULL pointer segfault qapi: Fix potential NULL pointer segfault qapi: convert sendkey monitor: move key_defs[] table and introduce two help functions qapi: add the QKeyCode enum qapi: generate list struct and visit_list for enum hmp: rename arguments monitor: rename keyname '<' to 'less' fix doc of using raw values with sendkey Add support for pretty-printing response in qmp-shell