aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2012-01-18qerror: add check-qerror.sh to verify alphabetical orderStefan Hajnoczi1-0/+22
We're supposed to keep qerror definitions and table entries in alphabetical order. In practice this is not checked. I haven't found a nice way to integrate this into the makefile yet but we can at least have this script which verifies that qerrors are in alphabetical order. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-01-12Fix qapi code generation fixAvi Kivity3-22/+14
The fixes to qapi code generation had multiple bugs: - the Null class used to drop output was missing some methods - in some scripts it was never instantiated, leading to a None return, which is missing even more methods - the --source and --header options were swapped Luckily, all those bugs were hidden by a makefile bug which caused the old behaviour (with the race) to be invoked. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-27Fix qapi code generation wrt parallel buildAvi Kivity3-9/+75
Make's multiple output syntax x.c x.h: x.template gen < x.template actually invokes the command once for x.c and once for x.h (with differing $@ in each invocation). During a parallel build, the two commands may be invoked in parallel; this opens up a race, where the second invocation trashes a file supposedly produced during the first, and now in use by a dependent command. The various qapi code generators are susceptible to this; fix by making them generate just one file per invocation. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-21scripts/analyse-9p-simpletrace.py: Add symbolic names for 9p operations.Harsh Prateek Bora1-2/+73
Currently, we just print the numerical value of 9p operation identifier in case of RERROR which is less meaningful for readability. Mapping 9p operation ids to symbolic names provides a better tracelog: RERROR (tag = 1 , id = TWALK , err = " No such file or directory ") RERROR (tag = 1 , id = TUNLINKAT , err = " Directory not empty ") This patch provides a dictionary of all possible 9p operation symbols mapped to their numerical identifiers which are likely to be used in future at various places in this script. Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-19vl.c: In qemu -h output, only print options for the arch we are running asMichael Ellerman1-0/+3
Only print options in the help output that are accepted by our arch. This is less confusing for users and also for other programs that consume the help output. The options affected are: -g and -prom-env only displayed on PPC or SPARC -win2k-hack, -rtc-td-hack, -no-fd-bootchk, -no-acpi, -no-hpet, -acpitable, -smbios only displayed on i386 -semihosting only displayed on ARM, M68K or XTENSA -old-param only displayed on ARM Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-15qapi: allow a 'gen' key to suppress code generationAnthony Liguori2-0/+2
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-14Fix spelling in comments, documentation and messagesStefan Weil1-2/+2
accidently->accidentally annother->another choosen->chosen consideres->considers decriptor->descriptor developement->development paramter->parameter preceed->precede preceeding->preceding priviledge->privilege propogation->propagation substraction->subtraction throught->through upto->up to usefull->useful Fix also grammar in posix-aio-compat.c Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-12-02fix spelling in scripts sub directoryDong Xu Wang1-1/+1
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-30qapi: fix guardname generationMichael Roth1-3/+4
Fix a bug in handling dotted paths, and exclude directory prefixes from generated guardnames to avoid odd/pseudo-random guardnames in generated headers. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-26checkpatch.pl: fix CAST detectionFlorian Mickler1-1/+1
We should only claim that something is a cast if we did not encouter a token before, that did set av_pending. This fixes the operator * in the line below to be detected as binary (vs unary). kmalloc(sizeof(struct alphatrack_ocmd) * true_size, GFP_KERNEL); Reported-by: Peter Chubb <nicta.com.au> Signed-off-by: Florian Mickler <florian@mickler.org> (cherry-picked from Linux kernel commit c023e4734c3e8801e0ecb5e81b831d42a374d861) Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-11-01checkpatch: remove rule on non-indented labelsPaolo Bonzini1-6/+0
There are 508 non-indented (non-default) labels, and 511 that are indented. So the rule is debatable at least. Actually, in the common case of labels at the outermost scope, there is really just one place where to put the label, so the rule is just wrong IMHO. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-10-31Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori1-1/+3
Conflicts: ui/spice-core.c
2011-10-31Merge remote-tracking branch 'qemu-kvm-tmp/uq/master' into stagingAnthony Liguori2-0/+704
2011-10-30hw/9pfs: Make VirtFS tracing work correctlyAneesh Kumar K.V1-82/+82
this patch fix multiple issues with VirtFS tracing. a) Add tracepoint to the correct code path. We handle error in complete_pdu b) Fix indentation in python script c) Fix variable naming issue in python script Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-27qapi-commands.py: Don't call the output marshal on errorLuiz Capitulino1-1/+3
Today we generate something like this: int qmp_marshal_input_query_foo(...) ... retval = qmp_query_foo(errp); qmp_marshal_output_query_foo(retval, ret, errp); ... However, if qmp_query_foo() fails 'retval' will probably be NULL, which can cause a segfault as not all visitors check if 'retval' is valid. This commit fixes that by changing the code generator to only call the output marshal if qmp_query_foo() succeeds, like this: retval = qmp_query_foo(errp); if (!error_is_set(errp)) { qmp_marshal_output_query_foo(retval, ret, errp); } Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2011-10-24kvm: Add top-like kvm statistics scriptJan Kiszka1-0/+480
Taken from original qemu-kvm/kvm/kvm_stat. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-24kvm: Add tool for querying VMX capabilitiesJan Kiszka1-0/+224
Taken from original qemu-kvm/kvm/scripts/vmxcap. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-10-15scripts: Simpletrace log analysis script for pretty-printing 9p log.Harsh Prateek Bora1-0/+142
This python script allows to pretty print 9p simpletrace logs and can be further enhanced to filter 9p logs based on command line arguments. Sample output: TGETATTR (tag = 1 , fid = 0 , request_mask = 0x7ff ) RGETATTR (tag = 1 , result_mask = 0x7ff , mode = 040777 , uid = 500 , gid = 500 ) TXATTRWALK (tag = 1 , fid = 0 , newfid = 1 , xattr name = 36832096 ) RXATTRWALK (tag = 1 , xattrsize = 18446744073709551555 ) TXATTRWALK (tag = 1 , fid = 0 , newfid = 1 , xattr name = 36744768 ) RXATTRWALK (tag = 1 , xattrsize = 18446744073709551555 ) TGETATTR (tag = 1 , fid = 1 , request_mask = 0x3fff ) RGETATTR (tag = 1 , result_mask = 0x17ff , mode = 040777 , uid = 500 , gid = 500 ) TWALK (tag = 1 , fid = 1 , newfid = 2 , nwnames = 1 ) RWALK (tag = 1 , nwnames = 1 , qids = 0x230aea0 ) Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-04qapi: Automatically generate a _MAX value for enumsLuiz Capitulino1-1/+4
It's the last value in the enum and is very useful for the C implementation. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2011-10-04qapi: Don't use c_var() on enum stringsLuiz Capitulino1-1/+1
Otherwise if we have something like 'foo-bar' in the schema, it will be generated as 'foo_bar' in the string lookup table. c_var() is good for C variables, but not for enum strings. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2011-10-04qapi: modify visitor code generation for list iterationMichael Roth1-2/+2
Modify logic such that we never assign values to the list head argument to progress through the list on subsequent iterations, instead rely only on having our return value passed back in as an argument on the next call. Also update QMP I/O visitors and test cases accordingly, and add a missing test case for QmpOutputVisitor. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2011-10-04qapi: generate qapi_free_* functions for *List typesMichael Roth1-0/+2
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2011-10-04qapi: fixup command generation for functions that return list typesAnthony Liguori1-8/+15
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2011-10-04qapi: add code generation support for middle modeAnthony Liguori3-15/+71
To get the ball rolling merging QAPI, this patch introduces a "middle mode" to the code generator. In middle mode, the code generator generates marshalling functions that are compatible with the current QMP server. We absolutely need to replace the current QMP server in order to support proper asynchronous commands but using a middle mode provides a middle-ground that lets us start converting commands in tree. Note that all of the commands have been converted already in my glib branch. Middle mode only exists until we finish merging them from my branch into the main tree. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2011-09-17trace: allow PRI*64 at beginning and ending of format stringStefan Hajnoczi1-7/+13
The tracetool parser only picks up PRI*64 and other format string macros when enclosed between double quoted strings. Lift this restriction by extracting everything after the closing ')' as the format string: cpu_set_apic_base(uint64_t val) "%016"PRIx64 ^^ ^^ One trick here: it turns out that backslashes in the format string like "\n" were being interpreted by echo(1). Fix this by using the POSIX printf(1) command instead. Although it normally does not make sense to include backslashes in trace event format strings, an injected newline causes tracetool to emit a broken header file and I want to eliminate cases where broken output is emitted, even if the input was bad. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-01simpletrace: fix process() argument countStefan Hajnoczi1-2/+2
The simpletrace.process() function invokes analyzer methods with the wrong number of arguments if a timestamp should be included. This patch fixes the issue so that trace analysis scripts can make use of timestamps. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-09-01trace: [stderr] add support for dynamically enabling/disabling eventsLluís1-5/+28
Uses the generic interface provided in "trace/control.h" in order to provide a programmatic interface as well as command line and monitor controls. Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01trace: [simple] disable all trace points by defaultLluís1-7/+2
Note that this refers to the backend-specific state (whether the output must be generated), not the event "disabled" property (which always uses the "nop" backend). Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01trace: always use the "nop" backend on events with the "disable" keywordLluís1-13/+2
Any event with the keyword/property "disable" generates an empty trace event using the "nop" backend, regardless of the current backend. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01trace: generalize the "property" concept in the trace-events fileLluís1-40/+33
This adds/modifies the following functions: * get_name: Get _only_ the event name * has_property: Return whether an event has a property (keyword before the event name) Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-09-01trace: move backend-specific code into the trace/ directoryLluís1-1/+1
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
2011-08-27checkpatch: fix braces {} handlingPavel Borzenkov1-1/+1
checkpatch.pl doesn't report warning for if/else statements with missing 'else' braces: if (something) { foo; } else bar; The patch has been tested using the last 100 commits. Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-12qapi: fix build issue due to missing newline in generated headerMichael Roth1-1/+1
Fixes a build issue on RHEL5, and potentially other distros, where gcc will generate an error due to us not writing a trailing "\n" when generating *qmp-commands.h Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-21qapi: add qapi-commands.py code generatorMichael Roth1-0/+385
This is the code generator for qapi command marshaling/dispatch. Currently only generators for synchronous qapi/qmp functions are supported. This script generates the following files: $(prefix)qmp-marshal.c: command marshal/dispatch functions for each QMP command defined in the schema. Functions generated by qapi-visit.py are used to convert qobjects recieved from the wire into function parameters, and uses the same visiter functions to convert native C return values to qobjects from transmission back over the wire. $(prefix)qmp-commands.h: Function prototypes for the QMP commands specified in the schema. $(prefix) is used in the same manner as with qapi-types.py Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
2011-07-21qapi: add qapi-visit.py code generatorMichael Roth1-0/+246
This is the code generator for qapi visiter functions used to marshal/unmarshal/dealloc qapi types. It generates the following 2 files: $(prefix)qapi-visit.c: visiter function for a particular c type, used to automagically convert qobjects into the corresponding C type and vice-versa, and well as for deallocation memory for an existing C type $(prefix)qapi-visit.h: declarations for previously mentioned visiter functions $(prefix) is used as decribed for qapi-types.py Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
2011-07-21qapi: add qapi-types.py code generatorMichael Roth1-0/+270
This is the code generator for qapi types. It will generation the following files: $(prefix)qapi-types.h - C types corresponding to types defined in the schema you pass in $(prefix)qapi-types.c - Cleanup functions for the above C types The $(prefix) is used to as a namespace to keep the generated code from one schema/code-generation separated from others so code and be generated from multiple schemas with clobbering previously created code. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
2011-07-21qapi: add qapi.py helper librariesMichael Roth1-0/+203
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
2011-07-21qapi: add ordereddict.py helper libraryMichael Roth1-0/+127
We need this to parse dictionaries with schema ordering intact so that C prototypes can be generated deterministically. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
2011-07-20checkpatch: Fix bracing false positives on #ifBlue Swirl1-0/+1
789f88d0b21fedfd4251d56bb7a9fbfbda7a4ac7 only fixed #else, fix also #if. Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-17checkpatch: don't error out on },{ linesAlexander Graf1-1/+3
When having code like this: static PCIDeviceInfo piix_ide_info[] = { { .qdev.name = "piix3-ide", .qdev.size = sizeof(PCIIDEState), .qdev.no_user = 1, .no_hotplug = 1, .init = pci_piix_ide_initfn, .vendor_id = PCI_VENDOR_ID_INTEL, .device_id = PCI_DEVICE_ID_INTEL_82371SB_1, .class_id = PCI_CLASS_STORAGE_IDE, },{ .qdev.name = "piix4-ide", .qdev.size = sizeof(PCIIDEState), .qdev.no_user = 1, .no_hotplug = 1, .init = pci_piix_ide_initfn, .vendor_id = PCI_VENDOR_ID_INTEL, .device_id = PCI_DEVICE_ID_INTEL_82371AB, .class_id = PCI_CLASS_STORAGE_IDE, },{ /* end of list */ } }; checkpatch currently errors out, claiming that spaces need to follow commas. However, this particular style of defining structs is pretty common in qemu code and very readable. So let's declare it as supported for the above case. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-22Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori1-0/+55
2011-06-20Add kernel header update scriptJan Kiszka1-0/+55
This helper pulls the required kernel headers for KVM and vhost into a specified directory. The update is triggered via scripts/update-linux-headers.sh LINUX_PATH and will place the output under linux-headers/linux and linux-headers/asm-*. It also imports the COPYING to care for headers without an explicit license. CC: Alexander Graf <agraf@suse.de> CC: Christoph Hellwig <hch@lst.de> CC: Peter Maydell <peter.maydell@linaro.org> CC: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-06-16get_maintainer: update to match qemu treeMichael S. Tsirkin1-22/+12
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-06-15get_maintainer.pl: copy utility from LinuxMichael S. Tsirkin1-0/+2159
Our MAINTAINERS file format matches Linux so get the utility to parse it from there. Updated as of linux 3.0-rc3 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-20s390x: s390x-linux-user supportUlrich Hecht1-1/+3
This patch adds support for running s390x binaries in the linux-user emulation code. Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-04-26trace: [ust] fix generation of 'trace.c' on events without argsLluís1-3/+4
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-26tracetool: allow ) in trace output stringPaolo Bonzini1-1/+1
Be greedy in matching the trailing "\)*" pattern. Otherwise, all the text in the trace string up to the last closed parenthesis is taken as part of the prototype. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-04-18PXE: Refresh all PXE ROMs from the ipxe submoduleAlex Williamson1-0/+99
Add script to make this easy to repeat later. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2011-03-07simpletrace: Thread-safe tracingStefan Hajnoczi1-1/+2
Trace events outside the global mutex cannot be used with the simple trace backend since it is not thread-safe. There is no check to prevent them being enabled so people sometimes learn this the hard way. This patch restructures the simple trace backend with a ring buffer suitable for multiple concurrent writers. A writeout thread empties the trace buffer when threshold fill levels are reached. Should the writeout thread be unable to keep up with trace generation, records will simply be dropped. Each time events are dropped a special record is written to the trace file indicating how many events were dropped. The event ID is 0xfffffffffffffffe and its signature is dropped(uint32_t count). Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-03-06tracetool: Add optional argument to specify dtrace probe namesJes Sorensen1-6/+13
Optional feature allowing a user to generate the probe list to match the name of the binary, in case they wish to install qemu under a different name than qemu-{system,user},<arch> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Stefan Hajnoczi <stefaha@linux.vnet.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>