Commit Graph

37149 Commits (be7433efbf8b4134ab9763abdecaf2e6a35e1ed1)

Author SHA1 Message Date
Kevin Wolf bc63781ca3 Merge remote-tracking branch 'mreitz/block' into queue-block
* mreitz/block:
  iotests: Lower 064's memory usage
  block: vhdx - force FileOffsetMB field to '0' for certain block states
2015-01-23 18:51:47 +01:00
Max Reitz e35053b25a iotests: Lower 064's memory usage
Test 064 reads a lot of data at once which currently results in qemu-io
having to allocate up to about 1 GB of memory (958 MB, to be exact).
This patch lowers that amount to 128 MB by making the test read smaller
chunks.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Message-id: 1422025185-25229-1-git-send-email-mreitz@redhat.com
2015-01-23 12:41:32 -05:00
Jeff Cody cdf9634bdf block: vhdx - force FileOffsetMB field to '0' for certain block states
The v1.0.0 spec calls out PAYLOAD_BLOCK_ZERO FileOffsetMB field as being
'reserved'.  In practice, this means that Hyper-V will fail to read a
disk image with PAYLOAD_BLOCK_ZERO block states with a FileOffsetMB
value other than 0.

The other states that indicate a block that is not there
(PAYLOAD_BLOCK_UNDEFINED, PAYLOAD_BLOCK_NOT_PRESENT,
 PAYLOAD_BLOCK_UNMAPPED) have multiple options for what FileOffsetMB may
be set to, and '0' is explicitly called out as an option.

For all the above states, we will also just set the FileOffsetMB value
to 0.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: a9fe92f53f07e6ab1693811e4312c0d1e958500b.1421787566.git.jcody@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-01-23 12:41:32 -05:00
Jeff Cody 9a29e18f7d block: update string sizes for filename,backing_file,exact_filename
The string field entries 'filename', 'backing_file', and
'exact_filename' in the BlockDriverState struct are defined as 1024
bytes.

However, many places that use these values accept a maximum of PATH_MAX
bytes, so we have a mixture of 1024 byte and PATH_MAX byte allocations.
This patch makes the BlockDriverStruct field string sizes match usage.

This patch also does a few fixes related to the size that needs to
happen now:

    * the block qapi driver is updated to use PATH_MAX bytes
    * the qcow and qcow2 drivers have an additional safety check
    * the block vvfat driver is updated to use PATH_MAX bytes
      for the size of backing_file, for systems where PATH_MAX is < 1024
      bytes.
    * qemu-img uses PATH_MAX rather than 1024.  These instances were not
      changed to be dynamically allocated, however, as the extra
      temporary 3K in stack usage for qemu-img does not seem worrisome.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-01-23 18:17:06 +01:00
Jeff Cody 1d33936ea8 block: mirror - change string allocation to 2-bytes
The backing_filename string in mirror_run() is only used to check
for a NULL string, so we don't need to allocate 1024 bytes (or, later,
PATH_MAX bytes), when we only need to copy the first 2 characters.

We technically only need 1 byte, as we are just checking for NULL, but
since backing_filename[] is populated by bdrv_get_backing_filename(), a
string size of 1 will always only return '\0';

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-01-23 18:17:06 +01:00
Jeff Cody a1a11d10ab block: remove unused variable in bdrv_commit
As Stefan pointed out, the variable 'filename' in bdrv_commit is unused,
despite being maintained in previous patches.

With this patch, get rid of the variable for good.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-01-23 18:17:06 +01:00
Jeff Cody 564d64bdde block: qapi - move string allocation from stack to the heap
Rather than declaring 'backing_filename2' on the stack in
bdrv_query_image_info(), dynamically allocate it on the heap.

Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-01-23 18:17:06 +01:00
Jeff Cody fe2065629a block: vmdk - move string allocations from stack to the heap
Functions 'vmdk_parse_extents' and 'vmdk_create' allocate several
PATH_MAX sized arrays on the stack.  Make these dynamically allocated.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-01-23 18:17:05 +01:00
Jeff Cody 395a22fae0 block: vmdk - make ret variable usage clear
Keep the variable 'ret' something that is returned by the function it is
defined in.  For the return value of 'sscanf', use a more meaningful
variable name.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-01-23 18:17:05 +01:00
Max Reitz f30136b35a iotests: Add tests for more corruption cases
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-01-23 18:17:05 +01:00
Max Reitz 8dd93d9339 qcow2: Add two more unalignment checks
This adds checks for unaligned L2 table offsets and unaligned data
cluster offsets (actually the preallocated offsets for zero clusters) to
the zero cluster expansion function.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-01-23 18:17:05 +01:00
Fam Zheng 1dc936aa84 virtio-blk: Use blk_aio_ioctl
Use the asynchronous interface of ioctl. This will not make the VM
unresponsive if the ioctl takes a long time.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-01-23 18:17:05 +01:00
Fam Zheng 75344fa4c5 virtio-blk: Pass req to virtio_blk_handle_scsi_req
In preparation for calling blk_aio_ioctl. Also make the function static
as no other files need it.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-01-23 18:17:05 +01:00
Peter Maydell a46b3aaf6b seccomp branch queue
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJUwkhpAAoJEP0M/1sS+L0v9TEIAK419i+1WIHgJn9c+144zQ2/
 V+/kw9/L7gI2E0sPzX13L6C9Xkl7RFFDslblgvJfrvGAUDPtZ6EUYgdqamKv+PDw
 G6S+jStDUlYOkD8SkL0txwwQLcH+nIjFeElRS7r9o2kMDQQAMLLZ7rlFlZenaxXv
 BNC0DLbxTQOZWya7aDifBx3nr3Aybj1w1S5YnntoPGksr/FP8H1/MpagwcRxb6ws
 4Nle6MqRNrozYMpZ5lZoeQ0ok22dKV4SbiZiXYcQ/Oi/j/7YgD4KF74/oI+7yOLE
 hog/+Xzc7Uamj6FIs9YMly5Fj66CK3f8ZYg2GgQTSJ1GqPuxSLKTrEZjfApN3eM=
 =mYYg
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/otubo/tags/pull-seccomp-20150123' into staging

seccomp branch queue

# gpg: Signature made Fri 23 Jan 2015 13:11:05 GMT using RSA key ID 12F8BD2F
# gpg: Can't check signature: public key not found

* remotes/otubo/tags/pull-seccomp-20150123:
  seccomp: add mlockall to whitelist

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-01-23 13:24:17 +00:00
Paolo Bonzini 4b45b05549 seccomp: add mlockall to whitelist
This is used by "-realtime mlock=on".

Signed-off-by: Eduardo Otubo <eduardo.otubo@profitbricks.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Tested-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Eduardo Otubo <eduardo.otubo@profitbricks.com>
2015-01-23 14:07:08 +01:00
Peter Maydell c6441452b5 b16: fix interrupt acknowledgement
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJUwOE1AAoJEEy22O7T6HE4Rk4P/jAriY03WoTzwhLBE8Rj9J+t
 2hY9sKTmB06Kn9tbdBhC/dqS4SFqdX6K4sSumw+AxWQL08OAR4z7EOass8eXUJ9G
 chAsvs+98fV2jYY0IA8OO2tyQL4PK/RUjOsOtqw/AQKCNIZ4BXjsLIlbSCZ9sp5b
 2i5Plqc7dkfIUT21s6Exr0YFGOgL/nSbAHa8aeHe3Iy85wG7YcEbkMKSPFYkkJhy
 LfnK5/LbOKzQL0xfmINJ7D8HasOhb440B+XVlr1+pNOtf8BfndMoT0N8WrimICke
 N+9zikUboWT53wbEct8J+4XouXJnDu/xXbQF0IRnNmZb5ThMssIjwm6DfLb1WbQY
 v866UdVULtEUsoQNMpoQk2WKT27Tm6afmQtZlXPcBLpAMdBxBMX/zJIgSSGS3cMZ
 ekhd+SMlgrjExjaXOHLo6wRp526VieRsr59CSi4hIh4vypPJ7VOQ3PM7kD4Cpr/E
 54eHCJgNSUlahD3aflHT2npXwVkmn/7sF0gbKKo/Rnv482eM2Rcp8Xk+Z8E1LDVt
 wwC+vH/sr+r5ceWILd38cT9KPNggszmPeE3snKe36BszgBlqyjLo8l8VqjjTvxMe
 M8WVUdoKGxW9M8AYL0vLhqBHem+TbEmetVZs/uWPajGQaRw7h2f7OKWGIQtubYlt
 UP1xWuRbLSdUHWpEgorE
 =aqey
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-audio-20150122-1' into staging

b16: fix interrupt acknowledgement

# gpg: Signature made Thu 22 Jan 2015 11:38:29 GMT 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-audio-20150122-1:
  sb16: fix interrupt acknowledgement

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-01-22 18:57:36 +00:00
Peter Maydell 8f970eff6e input: misc fixes.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJUwN6pAAoJEEy22O7T6HE4St8P/1d26YYIC2DMfWsrTM/pLQlq
 QDpYyeU51xOv59BKgRHchNMNS6AygJ3m6sWXwCq7lfsHEGVLJtlPXPIPDMD/pHc1
 xKchw5IsWkjVBaiVPgjFA3p4YcRbpUiarO60sP5bk3dzyuJvBPglc5dyMqCuLbVu
 EfhApw4Bpk7b07pC3/6G4TS5WkAYjbC1uLn5cd0ClaPaYuh2a73Tlo92K/DOXHG2
 bJtZTpfu5I69vVn8+tdnn6lz4PHycxh3NjQNw3QqgvOm97VZhW9iv6S5konyi1lq
 qeVEs9loFx8zlxKIaSFQOuC/JEtZ03hpKp8H0No+KxE1zU247kZpRbeR6HT3fSD5
 lMLHOs55+Nk2h8T+IEC0E7UPx+o1hELMLvjmNmM7dxVHUV/R3oq+rb98a1fMFr8r
 5n7qUKQJm03GFM6YsCGjnyV64DjUvl3ASh6yzHZ4tL7hA2rmZT+G38mxm84ScwP6
 dlFRR0707uZarnj8vz6Tr6ehAbUr6ylf7JpE4JsqluDHaGyY0rBgPkg2x50uqyd9
 ek2Nk7+jMpLUWrKGUQmOJjmDAb1tmOcFriZfg6duhAwlLFH9b4U0p47UvWkusGKq
 o/fZBLr0QPYYde7NlBNMWu3tmLi/1vYPCH8LaSmRPCNLgTO5vOTGed1FCqLiWq+a
 joYJUL9tzL6PSIqQ56m2
 =247P
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-20150122-1' into staging

input: misc fixes.

# gpg: Signature made Thu 22 Jan 2015 11:27:37 GMT 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-20150122-1:
  hw/input/hid.c Fix capslock hid code
  hid: handle full ptr queues in post_load
  input: improve docs for input-send-event qmp command

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-01-22 17:41:59 +00:00
Peter Maydell adeecf14d6 spice: fix coverity defect, add unix address support
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJUwNxEAAoJEEy22O7T6HE4srMQAIBKASUv8434NMAtnRKmMtUk
 auQrl+ZZjjluymrULtGjXaCHpw0o8taMjRhFi21ODuQFEbHm8oo2NThSY2gxmg91
 sQIR5WNb9O4a6S3jAH/XVf/iTBDaPIcFVSeuML7+YhXp3rhIfBMIj6trsK/iWSGD
 qCDWKMORZAdGrGPh6wzskmfR2fRm/sXeXm7oqmEP0jawd0oIX+Chno5BbfXz4/WB
 18SV/b2nqiV4vGOZF7Lzyi0a5IcrJV9vl+kQRf446TbJbyoVZPZQp6qLOCL3UT4c
 P5MtON2XqFjJb2BvXN6Jg3sMSGYGixHtenHXLXCTRUCUD+CWMIwN+AeA9q17wiWJ
 bXjYROx6oQ1YmhXLaJI0N7dXTohBEYC54SoDjinjdIKKrf2rCjAr6B6eaqyidc4q
 GHCrOdL4jTkbcAiBJ/MgUBgay9OFbKkje7tK8BP1j7cWpDaz7lG8qErmwkzWW3DX
 PvZxumMYnQe5gVPI6nIT2dNTwRTofyavkb/1KnthJTeFqJa1ecFCjew8c9TLo0WO
 29WHTeuwtblUmRFarapaB2zRyt6LR+f75mRQHog3h1qFaBiaWYuMrtxoqrCq1RL2
 J0LRLnmVxKK2+nuAHM4xMvzLl7dLHKIHHMClhAj3E8rIHOnk8ssy9/lunDiq/VHt
 CENvqA32bzkZyW2fmT3H
 =BEw6
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/spice/tags/pull-spice-20150122-1' into staging

spice: fix coverity defect, add unix address support

# gpg: Signature made Thu 22 Jan 2015 11:17:24 GMT 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/spice/tags/pull-spice-20150122-1:
  spice: fix coverity reported defect in display code
  spice: add unix address support

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-01-22 13:56:11 +00:00
Peter Maydell b3a4755a67 vnc: add support for multiple vnc displays
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJUwNhmAAoJEEy22O7T6HE4qNEP/3wE79x34VFtKUZ3k1hsUxOZ
 8Rbb8lbPhCeQjEF3pcxVF0QEjJidk/OKSyzLJbJXjq0L+6EmiNfII1bzBseUDvFe
 XsWLKuCnNwMr6fuZ34C4PPbRSYgBZhxQywsIV/RKdTxKxs5suPDoASOGI1ZAd1Fo
 y0fPBe/z3ecVSQcuKNiDQ7jdbJT7gQ65yn5DpdeM/LSHrW/Xo700WCZtQbc+ZcxW
 78SMj0SxhbfLgHB91xYw3yZT6L6xXed5HcJyqfboeGYIHrpRaHrEwkghumQ12XA1
 ZHRFkiaOZS8y565T0KMJxx1+sZerG9q/1xLCLohziR0u4BZ4H2txqtUviujQ00Dl
 83pVGWNlRvHgVgVuH7sfP1N3TqdmwOLr4UttzCtWxSJjDeK++z/zEHHB/aB4UZSr
 WHUG9cPLP/+trckE86CXbJ4LzAq1viiIin3i98tUh/jwljrJXW1jhd9qnoouFoAF
 VBxQ71G8BIVnm+TJuikcUSaf3VeRy1C1CT1XEsBy2jN4CYn7cDhnju+JdECgi2G0
 ZZrBfDWY3xKBcXA5t1aOJasSHO7PsPOPfZr/fIs6koPWiUL67GMRyZPNXYAn5xrz
 918WMWQ2KI93DT+uMLBT0veOG4du4MhadSnq1lXZnalFfYABrvzWiVNE97UF5aKE
 g/NVldhYivZP7uIhmLK5
 =+MFe
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20150122-1' into staging

vnc: add support for multiple vnc displays

# gpg: Signature made Thu 22 Jan 2015 11:00:54 GMT 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-vnc-20150122-1:
  monitor: add vnc websockets
  monitor: add query-vnc-servers command
  vnc: factor out qmp_query_client_list
  vnc: track & limit connections
  vnc: update docs/multiseat.txt
  vnc: allow binding servers to qemu consoles
  vnc: switch to QemuOpts, allow multiple servers
  vnc: add display id to acl names
  vnc: remove unused DisplayState parameter, add id instead.
  vnc: remove vnc_display global

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-01-22 12:14:19 +00:00
Dinar Valeev 0ee4de5840 hw/input/hid.c Fix capslock hid code
When ever USB keyboard is used, e.g. '-usbdevice keyboard' pressing
caps lock key send 0x32 hid code, which is treated as backslash.
Instead it should be 0x39 code. This affects sending uppercase keys,
as they typed whith caps lock active.

While on x86 this can be workarounded by using ps/2 protocol. On
Power it is crusial as we don't have anything else than USB.

This is fixes guest automation tasts over vnc.

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22 12:19:48 +01:00
Gerd Hoffmann ba4d26064e hid: handle full ptr queues in post_load
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
2015-01-22 12:19:48 +01:00
Gerd Hoffmann 4083ae311d input: improve docs for input-send-event qmp command
Text partly suggested by Markus Armbruster <armbru@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22 12:19:48 +01:00
Peter Maydell a805ca5401 qemu-sparc update
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQEcBAABAgAGBQJUv9o/AAoJEFvCxW+uDzIfTwcH/2XSisJynfECMgclwnyp1fbd
 xs5ZFP7pV2+eyrtOExiRX+CTOoEdiNxjlwO/sq4yrTkbUzPLDC9QoQonFK4GjXSA
 cNGCbvBusHgAzwyoqfzPmlX0FOGwgfEDoanPWFCq01Cf4vYCEJFDGxMj4OjgSQ7L
 VFIobD3Wsz9gNLF2bhj7YIbC1OYWFYLJuEeC+RzJ9+LJ36lmvijOqkfCVX6on69u
 3T7Qc+CgBPeJFmiXdHmDAKlmV4muQ2wddxqxSrPLbepJdiwoNap+fEz6pydMEoqX
 zMM9VrwbBTNAogWaVdab9gOtsBmY9x0ERV8cwyx2ZTZwP2SUIF1VIg6cZanHb6I=
 =b+DY
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-signed' into staging

qemu-sparc update

# gpg: Signature made Wed 21 Jan 2015 16:56:31 GMT using RSA key ID AE0F321F
# gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>"

* remotes/mcayland/tags/qemu-sparc-signed:
  disas/sparc: Remove unused data sparc_opcode_archs[]
  target-sparc: Mark gen_load_trap_state_at_tl() as !CONFIG_USER_ONLY
  target-sparc: is_translating_asi() is TARGET_SPARC64 only
  target-sparc: address_mask(), asi_address_mask() are TARGET_SPARC64 only
  target-sparc: Remove unused gen_op_subi_cc and gen_op_addi_cc

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-01-22 11:16:20 +00:00
Gerd Hoffmann 4478aa768c monitor: add vnc websockets
Add websockets bool to VncBasicInfo, report websocket server sockets,
flag websocket client connections.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22 11:18:47 +01:00
Gerd Hoffmann df88768460 monitor: add query-vnc-servers command
Add new query vnc qmp command, for the lack of better ideas just name it
"query-vnc-servers".  Changes over query-vnc:

 * It returns a list of vnc servers, so multiple vnc server instances
   are covered.
 * Each vnc server returns a list of server sockets.  Followup patch
   will use that to also report websockets.  In case we add support for
   multiple server sockets server sockets (to better support ipv4+ipv6
   dualstack) we can add them to the list too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22 11:18:47 +01:00
Gerd Hoffmann 2d29a4368c vnc: factor out qmp_query_client_list
so we can reuse it for the new vnc query command.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22 11:18:47 +01:00
Gerd Hoffmann e5f34cdd2d vnc: track & limit connections
Also track the number of connections in "connecting" and "shared" state
(in addition to the "exclusive" state).  Apply a configurable limit to
these connections.

The logic to apply the limit to connections in "shared" state is pretty
simple:  When the limit is reached no new connections are allowed.

The logic to apply the limit to connections in "connecting" state (this
is the state you are in *before* successful authentication) is
slightly different:  A new connect kicks out the oldest client which is
still in "connecting" state.  This avoids a easy DoS by unauthenticated
users by simply opening connections until the limit is reached.

Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22 11:18:47 +01:00
Gerd Hoffmann 86fdcf23f4 vnc: update docs/multiseat.txt
vnc joins the party ;)
Also some s/head/seat/ to clarify.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22 11:18:47 +01:00
Gerd Hoffmann 1d0d59fe29 vnc: allow binding servers to qemu consoles
This patch adds a display= parameter to the vnc options.  This allows to
bind a vnc server instance to a specific display, allowing to create a
multiseat setup with a vnc server for each seat.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22 11:18:46 +01:00
Gerd Hoffmann 4db14629c3 vnc: switch to QemuOpts, allow multiple servers
This patch switches vnc over to QemuOpts, and it (more or less
as side effect) allows multiple vnc server instances.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22 11:18:46 +01:00
Gerd Hoffmann c8496408b4 vnc: add display id to acl names
In case the display id is "default" (which is the one you get if you
don't explicitly assign one) we keep the old name scheme, without
display, for backward compatibility reasons.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
2015-01-22 11:18:46 +01:00
Gerd Hoffmann 14f7143ede vnc: remove unused DisplayState parameter, add id instead.
DisplayState isn't used anywhere, drop it.  Add the vnc server ID as
parameter instead, so it is possible to specify the server instance.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
2015-01-22 11:18:46 +01:00
Gerd Hoffmann d616ccc5dd vnc: remove vnc_display global
Replace with a vnc_displays list, so we can have multiple vnc server
instances.  Add vnc_server_find function to lookup a display by id.
With no id supplied return the first vnc server, for backward
compatibility reasons.

It is not possible (yet) to actually create multiple vnc server
instances.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
2015-01-22 11:18:46 +01:00
Gerd Hoffmann 51a0909914 spice: fix coverity reported defect in display code
Report:

1. Condition surface, taking false branch
406    if (surface && ssd->surface &&
407        surface_width(surface) == pixman_image_get_width(ssd->surface) &&
408        surface_height(surface) == pixman_image_get_height(ssd->surface)) {
409        /* no-resize fast path: just swap backing store */
...

10. alias_transfer: Assigning: ssd->ds = surface.
440    ssd->ds = surface;

11. var_deref_op: Dereferencing null pointer ssd->ds.
CID 1264334 (#1 of 1): Dereference after null check (FORWARD_NULL)
441    ssd->surface = pixman_image_ref(ssd->ds->image);

Fix:

Move code block dereferencing ssd->ds into the already existing
if (ssd->ds) { ... } block.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22 11:18:41 +01:00
Marc-André Lureau fe4831b1e7 spice: add unix address support
Teach qemu to set up a Spice server with a UNIX socket using the
following arguments -spice unix,addr=path.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22 11:18:41 +01:00
Paolo Bonzini 9939375c28 sb16: fix interrupt acknowledgement
SoundBlaster 16 emulation is very broken and consumes a lot of CPU, but a
small fix was suggested offlist and it is enough to fix some games.  I
got Epic Pinball to work with the "SoundBlaster Clone" option.

The processing of the interrupt register is wrong due to two missing
"not"s.  This causes the interrupt flag to remain set even after the
Acknowledge ports have been read (0x0e and 0x0f).

The line was introduced by commit 85571bc (audio merge (malc), 2004-11-07),
but the code might have been broken before because I did not look closely
at the huge patches from 10 years ago.

Reported-by: Joshua Bair <j_bair@bellsouth.net>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22 11:04:18 +01:00
Peter Maydell 7230818a2b disas/sparc: Remove unused data sparc_opcode_archs[]
Remove sparc_opcode_archs and the macros which use it, because we don't
use them in QEMU and they provoke clang warnings:

disas/sparc.c:307:39: warning: unused variable 'sparc_opcode_archs' [-Wunused-const-variable]
static const struct sparc_opcode_arch sparc_opcode_archs[] =
                                      ^

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2015-01-21 16:18:01 +00:00
Peter Maydell a2035e83fd target-sparc: Mark gen_load_trap_state_at_tl() as !CONFIG_USER_ONLY
The function gen_load_trap_state_at_tl() is only used in the softmmu
configs; wrap it in #ifndef CONFIG_USER_ONLY to avoid clang compiler
warnings in linux-user builds.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2015-01-21 16:18:01 +00:00
Peter Maydell 69694625e8 target-sparc: is_translating_asi() is TARGET_SPARC64 only
Move the is_translating_asi() inside the TARGET_SPARC64 ifdef (and remove
the unimplemented 32-bit codepath), as it is only called from TARGET_SPARC64
code. This fixes a clang 3.4 unused-function warning.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2015-01-21 16:18:01 +00:00
Peter Maydell e60538c79f target-sparc: address_mask(), asi_address_mask() are TARGET_SPARC64 only
The address_mask() and asi_address_mask() functions are only used in
TARGET_SPARC64 configs, so guard with ifdefs to avoid warnings about
unused functions in 32-bit builds.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2015-01-21 16:18:01 +00:00
Peter Maydell 6223029010 target-sparc: Remove unused gen_op_subi_cc and gen_op_addi_cc
The functions gen_op_addi_cc() and gen_op_subi_cc() are unused; remove them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2015-01-21 16:18:01 +00:00
Peter Maydell 699eae17b8 Miscellaneous cross-tree patches:
* load/store helper cleanup
  * drop TARGET_HAS_ICE define and checks
  * scripts/qapi-types.py: Add dummy member to empty structs
  * cpu_ldst.h: Don't define helpers if MMU_MODE*_SUFFIX not defined
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJUvneqAAoJEDwlJe0UNgzex0EP/RQ6yMx3q5YKX3vNGvy+62Gk
 Tw6Bv/mobWxYjY4v7p9hEPJmF7mzlzy3LNnjHBHVCz97yPthgfjTMWh0eKREWLwN
 YslGocAXSpIVU/5/orbDj0C9Q47QowSgsd64pZV4V82HMqWiENh6gYn/cJZemT+z
 tsoyI9/mTHyO4snMAWTpKp6GV8XbtdcoWDfhnak75LmK3Ow21loJMtDMKvE7KWNQ
 aRZYXwn+kqQ3lOp9sGO+fhEiGiaB8VFwWGsarp/4ir0qODKPLFesdRsq6u+hIOcj
 F1ShFNAH6b3mY7m1Q6g8b8QVbHnUnczApzfaoItfVdFF4nRsDxIGXB3yMKIR0RVG
 tIGH54OPlYSiR8FDCQF7nF5No3kc5gwwBVFwvx5ym1jNbb90JguGyXgI2VWaTxG6
 OusZPKEXyfUKsZPC+w/1NMHApvuAcGeeuVCV96CGpZ6xGqM3WM2Fa/Yopz1vQUNu
 sJygKjYjVF7PRGOfQiyr1vEbz5AjZhbNA4QlgEHsK42K8ENxZtNDrqvnMtxcSnvM
 CSIku4fWd6hp5IMtOqxRw6gY8D/dTzfa4lBQqC5BgfHmZUaS4Sli1BvoxGzeW2/+
 lq7Em/mLbqyVjVlAUe9/Tq91LErhgTrhxkawBwYo6fjCL1JADic5QP5RN1Fzf02O
 YwK/cnI7TeXWU77uFUmg
 =uCSO
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/pmaydell/tags/pull-misc-20150120' into staging

Miscellaneous cross-tree patches:
 * load/store helper cleanup
 * drop TARGET_HAS_ICE define and checks
 * scripts/qapi-types.py: Add dummy member to empty structs
 * cpu_ldst.h: Don't define helpers if MMU_MODE*_SUFFIX not defined

# gpg: Signature made Tue 20 Jan 2015 15:43:38 GMT using RSA key ID 14360CDE
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"

* remotes/pmaydell/tags/pull-misc-20150120:
  cpu_ldst.h: Don't define helpers if MMU_MODE*_SUFFIX not defined
  cpu_ldst.h, cpu-all.h, bswap.h: Update documentation on ld/st accessors
  cpu_ldst_template.h: Drop unused cpu_ldfq/stfq/ldfl/stfl accessors
  cpu_ldst.h: Drop unused _raw macros, saddr() and laddr()
  cpu_ldst_template.h: Use ld*_p directly rather than via ld*_raw macros
  cpu_ldst.h: Use inline functions for usermode cpu_ld/st accessors
  cpu_ldst.h: Remove unused very short ld*/st* defines
  cpu_ldst.h: Drop unused ld/st*_kernel defines
  target-mips: Don't use _raw load/store accessors
  linux-user/main.c (m68k): Use get_user_u16 rather than lduw in cpu_loop
  linux-user/vm86.c: Use cpu_ldl_data &c rather than plain ldl &c
  bsd-user/elfload.c: Don't use ldl() or ldq_raw()
  linux-user/elfload.c: Don't use _raw accessor functions
  target-sparc: Don't use {ld, st}*_raw functions
  monitor.c: Use ld*_p() instead of ld*_raw()
  cpu_ldst.h: Remove unused ldul_ macros
  exec.c: Drop TARGET_HAS_ICE define and checks
  scripts/qapi-types.py: Add dummy member to empty structs

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-01-20 16:19:58 +00:00
Peter Maydell de5ee4a888 cpu_ldst.h: Don't define helpers if MMU_MODE*_SUFFIX not defined
Not all targets define a full set of suffix strings for the
NB_MMU_MODES that they have. In this situation, don't define any
helper functions for that mode, rather than defining helper functions
with no suffix at all. The MMU mode is still functional; it is merely
not directly accessible via cpu_ld*_MODE from target helper functions.

Also add an "NB_MMU_MODES >= 2" check to the definition of the mode 1
helpers -- some targets only define one MMU mode.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Message-id: 1421432008-6786-1-git-send-email-peter.maydell@linaro.org
2015-01-20 15:19:35 +00:00
Peter Maydell db5fd8d709 cpu_ldst.h, cpu-all.h, bswap.h: Update documentation on ld/st accessors
Add documentation of what the cpu_*_* accessors look like.
Correct some minor errors in the existing documentation of the
direct _p accessor family. Remove the near-duplicate comment
on the _p accessors from cpu-all.h and replace it with a reference
to the comment in bswap.h.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 1421334118-3287-16-git-send-email-peter.maydell@linaro.org
2015-01-20 15:19:35 +00:00
Peter Maydell 82f11917c9 cpu_ldst_template.h: Drop unused cpu_ldfq/stfq/ldfl/stfl accessors
The cpu_ldfq/stfq/ldfl/stfl accessors for loading and storing
float32 and float64 are completely unused, so delete them.
(The union they use for converting from the float32/float64
type to uint32_t or uint64_t is the wrong way to do it anyway:
they should be using make_float* and float*_val.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 1421334118-3287-15-git-send-email-peter.maydell@linaro.org
2015-01-20 15:19:34 +00:00
Peter Maydell 800e2ecc89 cpu_ldst.h: Drop unused _raw macros, saddr() and laddr()
The _raw macros and their helpers saddr() and laddr() are now
totally unused -- delete them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 1421334118-3287-14-git-send-email-peter.maydell@linaro.org
2015-01-20 15:19:34 +00:00
Peter Maydell 355392329e cpu_ldst_template.h: Use ld*_p directly rather than via ld*_raw macros
The ld*_raw and st*_raw macros are now only used within the code
produced by cpu_ldst_template.h, and only in three places.
Expand these out to just call the ld_p and st_p functions directly.

Note that in all the callsites the address argument is a uintptr_t,
so we can drop that part of the double-cast used in the saddr() and
laddr() macros.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 1421334118-3287-13-git-send-email-peter.maydell@linaro.org
2015-01-20 15:19:34 +00:00
Peter Maydell 9220fe54c6 cpu_ldst.h: Use inline functions for usermode cpu_ld/st accessors
Use inline functions rather than macros for cpu_ld/st accessors
for the *-user configurations, as we already do for softmmu.
This has a two advantages:
 * we can actually typecheck our arguments
 * we don't need to leak the _raw macros everywhere

Since the _kernel functions were only used by target-i386/seg_helper.c,
put the definitions for them in that file too. (It already has the
similar template include code to define them for the softmmu case,
so it makes sense to have it deal with defining them for user-only.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 1421334118-3287-12-git-send-email-peter.maydell@linaro.org
2015-01-20 15:19:34 +00:00
Peter Maydell 177ea79f65 cpu_ldst.h: Remove unused very short ld*/st* defines
The very short ld*/st* defines are now not used anywhere; delete them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 1421334118-3287-11-git-send-email-peter.maydell@linaro.org
2015-01-20 15:19:34 +00:00
Peter Maydell 5a0826f7d2 cpu_ldst.h: Drop unused ld/st*_kernel defines
The ld*_kernel and st*_kernel defines are not used anywhere;
delete them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 1421334118-3287-10-git-send-email-peter.maydell@linaro.org
2015-01-20 15:19:34 +00:00