aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-05-13target/sh4: movua.l is an SH4-A only instructionAurelien Jarno1-11/+15
At the same time change the comment describing the instruction the same way than other instruction, so that the code is easier to read and search. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-13target/sh4: implement tas.b using atomic helperAurelien Jarno1-12/+7
We only emulate UP SH4, however as the tas.b instruction is used in the GNU libc, this improve linux-user emulation. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-13target/sh4: generate fences for SH4Aurelien Jarno1-4/+5
synco is a SH4-A only instruction. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-13target/sh4: optimize gen_write_sr using extract opAurelien Jarno1-6/+3
This doesn't change the generated code on x86, but optimizes it on most RISC architectures and makes the code simpler to read. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-13target/sh4: optimize gen_store_fpr64Aurelien Jarno1-7/+1
Using extr and avoiding intermediate temps. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-13target/sh4: fold ctx->bstate = BS_BRANCH into gen_conditional_jumpAurelien Jarno1-6/+3
Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-13target/sh4: only save flags state at the end of the TBAurelien Jarno1-36/+33
There is no need to save flags when entering and exiting the delay slot. They can be saved only when reaching the end of the TB. If the TB is interrupted before by an exception, they will be restored using restore_state_to_opc. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-13target/sh4: fix BS_EXCP exitAurelien Jarno1-9/+7
In case of exception, there is no need to call tcg_gen_exit_tb as the exception helper won't return. Also fix a few cases where BS_BRANCH is called instead of BS_EXCP. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-13target/sh4: fix BS_STOP exitAurelien Jarno1-2/+3
When stopping the translation because the state has changed, goto_tb should not be used as it might link TB with different flags. Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-13target/sh4: move DELAY_SLOT_TRUE flag into a separate globalAurelien Jarno3-18/+16
Instead of using one bit of the env flags to store the condition of the next delay slot, use a separate global. It simplifies reading and writing the flags variable and also removes some confusion between ctx->envflags and env->flags. Note that the global is first transfered to a temp in order to be able to discard the global before the brcond. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-13target/sh4: do not include DELAY_SLOT_TRUE in the TB stateAurelien Jarno1-2/+1
DELAY_SLOT_TRUE is used as a dynamic condition for the branch after the delay slot instruction. It is not used in code generation, so there is no need to including in the TB state. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-13target/sh4: get rid of DELAY_SLOT_CLEARMEAurelien Jarno3-16/+6
Now that ctx->flags has been split, it becomes clear that DELAY_SLOT_CLEARME has not impact on the code generation: in both case ctx->envflags is cleared, either by clearing all the flags, or by setting it to 0. This is left-over from pre-TCG era. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-13target/sh4: split ctx->flags into ctx->tbflags and ctx->envflagsAurelien Jarno1-79/+82
There is a confusion (and not only in the SH4 target) between tb->flags, env->flags and ctx->flags. To avoid it, split ctx->flags into ctx->tbflags and ctx->envflags. ctx->tbflags stays unchanged during the whole TB translation, while ctx->envflags evolves and is kept in sync with env->flags using TCG instructions. ctx->envflags now only contains the part that of env->flags that is contained in the TB state, i.e. the DELAY_SLOT* flags. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2017-05-11maintainers: Add myself as linux-user reviewerLaurent Vivier1-0/+1
I volunteer to review linux-user patches. Adding myself will help to not miss some of them. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Acked-by: Riku Voipio <riku.voipio@linaro.org> Message-id: 20170510153950.29343-1-laurent@vivier.eu Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-05-10Merge remote-tracking branch 'mjt/tags/trivial-patches-fetch' into stagingStefan Hajnoczi34-114/+112
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-10Merge remote-tracking branch 'danpb/tags/pull-qcrypto-2017-05-09-1' into stagingStefan Hajnoczi12-66/+135
Merge qcrypto 2017/05/09 v1 # gpg: Signature made Tue 09 May 2017 09:43:47 AM EDT # gpg: using RSA key 0xBE86EBB415104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF * danpb/tags/pull-qcrypto-2017-05-09-1: crypto: qcrypto_random_bytes() now works on windows w/o any other crypto libs crypto: move 'opaque' parameter to (nearly) the end of parameter list List SASL config file under the cryptography maintainer's realm Default to GSSAPI (Kerberos) instead of DIGEST-MD5 for SASL Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-05-10tests: Remove redundant assignmentFam Zheng1-1/+1
Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-05-10MAINTAINERS: Update paths for AioContext implementationPaolo Bonzini1-2/+2
Moved by c2b38b2 ("block: move AioContext, QEMUTimer, main-loop to libqemuutil") Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-05-10MAINTAINERS: Update paths for main loopPaolo Bonzini1-2/+2
Moved by c2b38b2 ("block: move AioContext, QEMUTimer, main-loop to libqemuutil"), let's update MAINTAINERS too. Reported-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-05-10jazz_led: fix bad snprintfPaolo Bonzini1-2/+2
Detected by GCC 7's -Wformat-truncation. snprintf writes at most 2 bytes here including the terminating NUL, so the result is truncated. In addition, the newline at the end is pointless. Fix the buffer size and the format string. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-05-10tests: Ignore another built executable (test-hmp)Eric Blake1-0/+1
Commit 78f86a2b7 added a new test, but forgot to exclude the built binary from version control. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
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-10virtfs: allow a device id to be specified in the -virtfs optionChris Webb2-3/+4
When using a virtfs root filesystem, the mount_tag needs to be set to /dev/root. This can be done long-hand as -fsdev local,id=root,path=/path/to/rootfs,... -device virtio-9p-pci,fsdev=root,mount_tag=/dev/root but the -virtfs shortcut cannot be used as it hard-codes the device identifier to match the mount_tag, and device identifiers may not contain '/': $ qemu-system-x86_64 -virtfs local,path=/foo,mount_tag=/dev/root,security_model=passthrough qemu-system-x86_64: -virtfs local,path=/foo,mount_tag=/dev/root,security_model=passthrough: duplicate fsdev id: /dev/root To support this case using -virtfs, we allow the device identifier to be specified explicitly when the mount_tag is not suitable: -virtfs local,id=root,path=/path/to/rootfs,mount_tag=/dev/root,... Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-05-10hw/core/generic-loader: Fix crash when running without CPUThomas Huth1-4/+5
When running QEMU with "-M none -device loader,file=kernel.elf", it currently crashes with a segmentation fault, because the "none"-machine does not have any CPU by default and the generic loader code tries to dereference s->cpu. Fix it by adding an appropriate check for a NULL pointer. Reported-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-05-10virtio-blk: Remove useless condition around g_free()Fam Zheng1-3/+1
Laszlo spotted and studied this wasteful "if". He pointed out: The original virtio_blk_free_request needed an "if" as it accesses one field, since 671ec3f05655 ("virtio-blk: Convert VirtIOBlockReq.elem to pointer", 2014-06-11); later on in f897bf751fbd ("virtio-blk: embed VirtQueueElement in VirtIOBlockReq", 2014-07-09) the field became embedded, so the "if" became unnecessary (at which point we were using g_slice_free(), but it is the same. Now drop it. Reported-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-05-10qemu-doc: Fix broken URLs of amnhltm.zip and dosidle210.zipThomas Huth1-5/+5
There are some broken URLs in the qemu-doc which reference tools that are not available at their original location anymore. Fortunately, they have been mirrored to archive.org, so point to that location instead. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-05-10use _Static_assert in QEMU_BUILD_BUG_ONAndreas Grapentin2-1/+21
QEMU_BUILD_BUG_ON should use C11's _Static_assert, if the compiler supports it, to provide more readable messages on failure. We check for _Static_assert in configure, and set CONFIG_STATIC_ASSERT accordingly. QEMU_BUILD_BUG_ON invokes _Static_assert if CONFIG_STATIC_ASSERT is defined, and reverts to the old way otherwise. That way, systems without C11 conforming compiler will still have the old messages, as verified by intentionally breaking the configure check. the following example output was generated by inverting the condition in QEMU_BUILD_BUG_ON: without _Static_assert: > In file included from /qemu/include/qemu/osdep.h:36:0, > from /qemu/qga/commands.c:13: > /qemu/qga/commands.c: In function ‘qmp_guest_exec_status’: > /qemu/include/qemu/compiler.h:89:12: error: negative width in bit-field ‘<anonymous>’ > struct { \ > ^ > /qemu/include/qemu/compiler.h:96:38: note: in expansion of macro QEMU_BUILD_BUG_ON_STRUCT’ > #define QEMU_BUILD_BUG_ON(x) typedef QEMU_BUILD_BUG_ON_STRUCT(x) \ > ^~~~~~~~~~~~~~~~~~~~~~~~ > /qemu/include/qemu/atomic.h:146:5: note: in expansion of macro ‘QEMU_BUILD_BUG_ON’ > QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \ > ^~~~~~~~~~~~~~~~~ > /qemu/include/qemu/atomic.h:417:5: note: in expansion of macro ‘atomic_load_acquire’ > atomic_load_acquire(ptr) > ^~~~~~~~~~~~~~~~~~~ > /qemu/qga/commands.c:160:21: note: in expansion of macro ‘atomic_mb_read’ > bool finished = atomic_mb_read(&gei->finished); > ^~~~~~~~~~~~~~ with _Static_assert: > In file included from /qemu/include/qemu/osdep.h:36:0, > from /qemu/qga/commands.c:13: > /qemu/qga/commands.c: In function ‘qmp_guest_exec_status’: > /qemu/include/qemu/compiler.h:94:30: error: static assertion failed: "not expecting: sizeof(*&gei->finished) > sizeof(void *)" > #define QEMU_BUILD_BUG_ON(x) _Static_assert(!(x), #x) > ^ > /qemu/include/qemu/atomic.h:146:5: note: in expansion of macro ‘QEMU_BUILD_BUG_ON’ > QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \ > ^~~~~~~~~~~~~~~~~ > /qemu/include/qemu/atomic.h:417:5: note: in expansion of macro ‘atomic_load_acquire’ > atomic_load_acquire(ptr) > ^~~~~~~~~~~~~~~~~~~ > /qemu/qga/commands.c:160:21: note: in expansion of macro ‘atomic_mb_read’ > bool finished = atomic_mb_read(&gei->finished); > ^~~~~~~~~~~~~~ Signed-off-by: Andreas Grapentin <andreas@grapentin.org> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-05-10channel-file: fix wrong parameter commentssochin.jiang1-1/+1
Signed-off-by: sochin.jiang <sochin@aliyun.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@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 Hajnoczi71-668/+805
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-09crypto: qcrypto_random_bytes() now works on windows w/o any other crypto libsGeert Martin Ijewski5-8/+57
If no crypto library is included in the build, QEMU uses qcrypto_random_bytes() to generate random data. That function tried to open /dev/urandom or /dev/random and if opening both files failed it errored out. Those files obviously do not exist on windows, so there the code uses CryptGenRandom(). Furthermore there was some refactoring and a new function qcrypto_random_init() was introduced. If a proper crypto library (gnutls or libgcrypt) is included in the build, this function does nothing. If neither is included it initializes the (platform specific) handles that are used by qcrypto_random_bytes(). Either: * a handle to /dev/urandom | /dev/random on unix like systems * a handle to a cryptographic service provider on windows Signed-off-by: Geert Martin Ijewski <gm.ijewski@web.de> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-05-09crypto: move 'opaque' parameter to (nearly) the end of parameter listDaniel P. Berrange4-14/+17
Previous commit moved 'opaque' to be the 2nd parameter in the list: commit 375092332eeaa6e47561ce47fd36144cdaf964d0 Author: Fam Zheng <famz@redhat.com> Date: Fri Apr 21 20:27:02 2017 +0800 crypto: Make errp the last parameter of functions Move opaque to 2nd instead of the 2nd to last, so that compilers help check with the conversion. this puts it back to the 2nd to last position. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-05-09List SASL config file under the cryptography maintainer's realmDaniel P. Berrange1-0/+1
No one is listed as maintainer for qemu.sasl. It is used by the VNC server for SASL auth, but since it is cryptography related, list it under the crytography maintainer's realm, rather than under the UI maintainer. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-05-09Default to GSSAPI (Kerberos) instead of DIGEST-MD5 for SASLDaniel P. Berrange2-44/+60
RFC 6331 documents a number of serious security weaknesses in the SASL DIGEST-MD5 mechanism. As such, QEMU should not be using or recommending it as a default mechanism for VNC auth with SASL. GSSAPI (Kerberos) is the only other viable SASL mechanism that can provide secure session encryption so enable that by defalt as the replacement. If users have TLS enabled for VNC, they can optionally decide to use SCRAM-SHA-1 instead of GSSAPI, allowing plain username and password auth. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@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-09qobject-input-visitor: Catch misuse of end_struct vs. end_listMarkus Armbruster1-2/+19
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493282486-28338-5-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> [More elaborate assertions for clarity]
2017-05-09qapi: Document intended use of @name within alternate visitsMarkus Armbruster1-2/+4
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493282486-28338-4-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-05-09qobject-input-visitor: Document full_name_nth()Markus Armbruster1-0/+11
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493282486-28338-3-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-05-09qmp: Improve QMP dispatch error messagesMarkus Armbruster1-7/+7
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1493282486-28338-2-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-05-09sockets: Delete unused helper socket_address_crumple()Markus Armbruster2-42/+0
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-8-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Commit message typo fixed]
2017-05-09sockets: Limit SocketAddressLegacy to external interfacesMarkus Armbruster24-406/+440
SocketAddressLegacy is a simple union, and simple unions are awkward: they have their variant members wrapped in a "data" object on the wire, and require additional indirections in C. SocketAddress is the equivalent flat union. Convert all users of SocketAddressLegacy to SocketAddress, except for existing external interfaces. See also commit fce5d53..9445673 and 85a82e8..c5f1ae3. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-7-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Minor editing accident fixed, commit message and a comment tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-09sockets: Rename SocketAddressFlat to SocketAddressMarkus Armbruster7-57/+57
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-6-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2017-05-09sockets: Rename SocketAddress to SocketAddressLegacyMarkus Armbruster23-312/+314
The next commit will rename SocketAddressFlat to SocketAddress, and the commit after that will replace most uses of SocketAddressLegacy by SocketAddress, replacing most of this commit's renames right back. Note that checkpatch emits a few "line over 80 characters" warnings. The long lines are all temporary; the SocketAddressLegacy replacement will shorten them again. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-5-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-09qapi: New QAPI_CLONE_MEMBERS()Markus Armbruster2-0/+27
QAPI_CLONE() returns a newly allocated QAPI object. Inconvenient when we want to clone into an existing object. QAPI_CLONE_MEMBERS() does exactly that. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-4-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-05-09sockets: Prepare inet_parse() for flattened SocketAddressMarkus Armbruster5-27/+22
I'm going to flatten SocketAddress: rename SocketAddress to SocketAddressLegacy, SocketAddressFlat to SocketAddress, eliminate SocketAddressLegacy except in external interfaces. inet_parse() returns a newly allocated InetSocketAddress. Lift the allocation from inet_parse() into its caller socket_parse() to prepare for flattening SocketAddress. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-3-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Straightforward rebase]
2017-05-09sockets: Prepare vsock_parse() for flattened SocketAddressMarkus Armbruster1-10/+10
I'm going to flatten SocketAddress: rename SocketAddress to SocketAddressLegacy, SocketAddressFlat to SocketAddress, eliminate SocketAddressLegacy except in external interfaces. vsock_parse() returns a newly allocated VsockSocketAddress. Lift the allocation from vsock_parse() into its caller socket_parse() to prepare for flattening SocketAddress. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-2-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>