Commit Graph

49313 Commits

Author SHA1 Message Date
Marc-André Lureau bdbcb547cf monitor: deprecate 'default' option
This option does nothing since commit 06ac27f.  Deprecate it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Stefan Weil e7709b499c qemu-ga: Remove stray 'q' in documentation
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Stefan Weil 6bd67f8968 Makefile: Fix help text for target 'installer'
The NSIS based installer currently does not install qemu-ga.
It installs the executables and other files for the QEMU system emulation.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Peter Maydell 35b6e94ba5 s390: avoid always-true comparison in s390_pci_generate_fid()
Coverity points out that the comparison "fid <= ZPCI_MAX_FID"
in s390_pci_generate_fid() is always true (because fid
is 32 bits and ZPCI_MAX_FID is 0xffffffff). This isn't a
bug because the real loop termination condition is
expressed later via an "if (...) break;" inside the loop,
but it is a bit odd. Rephrase the loop to avoid the
unnecessary duplicate-but-never-true conditional.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Peter Maydell 25174055f4 migration: Remove unneeded NULL check from migrate_fd_error()
All the callers of migrate_fd_error() pass a non-NULL
error parameter, and if any did pass NULL then we would
segfault in error_copy(), so remove the unnecessary
NULL check earlier in the function.
(Spotted by Coverity.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Daniel Shahaf 5a1de0b325 scripts/hxtool: fix undefined behavour of echo
Avoid undefined behaviour of echo(1) with backslashes in arguments
The behaviour is implementation-defined, different /bin/sh's behave
differently.

Signed-off-by: Daniel Shahaf <danielsh@apache.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Michael Tokarev e1f3b974f4 qemu-options.hx: set: fix copy-paste error
Reported-By: Daniel Shahaf <danielsh@apache.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Akanksha Srivastava 73f7fd8861 usb: Change *_exitfn return type from int to void
The *_exitfn functions cannot fail and should not be
returning int.
This also removes the passthru_exitfn since this callback
does nothing as of now.
This was suggested as a Bite-sized task for code cleanup.
Signed-off-by: Akanksha Srivastava <akanksha.dlf@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Laurent Vivier 936c223051 MAINTAINERS: qemu-trivial information
Information about "qemu-trivial" ML can be found in the wiki:

    http://wiki.qemu.org/Contribute/TrivialPatches

But the first place where a developer looks is the file MAINTAINERS.

This also allows the get_maintainer.pl script to display
the qemu-trivial ML address when the mail subject contains "trivial".

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
zhanghailiang 7344ffaa2d colo-compare: remove unused struct CompareChardevProps and 'props' variable
After commit 0a73336d, 'props' variable in find_and_check_chardev()
is unused. Remove it, togther with struct CompareChardevProps.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Michael Walle c1a900cf4a milkymist-pfpu: fix potential integer overflow
Since the lm32 is a 32 bit architecture, just return a 32 bit value which
is then converted to a 64 bit value.

Spotted by coverity, CID 1005506.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Thomas Huth f96fe6b5c2 hw/block/nvme: Simplify if-statements a little bit
The condition  '!A || (A && B)' is equivalent to '!A || B'.

Buglink: https://bugs.launchpad.net/qemu/+bug/1464611
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Michael Walle 0a04e11f32 target-lm32: rewrite gen_compare()
Drop the rX, rY and rZ stuff and use dc->r{0,1,2} directly. This should
also fix the false positive in coverity CID 1005720.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Michael Walle 237a8650d6 lm32: milkymist-tmu2: fix integer overflow
Don't truncate the multiplication and do a 64 bit one instead because
because the result is stored in a 64 bit variable.

Spotted by coverity, CID 1167561.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Michael Walle 19f846b19f target-lm32: disable asm logging via LOG_DIS()
The lm32 target already has a disassembler which logs the assembly
instructions with "-d in_asm". Therefore, turn of the LOG_DIS() macro to
prevent logging the assembly instructions twice. Also turn the macro in a
one which is always compiled to catch any errors while the macro is turned
off.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Michael Walle 49285e11d8 target-lm32: swap operand of wcsr in LOG_DIS()
Be consistent with the reference manual.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Michael Walle 95f7983bac target-lm32: fix LOG_DIS operand order
The order of most opcodes with immediates was wrong (according to the
reference manual) in the (debug) logging. Additionally, one operand for the
andhi instruction was completly wrong. Fix these.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Michael Walle 5db35b616b target-lm32: fix style issue
Both branches of the ternary operator have the same expressions. Drop the
operator.

This fixes: https://bugs.launchpad.net/qemu/+bug/1414293

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Thomas Huth 5f333d79a4 hw/tpm/tpm_passthrough: Simplify if-statements a little bit
The condition  '!A || (A && B)' is equivalent to '!A || B'

Buglink: https://bugs.launchpad.net/qemu/+bug/1464611
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Changlong Xie c551cd52cc filter-dump: add missing "["
Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-10-28 18:17:23 +03:00
Peter Maydell fd209e4a77 -----BEGIN PGP SIGNATURE-----
iQIcBAABAgAGBQJYEm6NAAoJEH3vgQaq/DkO+30P/0n5EYgIZQugvUXJvpu0xx7V
 EDqtgrirRTtKaoApqiY36U3WbWK+1pPdMcdJ2z4bI9+VyYkKxlEisgEeGy2E7S33
 qD1kV+L1NabBV8Ee577wxAZz3xl4MBh1pzCIXsySA2VRNg/W6L8hj4rTmjap1U9p
 ZtbLkmwMpSwTkJxWPG1W+k0klk1tYxmcwsWcCSCuSOTXm/0gBpWdy5gBRuQXVi0l
 DQFlKS6BDlRiCvR4Qix6n0v8VTQfbRMGS40M6tpr3/QH/HvoKhxfTS/g8P72Bk20
 DPNsKF9DBfTY3KCtjcSrPTREaMqFw8VXn5XSw1uE30ALZNHru9PpVS3hbLfGmltB
 HAVANMbqROFvkQghtGWD7f34Oks/bxzLKxEXPAs9stwvthV46KyJsMHuiSbuzJhv
 tOUq0MadEquuVvgDqoRYKrwyYrjsRRZ4z5kDDnOr2iGZK+Mrhq7jBuYuKcvHyQi0
 apd27X4wwQTx/9tavC+ujeuVxAWBlSSP1EVGSiIenlq21cHLowuZdqrt2swAYkCs
 VlUyOzdCO/62SJGcrnrRCj3sKWbPTySnmDZQKrHve4rBzcL28IHCRxIfzbXRBkQI
 kGigceOwIyNW/bnp6rSYoBFKpz1NF2VScr/t5JzknsC8gT/tA0wPDBoIeL/kPVHm
 T/qOTHLDY/fHUNwXOkTe
 =tz25
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging

# gpg: Signature made Thu 27 Oct 2016 22:15:57 BST
# gpg:                using RSA key 0x7DEF8106AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"
# Primary key fingerprint: FAEB 9711 A12C F475 812F  18F2 88A9 064D 1835 61EB
#      Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76  CBD0 7DEF 8106 AAFC 390E

* remotes/jnsnow/tags/ide-pull-request:
  qemu-iotests: Test creating floppy drives
  fdc: Move qdev properties to FloppyDrive
  fdc: Add a floppy drive qdev
  fdc: Add a floppy qbus
  macio: switch over to new byte-aligned DMA helpers
  dma-helpers: explicitly pass alignment into DMA helpers

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-28 14:29:50 +01:00
Peter Maydell 9879b75873 Block layer patches
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJYEjZDAAoJEH8JsnLIjy/WSXQQALz5t/O6jnLkLMceuJvAdxzk
 1w3cwcc2I2VOSubqnUXuK9KCFK0R8ifN0UmYNENbh9DCNEhDpbD16hbkO5LvnRwk
 IaFpt1jAP7Y9epZ3GnJ0JdAsk+PDnqj3zQW6PSJLyzXVOnyVCE7aU+fjEv3Khoa7
 88ye3xBx8F9RDaQ4EBOSm55q/gEk0RHnFbgq/YurHzWg5go23VwunVBP7XALG6Bs
 2jm5/iEKXdoIoJ57dADQzUf2WWMgE73CO9kd/c9iaFmd2FWOHHRsuFyj7a38bKmn
 N7kRDBrC3MlOPxP6zB2jBNmAa70cdQO9Ktqm7geTTb1WWSxxUHBuX1TtAsish6d7
 aYVSZyNoaSdwcRSnNTnJkscNItldAUtoPvgrYCbniWVRU7YiY+yUXsQyWdmpKbTE
 JLy06p4mGZEuDR5RDMWZfaJbw+eNtmpiL9vMRBM+A9EzMIhuVm1hu34/SRyvcPSM
 fyzW5gAYsPA7E+nZT1Jkpw/f8jxxUo1vdhQpWWGijCMK5kpkumfWXZKnuSKwvRYz
 xcHdGE1nbLfWaBgyClZCLRMNb3CFuDEsr4NCrjwGr4xdLs9VbxXxvNqvFl8DOWR/
 amVsQd6fvTfcusDxY9hY6BOlgID/dqfi7wzvxowDhsTG6ewSsqwjYLzUwADzcKn0
 sAmLBX3P3sJNrf7Y9UaT
 =BtvM
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches

# gpg: Signature made Thu 27 Oct 2016 18:15:47 BST
# gpg:                using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream: (23 commits)
  iotests: Add test for NBD's blockdev-add interface
  iotests: Add assert_json_filename_equal() method
  socket_scm_helper: Accept fd directly
  iotests.py: Allow concurrent qemu instances
  iotests.py: Add qemu_nbd function
  qapi: Allow blockdev-add for NBD
  block/nbd: Use SocketAddress options
  block/nbd: Accept SocketAddress
  block/nbd: Add nbd_has_filename_options_conflict()
  block/nbd: Use qdict_put()
  block/nbd: Default port in nbd_refresh_filename()
  block/nbd: Reject port parameter without host
  block/nbd: Drop trailing "." in error messages
  qemu-iotests: Fix typo for NFS with IMGOPTSSYNTAX
  block: Remove bdrv_aio_ioctl()
  raw: Implement .bdrv_co_ioctl instead of .bdrv_aio_ioctl
  block: Introduce .bdrv_co_ioctl() driver callback
  block: Remove bdrv_ioctl()
  raw-posix: Don't use bdrv_ioctl()
  block: Use blk_co_ioctl() for all BB level ioctls
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-28 12:06:41 +01:00
Peter Maydell 8639832846 seabios: update to 1.10.0 release.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJYEhROAAoJEEy22O7T6HE4wDcQALUSa9rfUNrqwChUKhOyFxT1
 DgqkwauuQ1xq5wCr2sANYIskuOdj/6Iy2ECRiCI2CRY1D94XpHf3eM8NDCyu0IMG
 cJQ2BwJHyuKd9h2gKYgGuxuGL7lec/DLkjC43QsaLl+HJZG+cCNnY5rzu+kUmpAf
 ALKnyQh+axnNg9eG6AfbK8Z0tBL/QQ8SsTeY/y7jc98BR5UENP4oLRs3gyPhxaCy
 E0TyUeh2Y/84p12KmpJXndM8aKmLvPAL+/PqQbw/u6OuqK1UTJULjhWefDMgF4ii
 XCC6OAuSNZKPef39S6Nr6FUM92cDQQytRdDfL9ggbpOg+v6RCOG5CRZcxn8ThLq3
 euQiGVnfqnaIngl1bQpWeGTpzIRhjPYGQXNdbYrRAzGqoewDjFUvAuUZ4TJFmlWM
 b/TN7vfeTPCToUCFPlozO/P0e9ax0vsPtTOVKPsbr3Gi/rnoJMvG9/OamAjEMaXL
 ukK4X1t5XVYrYyNWTvUmFyxxAVaBX4mYnn0eHeNmx3PU+HwHKdWAgrv8AamihEeG
 D0j3TidRGU3XL/b0P3ZvOu46ALit5bAfhARQ9/y6xSfB+ltjOhjBREfbxfOmopbh
 fWJRpu9pPVgHrb6f847hE+NI1UfzBxMj6D4i/gKPL5sCucwQFuFCJXzz3qBuoBA8
 EV/PD/R2+JWRrPAdrxPJ
 =MfME
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-seabios-20161027-2' into staging

seabios: update to 1.10.0 release.

# gpg: Signature made Thu 27 Oct 2016 15:50:54 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# 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>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/pull-seabios-20161027-2:
  seabios: update to 1.10.0 release.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-28 10:51:22 +01:00
Peter Maydell b67d87f969 virtio-gpu: fix memory leak in virtio_gpu_resource_create_2d
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJYEhAGAAoJEEy22O7T6HE4pYYP+wXpAVM8OVpIwXBGJTD5FkIy
 bh1+IQhxJqzvRSrco0MXnFKpE6OHPxw+6Rwz7SxA+XZWp1qPMVirWDroeB4mPhcn
 JaNvQK5DYnYyQiUNd716K7oXQbO+wA7fKnZynMKxKXweEb5i6kQ/phiRN+gc8AV2
 gFrvan+Ay9ZF1l4u9lFC2Du7k7CcLBri22UgjzSSp2p3/ou97zu+H2U0vIMw7iPL
 udAOvZ325cQgN+CKhswi5o1F2G3F1jURduhjEwKczm0YcNRRuAlByoc9Ib4r4h7S
 QGbQihh2r25dlXH5V0MwpBRs+8TrscOsK5+cMHCbvrDYFRlKmF86qObiN0EYoTDe
 NqS29kVIErkteaE/njpT/Z+T80MGQ5O40RkEjFB1B2h+DeXGzS/kA3UkxGv10Oxe
 MoEJ/92Nj9o6GZ/ef9a8KnnBvzYk+Shs5/AxZG+IwMOEjzG7AIfOnEH4xPObhLcx
 bty6uYb4e9d5MZbFeqpO1TuFelEOyUg9fIxmXz2vHUAGTfH7eVCKpZhSYzMrO7/F
 6bOz6zwAuEWgxQSmjGvO58AE0SOX3zNiuD7lUWOki0ZKP9+4abc3S7IaiVdEQWF2
 jXXvlDJDozsLYVnmuDRBhQZZf3fFcC+tqQi8VD5SqwW2SaMvU5zcrx1wrCDDp/We
 5ymJEMC+ZBHPXyo37vXf
 =PIwt
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20161027-1' into staging

virtio-gpu: fix memory leak in virtio_gpu_resource_create_2d

# gpg: Signature made Thu 27 Oct 2016 15:32:38 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# 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>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/pull-vga-20161027-1:
  virtio-gpu: fix memory leak in virtio_gpu_resource_create_2d

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-28 09:58:38 +01:00
Kevin Wolf c9bf278bf2 qemu-iotests: Test creating floppy drives
This tests the different supported methods to create floppy drives and
how they interact.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1477386868-21826-5-git-send-email-kwolf@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
2016-10-27 16:29:14 -04:00
Kevin Wolf a92bd191a4 fdc: Move qdev properties to FloppyDrive
This makes the FloppyDrive qdev object actually useful: Now that it has
all properties that don't belong to the controller, you can actually
use '-device floppy' and get a working result.

Command line semantics is consistent with CD-ROM drives: By default you
get a single empty floppy drive. You can override it with -drive and
using the same index, but if you use -drive to add a floppy to a
different index, you get both of them. However, as soon as you use any
'-device floppy', even to a different slot, the default drive is
disabled.

Using '-device floppy' without specifying the unit will choose the first
free slot on the controller.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1477386868-21826-4-git-send-email-kwolf@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
2016-10-27 16:29:13 -04:00
Kevin Wolf 394ea2cac4 fdc: Add a floppy drive qdev
Floppy controllers automatically create two floppy drive devices in qdev
now. (They always created two drives, but managed them only internally.)

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1477386868-21826-3-git-send-email-kwolf@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
2016-10-27 16:29:13 -04:00
Kevin Wolf 51e6e90e72 fdc: Add a floppy qbus
This adds a qbus to the floppy controller that should contain the floppy
drives eventually. At the moment it just exists and is empty.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1477386868-21826-2-git-send-email-kwolf@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
2016-10-27 16:29:13 -04:00
Mark Cave-Ayland be1e343995 macio: switch over to new byte-aligned DMA helpers
Now that the DMA helpers are byte-aligned they can be called directly from
the macio routines rather than emulating byte-aligned accesses via multiple
block-level accesses.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-Id: 1476445266-27503-3-git-send-email-mark.cave-ayland@ilande.co.uk
Signed-off-by: John Snow <jsnow@redhat.com>
2016-10-27 16:29:13 -04:00
Mark Cave-Ayland 99868af3d0 dma-helpers: explicitly pass alignment into DMA helpers
The hard-coded default alignment is BDRV_SECTOR_SIZE, however this is not
necessarily the case for all platforms. Use this as the default alignment for
all current callers.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Eric Blake <eblake@redhat.com>
Acked-by: John Snow <jsnow@redhat.com>
Message-id: 1476445266-27503-2-git-send-email-mark.cave-ayland@ilande.co.uk
Signed-off-by: John Snow <jsnow@redhat.com>
2016-10-27 16:29:13 -04:00
Fam Zheng db4df20de8 trace: Fix 'char **' compilation error in simple backend
Currently, the generated function body will do "strlen(arg)" but the
argument could be 'char **' or 'char * const *'. Avoid that by excluding
such cases in is_string check.

Reported by patchew's "make docker-test-mingw@fedora".

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1477453806-21097-1-git-send-email-famz@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-10-27 19:24:15 +01:00
Max Reitz b74fc7f78e iotests: Add test for NBD's blockdev-add interface
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Max Reitz e07375f552 iotests: Add assert_json_filename_equal() method
Since the order of keys in JSON filenames is not necessarily fixed, they
should not be compared to fixed strings. This method takes a Python dict
as a reference, parses a given JSON filename and compares both.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Max Reitz d35172b425 socket_scm_helper: Accept fd directly
This gives us more freedom about the fd that is passed to qemu, allowing
us to e.g. pass sockets.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Max Reitz 5fcbdf508a iotests.py: Allow concurrent qemu instances
By adding an optional suffix to the files used for communication with a
VM, we can launch multiple VM instances concurrently.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Max Reitz bec87774c2 iotests.py: Add qemu_nbd function
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Max Reitz 6b02b1f0a4 qapi: Allow blockdev-add for NBD
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Max Reitz f84d431b86 block/nbd: Use SocketAddress options
Drop the use of legacy options in favor of the SocketAddress
representation, even for internal use (i.e. for storing the result of
the filename parsing).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Max Reitz 491d6c7c4e block/nbd: Accept SocketAddress
Add a new option "server" to the NBD block driver which accepts a
SocketAddress.

"path", "host" and "port" are still supported as legacy options and are
mapped to their corresponding SocketAddress representation.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Max Reitz 48c38e0b8d block/nbd: Add nbd_has_filename_options_conflict()
Right now, we have four possible options that conflict with specifying
an NBD filename, and a future patch will add another one ("address").
This future option is a nested QDict that is flattened at this point,
requiring us to test each option whether its key has an "address."
prefix. Therefore, we will then need to iterate through all options
(including the "export" option which was not covered so far).

Adding this iteration logic now will simplify adding the new option
later. A nice side effect is that the user will not receive a long list
of five options which are not supposed to be specified with a filename,
but we can actually print the problematic option.

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Max Reitz fcfcd8ffcc block/nbd: Use qdict_put()
Instead of inlining this nice macro (i.e. resorting to
qdict_put_obj(..., QOBJECT(...))), use it.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Max Reitz 7edca33804 block/nbd: Default port in nbd_refresh_filename()
Instead of not emitting the port in nbd_refresh_filename(), just set it
to the default if the user did not specify it. This makes the logic a
bit simpler.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Max Reitz 442045cbce block/nbd: Reject port parameter without host
Currently, a port that is passed along with a UNIX socket path is
silently ignored. That is not exactly ideal, it should be an error
instead.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Max Reitz 82d73014a9 block/nbd: Drop trailing "." in error messages
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Kevin Wolf e5b77eec91 qemu-iotests: Fix typo for NFS with IMGOPTSSYNTAX
Commit 076003f5 added configuration for NFS with IMGOPTSSYNTAX enabled,
but it didn't use the right variable name: $TEST_DIR_OPTS doesn't exist.
This fixes the mistake.

However, this doesn't make anything work that was broken before: The
only way to get IMGOPTSSYNTAX is with -luks, but the combination of
-luks and -nfs doesn't get qemu-img create commands right (because
qemu-img create doesn't support --image-opts yet), so even after this
fix some more work would be required to make the tests pass.

Reported-by: Tomáš Golembiovský <tgolembi@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-10-27 19:05:23 +02:00
Kevin Wolf cbc14ac9c3 block: Remove bdrv_aio_ioctl()
It is unused now.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2016-10-27 19:05:23 +02:00
Kevin Wolf 151a2930c4 raw: Implement .bdrv_co_ioctl instead of .bdrv_aio_ioctl
It's the simpler interface to use for the raw format driver.

Apart from that, this removes the last user of the AIO emulation
implemented by bdrv_aio_ioctl().

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2016-10-27 19:05:23 +02:00
Kevin Wolf 16a389dc9e block: Introduce .bdrv_co_ioctl() driver callback
This allows drivers to implement ioctls in a coroutine-based way.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2016-10-27 19:05:23 +02:00
Kevin Wolf 61b2450414 block: Remove bdrv_ioctl()
It is unused now.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2016-10-27 19:05:23 +02:00
Kevin Wolf 0d4377b3ea raw-posix: Don't use bdrv_ioctl()
Instead of letting raw-posix use the bdrv_ioctl() abstraction to issue
an ioctl to itself, just call ioctl() directly.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2016-10-27 19:05:23 +02:00