aboutsummaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2020-09-30checkpatch: Detect '%#' or '%0#' in printf-style format stringsDov Murik1-2/+8
According to the coding style document, we should use literal '0x' prefix instead of printf's '#' flag (which appears as '%#' or '%0#' in the format string). Add a checkpatch rule to enforce that. Note that checkpatch already had a similar rule for trace-events files. Example usage: $ scripts/checkpatch.pl --file chardev/baum.c ... ERROR: Don't use '#' flag of printf format ('%#') in format strings, use '0x' prefix instead #366: FILE: chardev/baum.c:366: + DPRINTF("Broken packet %#2x, tossing\n", req); \ ... ERROR: Don't use '#' flag of printf format ('%#') in format strings, use '0x' prefix instead #472: FILE: chardev/baum.c:472: + DPRINTF("unrecognized request %0#2x\n", req); ... Signed-off-by: Dov Murik <dovmurik@linux.vnet.ibm.com> Message-Id: <20200914172623.72955-1-dovmurik@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2020-09-30checkpatch: avoid error on cover letter filesStefano Garzarella1-1/+1
Running checkpatch on a directory that contains a cover letter reports this error: Checking /tmp/tmpbnngauy3/0000-cover-letter.patch... ERROR: Does not appear to be a unified-diff format patch total: 1 errors, 0 warnings, 0 lines checked Let's skip cover letter as it is already done in the Linux kernel commits 06330fc40e3f ("checkpatch: avoid NOT_UNIFIED_DIFF errors on cover-letter.patch files") and a08ffbef4ab7 ("checkpatch: fix ignoring cover-letter logic"). Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Message-Id: <20200917170212.92672-1-sgarzare@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-30mtest2make: add support for introspected test dependenciesPaolo Bonzini1-4/+15
Right now all "make check" targets depend blindly on "all". If Meson is 0.56.0 or newer, we can use the correct dependencies using the new "depends" entry in "meson introspect --tests". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-30ninjatool: rebuild multi-output targets if outputs are missingPaolo Bonzini1-0/+3
The "stamp file trick" used to group targets of a single multi-output rule prevents the user from deleting one such target in order to force its rebuild. Doing so will not touch the stamp file, and therefore only the dummy ":" command will be executed. With this patch, ninjatool writes rules that force-rebuild the stamp file if any of its outputs are missing. Rebuilding the missing target therefore causes the stamp file to be rebuilt too. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-29Remove texinfo dependency from docker and CI configsPeter Maydell1-1/+0
We don't need texinfo to build the docs any more, so we can drop that dependency from our docker and other CI configs. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200925162316.21205-22-peter.maydell@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2020-09-29Remove Texinfo related line from git.orderfilePeter Maydell1-1/+0
We don't use Texinfo any more; we can remove the references to the .texi source file from our git.orderfile. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200925162316.21205-20-peter.maydell@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2020-09-29scripts/texi2pod: Delete unused scriptPeter Maydell2-537/+1
We no longer need the texi2pod script, so we can delete it, and the special-casing it had in the checkpatch script. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200925162316.21205-19-peter.maydell@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2020-09-29scripts/qapi: Remove texinfo generation supportPeter Maydell3-311/+0
We no longer use the generated texinfo format documentation, so delete the code that generates it, and the test case for the generation. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200925162316.21205-17-peter.maydell@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2020-09-29scripts/qapi/parser.py: improve doc comment indent handlingPeter Maydell1-19/+74
Make the handling of indentation in doc comments more sophisticated, so that when we see a section like: Notes: some text some more text indented line 3 we save it for the doc-comment processing code as: some text some more text indented line 3 and when we see a section with the heading on its own line: Notes: some text some more text indented text we also accept that and save it in the same form. If we detect that the comment document text is not indented as much as we expect it to be, we throw a parse error. (We don't complain about over-indented sections, because for rST this can be legitimate markup.) The golden reference for the doc comment text is updated to remove the two 'wrong' indents; these now form a test case that we correctly stripped leading whitespace from an indented multi-line argument definition. We update the documentation in docs/devel/qapi-code-gen.txt to describe the new indentation rules. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200925162316.21205-6-peter.maydell@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Whitespace between sentences tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2020-09-29scripts/qapi: Move doc-comment whitespace stripping to doc.pyPeter Maydell2-8/+5
As we accumulate lines from doc comments when parsing the JSON, the QAPIDoc class generally strips leading and trailing whitespace using line.strip() when it calls _append_freeform(). This is fine for Texinfo, but for rST leading whitespace is significant. We'd like to move to having the text in doc comments be rST format rather than a custom syntax, so move the removal of leading whitespace from the QAPIDoc class to the texinfo-specific processing code in texi_format() in qapi/doc.py. (Trailing whitespace will always be stripped by the rstrip() in Section::append regardless.) In a followup commit we will make the whitespace in the lines of doc comment sections more consistently follow the input source. There is no change to the generated .texi files before and after this commit. Because the qapi-schema test checks the exact values of the documentation comments against a reference, we need to update that reference to match the new whitespace. In the first four places this is now correctly checking that we did put in the amount of whitespace to pass a rST-formatted list to the backend; in the last two places the extra whitespace is 'wrong' and will go away again in the following commit. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200925162316.21205-5-peter.maydell@linaro.org> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2020-09-23qemu/atomic.h: rename atomic_ to qatomic_Stefan Hajnoczi1-1/+1
clang's C11 atomic_fetch_*() functions only take a C11 atomic type pointer argument. QEMU uses direct types (int, etc) and this causes a compiler error when a QEMU code calls these functions in a source file that also included <stdatomic.h> via a system header file: $ CC=clang CXX=clang++ ./configure ... && make ../util/async.c:79:17: error: address argument to atomic operation must be a pointer to _Atomic type ('unsigned int *' invalid) Avoid using atomic_*() names in QEMU's atomic.h since that namespace is used by <stdatomic.h>. Prefix QEMU's APIs with 'q' so that atomic.h and <stdatomic.h> can co-exist. I checked /usr/include on my machine and searched GitHub for existing "qatomic_" users but there seem to be none. This patch was generated using: $ git grep -h -o '\<atomic\(64\)\?_[a-z0-9_]\+' include/qemu/atomic.h | \ sort -u >/tmp/changed_identifiers $ for identifier in $(</tmp/changed_identifiers); do sed -i "s%\<$identifier\>%q$identifier%g" \ $(git grep -I -l "\<$identifier\>") done I manually fixed line-wrap issues and misaligned rST tables. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200923105646.47864-1-stefanha@redhat.com>
2020-09-22Merge remote-tracking branch ↵Peter Maydell6-7/+8
'remotes/vivier2/tags/trivial-branch-for-5.2-pull-request' into staging Pull request trivial patches 20200919 # gpg: Signature made Sat 19 Sep 2020 19:43:35 BST # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/trivial-branch-for-5.2-pull-request: contrib/: fix some comment spelling errors qapi/: fix some comment spelling errors disas/: fix some comment spelling errors linux-user/: fix some comment spelling errors util/: fix some comment spelling errors scripts/: fix some comment spelling errors docs/: fix some comment spelling errors migration/: fix some comment spelling errors qemu/: fix some comment spelling errors scripts/git.orderfile: Display meson files along with buildsys ones hw/timer/hpet: Fix debug format strings hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw meson: remove empty else and duplicated gio deps manual: escape backslashes in "parsed-literal" blocks ui/spice-input: Remove superfluous forward declaration hw/ppc/ppc4xx_pci: Replace magic value by the PCI_NUM_PINS definition hw/gpio/max7310: Remove impossible check Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-21Merge remote-tracking branch ↵Peter Maydell6-245/+1057
'remotes/ehabkost/tags/machine-next-pull-request' into staging QOM queue, 2020-09-18 Fixes: * Error value corrections (Markus Armbruster) * Correct object_class_dynamic_cast_assert() documentation (Eduardo Habkost) * Ensure objects using QEMU_ALIGNED are properly aligned (Richard Henderson) QOM cleanups (Eduardo Habkost): * Rename some constants * Simplify parameters of OBJECT_DECLARE* macros * Additional DECLARE_*CHECKER* usage * Additional OBJECT_DECLARE_TYPE usage * Additional OBJECT_DECLARE_SIMPLE_TYPE usage # gpg: Signature made Fri 18 Sep 2020 21:45:29 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: Use OBJECT_DECLARE_SIMPLE_TYPE when possible Use OBJECT_DECLARE_TYPE when possible qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros qom: Remove ParentClassType argument from OBJECT_DECLARE_SIMPLE_TYPE scripts/codeconverter: Update to latest version target/s390x: Set instance_align on S390CPU TypeInfo target/riscv: Set instance_align on RISCVCPU TypeInfo target/ppc: Set instance_align on PowerPCCPU TypeInfo target/arm: Set instance_align on CPUARM TypeInfo qom: Allow objects to be allocated with increased alignment qom: Correct error values in two contracts qom: Clean up object_property_get_enum()'s error value qom: Correct object_class_dynamic_cast_assert() documentation sifive: Use DECLARE_*CHECKER* macros sifive: Move QOM typedefs and add missing includes sifive_u: Rename memmap enum constants sifive_e: Rename memmap enum constants Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-18scripts/codeconverter: Update to latest versionEduardo Habkost6-245/+1057
I'm not documenting every single change in the codeconverter script because most of that code will be deleted once we finish the QOM code conversion. This patch updates the script to the latest version that was used to perform changes in the QOM code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20200916182519.415636-2-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-18analyze-migration.py: fix read_migration_debug_json() return typeAlexey Kirillov1-1/+2
Since we use result of read_migration_debug_json() as JSON formatted string, we must provide proper type. Before Python 3.6 json.loads() method support only str typed input. Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru> Message-Id: <20200715152135.20287-1-lekiravi@yandex-team.ru> [ehabkost: added comment explaining why decode() is needed} Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-18scripts/simplebench: compare write request performanceAndrey Shinkevich1-0/+170
The script 'bench_write_req.py' allows comparing performances of write request for two qemu-img binary files. An example with (qemu-img binary 1) and without (qemu-img binary 2) the applied patch "qcow2: skip writing zero buffers to empty COW areas" (git commit ID: c8bb23cbdbe32f5) has the following results: SSD: ---------------- ------------------- ------------------- <qemu-img binary 1> <qemu-img binary 2> <cluster front> 0.10 +- 0.00 8.16 +- 0.65 <cluster middle> 0.10 +- 0.00 7.37 +- 1.10 <cross cluster> 7.40 +- 1.08 21.97 +- 4.19 <cluster 64K> 2.14 +- 0.94 8.48 +- 1.66 ---------------- ------------------- ------------------- HDD: ---------------- ------------------- ------------------- <qemu-img binary 1> <qemu-img binary 2> <cluster front> 2.30 +- 0.01 6.19 +- 0.06 <cluster middle> 2.20 +- 0.09 6.20 +- 0.06 <cross cluster> 8.32 +- 0.16 8.26 +- 0.14 <cluster 64K> 8.20 +- 0.05 6.26 +- 0.10 ---------------- ------------------- ------------------- Suggested-by: Denis V. Lunev <den@openvz.org> Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <1594741846-475697-1-git-send-email-andrey.shinkevich@virtuozzo.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-17scripts/: fix some comment spelling errorszhaolichang5-7/+7
I found that there are many spelling errors in the comments of qemu, so I used the spellcheck tool to check the spelling errors and finally found some spelling errors in the scripts folder. Signed-off-by: zhaolichang <zhaolichang@huawei.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200917075029.313-5-zhaolichang@huawei.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-16scripts/git.orderfile: Display meson files along with buildsys onesPhilippe Mathieu-Daudé1-0/+1
Since commit a56650518f5 ("configure: integrate Meson in the build system") we replaced many Makefile by Meson files. Adapt the git.orderfile script to display the new file at the same position. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Message-Id: <20200907161222.41915-1-philmd@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-14decodetree: Improve identifier matchingRichard Henderson1-16/+30
Only argument set members have to be C identifiers, everything else gets prefixed during conversion to C. Some places just checked the leading character, and some places matched a leading character plus a C identifier. Convert everything to match full identifiers, including the [&%@&] prefix, and drop the full C identifier requirement. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20200903192334.1603773-1-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-11Merge remote-tracking branch ↵Peter Maydell9-0/+2183
'remotes/ehabkost/tags/machine-next-pull-request' into staging QOM boilerplate cleanup Documentation build fix: * memory: Remove kernel-doc comment marker (Eduardo Habkost) QOM cleanups: * Rename QOM macros for consistency between TYPE_* and type checking constants (Eduardo Habkost) QOM new macros: * OBJECT_DECLARE_* and OBJECT_DEFINE_* macros (Daniel P. Berrangé) * DECLARE_*_CHECKER macros (Eduardo Habkost) Automated QOM boilerplate changes: * Automated changes to use DECLARE_*_CHECKER (Eduardo Habkost * Automated changes to use OBJECT_DECLARE* (Eduardo Habkost) # gpg: Signature made Thu 10 Sep 2020 19:17:49 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: (33 commits) virtio-vga: Use typedef name for instance_size vhost-user-vga: Use typedef name for instance_size xilinx_axienet: Use typedef name for instance_size lpc_ich9: Use typedef name for instance_size omap_intc: Use typedef name for instance_size xilinx_axidma: Use typedef name for instance_size tusb6010: Rename TUSB to TUSB6010 pc87312: Rename TYPE_PC87312_SUPERIO to TYPE_PC87312 vfio: Rename PCI_VFIO to VFIO_PCI usb: Rename USB_SERIAL_DEV to USB_SERIAL sabre: Rename SABRE_DEVICE to SABRE rs6000_mc: Rename RS6000MC_DEVICE to RS6000MC filter-rewriter: Rename FILTER_COLO_REWRITER to FILTER_REWRITER esp: Rename ESP_STATE to ESP ahci: Rename ICH_AHCI to ICH9_AHCI vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID vfio: Rename VFIO_AP_DEVICE_TYPE to TYPE_VFIO_AP_DEVICE dev-smartcard-reader: Rename CCID_DEV_NAME to TYPE_USB_CCID_DEV ap-device: Rename AP_DEVICE_TYPE to TYPE_AP_DEVICE gpex: Fix type checking function name ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-09scripts/cleanup-trace-events: Emit files in alphabetical orderMarkus Armbruster1-5/+8
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 20200806141334.3646302-3-armbru@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-09-09scripts/cleanup-trace-events: Fix for vcpu propertyMarkus Armbruster1-4/+6
Commit a44cf524f8 "scripts/cleanup-trace-events: Update for current practice" limited search to the input file's directory. That's wrong for events with the vcpu property, because these can only be defined in root directory. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 20200806141334.3646302-2-armbru@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-09-09scripts/tracetool: Use void pointer for vcpuRoman Bolshakov1-1/+1
dtrace on macOS complains that CPUState * is used for a few probes: dtrace: failed to compile script trace-dtrace-root.dtrace: line 130: syntax error near "CPUState" A comment in scripts/tracetool/__init__.py mentions that: We only want to allow standard C types or fixed sized integer types. We don't want QEMU specific types as we can't assume trace backends can resolve all the typedefs Fixes: 3d211d9f4dbee ("trace: Add 'vcpu' event property to trace guest vCPU") Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> Message-id: 20200717093517.73397-3-r.bolshakov@yadro.com Cc: Cameron Esfahani <dirty@apple.com> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-09-09scripts/tracetool: Fix dtrace generation for macOSRoman Bolshakov1-1/+14
dtrace USDT is fully supported since OS X 10.6. There are a few peculiarities compared to other dtrace flavors. 1. It doesn't accept empty files. 2. It doesn't recognize bool type but accepts C99 _Bool. 3. It converts int8_t * in probe points to char * in header files and introduces [-Wpointer-sign] warning. Cc: Cameron Esfahani <dirty@apple.com> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20200717093517.73397-2-r.bolshakov@yadro.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-09-08codeconverter: script for automating QOM code cleanupsEduardo Habkost9-0/+2183
This started as a simple script that scanned for regular expressions, but became more and more complex when exceptions to the rules were found. I don't know if this should be maintained in the QEMU source tree long term (maybe it can be reused for other code transformations that Coccinelle can't handle). In either case, this is included as part of the patch series to document how exactly the automated code transformations in the next patches were done. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20200831210740.126168-7-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-08Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-09-08' into ↵Peter Maydell1-7/+17
staging QAPI patches patches for 2020-09-08 # gpg: Signature made Tue 08 Sep 2020 07:06:52 BST # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2020-09-08: qapi/block-core.json: Fix nbd-server-start docs qapi: Fix indentation, again qapi/migration.json: Fix indentation qapi: Make section headings start a new doc comment block qapi: Reject section markup in definition documentation Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-08meson: Convert undefsym.sh to undefsym.pyYonggang Luo2-20/+49
Shell scripts are not easily invoked from the build process on MSYS, so convert undefsym.sh to a python script. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Message-Id: <20200902170054.810-3-luoyonggang@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08oss-fuzz: fix rpathAlexander Bulekov1-1/+1
Prior to this change, readelf -d build/out/qemu/qemu-fuzz-i386-target-virtio-net-slirp ... 0x000000000000000f (RPATH) Library rpath: ['$$ORIGIN/lib':$ORIGIN/migration:$ORIGIN/] As of 1a4db552d8 ("ninjatool: quote dollars in variables"), we don't need to manually double the dollars. Also, remove the single-quotes as they are copied into the rpath. After this change: 0x000000000000000f (RPATH) Library rpath: [$ORIGIN/lib:$ORIGIN/migration:$ORIGIN/] Signed-off-by: Alexander Bulekov <alxndr@bu.edu> Message-Id: <20200902142657.112879-3-alxndr@bu.edu> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08meson: compute config_all_devices directlyPaolo Bonzini1-3/+0
There is no need anymore to produce config-all-devices.mak, compute the resulting dictionary directly instead of going through grepy.sh. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08meson: convert the speed testsPaolo Bonzini1-1/+8
Use meson benchmark() for them, adjust mtest2make.py for that. A new target "make bench" can be used to run all benchmarks. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200828110734.1638685-14-marcandre.lureau@redhat.com> [Rewrite mtest2make part. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08ninjatool: use constant names for stamp filesPaolo Bonzini1-3/+5
Numbering files according to rules causes confusion, because CUSTOM_COMMAND3.stamp from a previous build might represent completely different targets after Makefile.ninja is regenerated. As a result, the new targets are not rebuilt and compilation fails. Use the targets to build a SHA1 hash; the chances for collision are one in 2^24 even with a 12-character prefix of the hash. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08mtest2make: unify tests that appear in multiple suitesPaolo Bonzini1-36/+38
Whenever a test appears in multiple suites, the rules generated by mtest2make are currently running it twice. Instead, after this patch we generate a phony target for each test and we have a generic "run-tests" target depend on all the tests that were chosen on the command line. Tests that appear in multiple suites will be added to the prerequisites just once. This has other advantages: it removes the handling of -k and it increases parallelism. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08mtest2make: hide output of successful testsPaolo Bonzini2-1/+36
The softfloat tests are quite noisy; before the Meson conversion they buffered the output in a file and emitted the output only if the test failed. Tweak mtest2make.py so that the courtesy is extended to all non-TAP tests. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08mtest2make: split working directory from test commandPaolo Bonzini1-8/+8
Pass the working directory and test command in separate macro arguments, so that we will be able to insert a test driver in the next patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08mtest2make: split environment from test commandPaolo Bonzini1-8/+9
Pass the environment and test command in separate macro arguments, so that we will be able to insert a test driver in the next patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-07qapi: Make section headings start a new doc comment blockMarkus Armbruster1-8/+13
Our current QAPI doc-comment markup allows section headers (introduced with a leading '=' or '==') anywhere in a free-form documentation comment. This works for Texinfo because the generator simply prints a Texinfo section command at that point in the output stream. For rST generation, since we're assembling a tree of docutils nodes, this is awkward because a new section implies starting a new section node at the top level of the tree and generating text into there. Make section headers start a new free-form documentation block, so the future rST document generator doesn't have to look at every line in free-form blocks and handle headings in odd places. This change makes no difference to the generated Texinfo. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200320091805.5585-3-armbru@redhat.com>
2020-09-07qapi: Reject section markup in definition documentationMarkus Armbruster1-0/+5
Section markup in definition documentation makes no sense and can produce invalid Texinfo. Reject. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200320091805.5585-2-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2020-09-03scripts/qmp/qom-fuse: Fix getattr(), read() for files in /Markus Armbruster1-2/+8
path, prop = "type".rsplit('/', 1) sets path to "", which doesn't work. Correct to "/". Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200723142738.1868568-4-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
2020-09-03scripts/qmp/qom-fuse: Port to current Python module fuseMarkus Armbruster1-46/+47
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200723142738.1868568-3-armbru@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
2020-09-03scripts/qmp/qom-fuse: Unbreak import of QEMUMonitorProtocolMarkus Armbruster1-2/+2
Commit c7b942d7f8 "scripts/qmp: Fix shebang and imports" messed with it for reasons I don't quite understand. I do understand how it fails now: it neglects to import sys. Fix that. It now fails because it expects an old version of module fuse. That's next. Fixes: c7b942d7f84ef54f266921bf7668d43f1f2c7c79 Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200723142738.1868568-2-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
2020-09-03qapi: enable use of g_autoptr with QAPI typesDaniel P. Berrangé1-0/+1
Currently QAPI generates a type and function for free'ing it: typedef struct QCryptoBlockCreateOptions QCryptoBlockCreateOptions; void qapi_free_QCryptoBlockCreateOptions(QCryptoBlockCreateOptions *obj); This is used in the traditional manner: QCryptoBlockCreateOptions *opts = NULL; opts = g_new0(QCryptoBlockCreateOptions, 1); ....do stuff with opts... qapi_free_QCryptoBlockCreateOptions(opts); Since bumping the min glib to 2.48, QEMU has incrementally adopted the use of g_auto/g_autoptr. This allows the compiler to run a function to free a variable when it goes out of scope, the benefit being the compiler can guarantee it is freed in all possible code ptahs. This benefit is applicable to QAPI types too, and given the seriously long method names for some qapi_free_XXXX() functions, is much less typing. This change thus makes the code generator emit: G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoBlockCreateOptions, qapi_free_QCryptoBlockCreateOptions) The above code example now becomes g_autoptr(QCryptoBlockCreateOptions) opts = NULL; opts = g_new0(QCryptoBlockCreateOptions, 1); ....do stuff with opts... Note, if the local pointer needs to live beyond the scope holding the variable, then g_steal_pointer can be used. This is useful to return the pointer to the caller in the success codepath, while letting it be freed in all error codepaths. return g_steal_pointer(&opts); The crypto/block.h header needs updating to avoid symbol clash now that the g_autoptr support is a standard QAPI feature. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200723153845.2934357-1-berrange@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2020-09-01meson: add NSIS buildingMarc-André Lureau1-0/+78
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200826110419.528931-9-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-01meson: install scripts/qemu-trace-stapMarc-André Lureau1-0/+3
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200826130622.553318-3-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-31scripts: Add u2f-setup-gen scriptCésar Belley1-0/+170
This patch adds the script used to generate setup directories, needed for the device u2f-emulated configuration in directory mode: python u2f-setup-gen.py $DIR qemu -usb -device u2f-emulated,dir=$DIR Signed-off-by: César Belley <cesar.belley@lse.epita.fr> Message-id: 20200826114209.28821-11-cesar.belley@lse.epita.fr Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-08-27ninjatool: Fixes E$$: in generated Makefile.ninjaYonggang Luo1-1/+1
Even though SIMPLE_PATH_RE is used with re.match (which anchors the match implictly to the beginning of the string) it also needs an end-of-string anchor in order to match the full path token. Otherwise, the match would succeed incorrectly for $ and : characters contained in the path, for example if the path starts with C:/ or E:/. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-27meson: fix relpath failure on Win32Yonggang Luo1-2/+9
On win32, os.path.relpath can raise an exception when computing for example C:/msys64/mingw64/x.exe relative to E:/path/qemu-build. Use try...except to avoid this, just using an absolute path in this case. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-27ninjatool: quote dollars in variablesPaolo Bonzini1-1/+2
Otherwise, dollars (such as in the special $ORIGIN rpath) are eaten by Make. Reported-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-27scripts/qemu-version.sh: Add missing space before ']'Thomas Huth1-1/+1
When configure has been run with --with-pkgversion=xyz, the shell complains about a missing ']' in this script. Fixes: 2c273f32d3 ("meson: generate qemu-version.h") Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21meson: replace create-config with meson configure_filePaolo Bonzini1-131/+0
Move the create-config logic to meson.build; create a configuration_data object and let meson handle the quoting and output. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-08-21rules.mak: drop unneeded macrosPaolo Bonzini1-3/+3
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>