aboutsummaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2015-05-05Merge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-20150505-1' into ↵Peter Maydell1-0/+16
staging sdl2: add opengl support # gpg: Signature made Tue May 5 10:36:25 2015 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-sdl-20150505-1: sdl2: Fix RGB555 sdl2: add support for display rendering using opengl. sdl2: move SDL_* includes to sdl2.h console-gl: add opengl rendering helper functions opengl: add shader helper functions. opengl: add shader build infrastructure Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-05-05coverity: fix address_space_rw modelPaolo Bonzini1-3/+3
If the is_write argument is true, address_space_rw writes to memory and thus reads from the buffer. The opposite holds if is_write is false. Fix the model. Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-05-05opengl: add shader build infrastructureGerd Hoffmann1-0/+16
perl script to transform shader programs into c include files with static string constands containing the shader programs, so we can easily embed them into qemu. Also some Makefile logic for them. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2015-04-28iotests: add QMP event waiting queueJohn Snow1-30/+65
A filter is added to allow callers to request very specific events to be pulled from the event queue, while leaving undesired events still in the stream. This allows us to poll for completion data for multiple asynchronous events in any arbitrary order. A new timeout context is added to the qmp pull_event method's wait parameter to allow tests to fail if they do not complete within some expected period of time. Also fixed is a bug in qmp.pull_event where we try to retrieve an event from an empty list if we attempt to retrieve an event with wait=False but no events have occurred. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1429314609-29776-19-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-04-28scripts: add 'qemu coroutine' command to qemu-gdb.pyStefan Hajnoczi1-0/+75
The 'qemu coroutine <coroutine-address>' GDB command prints the backtrace for a CoroutineUContext. This is useful for peeking inside yielded coroutines that are waiting for file descriptor events, timers, etc. For example: $ gdb tests/test-coroutine (gdb) b test_yield (gdb) r (gdb) b qemu_coroutine_enter (gdb) c (gdb) c Continuing. Breakpoint 2, qemu_coroutine_enter (co=0x555555c66520, opaque=0x0) at qemu-coroutine.c:103 103 { (gdb) source scripts/qemu-gdb.py (gdb) qemu coroutine 0x555555c66520 #0 0x000055555557a740 in qemu_coroutine_switch (from_=<optimized out>, to_=0x7ffff7f90a70, action=COROUTINE_YIELD) at coroutine-ucontext.c:177 #1 0x0000555555566af9 in yield_5_times (opaque=0x7fffffffdbb7) at tests/test-coroutine.c:107 #2 0x000055555557a7aa in coroutine_trampoline (i0=<optimized out>, i1=<optimized out>) at coroutine-ucontext.c:80 #3 0x00007ffff08de000 in __start_context () at /lib64/libc.so.6 Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1427409754-8556-1-git-send-email-stefanha@redhat.com Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-04-28checkpatch: complain about ffs(3) callsStefan Hajnoczi1-0/+11
The ffs(3) family of functions is not portable. MinGW doesn't always provide the function. Use ctz32() or ctz64() instead. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1427124571-28598-10-git-send-email-stefanha@redhat.com Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-04-28Merge remote-tracking branch ↵Peter Maydell1-3/+5
'remotes/pmaydell/tags/pull-target-arm-20150427' into staging target-arm queue: * memory system updates to support transaction attributes * set user-mode and secure attributes for accesses made by ARM CPUs * rename c1_coproc to cpacr_el1 * adjust id_aa64pfr0 when has_el3 CPU property disabled * allow ARMv8 SCR.SMD updates # gpg: Signature made Mon Apr 27 16:14:30 2015 BST using RSA key ID 14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" * remotes/pmaydell/tags/pull-target-arm-20150427: Allow ARMv8 SCR.SMD updates target-arm: Adjust id_aa64pfr0 when has_el3 CPU property disabled target-arm: rename c1_coproc to cpacr_el1 target-arm: Check watchpoints against CPU security state target-arm: Use attribute info to handle user-only watchpoints target-arm: Add user-mode transaction attribute target-arm: Use correct memory attributes for page table walks target-arm: Honour NS bits in page tables Switch non-CPU callers from ld/st*_phys to address_space_ld/st* exec.c: Capture the memory attributes for a watchpoint hit exec.c: Add new address_space_ld*/st* functions exec.c: Make address_space_rw take transaction attributes exec.c: Convert subpage memory ops to _with_attrs Add MemTxAttrs to the IOTLB Make CPU iotlb a structure rather than a plain hwaddr memory: Replace io_mem_read/write with memory_region_dispatch_read/write memory: Define API for MemoryRegionOps to take attrs and return status Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-04-26exec.c: Make address_space_rw take transaction attributesPeter Maydell1-3/+5
Make address_space_rw take transaction attributes, rather than always using the 'unspecified' attributes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
2015-04-24qapi: Drop dead genlist parameterEric Blake1-13/+9
Defaulting a parameter to True, then having all callers omit or pass an explicit True for that parameter, is pointless. Looks like it has been dead since introduction in commit 06d64c6, more than 4 years ago. Signed-off-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2015-03-18build: pass .d file name to scripts/make_device_config.sh, fix makefile targetPaolo Bonzini1-8/+10
The .d file name must match exactly what is used in the SUBDIR_DEVICES_MAK_DEP variable. Instead of making assumptions in the make_device_config.sh script, just pass it in. Similarly, the makefile target may not match the output file name, because Makefile uses a temporary file. Instead of making assumptions on what the Makefile does, emit the config-devices.mak file to stdout, and use the passed-in destination as the makefile target Reported-by: Peter Maydell <peter.maydell@linaro.org> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-17scripts: Add qom-tree scriptAndreas Färber1-0/+70
Functionally it is a recursive qom-list with qom-get per non-child<> property. Some failures needed to be handled, such as trying to read a pointer property, which is not representable in QMP. Those print a literal "<EXCEPTION>". Tested-by: Alistair Francis <alistair.francis@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-03-17coverity: Fix g_malloc_n-like modelsJan Kiszka1-3/+3
Allocate the calculated overall size, not only the size of a single element. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2015-03-10kvm_stat: add kvm_stat.1 man pageStefan Hajnoczi1-0/+55
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Ademar Reis <areis@redhat.com> Reviewed-by: Wei Huang <wei@redhat.com> Message-Id: <1425338947-10296-3-git-send-email-stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-10kvm_stat: add column headers to text UIStefan Hajnoczi1-1/+4
The curses user interface shows both the accumulated total and the current event counts. Add column headers so it's clear what the numbers mean. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Ademar Reis <areis@redhat.com> Reviewed-by: Wei Huang <wei@redhat.com> Message-Id: <1425338947-10296-2-git-send-email-stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-09Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell1-1/+51
pci, pc, virtio fixes and cleanups A bunch of fixes all over the place. All of ACPI refactoring has been merged. Legacy pci commands have been dropped. virtio header cleanup initial patches from virtio-1.0 branch Signed-off-by: Michael S. Tsirkin <mst@redhat.com> * remotes/mst/tags/for_upstream: (130 commits) acpi: drop unused code aml-build: comment fix acpi-build: fix typo in comment acpi: update generated files vhost user:support vhost user nic for non msi guests aml-build: fix build for glib < 2.22 acpi: update generated files Makefile.target: binary depends on config-devices acpi-test-data: update after pci rewrite acpi, mem-hotplug: use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb(). pci-hotplug-old: Has been dead for five major releases, bury pci: Give a few helpers internal linkage acpi: make build_*() routines static to aml-build.c pc: acpi: remove not used anymore ssdt-[misc|pcihp].hex.generated blobs pc: acpi-build: drop template patching and create PCI bus tree dynamically tests: ACPI: update pc/SSDT.bridge due to new alg of PCI tree creation pc: acpi-build: simplify PCI bus tree generation tests: add ACPI blobs for qemu with bridge cases tests: bios-tables-test: add support for testing bridges tests: ACPI test blobs update due to PCI0._CRS changes ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Conflicts: hw/pci/pci-hotplug-old.c
2015-03-04Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' ↵Peter Maydell1-7/+19
into staging # gpg: Signature made Mon Mar 2 21:45:18 2015 GMT using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/tracing-pull-request: trace: add DTrace reserved words for .d files unbreak dtrace tracing due to double _ in rdma names Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-02trace: add DTrace reserved words for .d filesStefan Hajnoczi1-7/+19
DTrace on Mac OS X fails due to trace events using 'self' as an argument name: GEN trace/generated-tracers-dtrace.h dtrace: failed to compile script trace/generated-tracers-dtrace.dtrace: line 1330: syntax error, unexpected DT_KEY_SELF, expecting ) near "self" make: *** [trace/generated-tracers-dtrace.h] Error 1 Filter argument names according to the list of DTrace .d file reserved keywords. Note that DTrace on Mac and Linux still do not work after this patch. There are additional build issues remaining. Reported-by: Henk Poley <henkpoley@gmail.com> Tested-by: Henk Poley <henkpoley@gmail.com> Cc: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-02-27Makefile: don't silence mak file test with V=1Michael S. Tsirkin1-1/+1
V=1 should show what's going on, it's not nice to silence things unconditionally. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <1424332114-13440-1-git-send-email-mst@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-26Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into stagingPeter Maydell1-4/+7
* remotes/qmp-unstable/queue/qmp: qapi-types: add C99 index names to arrays monitor: Fix missing err = NULL in client_migrate_info() balloon: Fix typo hmp: Fix warning from smatch (wrong argument in function call) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-02-26update-linux-headers.sh: s/__inline__/inline/Michael S. Tsirkin1-0/+1
Thomas Huth noticed that some linux headers use __inline__, change to inline to be consistent with the rest of QEMU. Reported-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-02-26scripts: add arch specific standard-headersMichael S. Tsirkin1-0/+2
Copy arch specific virtio headers. ATM this applies to s390 only. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-02-26update-linux-headers: use standard-headersMichael S. Tsirkin1-1/+7
Drop the linux-specific virtio headers, use the copy from standard-headers instead. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-02-26scripts/update-linux-headers.sh: pull virtio hdrsMichael S. Tsirkin1-0/+41
It doesn't make sense to copy values manually: the only issue with getting headers from linux seems to be dealing with linux/types, we can easily fix that automatically while importing. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2015-02-24Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell2-5/+45
- vhost-scsi: add bootindex property - RCU: fix MemoryRegion lifetime issues in PCI; document the rules; convert of AddressSpaceDispatch and RAMList - KVM: add kvm_exit reasons for aarch64 # gpg: Signature made Mon Feb 16 16:32:32 2015 GMT using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: (21 commits) Convert ram_list to RCU exec: convert ram_list to QLIST cosmetic changes preparing for the following patches exec: protect mru_block with RCU rcu: add g_free_rcu rcu: introduce RCU-enabled QLIST exec: RCUify AddressSpaceDispatch exec: make iotlb RCU-friendly exec: introduce cpu_reload_memory_map docs: clarify memory region lifecycle pci: split shpc_cleanup and shpc_free pcie: remove mmconfig memory leak and wrap mmconfig update with transaction memory: keep the owner of the AddressSpace alive until do_address_space_destroy rcu: run RCU callbacks under the BQL rcu: do not let RCU callbacks pile up indefinitely vhost-scsi: set the bootable value of channel/target/lun vhost-scsi: add a property for booting vhost-scsi: expose the TYPE_FW_PATH_PROVIDER interface vhost-scsi: add bootindex property qdev: support to get a device firmware path directly ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-02-23qapi-types: add C99 index names to arraysMichael S. Tsirkin1-4/+7
It's not easy to figure out how monitor translates strings: most QEMU code deals with translated indexes, these are translated using _lookup arrays, so you need to find the array name, and find the appropriate offset. This patch adds C99 indexes to lookup arrays, which makes it possible to find the correct key using simple grep, and see that the matching is correct at a glance. Example: Before: const char *MigrationCapability_lookup[] = { "xbzrle", "rdma-pin-all", "auto-converge", "zero-blocks", NULL, }; After: const char *MigrationCapability_lookup[] = { [MIGRATION_CAPABILITY_XBZRLE] = "xbzrle", [MIGRATION_CAPABILITY_RDMA_PIN_ALL] = "rdma-pin-all", [MIGRATION_CAPABILITY_AUTO_CONVERGE] = "auto-converge", [MIGRATION_CAPABILITY_ZERO_BLOCKS] = "zero-blocks", [MIGRATION_CAPABILITY_MAX] = NULL, }; Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2015-02-16exec: convert ram_list to QLISTMike Day1-4/+4
QLIST has RCU-friendly primitives, so switch to it. Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Mike Day <ncmike@ncultra.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-16qtest: Add scripts/qtest.pyFam Zheng1-0/+71
This adds scripts/qtest.py as a python library for qtest protocol. This is a skeleton with a basic "cmd" method to execute a command, reading and parsing of qtest output could be added later on demand. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 1422586186-9925-3-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-02-11kvm_stat: Add kvm_exit reasons for aarch64Wei Huang1-1/+41
This patch defines the list of kvm_exit reasons for aarch64. This list is based on the Exception Class (EC) field of HSR register. With this patch users can trace the execution of guest VMs better. A sample output from command "kvm_stat -1 -t" is shown as the following: <...> kvm_exit(WATCHPT_HYP) 0 0 kvm_exit(WFI) 9422 9361 NOTE: This patch requires TRACE_EVENT(kvm_exit) to include exit_reason field in TP_ARGS. A patch to upstream kernel has been submitted. Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-10Fix name error in migration stream analyzation scriptGreg Kurz1-1/+1
It fixes the following error: Traceback (most recent call last): File "./scripts/analyze-migration.py", line 584, in <module> dump.read(dump_memory = args.memory) File "./scripts/analyze-migration.py", line 528, in read self.sections[section_id].read() File "./scripts/analyze-migration.py", line 250, in read self.file.readvar(n_valid * HASH_PTE_SIZE_64) NameError: global name 'HASH_PTE_SIZE_64' is not defined Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2015-02-06Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' ↵Peter Maydell1-1/+9
into staging # gpg: Signature made Fri 06 Feb 2015 13:45:06 GMT using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/tracing-pull-request: trace: Print PID and time in stderr traces Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-02-06trace: Print PID and time in stderr tracesDr. David Alan Gilbert1-1/+9
When debugging migration it's useful to know the PID of each trace message so you can figure out if it came from the source or the destination. Printing the time makes it easy to do latency measurements or timings between trace points. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-id: 1421746875-9962-1-git-send-email-dgilbert@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-02-05Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20150205' ↵Peter Maydell2-0/+594
into staging migration/next for 20150205 # gpg: Signature made Thu 05 Feb 2015 16:17:08 GMT using RSA key ID 5872D723 # gpg: Can't check signature: public key not found * remotes/juanquintela/tags/migration/20150205: fix mc146818rtc wrong subsection name to avoid vmstate_subsection_load() fail Tracify migration/rdma.c Add migration stream analyzation script migration: Append JSON description of migration stream qemu-file: Add fast ftell code path QJSON: Add JSON writer Print errors in some of the early migration failure cases. Migration: Add lots of trace events savevm: Convert fprintf to error_report vmstate-static-checker: update whitelist Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-02-05Add migration stream analyzation scriptAlexander Graf1-0/+592
This patch adds a python tool to the scripts directory that can read a dumped migration stream if it contains the JSON description of the device states. I constructs a human readable JSON stream out of it. It's very simple to use: $ qemu-system-x86_64 (qemu) migrate "exec:cat > mig" $ ./scripts/analyze_migration.py -f mig Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-02-05vmstate-static-checker: update whitelistAmit Shah1-0/+2
Commit 22382bb96c8bd88370c1ff0cb28c3ee6bee79ed3 renamed the 'hw_cursor_x' and 'hw_cursor_y' fields in cirrus_vga. Update the static checker's whitelist to allow matching against the old and new names. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-02-05coverity: Model g_free() isn't necessarily free()Markus Armbruster1-8/+8
Memory allocated with GLib needs to be freed with GLib. Freeing it with free() instead of g_free() is a common error. Harmless when g_free() is a trivial wrapper around free(), which is commonly the case. But model the difference anyway. In a local scan, this flags four ALLOC_FREE_MISMATCH. Requires --enable ALLOC_FREE_MISMATCH, because the checker is still preview. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-05coverity: Model GLib string allocation partiallyMarkus Armbruster1-0/+89
Without a model, Coverity can't know that the result of g_strdup() needs to be fed to g_free(). One way to get such a model is to scan GLib, build a derived model file with cov-collect-models, and use that when scanning QEMU. Unfortunately, the Coverity Scan service we use doesn't support that. Thus, we're stuck with the other way: write a user model. Doing that for all of GLib is hardly practical. I'm doing it for the "String Utility Functions" we actually use that return dynamically allocated strings. In a local scan, this flags 20 additional RESOURCE_LEAKs. The ones I checked look genuine. It also loses a NULL_RETURNS about ppce500_init() using qemu_find_file() without error checking. I don't understand why. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-05coverity: Improve model for GLib memory allocationMarkus Armbruster1-35/+104
In current versions of GLib, g_new() may expand into g_malloc_n(). When it does, Coverity can't see the memory allocation, because we don't model g_malloc_n(). Similarly for g_new0(), g_renew(), g_try_new(), g_try_new0(), g_try_renew(). Model g_malloc_n(), g_malloc0_n(), g_realloc_n(). Model g_try_malloc_n(), g_try_malloc0_n(), g_try_realloc_n() by adding indeterminate out of memory conditions on top. To avoid undue duplication, replace the existing models for g_malloc() & friends by trivial wrappers around g_malloc_n() & friends. In a local scan, this flags four additional RESOURCE_LEAKs and one NULL_RETURNS. The NULL_RETURNS is a false positive: Coverity can now see that g_try_malloc(l1_sz * sizeof(uint64_t)) in qcow2_check_metadata_overlap() may return NULL, but is too stupid to recognize that a loop executing l1_sz times won't be entered then. Three out of the four RESOURCE_LEAKs appear genuine. The false positive is in ppce500_prep_device_tree(): the pointer dies, but a pointer to a struct member escapes, and we get the pointer back for freeing with container_of(). Too funky for Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
2015-01-26kvm_stat: Add RESET support for perf event ioctlWei Huang1-0/+5
While running kvm_stat using tracepoint on ARM64 hardware (e.g. "kvm_stat -1 -t"), the initial values of some kvm_userspace_exit counters were found to be very suspecious. For instance the tracing tool showed that S390_TSCH was called many times on ARM64 machine, which apparently was wrong. This patch adds RESET ioctl support for perf monitoring. Before calling ioctl to enable a perf event, this patch resets the counter first. With this patch, the init counter values become correct on ARM64 hardware. Example: ==== before patch ==== kvm_userspace_exit(S390_SIEIC) 1426 0 kvm_userspace_exit(S390_TSCH) 339 0 ==== after patch ==== kvm_userspace_exit(S390_SIEIC) 0 0 kvm_userspace_exit(S390_TSCH) 0 0 Signed-off-by: Wei Huang <wei@redhat.com>
2015-01-26kvm_stat: Print errno when syscall to perf_event_open() failsWei Huang1-1/+6
kvm_stat uses syscall() to call perf_event_open(). If this function call fails, the returned value is -1, which doesn't tell the details of such failure (i.e. ENOSYS or EINVAL). This patch retrieves errno and prints it when syscall() fails. The error message will look like "Exception: perf_event_open failed, errno = 38". Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-01-26kvm_stat: Update exit reasons to the latest defintionWei Huang1-0/+4
This patch updates the exit reasons for x86_vmx, x86_svm, and userspace to the latest definition. Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-01-26kvm_stat: Add aarch64 supportWei Huang1-0/+8
This patch enables aarch64 support for kvm_stat. The platform detection is based on OS uname. Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-01-20scripts/qapi-types.py: Add dummy member to empty structsPeter Maydell1-0/+8
Make sure that all generated C structs have at least one field; this avoids potential issues with attempting to malloc space for zero-length structs in C (g_malloc(sizeof struct) would return NULL). It also avoids an incompatibility with C++ (where an empty struct is size 1); that isn't important to us now but might be in future. Generated empty structures look like this: struct Abort { char qapi_dummy_field_for_empty_struct; }; This silences clang warnings like: ./qapi-types.h:3752:1: warning: empty struct has size 0 in C, size 1 in C++ [-Wextern-c-compat] struct Abort ^ Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1419359069-16611-1-git-send-email-peter.maydell@linaro.org
2015-01-13checkpatch: Brace handling on multi-line conditionMax Reitz1-2/+11
CODING_STYLE states the following about braces around blocks: > The opening brace is on the line that contains the control flow > statement that introduces the new block; [...] This is obviously impossible with multi-line conditions. Therefore, CODING_STYLE does not make any clear statement about where to put the opening brace after a multi-line condition. There is a reason to prefer to place the opening brace on an own line after such a condition while still placing it on the same line as the "control flow statement" if possible; that reason is that the last line of a multi-line condition is indented, in the case of "if", it is often indented by four spaces, just as much as the first statement in the block will be indented. This is hard to read as there is no clearly visible distinction between condition and block. Placing the opening brace on a separate line solves this issue. Also, there are cases where placing the opening brace on a separate line is the only viable option; if the previous line had nearly 80 characters and splitting it is not desirable, the opening brace is naturally placed on an own line. This patch fixes checkpatch.pl to not complain about braces on own lines if the condition introducing the block spanned more than one line, or if the previous line had 79 or 80 characters. Furthermore, the warning about not having braces around a block is fixed to mind braces not being on the last line of the condition. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-12-10get_maintainer.pl: Remove the --git-chief-penguins optionThomas Huth1-44/+1
Linus likely does not want to get e-mails about QEMU, so let's just remove this option. Suggested-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Reviewed-by: Don Slutz <dslutz@verizon.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
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>