aboutsummaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2017-07-04checkpatch: should not use signal except for SIG_DFL or SIG_IGNPaolo Bonzini1-0/+4
Using signal to establish a signal handler is not portable; on SysV systems, the signal handler would be reset to SIG_DFL after delivery, while BSD preserves the signal handler. Daniel Berrange reported that (to complicate matters further) the signal system call has SysV behavior, but glibc signal() actually calls the sigaction system call to provide BSD behavior. However, using signal() to set a signal's disposition to SIG_DFL or SIG_IGN is portable and is a relatively common occurrence in QEMU source code, so allow that. Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-06-20qapi: Remove visit_start_alternate() parameter promote_intMarc-André Lureau1-9/+3
Before the previous commit, parameter promote_int = true made visit_start_alternate() with an input visitor avoid QTYPE_QINT variants and create QTYPE_QFLOAT variants instead. This was used where QTYPE_QINT variants were invalid. The previous commit fused QTYPE_QINT with QTYPE_QFLOAT, rendering promote_int useless and unused. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20170607163635.17635-8-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-20qapi: merge QInt and QFloat in QNumMarc-André Lureau3-22/+20
We would like to use a same QObject type to represent numbers, whether they are int, uint, or floats. Getters will allow some compatibility between the various types if the number fits other representations. Add a few more tests while at it. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170607163635.17635-7-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [parse_stats_intervals() simplified a bit, comment in test_visitor_in_int_overflow() tidied up, suppress bogus warnings] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-06-12Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' ↵Peter Maydell1-1/+9
into staging # gpg: Signature made Wed 07 Jun 2017 19:55:32 BST # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/tracing-pull-request: simpletrace: Improve the error message if event is not declared Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-06-07coccinelle: fix typo in commentPhilippe Mathieu-Daudé1-1/+1
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-06-07simpletrace: Improve the error message if event is not declaredJose Ricardo Ziviani1-1/+9
Today, if we use a trace-event file which does not declare an event existing in the log file we'll get the following error: $ scripts/simpletrace.py trace-events trace-68508 Traceback (most recent call last): File "scripts/simpletrace.py", line 242, in <module> run(Formatter()) File "scripts/simpletrace.py", line 217, in run process(events, sys.argv[2], analyzer, read_header=read_header) File "scripts/simpletrace.py", line 192, in process for rec in read_trace_records(edict, log): File "scripts/simpletrace.py", line 107, in read_trace_records rec = read_record(edict, idtoname, fobj) File "scripts/simpletrace.py", line 71, in read_record return get_record(edict, idtoname, rechdr, fobj) File "scripts/simpletrace.py", line 45, in get_record event = edict[name] KeyError: 'qemu_mutex_locked' This patch improves this error by adding a hint instead of just that KeyError log: $ scripts/simpletrace.py trace-events trace-68508 'qemu_mutex_locked' event is logged but is not declared in the trace events file, try using trace-events-all instead. Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 1496075404-8845-1-git-send-email-joserz@linux.vnet.ibm.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-06-05scripts: Test script to look for -device crashesEduardo Habkost1-0/+624
Test code to check if we can crash QEMU using -device. It will test all accel/machine/device combinations by default, which may take a few hours (it's more than 90k test cases). There's a "-r" option that makes it test a random sample of combinations. The scripts contains a whitelist for: 1) known error messages that make QEMU exit cleanly; 2) known QEMU crashes. This is the behavior when the script finds a failure: * Known clean (exitcode=1) errors generate DEBUG messages (hidden by default) * Unknown clean (exitcode=1) errors will generate INFO messages (visible by default) * Known crashes generate error messages, but are not fatal (unless --strict mode is used) * Unknown crashes generate fatal error messages Having an updated whitelist of known clean errors is useful to make the script less verbose and run faster when in --quick mode, but the whitelist doesn't need to be always up to date. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170526181200.17227-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-06-05qemu.py: Add QEMUMachine.exitcode() methodEduardo Habkost1-0/+5
Allow the exit code of QEMU to be queried by scripts. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170526181200.17227-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-06-05qemu.py: Don't set _popen=None on error/shutdownEduardo Habkost1-5/+7
Keep the Popen object around to we can query its exit code later. To keep the existing 'self._popen is None' checks working, add a is_running() method, that will check if the process is still running. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170526181200.17227-2-ehabkost@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-05-31qapi: Reject alternates that can't work with keyval_parse()Markus Armbruster1-2/+17
Alternates are sum types like unions, but use the JSON type on the wire / QType in QObject instead of an explicit tag. That's why we require alternate members to have distinct QTypes. The recently introduced keyval_parse() (commit d454dbe) can only produce string scalars. The qobject_input_visitor_new_keyval() input visitor mostly hides the difference, so code using a QObject input visitor doesn't have to care whether its input was parsed from JSON or KEY=VALUE,... The difference leaks for alternates, as noted in commit 0ee9ae7: a non-string, non-enum scalar alternate value can't currently be expressed. In part, this is just our insufficiently sophisticated implementation. Consider alternate type 'GuestFileWhence'. It has an integer member and a 'QGASeek' member. The latter is an enumeration with values 'set', 'cur', 'end'. The meaning of b=set, b=cur, b=end, b=0, b=1 and so forth is perfectly obvious. However, our current implementation falls apart at run time for b=0, b=1, and so forth. Fixable, but not today; add a test case and a TODO comment. Now consider an alternate type with a string and an integer member. What's the meaning of a=42? Is it the string "42" or the integer 42? Whichever meaning you pick makes the other inexpressible. This isn't just an implementation problem, it's fundamental. Our current implementation will pick string. So far, we haven't needed such alternates. To make sure we stop and think before we add one that cannot sanely work with keyval_parse(), let's require alternate members to have sufficiently distinct representation in KEY=VALUE,... syntax: * A string member clashes with any other scalar member * An enumeration member clashes with bool members when it has value 'on' or 'off'. * An enumeration member clashes with numeric members when it has a value that starts with '-', '+', or a decimal digit. This is a rather lazy approximation of the actual number syntax accepted by the visitor. Note that enumeration values starting with '-' and '+' are rejected elsewhere already, but better safe than sorry. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1495471335-23707-5-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-05-30Merge remote-tracking branch 'armbru/tags/pull-qapi-2017-05-23' into stagingStefan Hajnoczi1-1/+1
QAPI patches for 2017-05-23 # gpg: Signature made Tue 23 May 2017 12:33:32 PM BST # gpg: using RSA key 0x3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * armbru/tags/pull-qapi-2017-05-23: qapi-schema: Remove obsolete note from ObjectTypeInfo block: Use QDict helpers for --force-share shutdown: Expose bool cause in SHUTDOWN and RESET events shutdown: Add source information to SHUTDOWN and RESET shutdown: Preserve shutdown cause through replay shutdown: Prepare for use of an enum in reset/shutdown_request shutdown: Simplify shutdown_signal sockets: Plug memory leak in socket_address_flatten() scripts/qmp/qom-set: fix the value argument passed to srv.command() Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-05-23scripts/qmp/qom-set: fix the value argument passed to srv.command()Greg Kurz1-1/+1
When invoking the script with -s, we end up passing a bogus value to QEMU: $ ./scripts/qmp/qom-set -s /var/tmp/qmp-sock-exp /machine.accel kvm {} $ ./scripts/qmp/qom-get -s /var/tmp/qmp-sock-exp /machine.accel /var/tmp/qmp-sock-exp This happens because sys.argv[2] isn't necessarily the command line argument that holds the value. It is sys.argv[4] when -s was also passed. Actually, the code already has a variable to handle that. This patch simply uses it. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <149373610338.5144.9635049015143453288.stgit@bahia.lan> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-19linux-headers: updateCornelia Huck1-1/+1
Update against Linux v4.12-rc1. Also include the new vfio_ccw.h header. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2017-05-10Merge remote-tracking branch 'mjt/tags/trivial-patches-fetch' into stagingStefan Hajnoczi9-10/+17
trivial patches for 2017-05-10 # gpg: Signature made Wed 10 May 2017 03:19:30 AM EDT # gpg: using RSA key 0x701B4F6B1A693E59 # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931 4B22 701B 4F6B 1A69 3E59 * mjt/tags/trivial-patches-fetch: (23 commits) tests: Remove redundant assignment MAINTAINERS: Update paths for AioContext implementation MAINTAINERS: Update paths for main loop jazz_led: fix bad snprintf tests: Ignore another built executable (test-hmp) scripts: Switch to more portable Perl shebang scripts/qemu-binfmt-conf.sh: Fix shell portability issue virtfs: allow a device id to be specified in the -virtfs option hw/core/generic-loader: Fix crash when running without CPU virtio-blk: Remove useless condition around g_free() qemu-doc: Fix broken URLs of amnhltm.zip and dosidle210.zip use _Static_assert in QEMU_BUILD_BUG_ON channel-file: fix wrong parameter comments block: Make 'replication_state' an enum util: Use g_malloc/g_free in envlist.c qga: fix compiler warnings (clang 5) device_tree: fix compiler warnings (clang 5) usb-ccid: make ccid_write_data_block() cope with null buffers tests: Ignore more test executables Add 'none' as type for drive's if option ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-05-10scripts: Switch to more portable Perl shebangKamil Rytarowski8-8/+15
The default NetBSD package manager is pkgsrc and it installs Perl along other third party programs under custom and configurable prefix. The default prefix for binary prebuilt packages is /usr/pkg, and the Perl executable lands in /usr/pkg/bin/perl. This change switches "/usr/bin/perl" to "/usr/bin/env perl" as it's the most portable solution that should work for almost everybody. Perl's executable is detected automatically. This change switches -w option passed to the executable with more modern "use warnings;" approach. There is no functional change to the default behavior. Signed-off-by: Kamil Rytarowski <n54@gmx.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-05-10scripts/qemu-binfmt-conf.sh: Fix shell portability issueKamil Rytarowski1-2/+2
Appease pkgsrc and use portable shell variable comparison. This switches "==" to "=". It should not be a functional change. Signed-off-by: Kamil Rytarowski <n54@gmx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-05-09Merge remote-tracking branch 'armbru/tags/pull-qapi-2017-05-04-v3' into stagingStefan Hajnoczi2-5/+74
QAPI patches for 2017-05-04 # gpg: Signature made Tue 09 May 2017 03:16:12 AM EDT # gpg: using RSA key 0x3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * armbru/tags/pull-qapi-2017-05-04-v3: (28 commits) qmp-shell: improve help qmp-shell: don't show version greeting if unavailable qmp-shell: Cope with query-commands error qmp-shell: add -N option to skip negotiate qmp-shell: add persistent command history qobject-input-visitor: Catch misuse of end_struct vs. end_list qapi: Document intended use of @name within alternate visits qobject-input-visitor: Document full_name_nth() qmp: Improve QMP dispatch error messages sockets: Delete unused helper socket_address_crumple() sockets: Limit SocketAddressLegacy to external interfaces sockets: Rename SocketAddressFlat to SocketAddress sockets: Rename SocketAddress to SocketAddressLegacy qapi: New QAPI_CLONE_MEMBERS() sockets: Prepare inet_parse() for flattened SocketAddress sockets: Prepare vsock_parse() for flattened SocketAddress test-qga: Actually test 0xff sync bytes fdc-test: Avoid deprecated 'change' command QemuOpts: Simplify qemu_opts_to_qdict() block: Simplify bdrv_append_temp_snapshot() logic ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-05-09qmp-shell: improve helpMarc-André Lureau1-1/+5
Describe the arguments & fix the tool name. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170504125432.21653-5-marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-09qmp-shell: don't show version greeting if unavailableMarc-André Lureau1-0/+3
qemu-ga doesn't have greeting. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170504125432.21653-4-marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-09qmp-shell: Cope with query-commands errorMarc-André Lureau1-1/+4
qemu-ga doesn't implement it. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170504125432.21653-3-marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Commit message tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-09qmp-shell: add -N option to skip negotiateMarc-André Lureau1-4/+7
qemu-ga doesn't have negotiate phase. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170504125432.21653-2-marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-09qmp-shell: add persistent command historyJohn Snow1-0/+21
Use the existing readline history function we are utilizing to provide persistent command history across instances of qmp-shell. This assists entering debug commands across sessions that may be interrupted by QEMU sessions terminating, where the qmp-shell has to be relaunched. Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20170427223628.20893-1-jsnow@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com> Tested-by: Kashyap Chamarthy <kchamart@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-08qobject: Add helper macros for common scalar insertionsEric Blake1-0/+22
Rather than making lots of callers wrap a scalar in a QInt, QString, or QBool, provide helper macros that do the wrapping automatically. Update the Coccinelle script to make mass conversions easy, although the conversion itself will be done as a separate patches to ease review and backport efforts. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20170427215821.19397-6-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-08coccinelle: Add script to remove useless QObject castsEric Blake1-0/+13
We have macros in place to make it less verbose to add a subtype of QObject to both QDict and QList. While we have made cleanups like this in the past (see commit fcfcd8ffc, for example), having it be automated by Coccinelle makes it easier to maintain. The script is separate from the cleanups, for ease of review and backporting. A later patch will then add further possible cleanups. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20170427215821.19397-4-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-08Merge remote-tracking branch 'bonzini/tags/for-upstream' into stagingStefan Hajnoczi2-16/+58
A large set of small patches. I have not included yet vhost-user-scsi, but it'll come in the next pull request. * use GDB XML register description for x86 * use _Static_assert in QEMU_BUILD_BUG_ON * add "R:" to MAINTAINERS and get_maintainers * checkpatch improvements * dump threading fixes * first part of vhost-user-scsi support * QemuMutex tracing * vmw_pvscsi and megasas fixes * sgabios module update * use Rev3 (ACPI 2.0) FADT * deprecate -hdachs * improve -accel documentation * hax fix * qemu-char GSource bugfix # gpg: Signature made Fri 05 May 2017 06:10:40 AM EDT # gpg: using RSA key 0xBFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # 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 * bonzini/tags/for-upstream: (21 commits) vhost-scsi: create a vhost-scsi-common abstraction libvhost-user: replace vasprintf() to fix build get_maintainer: add subsystem to reviewer output get_maintainer: --r (list reviewer) is on by default get_maintainer: it's '--pattern-depth', not '-pattern-depth' get_maintainer: Teach get_maintainer.pl about the new "R:" tag MAINTAINERS: Add "R:" tag for self-appointed reviewers Fix the -accel parameter and the documentation for 'hax' dump: Acquire BQL around vm_start() in dump thread hax: Fix memory mapping de-duplication logic checkpatch: Disallow glib asserts in main code trace: add qemu mutex lock and unlock trace events vmw_pvscsi: check message ring page count at initialisation sgabios: update for "fix wrong video attrs for int 10h,ah==13h" scsi: avoid an off-by-one error in megasas_mmio_write vl: deprecate the "-hdachs" option use _Static_assert in QEMU_BUILD_BUG_ON target/i386: Add GDB XML register description support char: Fix removing wrong GSource that be found by fd_in_tag hw/i386: Build-time assertion on pc/q35 reset register being identical. ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-05-08trace: disallow more than 10 arguments per trace eventDaniel P. Berrange1-0/+4
The UST trace backend can only cope with upto 10 arguments. To ensure we don't exceed the limit when UST is not compiled in, disallow more than 10 arguments upfront. This prevents the case where: commit 0fc8aec7de64f2bf83a274a2a38b938ce03425d2 Author: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> Date: Tue Apr 18 10:20:20 2017 +0800 COLO-compare: Optimize tcp compare trace event Optimize two trace events as one, adjust print format make it easy to read. rename trace_colo_compare_pkt_info_src/dst to trace_colo_compare_tcp_info. regressed the fix done in commit 2dfe5113b11ce0ddb08176ebb54ab7ac4104b413 Author: Alex Bennée <alex.bennee@linaro.org> Date: Fri Oct 28 14:25:59 2016 +0100 net: split colo_compare_pkt_info into two trace events It seems there is a limit to the number of arguments a UST trace event can take and at 11 the previous trace command broke the build. Split the trace into a src pkt and dst pkt trace to fix this. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20161028132559.8324-1-alex.bennee@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Now we get an immediate fail even when UST is disabled: GEN net/trace.h Traceback (most recent call last): File "/home/berrange/src/virt/qemu/scripts/tracetool.py", line 154, in <module> main(sys.argv) File "/home/berrange/src/virt/qemu/scripts/tracetool.py", line 145, in main events.extend(tracetool.read_events(fh)) File "/home/berrange/src/virt/qemu/scripts/tracetool/__init__.py", line 307, in read_events event = Event.build(line) File "/home/berrange/src/virt/qemu/scripts/tracetool/__init__.py", line 244, in build event = Event(name, props, fmt, args) File "/home/berrange/src/virt/qemu/scripts/tracetool/__init__.py", line 196, in __init__ "argument count" % name) ValueError: Event 'colo_compare_tcp_info' has more than maximum permitted argument count Makefile:96: recipe for target 'net/trace.h-timestamp' failed Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20170426153900.21066-1-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-05-05get_maintainer: add subsystem to reviewer outputJoe Perches1-15/+16
Reviewer output currently does not include the subsystem that matched. Add it. Miscellanea: o Add a get_subsystem_name routine to centralize this Cherry picked from Linux commit 2a7cb1dc82fc2a52e747b4c496c13f6575fb1790. Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-05-05get_maintainer: --r (list reviewer) is on by defaultBrian Norris1-1/+1
We don't consistenly document the default value next to the option listing, but we do have a list of defaults here, so let's keep it up to date. Cherry picked from Linux commit 4f07510df2e8c47fd65b8ffaaf6c5d334d59d598. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-05-05get_maintainer: it's '--pattern-depth', not '-pattern-depth'Brian Norris1-1/+1
Though it appears that Perl's GetOptions will take either, the latter is not documented in the options listing. Cherry picked from Linux commit cc7ff0ef6eca3deeea4a424ca47a67c8450d5424. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-05-05get_maintainer: Teach get_maintainer.pl about the new "R:" tagJoe Perches1-1/+21
We can now designate reviewers in the MAINTAINERS file with the new "R:" tag, so this commit teaches get_maintainers.pl to add their email addresses. Cherry picked from Linux commit c1c3f2c906e35bcb6e4cdf5b8e077660fead14fe, with fixes to avoid \C as in QEMU commit ba10f729f1 ("get_maintainer.pl: \C is deprecated", 2015-09-25). Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-05-05checkpatch: Disallow glib asserts in main codeDr. David Alan Gilbert1-0/+21
Glib commit a6a875068779 (from 2013) made many of the glib assert macros non-fatal if a flag is set. This causes two problems: a) Compilers moan that your code is unsafe even though you've put an assert in before the point of use. b) Someone evil could, in a library, call g_test_set_nonfatal_assertions() and cause our assertions in important places not to fail and potentially allow memory overruns. Ban most of the glib assertion functions (basically everything except g_assert and g_assert_not_reached) except in tests/ This makes checkpatch gives an error such as: ERROR: Use g_assert or g_assert_not_reached #77: FILE: vl.c:4725: + g_assert_cmpstr("Chocolate", >, "Cheese"); Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20170427165526.19836-1-dgilbert@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-04-21simpletrace: document Analyzer method signaturesStefan Hajnoczi1-1/+22
Users can inherit from the simpletrace.Analyzer class and receive callbacks when events of interest occur in a trace file. The method signature is a little magic because the timestamp and pid arguments are optional. Document this. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20170411095654.18383-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-04-07scripts/qemugdb/mtree.py: fix up mtree dumpAlex Bennée1-2/+10
Since QEMU has been able to build with native Int128 support this was broken as it attempts to fish values out of the non-existent structure. Also the alias print was trying to make a %x out of gdb.ValueType directly which didn't seem to work. Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2017-03-28trace: fix tcg tracing build breakageStefan Hajnoczi2-0/+2
Commit 0ab8ed18a6fe98bfc82705b0f041fbf2a8ca5b60 ("trace: switch to modular code generation for sub-directories") forgot to convert "tcg" trace events to the modular code generation approach where each sub-directory has its own trace-events file. This patch fixes compilation for "tcg" trace events. Currently they are only used in the root ./trace-events file. "tcg" trace events can only be used in the root ./trace-events file for the time being. Reported-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20170327131718.18268-1-stefanha@redhat.com Suggested-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-03-21qapi2texi: Fix translation of *strong* and _emphasized_Markus Armbruster1-2/+2
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1490015515-25851-7-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-21qapi: Drop unused QAPIDoc member optionalMarkus Armbruster1-1/+0
Unused since commit aa964b7 "qapi2texi: Convert to QAPISchemaVisitor" Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1490015515-25851-4-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-21qapi2texi: Fix to actually fail when 'doc-required' is falseMarkus Armbruster1-0/+1
Messed up in commit bc52d03. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1490015515-25851-3-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-16qapi: Fix a misleading parser error messageMarkus Armbruster1-1/+2
When choking on a token where an expression is expected, we report 'Expected "{", "[" or string'. Close, but no cigar. Fix it to Expected '"{", "[", string, boolean or "null"'. Missed in commit e53188a. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-48-git-send-email-armbru@redhat.com>
2017-03-16qapi: Make pylint a bit happierMarkus Armbruster3-8/+7
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-47-git-send-email-armbru@redhat.com>
2017-03-16qapi: Drop unused .check_clash() parameter schemaMarkus Armbruster1-5/+5
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-46-git-send-email-armbru@redhat.com>
2017-03-16qapi: union_types is a list used like a dict, make it oneMarkus Armbruster1-16/+3
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-45-git-send-email-armbru@redhat.com>
2017-03-16qapi: struct_types is a list used like a dict, make it oneMarkus Armbruster1-17/+4
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-44-git-send-email-armbru@redhat.com>
2017-03-16qapi: enum_types is a list used like a dict, make it oneMarkus Armbruster1-23/+6
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-43-git-send-email-armbru@redhat.com>
2017-03-16qapi: Factor add_name() calls out of the meta conditionalMarkus Armbruster1-15/+9
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-42-git-send-email-armbru@redhat.com>
2017-03-16qapi: Simplify what gets stored in enum_typesMarkus Armbruster1-14/+15
Don't invent a new dictionary structure just for enum_types, simply store the defining expression, like we do for struct_types and union_types. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-41-git-send-email-armbru@redhat.com>
2017-03-16qapi: Drop unused variable eventsMarkus Armbruster1-3/+0
Missed in commit e98859a Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-40-git-send-email-armbru@redhat.com>
2017-03-16qapi: Eliminate check_docs() and drop QAPIDoc.exprMarkus Armbruster1-17/+10
Move what's left in check_docs() to check_expr(). Delegate the actual checking to new QAPIDoc.check_expr(). QAPIDoc.expr is now unused; drop it. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-39-git-send-email-armbru@redhat.com>
2017-03-16qapi: Fix detection of bogus member documentationMarkus Armbruster1-25/+13
check_definition_doc() checks for member documentation without a matching member. It laboriously second-guesses what members QAPISchema._def_exprs() will create. That's a stupid game. Move the check into QAPISchema.check(), where the members are known. Delegate the actual checking to new QAPIDoc.check(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-38-git-send-email-armbru@redhat.com>
2017-03-16qapi: Move empty doc section checking to doc parserMarkus Armbruster1-6/+14
Results in a more precise error location, but the real reason is emptying out check_docs() step by step. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-35-git-send-email-armbru@redhat.com>
2017-03-16qapi: Improve error message on @NAME: in free-form docMarkus Armbruster1-11/+6
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-34-git-send-email-armbru@redhat.com>