Peter Maydell [Fri, 26 Jun 2015 10:32:58 +0000 (11:32 +0100)]
Merge remote-tracking branch 'remotes/lalrae/tags/mips-
20150626' into staging
MIPS patches 2015-06-26
Changes:
* MIPS UHI semihosting support
* microMIPS32 R6 support
# gpg: Signature made Fri Jun 26 10:42:33 2015 BST using RSA key ID
0B29DA6B
# gpg: Good signature from "Leon Alrae <leon.alrae@imgtec.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 8DD3 2F98 5495 9D66 35D4 4FC0 5211 8E3C 0B29 DA6B
* remotes/lalrae/tags/mips-
20150626:
target-mips: add mips32r6-generic CPU definition
target-mips: microMIPS32 R6 POOL16{A, C} instructions
target-mips: microMIPS32 R6 Major instructions
target-mips: microMIPS32 R6 POOL32{I, C} instructions
target-mips: microMIPS32 R6 POOL32F instructions
target-mips: microMIPS32 R6 POOL32A{XF} instructions
target-mips: microMIPS32 R6 branches and jumps
target-mips: add microMIPS32 R6 opcode enum
target-mips: signal RI for removed instructions in microMIPS R6
target-mips: raise RI exceptions when FIR.PS = 0
target-mips: rearrange gen_compute_compact_branch
target-mips: refactor {D}LSA, {D}ALIGN, {D}BITSWAP
target-mips: remove an unused argument
target-mips: add microMIPS TLBINV, TLBINVF
target-mips: fix {RD, WR}PGPR in microMIPS
target-mips: convert host to MIPS errno values when required
target-mips: add Unified Hosting Interface (UHI) support
target-mips: remove identical code in different branch
hw/mips: Do not clear BEV for MIPS malta kernel load
include/softmmu-semi.h: Make semihosting support 64-bit clean
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Yongbok Kim [Wed, 24 Jun 2015 23:24:27 +0000 (00:24 +0100)]
target-mips: add mips32r6-generic CPU definition
Define a new CPU definition supporting MIPS32 Release 6 ISA and
microMIPS32 Release 6 ISA.
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:26 +0000 (00:24 +0100)]
target-mips: microMIPS32 R6 POOL16{A, C} instructions
microMIPS32 Release 6 POOL16A/ POOL16C instructions
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:25 +0000 (00:24 +0100)]
target-mips: microMIPS32 R6 Major instructions
Add new microMIPS32 Release 6 Major opcode instructions
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:24 +0000 (00:24 +0100)]
target-mips: microMIPS32 R6 POOL32{I, C} instructions
Add new microMIPS32 Release 6 POOL32I/POOL32C type instructions
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:23 +0000 (00:24 +0100)]
target-mips: microMIPS32 R6 POOL32F instructions
Add new microMIPS32 Release 6 POOL32F instructions
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:22 +0000 (00:24 +0100)]
target-mips: microMIPS32 R6 POOL32A{XF} instructions
Add new microMIPS32 Release 6 pool32a/pool32axf instructions.
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:21 +0000 (00:24 +0100)]
target-mips: microMIPS32 R6 branches and jumps
Add new microMIPS32 Release 6 branch and jump instructions.
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:20 +0000 (00:24 +0100)]
target-mips: add microMIPS32 R6 opcode enum
Add microMIPS32 Release 6 opcode enum.
Remove RI checking for pre-R6 reserved opcode.
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:19 +0000 (00:24 +0100)]
target-mips: signal RI for removed instructions in microMIPS R6
Signal a Reserved Instruction exception for removed instruction encoding
in microMIPS Release 6.
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:18 +0000 (00:24 +0100)]
target-mips: raise RI exceptions when FIR.PS = 0
64-bit paired-single (PS) floating point data type is optional in the
pre-Release 6.
It has to raise RI exception when PS type is not implemented. (FIR.PS = 0)
(The PS data type is removed in the Release 6.)
Loongson-2E and Loongson-2F don't have any implementation field in
FCSR0(FIR) but do support PS data format, therefore for these cores RI will
not be signalled regardless of PS bit.
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:17 +0000 (00:24 +0100)]
target-mips: rearrange gen_compute_compact_branch
The function will be also used for microMIPS Release 6.
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:16 +0000 (00:24 +0100)]
target-mips: refactor {D}LSA, {D}ALIGN, {D}BITSWAP
Refactor those instructions in order to reuse them for microMIPS32
Release 6.
Rearrange gen_move_low32().
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:15 +0000 (00:24 +0100)]
target-mips: remove an unused argument
Remove an unused argument from decode_micromips32_opc()
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:14 +0000 (00:24 +0100)]
target-mips: add microMIPS TLBINV, TLBINVF
Add microMIPS TLBINV, TLBINVF
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Yongbok Kim [Wed, 24 Jun 2015 23:24:13 +0000 (00:24 +0100)]
target-mips: fix {RD, WR}PGPR in microMIPS
rt, rs were swapped
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Leon Alrae [Fri, 19 Jun 2015 10:08:44 +0000 (11:08 +0100)]
target-mips: convert host to MIPS errno values when required
Convert only errno values which can be returned by system calls in
mips-semi.c and are not generic to all archs.
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Leon Alrae [Fri, 19 Jun 2015 10:08:43 +0000 (11:08 +0100)]
target-mips: add Unified Hosting Interface (UHI) support
Add UHI semihosting support for MIPS. QEMU run with "-semihosting" option
will alter the behaviour of SDBBP 1 instruction -- UHI operation will be
called instead of generating a debug exception.
Also tweak Malta's pseudo-bootloader. On CPU reset the $4 register is set
to -1 if semihosting arguments are passed to indicate that the UHI
operations should be used to obtain input arguments.
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Leon Alrae [Fri, 19 Jun 2015 10:08:42 +0000 (11:08 +0100)]
target-mips: remove identical code in different branch
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Matthew Fortune [Fri, 19 Jun 2015 10:08:41 +0000 (11:08 +0100)]
hw/mips: Do not clear BEV for MIPS malta kernel load
The BEV flag controls whether the boot exception vector is still
in place when starting a kernel. When cleared the exception vector
at EBASE (or hard coded address of 0x80000000) is used instead.
The early stages of the linux kernel would benefit from BEV still
being set to ensure any faults get handled by the boot rom exception
handlers. This is a moot point for system qemu as there aren't really
any BEV handlers, but there are other good reasons to change this...
The UHI (semi-hosting interface) defines special behaviours depending
on whether an application starts in an environment with BEV set or
cleared. When BEV is set then UHI assumes that a bootloader is
relatively dumb and has no advanced exception handling logic.
However, when BEV is cleared then UHI assumes that the bootloader
has the ability to handle UHI exceptions with its exception handlers
and will unwind and forward UHI SYSCALL exceptions to the exception
vector that was installed prior to running the application.
Signed-off-by: Matthew Fortune <matthew.fortune@imgtec.com>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Maciej W. Rozycki [Fri, 19 Jun 2015 10:08:40 +0000 (11:08 +0100)]
include/softmmu-semi.h: Make semihosting support 64-bit clean
Correct addresses passed around in semihosting to use a data type suitable
for both 32-bit and 64-bit targets.
Signed-off-by: Maciej W. Rozycki <macro@codesourcery.com>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Peter Maydell [Thu, 25 Jun 2015 13:03:55 +0000 (14:03 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into staging
# gpg: Signature made Wed Jun 24 16:37:23 2015 BST using RSA key ID
81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>"
* remotes/stefanha/tags/net-pull-request:
net: simplify net_client_init1()
net: drop if expression that is always true
net: raise an error if -net type is invalid
net: replace net_client_init1() netdev whitelist with blacklist
net: add missing "netmap" to host_net_devices[]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Peter Maydell [Thu, 25 Jun 2015 10:19:46 +0000 (11:19 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
# gpg: Signature made Wed Jun 24 16:27:53 2015 BST using RSA key ID
81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>"
* remotes/stefanha/tags/block-pull-request:
virito-blk: drop duplicate check
qemu-iotests: fix 051.out after qdev error message change
iov: don't touch iov in iov_send_recv()
raw-posix: Introduce hdev_is_sg()
raw-posix: Use DPRINTF for DEBUG_FLOPPY
raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT
Fix migration in case of scsi-generic
block: Use bdrv_is_sg() everywhere
nvme: Fix memleak in nvme_dma_read_prp
vvfat: add a label option
util/hbitmap: Add an API to reset all set bits in hbitmap
virtio-blk: Use blk_drain() to drain IO requests
block-backend: Introduce blk_drain()
throttle: Check current timers before updating any_timer_armed[]
block: Let bdrv_drain_all() to call aio_poll() for each AioContext
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Stefan Hajnoczi [Wed, 27 May 2015 16:16:52 +0000 (17:16 +0100)]
net: simplify net_client_init1()
Drop the union and move the hubport creation into the !is_netdev case.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id:
1432743412-15943-6-git-send-email-stefanha@redhat.com
Stefan Hajnoczi [Wed, 27 May 2015 16:16:51 +0000 (17:16 +0100)]
net: drop if expression that is always true
Both is_netdev and !is_netdev paths already check that
net_client_init_func[opts->kind] is non-NULL so there is no need for the
if statement.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id:
1432743412-15943-5-git-send-email-stefanha@redhat.com
Stefan Hajnoczi [Wed, 27 May 2015 16:16:50 +0000 (17:16 +0100)]
net: raise an error if -net type is invalid
When a -net type is used that was not compiled into the binary there
should be an error message.
Note the special case for -net none, which is a no-op.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id:
1432743412-15943-4-git-send-email-stefanha@redhat.com
Stefan Hajnoczi [Wed, 27 May 2015 16:16:49 +0000 (17:16 +0100)]
net: replace net_client_init1() netdev whitelist with blacklist
It's cumbersome to keep the whitelist up-to-date. New netdev backends
should most likely be allowed so a blacklist makes more sense than a
whitelist.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id:
1432743412-15943-3-git-send-email-stefanha@redhat.com
Stefan Hajnoczi [Wed, 27 May 2015 16:16:48 +0000 (17:16 +0100)]
net: add missing "netmap" to host_net_devices[]
Although hmp-commands.hx lists "netmap" as a valid host_net_add type,
the command rejects it because it's missing from the list.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id:
1432743412-15943-2-git-send-email-stefanha@redhat.com
Gonglei [Wed, 24 Jun 2015 09:29:24 +0000 (17:29 +0800)]
virito-blk: drop duplicate check
in_num = req->elem.in_num, and req->elem.in_num is
checked in line 489, so the check about in_num variable
is superflous, let's drop it.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id:
1435138164-11728-1-git-send-email-arei.gonglei@huawei.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Stefan Hajnoczi [Tue, 23 Jun 2015 14:56:09 +0000 (15:56 +0100)]
qemu-iotests: fix 051.out after qdev error message change
Commit
f006cf7fa9a63ba8e4ccf57d46231ce594301727 ("qdev-monitor:
Propagate errors through qdev_device_add()") dropped a meaningless error
message. This change in output caused qemu-iotests 051 to fail:
QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be initialized
Update 051.out so the test passes again.
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id:
1435071369-30936-1-git-send-email-stefanha@redhat.com
Peter Maydell [Tue, 23 Jun 2015 17:25:55 +0000 (18:25 +0100)]
Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2015-06-23' into staging
trivial patches for 2015-06-23
# gpg: Signature made Tue Jun 23 18:23:45 2015 BST using RSA key ID
A4C3D7DB
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg: aka "Michael Tokarev <mjt@corpit.ru>"
# gpg: aka "Michael Tokarev <mjt@debian.org>"
* remotes/mjt/tags/pull-trivial-patches-2015-06-23: (21 commits)
util/qemu-sockets: improve ai_flag hints for ipv6 hosts
hw/display/tcx.c: Fix memory leak
hw/display/cg3.c: Fix memory leak
Makefile: Add "make ctags"
Makefile: Fix "make cscope TAGS"
qemu-options: Use @itemx where appropriate
qemu-options: Improve -global documentation
throttle: Fix typo in the documentation of block_set_io_throttle
hw/display/qxl-logger.c: Constify some variable
configure: rearrange --help and consolidate enable/disable together
libcacard: pkgconfig: tidy dependent libs
vt82c686: QOMify
xen_pt: QOMify
wdt_i6300esb: QOMify
piix4: QOMify
piix: piix3 QOMify
pci-assign: QOMify
Print error when failing to load PCI config data
Grammar: 'as to'->'as for'
remove libdecnumber/dpd/decimal128Local.h
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Wolfgang Bumiller [Thu, 21 May 2015 12:33:29 +0000 (14:33 +0200)]
util/qemu-sockets: improve ai_flag hints for ipv6 hosts
*) Do not use AI_ADDRCONFIG on listening sockets, because this flag
makes it impossible to explicitly listen on '127.0.0.1' if no global
ipv4 address is configured additionally, making this a very
uncomfortable option.
*) Add AI_V4MAPPED hint for connecting sockets.
If your system is globally only connected via ipv6 you often still want
to be able to use '127.0.0.1' and 'localhost' (even if localhost doesn't
also have an ipv6 entry).
For example, PVE - unless explicitly asking for insecure mode - uses
ipv4 loopback addresses with QEMU for live migrations tunneled over SSH.
These fail to start because AI_ADDRCONFIG makes getaddrinfo refuse to
work with '127.0.0.1'.
As for the AI_V4MAPPED flag: glibc uses it by default, and providing
non-0 flags removes it. I think it makes sense to use it.
I also want to point out that glibc explicitly sidesteps POSIX standards
when passing 0 as hints by then assuming both AI_V4MAPPED and
AI_ADDRCONFIG (the latter being a rather weird choice IMO), while
according to POSIX.1-2001 it should be assumed 0. (glibc considers its
choice an improvement.)
Since either AI_CANONNAME or AI_PASSIVE are passed in our cases, glibc's
default flags in turn are disabled again unless explicitly added, which
I do with this patch.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Shannon Zhao [Thu, 28 May 2015 11:13:45 +0000 (19:13 +0800)]
hw/display/tcx.c: Fix memory leak
Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Shannon Zhao [Thu, 28 May 2015 11:13:42 +0000 (19:13 +0800)]
hw/display/cg3.c: Fix memory leak
Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Fam Zheng [Fri, 22 May 2015 05:35:08 +0000 (13:35 +0800)]
Makefile: Add "make ctags"
This generates ctags file
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Fam Zheng [Fri, 22 May 2015 05:35:07 +0000 (13:35 +0800)]
Makefile: Fix "make cscope TAGS"
Cscope and TAGS files work in source directory rather than the build
directory, also, don't ask users to run configure first, because they
may have an out of tree build.
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Markus Armbruster [Mon, 15 Jun 2015 12:35:59 +0000 (14:35 +0200)]
qemu-options: Use @itemx where appropriate
Doesn't appear to make a difference, but let's use it consistently.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Markus Armbruster [Mon, 15 Jun 2015 12:35:58 +0000 (14:35 +0200)]
qemu-options: Improve -global documentation
Recent commit 3751d7c "vl: allow full-blown QemuOpts syntax for
-global" overloaded its existing argument syntax DRIVER.PROP=VALUE
with QemuOpts syntax. Unambigious as long as no DRIVER contains '='.
Its documentation claims that "the two syntaxes are equivalent."
Improve it to spell out how exactly the old syntax gets desugared into
the new one.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Alberto Garcia [Mon, 15 Jun 2015 13:12:52 +0000 (16:12 +0300)]
throttle: Fix typo in the documentation of block_set_io_throttle
Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Frediano Ziglio [Thu, 11 Jun 2015 13:17:56 +0000 (14:17 +0100)]
hw/display/qxl-logger.c: Constify some variable
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Michael Tokarev [Wed, 17 Jun 2015 19:19:26 +0000 (22:19 +0300)]
configure: rearrange --help and consolidate enable/disable together
This is an attempt to rearrange configure --help output a bit
and consolidate pairs of --enable/disable into its own section.
After this, help text is easier to sort, manage and read.
More descriptive text can be added as well, since we now have
more space.
While at it, mention en/dis-able-vte.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Michael Tokarev [Wed, 17 Jun 2015 18:02:03 +0000 (21:02 +0300)]
libcacard: pkgconfig: tidy dependent libs
libcacard.pc file lists only one package in Requires
field, which is nss, while glib-2.0 is also a requiriment.
Furthermore, for libraries used internally by the library
(this is the way nss and glib are used by libcacard),
Requires.private shold be used instead of Requires.
Fix both issues.
This does not affect linking of qemu because it links
with objects from libcacard directly.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Gonglei [Wed, 13 May 2015 00:43:27 +0000 (08:43 +0800)]
vt82c686: QOMify
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Gonglei [Wed, 13 May 2015 00:43:26 +0000 (08:43 +0800)]
xen_pt: QOMify
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Tested-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Gonglei [Wed, 13 May 2015 00:43:25 +0000 (08:43 +0800)]
wdt_i6300esb: QOMify
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Gonglei [Wed, 13 May 2015 00:43:24 +0000 (08:43 +0800)]
piix4: QOMify
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Gonglei [Wed, 13 May 2015 00:43:23 +0000 (08:43 +0800)]
piix: piix3 QOMify
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Gonglei [Wed, 13 May 2015 00:43:22 +0000 (08:43 +0800)]
pci-assign: QOMify
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Dr. David Alan Gilbert [Wed, 3 Jun 2015 16:58:01 +0000 (17:58 +0100)]
Print error when failing to load PCI config data
When loading migration fails due to a disagreement about
PCI config data we don't currently get any errors explaining
that was the cause of the problem or which byte in the config
data was at fault.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Dr. David Alan Gilbert [Wed, 3 Jun 2015 18:43:56 +0000 (19:43 +0100)]
Grammar: 'as to'->'as for'
Fixup migrate-incoming text as requested by Eric in:
http://lists.nongnu.org/archive/html/qemu-devel/2015-03/msg03362.html
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Michael Tokarev [Wed, 3 Jun 2015 14:37:27 +0000 (17:37 +0300)]
remove libdecnumber/dpd/decimal128Local.h
Commit
72ac97cdfc added two equivalent versions of decimal128Local.h,
one in libdecnumber/dpd/ and another in include/libdecnumber/dpd/.
Being identical by the code, the two files however differs in the
licensing terms. The one in libdecnumber/dpd/ (which is being
removed by this patch) is licensed as GPL3.1 (plus gcc runtime
exception), which, as far as I know, is not compatible with GPL-2.
This file is not used (it is included from
include/libdecnumber/dpd/decimal128.h, so version in include/ is
used).
More, the version in include/ can also be removed, since none
of the 3 defines from that file are actually used by the code.
Even more, one of the defines from there, decimal128SetSign,
is redefined (to equivalent value) in libdecnumber/dpd/decimal128.c,
but again, never used.
What a mess...
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Alex Bennée [Wed, 3 Jun 2015 13:22:41 +0000 (14:22 +0100)]
configure: append --extra-ldflags to LDFLAGS
The help text says --extra-ldflags is appended to LDFLAGS so make it so.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Peter Maydell [Tue, 23 Jun 2015 16:46:20 +0000 (17:46 +0100)]
Merge remote-tracking branch 'remotes/sstabellini/tags/xen-220615-3' into staging
xen-220615, more SOB lines
# gpg: Signature made Tue Jun 23 17:19:08 2015 BST using RSA key ID
70E1AE90
# gpg: Good signature from "Stefano Stabellini <stefano.stabellini@eu.citrix.com>"
* remotes/sstabellini/tags/xen-220615-3:
Revert "xen-hvm: increase maxmem before calling xc_domain_populate_physmap"
xen/pass-through: constify some static data
xen/pass-through: log errno values rather than function return ones
xen/pass-through: ROM BAR handling adjustments
xen/pass-through: fold host PCI command register writes
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Stefano Stabellini [Mon, 22 Jun 2015 13:00:42 +0000 (13:00 +0000)]
Revert "xen-hvm: increase maxmem before calling xc_domain_populate_physmap"
This reverts commit
c1d322e6048796296555dd36fdd102d7fa2f50bf.
The original commit fixes a bug when assigning a large number of
devices which require option roms to a guest. (One known
configuration that needs extra memory is having more than 4 emulated
NICs assigned. Three or fewer NICs seems to work without this
functionality.)
However, by unilaterally increasing maxmem, it introduces two
problems.
First, now libxl's calculation of the required maxmem during migration
is broken -- any guest which exercised this functionality will fail on
migration. (Guests which have the default number of devices are not
affected.)
Secondly, it makes it impossible for a higher-level toolstack or
administer to predict how much memory a VM will actually use, making
it much more difficult to effectively use all of the memory on a
machine.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Jan Beulich [Fri, 5 Jun 2015 12:04:55 +0000 (13:04 +0100)]
xen/pass-through: constify some static data
This is done indirectly by adjusting two typedefs and helps emphasizing
that the respective tables aren't supposed to be modified at runtime
(as they may be shared between devices).
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Jan Beulich [Fri, 5 Jun 2015 12:04:18 +0000 (13:04 +0100)]
xen/pass-through: log errno values rather than function return ones
Functions setting errno commonly return just -1, which is of no
particular use in the log file.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Jan Beulich [Mon, 8 Jun 2015 13:11:51 +0000 (14:11 +0100)]
xen/pass-through: ROM BAR handling adjustments
Expecting the ROM BAR to be written with an all ones value when sizing
the region is wrong - the low bit has another meaning (enable/disable)
and bits 1..10 are reserved. The PCI spec also mandates writing all
ones to just the address portion of the register.
Use suitable constants also for initializing the ROM BAR register field
description.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Jan Beulich [Fri, 15 May 2015 12:46:11 +0000 (13:46 +0100)]
xen/pass-through: fold host PCI command register writes
The code introduced to address XSA-126 allows simplification of other
code in xen_pt_initfn(): All we need to do is update "cmd" suitably,
as it'll be written back to the host register near the end of the
function anyway.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Wen Congyang [Thu, 21 May 2015 01:50:10 +0000 (09:50 +0800)]
iov: don't touch iov in iov_send_recv()
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Message-id:
555D39D2.4000705@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Dimitris Aragiorgis [Tue, 23 Jun 2015 10:45:00 +0000 (13:45 +0300)]
raw-posix: Introduce hdev_is_sg()
Until now, an SG device was identified only by checking if its path
started with "/dev/sg". Then, hdev_open() would set the bs->sg flag
accordingly. The patch relies on the actual properties of the device
instead of the specified file path.
To this end, test for an SG device (e.g. /dev/sg0) by ensuring that
all of the following holds:
- The specified file name corresponds to a character device
- The device supports the SG_GET_VERSION_NUM ioctl
- The device supports the SG_GET_SCSI_ID ioctl
Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
Message-id:
1435056300-14924-6-git-send-email-dimara@arrikto.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Dimitris Aragiorgis [Tue, 23 Jun 2015 10:44:59 +0000 (13:44 +0300)]
raw-posix: Use DPRINTF for DEBUG_FLOPPY
Get rid of several #ifdef DEBUG_FLOPPY and substitute them with
DPRINTF.
Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id:
1435056300-14924-5-git-send-email-dimara@arrikto.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Dimitris Aragiorgis [Tue, 23 Jun 2015 10:44:58 +0000 (13:44 +0300)]
raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT
Building the QEMU tools fails if we #define DEBUG_BLOCK inside
block/raw-posix.c. Here instead of adding qemu-log.o in block-obj-y
so that DEBUG_BLOCK_PRINT can be used, we substitute the latter with
a simple DPRINTF() (that does not cause bit-rot).
Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id:
1435056300-14924-4-git-send-email-dimara@arrikto.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Dimitris Aragiorgis [Tue, 23 Jun 2015 10:44:57 +0000 (13:44 +0300)]
Fix migration in case of scsi-generic
During migration, QEMU uses fsync()/fdatasync() on the open file
descriptor for read-write block devices to flush data just before
stopping the VM.
However, fsync() on a scsi-generic device returns -EINVAL which
causes the migration to fail. This patch skips flushing data in case
of an SG device, since submitting SCSI commands directly via an SG
character device (e.g. /dev/sg0) bypasses the page cache completely,
anyway.
Note that fsync() not only flushes the page cache but also the disk
cache. The scsi-generic device never sends flushes, and for
migration it assumes that the same SCSI device is used by the
destination host, so it does not issue any SCSI SYNCHRONIZE CACHE
(10) command.
Finally, remove the bdrv_is_sg() test from iscsi_co_flush() since
this is now redundant (we flush the underlying protocol at the end
of bdrv_co_flush() which, with this patch, we never reach).
Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id:
1435056300-14924-3-git-send-email-dimara@arrikto.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Dimitris Aragiorgis [Tue, 23 Jun 2015 10:44:56 +0000 (13:44 +0300)]
block: Use bdrv_is_sg() everywhere
Instead of checking bs->sg use bdrv_is_sg() consistently throughout
the code.
Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id:
1435056300-14924-2-git-send-email-dimara@arrikto.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Lu Lina [Fri, 19 Jun 2015 06:27:34 +0000 (14:27 +0800)]
nvme: Fix memleak in nvme_dma_read_prp
Signed-off-by: Lu Lina <lina.lulina@huawei.com>
Acked-by: Keith Busch <keith.busch@intel.com>
Message-id:
1434695254-69808-1-git-send-email-kathy.wangting@huawei.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Wolfgang Bumiller [Fri, 19 Jun 2015 09:35:29 +0000 (11:35 +0200)]
vvfat: add a label option
Until now the vvfat volume label was hardcoded to be
"QEMU VVFAT", now you can pass a file.label=labelname option
to the -drive to change it.
The FAT structure defines the volume label to be limited to
11 bytes and is filled up spaces when shorter than that. The
trailing spaces however aren't exposed to the user by
operating systems.
[Added missing comment '#' characters in block-core.json to fix build
errors.
--Stefan]
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Message-id:
1434706529-13895-2-git-send-email-w.bumiller@proxmox.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Wen Congyang [Fri, 22 May 2015 01:29:46 +0000 (09:29 +0800)]
util/hbitmap: Add an API to reset all set bits in hbitmap
The function bdrv_clear_dirty_bitmap() is updated to use
faster hbitmap_reset_all() call.
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id:
555E868A.60506@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Alexander Yarygin [Wed, 17 Jun 2015 10:37:20 +0000 (13:37 +0300)]
virtio-blk: Use blk_drain() to drain IO requests
Each call of the virtio_blk_reset() function calls blk_drain_all(),
which works for all existing BlockDriverStates, while draining only
one is needed.
This patch replaces blk_drain_all() by blk_drain() in
virtio_blk_reset(). virtio_blk_data_plane_stop() should be called
after draining because it restores vblk->complete_request.
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Message-id:
1434537440-28236-3-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Alexander Yarygin [Wed, 17 Jun 2015 10:37:19 +0000 (13:37 +0300)]
block-backend: Introduce blk_drain()
This patch introduces the blk_drain() function which allows to replace
blk_drain_all() when only one BlockDriverState needs to be drained.
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Message-id:
1434537440-28236-2-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Alberto Garcia [Mon, 15 Jun 2015 15:41:15 +0000 (18:41 +0300)]
throttle: Check current timers before updating any_timer_armed[]
Calling throttle_group_config() cancels all timers from a particular
BlockDriverState, so any_timer_armed[] should be updated accordingly.
However, with the current code it may happen that a timer is armed in
a different BlockDriverState from the same group, so any_timer_armed[]
would be set to false in a situation where there is still a timer
armed.
The consequence is that we might end up with two timers armed. This
should not have any noticeable impact however, since all accesses to
the ThrottleGroup are protected by a lock, and the situation would
become normal again shortly thereafter as soon as all timers have been
fired.
The correct way to solve this is to check that we're actually
cancelling a timer before updating any_timer_armed[].
Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id:
1434382875-3998-1-git-send-email-berto@igalia.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Alexander Yarygin [Wed, 10 Jun 2015 11:38:17 +0000 (14:38 +0300)]
block: Let bdrv_drain_all() to call aio_poll() for each AioContext
After the commit
9b536adc ("block: acquire AioContext in
bdrv_drain_all()") the aio_poll() function got called for every
BlockDriverState, in assumption that every device may have its own
AioContext. If we have thousands of disks attached, there are a lot of
BlockDriverStates but only a few AioContexts, leading to tons of
unnecessary aio_poll() calls.
This patch changes the bdrv_drain_all() function allowing it find shared
AioContexts and to call aio_poll() only for unique ones.
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id:
1433936297-7098-4-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Peter Maydell [Tue, 23 Jun 2015 12:32:50 +0000 (13:32 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-
20150623-1' into staging
virtio-input: property fixes, add evdev passthrough
# gpg: Signature made Tue Jun 23 09:33:29 2015 BST using RSA key ID
D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg: aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
* remotes/kraxel/tags/pull-input-
20150623-1:
Add MAINTAINERS entry for virtio-input
virtio-input: evdev passthrough
virtio-input: move properties, use virtio_instance_init_common
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Peter Maydell [Tue, 23 Jun 2015 09:38:00 +0000 (10:38 +0100)]
Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-06-22' into staging
Monitor patches
# gpg: Signature made Mon Jun 22 18:56:18 2015 BST using RSA key ID
EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg: aka "Markus Armbruster <armbru@pond.sub.org>"
* remotes/armbru/tags/pull-monitor-2015-06-22: (24 commits)
Include monitor/monitor.h exactly where needed
Include qapi/qmp/qerror.h exactly where needed
qerror: Move #include out of qerror.h
qerror: Finally unused, clean up
qmp: Wean off qerror_report()
tpm: Avoid qerror_report() outside QMP command handlers
qerror: Clean up QERR_ macros to expand into a single string
qerror: Eliminate QERR_DEVICE_NOT_FOUND
vl: Use error_report() for --display errors
vl: Avoid qerror_report() outside QMP command handlers
QemuOpts: Wean off qerror_report_err()
qdev-monitor: Propagate errors through qdev_device_add()
qdev-monitor: Propagate errors through set_property()
qdev-monitor: Convert qbus_find() to Error
qdev-monitor: Fix check for full bus
qdev-monitor: Stop error avalanche in qbus_find_recursive()
disas: Remove uses of CPU env
monitor: Split mon_get_cpu fn to remove ENV_GET_CPU
monitor: Fix failure path for "S" argument
monitor: Point to "help" command on syntax error
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Gerd Hoffmann [Fri, 19 Jun 2015 08:25:34 +0000 (10:25 +0200)]
Add MAINTAINERS entry for virtio-input
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Fri, 28 Mar 2014 08:18:47 +0000 (09:18 +0100)]
virtio-input: evdev passthrough
This allows to assign host input devices to the guest:
qemu -device virtio-input-host-pci,evdev=/dev/input/event<nr>
The guest gets exclusive access to the input device, so be careful
with assigning the keyboard if you have only one connected to your
machine.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Thu, 18 Jun 2015 15:45:47 +0000 (17:45 +0200)]
virtio-input: move properties, use virtio_instance_init_common
Move properties from virtio-*-pci to virtio-*-device.
Also make better use of QOM and attach common properties
to the abstract parent classes (virtio-input-device and
virtio-input-pci-device).
Switch the hid device instance init functions over to use
virtio_instance_init_common, so we get the properties of the
virtio device aliased properly to the virtio pci proxy.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Markus Armbruster [Tue, 17 Mar 2015 17:16:21 +0000 (18:16 +0100)]
Include monitor/monitor.h exactly where needed
In particular, don't include it into headers.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus Armbruster [Tue, 17 Mar 2015 16:22:46 +0000 (17:22 +0100)]
Include qapi/qmp/qerror.h exactly where needed
In particular, don't include it into headers.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus Armbruster [Tue, 17 Mar 2015 17:29:20 +0000 (18:29 +0100)]
qerror: Move #include out of qerror.h
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus Armbruster [Tue, 17 Mar 2015 13:29:59 +0000 (14:29 +0100)]
qerror: Finally unused, clean up
Remove it except for two things in qerror.h:
* Two #include to be cleaned up separately to avoid cluttering this
patch.
* The QERR_ macros. Mark as obsolete.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus Armbruster [Fri, 13 Mar 2015 16:25:50 +0000 (17:25 +0100)]
qmp: Wean off qerror_report()
The traditional QMP command handler interface
int qmp_FOO(Monitor *mon, const QDict *params, QObject **ret_data);
doesn't provide for returning an Error object. Instead, the handler
is expected to stash it in the monitor with qerror_report().
When we rebased QMP on top of QAPI, we didn't change this interface.
Instead, commit 776574d introduced "middle mode" as a temporary aid
for converting existing QMP commands to QAPI one by one. More than
three years later, we're still using it.
Middle mode has two effects:
* Instead of the native input marshallers
static void qmp_marshal_input_FOO(QDict *, QObject **, Error **)
it generates input marshallers conforming to the traditional QMP
command handler interface.
* It suppresses generation of code to register them with
qmp_register_command()
This permits giving them internal linkage.
As long as we need qmp-commands.hx, we can't use the registry behind
qmp_register_command(), so the latter has to stay for now.
The former has to go to get rid of qerror_report(). Changing all QMP
commands to fit the QAPI mold in one go was impractical back when we
started, but by now there are just a few stragglers left:
do_qmp_capabilities(), qmp_qom_set(), qmp_qom_get(), qmp_object_add(),
qmp_netdev_add(), do_device_add().
Switch middle mode to generate native input marshallers, and adapt the
stragglers. Simplifies both the monitor code and the stragglers.
Rename do_qmp_capabilities() to qmp_capabilities(), and
do_device_add() to qmp_device_add, because that's how QMP command
handlers are named today.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus Armbruster [Tue, 17 Mar 2015 11:09:02 +0000 (12:09 +0100)]
tpm: Avoid qerror_report() outside QMP command handlers
qerror_report() is a transitional interface to help with converting
existing monitor commands to QMP. It should not be used elsewhere.
Replace by error_report().
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus Armbruster [Tue, 17 Mar 2015 10:54:50 +0000 (11:54 +0100)]
qerror: Clean up QERR_ macros to expand into a single string
These macros expand into error class enumeration constant, comma,
string. Unclean. Has been that way since commit 13f59ae.
The error class is always ERROR_CLASS_GENERIC_ERROR since the previous
commit.
Clean up as follows:
* Prepend every use of a QERR_ macro by ERROR_CLASS_GENERIC_ERROR, and
delete it from the QERR_ macro. No change after preprocessing.
* Rewrite error_set(ERROR_CLASS_GENERIC_ERROR, ...) into
error_setg(...). Again, no change after preprocessing.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus Armbruster [Mon, 16 Mar 2015 07:57:47 +0000 (08:57 +0100)]
qerror: Eliminate QERR_DEVICE_NOT_FOUND
Error classes other than ERROR_CLASS_GENERIC_ERROR should not be used
in new code. Hiding them in QERR_ macros makes new uses hard to spot.
Fortunately, there's just one such macro left. Eliminate it with this
coccinelle semantic patch:
@@
expression EP, E;
@@
-error_set(EP, QERR_DEVICE_NOT_FOUND, E)
+error_set(EP, ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found", E)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus Armbruster [Fri, 13 Feb 2015 17:23:45 +0000 (18:23 +0100)]
vl: Use error_report() for --display errors
Results in nicer error messages. Before this patch:
Invalid GTK option string: gtk,lirum-larum
After:
qemu-system-x86_64: -display gtk,lirum-larum: Invalid GTK option string
Of course, the thing ought to use QemuOpts instead of parsing by hand.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus Armbruster [Fri, 27 Feb 2015 08:47:12 +0000 (09:47 +0100)]
vl: Avoid qerror_report() outside QMP command handlers
qerror_report() is a transitional interface to help with converting
existing monitor commands to QMP. It should not be used elsewhere.
Replace by error_report() in initial startup helpers parse_sandbox()
and parse_add_fd().
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus Armbruster [Fri, 13 Feb 2015 11:50:26 +0000 (12:50 +0100)]
QemuOpts: Wean off qerror_report_err()
qerror_report_err() is a transitional interface to help with
converting existing monitor commands to QMP. It should not be used
elsewhere.
The only remaining user in qemu-option.c is qemu_opts_parse(). Is it
used in QMP context? If not, we can simply replace
qerror_report_err() by error_report_err().
The uses in qemu-img.c, qemu-io.c, qemu-nbd.c and under tests/ are
clearly not in QMP context.
The uses in vl.c aren't either, because the only QMP command handlers
there are qmp_query_status() and qmp_query_machines(), and they don't
call it.
Remaining uses:
* drive_def(): Command line -drive and such, HMP drive_add and pci_add
* hmp_chardev_add(): HMP chardev-add
* monitor_parse_command(): HMP core
* tmp_config_parse(): Command line -tpmdev
* net_host_device_add(): HMP host_net_add
* net_client_parse(): Command line -net and -netdev
* qemu_global_option(): Command line -global
* vnc_parse_func(): Command line -display, -vnc, default display, HMP
change, QMP change. Bummer.
* qemu_pci_hot_add_nic(): HMP pci_add
* usb_net_init(): Command line -usbdevice, HMP usb_add
Propagate errors through qemu_opts_parse(). Create a convenience
function qemu_opts_parse_noisily() that passes errors to
error_report_err(). Switch all non-QMP users outside tests to it.
That leaves vnc_parse_func(). Propagate errors through it. Since I'm
touching it anyway, rename it to vnc_parse().
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Markus Armbruster [Thu, 12 Mar 2015 13:00:41 +0000 (14:00 +0100)]
qdev-monitor: Propagate errors through qdev_device_add()
Also polish an error message while I'm touching the line anyway,
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Markus Armbruster [Thu, 12 Mar 2015 12:58:02 +0000 (13:58 +0100)]
qdev-monitor: Propagate errors through set_property()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Markus Armbruster [Wed, 11 Mar 2015 18:16:04 +0000 (19:16 +0100)]
qdev-monitor: Convert qbus_find() to Error
As usual, the conversion breaks printing explanatory messages after
the error: actual printing of the error gets delayed, so the
explanations precede rather than follow it.
Pity. Disable them for now. See also commit 7216ae3.
While there, eliminate QERR_BUS_NOT_FOUND, and clean up unusual
spelling in the error message.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Markus Armbruster [Wed, 11 Mar 2015 17:39:16 +0000 (18:39 +0100)]
qdev-monitor: Fix check for full bus
Property bus has always been too screwed up to be really usable for
values other than plain bus IDs. This just fixes a bug that crept in
in commit 1395af6 "qdev: add a maximum device allowed field for the
bus."
It doesn't always fail when it should:
$ qemu-system-x86_64 -nodefaults -device virtio-serial-pci -device virtio-rng-device,bus=pci.0/virtio-serial-pci/virtio-bus
Happily plugs the virtio-rng-device into the virtio-bus provided by
virtio-serial-pci, even though its only slot is already occupied by a
virtio-serial-device.
And sometimes fails when it shouldn't:
$ qemu-system-x86_64 -nodefaults -device virtio-serial-pci -device virtserialport,bus=virtio-bus/virtio-serial-device
Yes, the virtio-bus is full, but the virtio-serial-bus provided by
virtio-serial-device isn't, and that's the one we're trying to use.
Root cause: we check "bus full" when we resolve the first element of
the path. That's the correct one only when it's also the last one.
Fix by moving the "bus full" check to right before we return a bus.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Markus Armbruster [Wed, 11 Mar 2015 16:26:31 +0000 (17:26 +0100)]
qdev-monitor: Stop error avalanche in qbus_find_recursive()
Reproducer:
$ qemu-system-x86_64 -nodefaults -device virtio-rng-pci -device virtio-rng-pci -device virtio-rng-device,bus=virtio-bus
qemu-system-x86_64: -device virtio-rng-device,bus=virtio-bus: Bus 'virtio-bus' is full
qemu-system-x86_64: -device virtio-rng-device,bus=virtio-bus: Bus 'virtio-bus' is full
qemu-system-x86_64: -device virtio-rng-device,bus=virtio-bus: Bus 'virtio-bus' not found
qbus_find_recursive() reports the "is full" error itself, and leaves
reporting "not found" to its caller. The result is confusion. Write
it a function contract that permits leaving all error reporting to the
caller, and implement it. Update callers to detect and report "is
full".
Screwed up when commit 1395af6 added the max_dev limit and the "is
full" error condition to enforce it.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Peter Crosthwaite [Sun, 24 May 2015 21:20:41 +0000 (14:20 -0700)]
disas: Remove uses of CPU env
disas does not need to access the CPU env for any reason. Change the
APIs to accept CPU pointers instead. Small change pattern needs to be
applied to all target translate.c. This brings us closer to making
disas.o a common-obj and less architecture specific in general.
Cc: Richard Henderson <rth@twiddle.net>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Michael Walle <michael@walle.cc>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Cc: Jia Liu <proljc@gmail.com>
Cc: Alexander Graf <agraf@suse.de>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Peter Crosthwaite [Sun, 24 May 2015 21:20:40 +0000 (14:20 -0700)]
monitor: Split mon_get_cpu fn to remove ENV_GET_CPU
The monitor currently has one helper, mon_get_cpu() which will return
an env pointer. The target specific users of this API want an env, but
all the target agnostic users really just want the cpu pointer. These
users then need to use the target-specifically defined ENV_GET_CPU to
navigate back up to the CPU from the ENV. Split the API for the two
uses cases to remove all need for ENV_GET_CPU.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Bandan Das [Wed, 3 Jun 2015 22:38:10 +0000 (18:38 -0400)]
monitor: Fix failure path for "S" argument
Since the "S" argument type is only used with the "?" flag,
the bug can't bite.
Signed-off-by: Bandan Das <bsd@redhat.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Bandan Das [Wed, 3 Jun 2015 22:38:09 +0000 (18:38 -0400)]
monitor: Point to "help" command on syntax error
When a command fails due to incorrect syntax or input, suggest using
the "help" command to get more information about the command. This
is only applicable for HMP.
Signed-off-by: Bandan Das <bsd@redhat.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Bandan Das [Wed, 3 Jun 2015 22:38:08 +0000 (18:38 -0400)]
monitor: cleanup parsing of cmd name and cmd arguments
There's too much going on in monitor_parse_command().
Split up the arguments parsing bits into a separate function
monitor_parse_arguments(). Let the original function check for
command validity and sub-commands if any and return data (*cmd)
that the newly introduced function can process and return a
QDict. Also, pass a pointer to the cmdline to track current
parser location.
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Bandan Das <bsd@redhat.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Bandan Das [Wed, 3 Jun 2015 22:38:07 +0000 (18:38 -0400)]
monitor: remove debug prints
The preferred solution is to use tracepoints and there
is good chance of bitrot with the debug prints not being
enabled at compile time. Remove them.
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Bandan Das <bsd@redhat.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Eric Blake [Fri, 15 May 2015 22:25:00 +0000 (16:25 -0600)]
qobject: Use 'bool' inside qdict
Now that qbool is fixed, let's fix getting and setting a bool
value to a qdict member to also use C99 bool rather than int.
I audited all callers to ensure that the changed return type
will not cause any changed semantics.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Eric Blake [Fri, 15 May 2015 22:24:59 +0000 (16:24 -0600)]
qobject: Use 'bool' for qbool
We require a C99 compiler, so let's use 'bool' instead of 'int'
when dealing with boolean values. There are few enough clients
to fix them all in one pass.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>