Commit Graph

39067 Commits

Author SHA1 Message Date
Denis V. Lunev
74cf6c5026 block/parallels: support parallels image creation
Do not even care to create WithoutFreeSpace image, it is obsolete.
Always create WithouFreSpacExt one.

The code also does not spend a lot of efforts to fill cylinders and
heads fields, they are not used actually in a real life neither in
QEMU nor in Parallels products.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Roman Kagan <rkagan@parallels.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Roman Kagan <rkagan@parallels.com>
Message-id: 1430207220-24458-12-git-send-email-den@openvz.org
CC: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-05-22 09:37:31 +01:00
Denis V. Lunev
50ffd8fd3c iotests, parallels: test for write into Parallels image
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Roman Kagan <rkagan@parallels.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Roman Kagan <rkagan@parallels.com>
Message-id: 1430207220-24458-11-git-send-email-den@openvz.org
CC: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-05-22 09:37:31 +01:00
Denis V. Lunev
5a41e1fa95 block/parallels: _co_writev callback for Parallels format
Support write on Parallels images. The code is almost the same as one
in the previous patch implemented scatter-gather IO for read.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Roman Kagan <rkagan@parallels.com>
Signed-off-by: Roman Kagan <rkagan@parallels.com>
Message-id: 1430207220-24458-10-git-send-email-den@openvz.org
CC: Roman Kagan <rkagan@parallels.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-05-22 09:37:31 +01:00
Denis V. Lunev
d0e61ce56d block/parallels: mark parallels format driver as zero inited
From the guest point of view unallocated blocks are zeroed.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Roman Kagan <rkagan@parallels.com>
Signed-off-by: Roman Kagan <rkagan@parallels.com>
Message-id: 1430207220-24458-9-git-send-email-den@openvz.org
CC: Roman Kagan <rkagan@parallels.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-05-22 09:37:31 +01:00
Denis V. Lunev
912f31281a block/parallels: replace magic constants 4, 64 with proper sizeofs
simple purification..

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Roman Kagan <rkagan@parallels.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Roman Kagan <rkagan@parallels.com>
Message-id: 1430207220-24458-8-git-send-email-den@openvz.org
CC: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-05-22 09:37:31 +01:00
Denis V. Lunev
481fb9cf18 block/parallels: provide _co_readv routine for parallels format driver
Main approach is taken from qcow2_co_readv.

The patch drops coroutine lock for the duration of IO operation and
peforms normal scatter-gather IO using standard QEMU backend.

The patch also adds comment about locking considerations in the driver.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Roman Kagan <rkagan@parallels.com>
Signed-off-by: Roman Kagan <rkagan@parallels.com>
Message-id: 1430207220-24458-7-git-send-email-den@openvz.org
CC: Roman Kagan <rkagan@parallels.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-05-22 09:37:31 +01:00
Roman Kagan
dd3bed16ff block/parallels: add get_block_status
Implement VFS method for get_block_status to Parallels format driver.

qemu_co_mutex_lock is not necessary yet (the driver is read-only) but
will be necessary very soon when write will be supported.

Signed-off-by: Roman Kagan <rkagan@parallels.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Message-id: 1430207220-24458-6-git-send-email-den@openvz.org
CC: Kevin Wolf <kwolf@redhat.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-05-22 09:37:31 +01:00
Roman Kagan
9de9da17d8 block/parallels: read up to cluster end in one go
Teach parallels_read() to do reads in coarser granularity than just a
single sector: if requested, read up to the cluster end in one go.

Signed-off-by: Roman Kagan <rkagan@parallels.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1430207220-24458-5-git-send-email-den@openvz.org
CC: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-05-22 09:37:31 +01:00
Roman Kagan
2944256997 block/parallels: switch to bdrv_read
Switch the .bdrv_read method implementation from using bdrv_pread() to
bdrv_read() on the underlying file, since the latter is subject to i/o
throttling while the former is not.

Besides, since bdrv_read() operates in sectors rather than bytes, adjust
the helper functions to do so too.

Signed-off-by: Roman Kagan <rkagan@parallels.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Message-id: 1430207220-24458-4-git-send-email-den@openvz.org
CC: Kevin Wolf <kwolf@redhat.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-05-22 09:37:31 +01:00
Denis V. Lunev
0789890467 block/parallels: rename parallels_header to ParallelsHeader
this follows QEMU coding convention

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Roman Kagan <rkagan@parallels.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1430207220-24458-3-git-send-email-den@openvz.org
CC: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-05-22 09:37:31 +01:00
Denis V. Lunev
d134cf73b1 iotests, parallels: quote TEST_IMG in 076 test to be path-safe
suggested by Jeff Cody

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Roman Kagan <rkagan@parallels.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1430207220-24458-2-git-send-email-den@openvz.org
CC: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-05-22 09:37:31 +01:00
Richard Henderson
32ad48abd7 target-alpha: Add vector implementation for CMPBGE
While conditionalized on SSE2, it's a "portable" gcc generic vector
implementation, which could be enabled on other hosts.

Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-21 10:34:18 -07:00
Richard Henderson
8d8d324e34 target-alpha: Rewrite helper_zapnot
This form produces significantly smaller code on x86_64.

Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-21 10:33:36 -07:00
Peter Maydell
9e549d36e9 vnc: misc fixes.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJVXEatAAoJEEy22O7T6HE4YswP/RDw7kbNH6ZKwp+z88Ex8OLj
 /CvK3X/LA/+IDj19w17j1DvGETGfCkj7RmbZTA2WDOUV3wRvwaO6TRf3nzRVJLGL
 00CbE0V+76e9bzr4COKjU3HseFHsuXyICyk1qmqOgt+Jv3ZwEVavqlSwodoschtV
 WjD6C+oyb2vzEQBQxHyfx6tDxlF4xMiIe0lnztwd98sejLAslkrF8qZ3zfen21mt
 zf67QHumW+sooFge7Q0Ur4nGdty6rU5DNK7hv1RWow/riqtlp13Ewi2WYIbjPY3B
 rF0yaBOT/6LwdJyu5AcqGLRz6dHW1bUOpcjnLYgF398RuXZwt1vxTrB9oA67abaz
 XXLPoTjFfkEDkhbr7VqCLOqHqG1JNt6+/V8LvDAVZMFovianKKZSbOScgHlLPd/0
 vNzk9hY56Ih07F58yP+Sv9NBebGvOJ4JFQO31ARqSwVXpn8qki34T90a0qCFCmAG
 35IUxn2wk2ZFzdEYtcICICzh4HdjoHYu1USqmrg14HGfDl6InjYJKz2HfVyHRXwH
 OgivIo06xwPCGEfGF94VYdTFWU6k+dgKHVc/EI+ikYZGdl+pixihvf7oK/gbmPLx
 ZN+P0sCe6dn5mc/ZHVnhoxyaR9pMQAdWsGMExXgMBUgBQyrZPPievXFEV2Rm5Yia
 2Db2RyyrSo1/jy/5Wnf7
 =oeH6
 -----END PGP SIGNATURE-----

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

vnc: misc fixes.

# gpg: Signature made Wed May 20 09:32:45 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-vnc-20150520-1:
  qemu-sockets: Report explicit error if unlink fails
  vnc: Tweak error when init fails
  vnc: Don't assert if opening unix socket fails
  ui: remove check for failure of qemu_acl_init()
  Strip brackets from vnc host

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-05-21 09:07:19 +01:00
Cole Robinson
0ef705a265 qemu-sockets: Report explicit error if unlink fails
Consider this case:

$ ls -ld ~/root-owned/
drwx--x--x. 2 root root 4096 Apr 29 12:55 /home/crobinso/root-owned/
$ ls -l ~/root-owned/foo.sock
-rwxrwxrwx. 1 crobinso crobinso 0 Apr 29 12:55 /home/crobinso/root-owned/foo.sock

$ qemu-system-x86_64 -vnc unix:~/root-owned/foo.sock
qemu-system-x86_64: -vnc unix:/home/crobinso/root-owned/foo.sock: Failed to start VNC server: Failed to bind socket to /home/crobinso/root-owned/foo.sock: Address already in use

...which is techinically true, but the real error is that we failed to
unlink. So report it.

This may seem pathological but it's a real possibility via libvirt.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-20 10:23:08 +02:00
Cole Robinson
bc119048d7 vnc: Tweak error when init fails
Before:
qemu-system-x86_64: -display vnc=unix:/root/foo.sock: Failed to start VNC server on `(null)': Failed to bind socket to /root/foo.sock: Permission denied

After:
qemu-system-x86_64: -display vnc=unix:/root/foo.sock: Failed to start VNC server: Failed to bind socket to /root/foo.sock: Permission denied

Rather than tweak the string possibly show unix: value as well,
just drop the explicit display reporting. We already get the cli
string in the error message, that should be sufficient.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-20 10:23:08 +02:00
Cole Robinson
3d00ac1a2e vnc: Don't assert if opening unix socket fails
Reproducer:

$ qemu-system-x86_64 -display vnc=unix:/root/i-cant-access-you.sock
qemu-system-x86_64: iohandler.c:60: qemu_set_fd_handler2: Assertion `fd >= 0' failed.
Aborted (core dumped)

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-20 10:23:08 +02:00
Daniel P. Berrange
2b2c1a38ee ui: remove check for failure of qemu_acl_init()
The qemu_acl_init() function has long since stopped being able
to return NULL, since g_malloc will abort on OOM. As such the
checks for NULL were unreachable code.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-20 10:23:08 +02:00
Ján Tomko
274c3b52e1 Strip brackets from vnc host
Commit v2.2.0-1530-ge556032 vnc: switch to inet_listen_opts
bypassed the use of inet_parse in inet_listen, making literal
IPv6 addresses enclosed in brackets fail:

qemu-kvm: -vnc [::1]:0: Failed to start VNC server on `(null)': address
resolution failed for [::1]:5900: Name or service not known

Strip the brackets to make it work again.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-20 10:23:08 +02:00
Peter Maydell
eba05e922e serial: fix multi-pci card error cleanup.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJVWxTBAAoJEEy22O7T6HE48boP/0e+WavR48nhASyYNLTW5SR7
 NmOPqN964HN0dDP3S5jItD1GP2DtPb/9kQga0l8b/t5X89oW23ZjB6EHlVDLboNS
 b0zc6ahcvNpvNRm/DYEv8zZCXU9e6qwCUKfo/TZ7L74bP0/2ol49Ry3fvKZrs/JK
 M8emDFh3CoVvvQoLO1eUpoj9ATi20I28silVFgaHeU7kB/qGXoQCPiO8Wu5GBGgS
 HvtfB2VA0tn4D/NeWO5ll78GhO+TtB0SXsFfW9ln7wlYAgTv0/7mPaS4ELTTeSye
 ThBR/CN7ArKINPIEEDIJUT2y8Hv4XeKgFTH1WjAce3LMjx1kGeA6mfOsXm63YCgj
 JqMJhnxSkNY4GqHLxzb6+KYgqOq7KVPsjbUyHR52M2thl0PEEbP9Ft/XXZT6WAkB
 8ISjk+vmfojAEVYXjk/ZZvDTkws+53r/aWO5FakObAj/l2Sk8FtrBMJyqdo/+2QO
 6GCJUVnmPVhGpaT94ysCwihIJl6CPpARAFWwKKleCZx2AENL7amk8HxilaDcJE5S
 /is3c7YIc6vL5PENUuyoAIsnvWhnocSvwGvsMtWkLtrnGbCYaEGyLpk1ty12PSQM
 e2kWd/qxIerKECyJ1+BPZb8zewR0o9wxHX/qZtrfOo9zsSwc8JOZFw8s1HWxDMj8
 XbqDYzHlmBUvMg8kQY02
 =4NPQ
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-serial-20150519-1' into staging

serial: fix multi-pci card error cleanup.

# gpg: Signature made Tue May 19 11:47: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-serial-20150519-1:
  serial: fix multi-pci card error cleanup.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-05-19 14:10:33 +01:00
Gerd Hoffmann
a48da7b5bc serial: fix multi-pci card error cleanup.
Put the number of serial ports into a local variable in
multi_serial_pci_realize, then increment the port count
(pci->ports) as we initialize the serial port cores.

Now pci->ports always holds the number of successfully
initialized ports and we can use multi_serial_pci_exit
to properly cleanup the already initialized bits in case
of a init failure.

https://bugzilla.redhat.com/show_bug.cgi?id=970551

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2015-05-19 12:47:08 +02:00
Peter Maydell
fdbe454a24 hw/display: qomify vga cards
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJVWw8NAAoJEEy22O7T6HE4A74P/ihkDQXyBiFySkde0gLLOQZ0
 SSRmoO6HN4aNsCssliJSidYxp2AjWYCZJfG0Cc7ExwOcKqZ5u5N8ysOK20DjOuXd
 CjQMtUe7V0zHivJlhUeNHusuKx3+5Bvi+b/Az1fYXaN5UPD8VKKt7FWvRx6P44SE
 kQyP01HhQCvPL29GeJnx5PFaOeB+xMkIzYaywK0ZBzBrFKGpect2kQsEsRcCujil
 nnBn4XgMh7XZ3yPHfPtYaOj2kB5CCStKEfkXkZ58O0KsZGJXsuf+LVGtMuErpOtF
 HHnIUEysaFx5WcWkdgF35e2fRsPgmVUWykVsxQSa/1Gwpbgrxj98jr56pvNqUQ3P
 RebphUCOpB+xzHv1cJeBG5KApxfAKWuBLNqYICMiZgYYZV1kVl61ncLgxrXCBMQJ
 w8BVG9/N0T0MYT/2ITrXfmr6fWS0DhC6o4KSTPvraJ/BId6eCg757eNzI++bp5z3
 Fa8AKLz2aWFQAjO5dKQ5Qx8zMCQcvHu8LxDTv+VpliLl9hn+PUlAjovaLsiNHQtB
 Ij2UOK/ZF3Q9keHAcqYUZK8CmgTl5BzTPAisE/ARdSdnWhPBRxH0+x7Hs8CqXVAy
 M8Sajp4dJNRyn+PSN8Dro54nJnw0GCGrmrsDULldweVFAsC2eZ34gYB06M1F8exP
 SWSl2DPYc6csTKaQZTR1
 =bq6x
 -----END PGP SIGNATURE-----

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

hw/display: qomify vga cards

# gpg: Signature made Tue May 19 11:23:09 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-vga-20150519-1:
  vga-pci: QOMify
  qxl: QOMify
  cirrus_vga: QOMify

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-05-19 11:47:03 +01:00
Gonglei
176c324feb vga-pci: QOMify
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-19 11:40:01 +02:00
Gonglei
c69f6c7dcf qxl: QOMify
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-19 11:40:01 +02:00
Gonglei
d338bae33a cirrus_vga: QOMify
QOMify pci-cirrus-vga like isa-cirrus-vga device.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-19 11:40:01 +02:00
Peter Maydell
faa261a7fb cocoa queue:
* fix various issues with full screen in the OSX UI
  * set an icon for our binary file
  * add entries to the View menu for QEMU consoles
  * fix various warnings that are produced when building on 10.10
    (largely deprecated interfaces)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJVWvGTAAoJEDwlJe0UNgzeMgcP/AsRHEiGwsNqKRvOAfC9M0UX
 eqKHKgy1jyNn0GJHjhVHxmXgQ47o8nPlvOJi4EP/y8smdAQC3Ky373WsmyEfqEgN
 2JxErWeKOaxVw83Kms2o9d9lckc3BYg5UfnRDq8OhKCIZ2NQRjJ58/LuRMLU4/Th
 jCuFfdA1YmxIiMncdHL/tB1KT+fnvB+yFzFME1uq5jdKgEWW62OaNsdIQbSZLveu
 0YYX6vMQoRE70yAZI95HRF4+K4CAWyTiu3AUW2sjCv+OetHOR1BktJdmZ9DZthuq
 MB9FuCzapzkmZkKszBvRDmA1zgrzZmKdFrLxpVvSFwy0Hmytg7O3xeIbtiaus2Y7
 Uj6Td2YxQo+t1z9cu0UVqpvzBtl3Ez8Ze/lsu+07Upt8tzApEt53693402s/X+Xv
 7zTfGUOh/88Gbv7mZ/QXDxM+MBnlSicfMebC19jrumQPuddSmqE3UlAK7mQ0xpAY
 XGtmlqq6FJc7jq1BfjsTA4HbsEICtl5om2T6EyMZdKu4RXmtVZmQc0CDTLC8kitV
 qas6wvjlmysVX7btrQP+/mGI0WaDsetxp8UTjeLFSl+vPD0WVsru9zsSDrVdAFt4
 pshKDVp62xi8lDsW+DWzFC6S3BSiL3ZAuPSIFdRwp6kbYQvsxtC2zYIkVcrwGZdJ
 tYJtxkcSeKGRs2I4ugxZ
 =dZVT
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/pmaydell/tags/pull-cocoa-20150519' into staging

cocoa queue:
 * fix various issues with full screen in the OSX UI
 * set an icon for our binary file
 * add entries to the View menu for QEMU consoles
 * fix various warnings that are produced when building on 10.10
   (largely deprecated interfaces)

# gpg: Signature made Tue May 19 09:17:23 2015 BST using RSA key ID 14360CDE
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"

* remotes/pmaydell/tags/pull-cocoa-20150519:
  ui/cocoa: Add console items to the View menu
  ui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants
  ui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up
  ui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate
  ui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int
  ui/cocoa: Remove compatibility ifdefs for OSX 10.4
  ui/cocoa: Drop tests for CGImageCreateWithImageInRect support
  Makefile.target: set icon for binary file on Mac OS X
  ui/cocoa: Make -full-screen option work on Mac OS X
  ui/cocoa: Fix several full screen issues on Mac OS X

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-05-19 10:25:59 +01:00
Programmingkid
b4c6a112dc ui/cocoa: Add console items to the View menu
Add any console that is available to the current emulator as a
menu item under the View menu.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
[PMM: Adjusted to apply after zoom-to-fit menu item was added;
 create the View menu at the same time as all the others, and only
 add the dynamically-determined items to it later]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-05-19 09:11:18 +01:00
Peter Maydell
8617989eae ui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants
In OSX 10.10, the NSOKButton and NSCancelButton constants are deprecated
and provoke compiler warnings. Avoid them by using the
NSFileHandlingPanelCancelButton and NSFileHandlingPanelOKButton constants
instead. These are the documented correct constants for the 10.6-and-up
beginSheetModalForWindow API we use. We also use the same method for
the pre-10.6 compatibility code path, but conveniently the constant
values are the same and the constant names have been present since 10.0.
Preferring the constant names that match the non-legacy API makes more
sense anyway.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1431296361-16981-7-git-send-email-peter.maydell@linaro.org
2015-05-19 09:11:18 +01:00
Peter Maydell
81801ae213 ui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up
Starting in OSX 10.10, NSWindow useOptimizedDrawing is deprecated, so
don't use it there.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1431296361-16981-6-git-send-email-peter.maydell@linaro.org
2015-05-19 09:11:18 +01:00
Peter Maydell
2a4c8c53da ui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate
Our class QemuCocoaAppController implements the NSApplicationDelegate
interface, and we pass an object of this class to [NSApp setDelegate].
However, we weren't declaring in the class definition that we implemented
this interface; in OSX 10.10 this provokes the following (slighly
misleading) warning:
ui/cocoa.m:1031:24: warning: sending 'QemuCocoaAppController *' to parameter of
      incompatible type 'id<NSFileManagerDelegate>'
    [NSApp setDelegate:appController];
                       ^~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h:109:47:
note: passing argument to parameter 'delegate' here
@property (assign) id <NSFileManagerDelegate> delegate NS_AVAILABLE(10_5,
2_0);
                                              ^

Annoyingly, this interface wasn't formally defined until OSX 10.6, so we
have to surround the relevant part of the @interface line with an ifdef.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1431296361-16981-5-git-send-email-peter.maydell@linaro.org
2015-05-19 09:11:18 +01:00
Peter Maydell
de1aadee28 ui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int
The type for openPanelDidEnd's returnCode argument should be NSInteger,
not int. This only matters for the OSX 10.5 code path where we pass
the method directly to an OSX function to call.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1431296361-16981-4-git-send-email-peter.maydell@linaro.org
2015-05-19 09:11:18 +01:00
Peter Maydell
89424ff32f ui/cocoa: Remove compatibility ifdefs for OSX 10.4
Remove compatibility ifdefs that work around OSX 10.4 not providing
various typedefs and functions.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1431296361-16981-3-git-send-email-peter.maydell@linaro.org
2015-05-19 09:11:17 +01:00
Peter Maydell
b63901d84c ui/cocoa: Drop tests for CGImageCreateWithImageInRect support
The code that tries to test at both compiletime and runtime
for whether CGImageCreateWithImageInRect is supported provokes
a compile warning on OSX 10.3:

ui/cocoa.m:378:13: warning: comparison of function 'CGImageCreateWithImageInRect'
      equal to a null pointer is always false[-Wtautological-pointer-compare]
        if (CGImageCreateWithImageInRect == NULL) { // test if "CGImageCreateWithImageInRect" is
supported on host at runtime
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~    ~~~~

The simplest way to deal with this is just to drop this code,
since we don't in practice support OSX 10.4 anyway. (10.5 was
released in 2007 and is the last PPC version, so is the earliest
we really need to continue to support at all.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1431296361-16981-2-git-send-email-peter.maydell@linaro.org
2015-05-19 09:11:17 +01:00
Programmingkid
4e34017c21 Makefile.target: set icon for binary file on Mac OS X
Implements setting the icon for the binary file in Mac OS X.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
[PMM: tweaked makefile to use $@ and quiet-command]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-05-19 09:11:17 +01:00
Programmingkid
43227af88a ui/cocoa: Make -full-screen option work on Mac OS X
This patch makes the -full-screen option actually instruct QEMU to
enter fullscreen at startup, on Mac OS X.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-05-19 09:11:17 +01:00
Programmingkid
5d1b2eef58 ui/cocoa: Fix several full screen issues on Mac OS X
This patch makes several changes:
- Minimizes distorted full screen display by respecting aspect
ratios.
- Makes full screen mode available on Mac OS 10.7 and higher.
- Allows user to decide if video should be stretched to fill the
screen, using a menu item called "Zoom To Fit".
- Hides the normalWindow so it won't show up in full screen mode.
- Allows user to exit full screen mode.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
[PMM: minor whitespace tweaks, remove incorrectly duplicated
 use of 'f' menu accelerator key]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-05-19 09:11:17 +01:00
Richard Henderson
57a808b6d7 target-alpha: Raise IOV from CVTQL
Even if an exception isn't taken, the status flags need updating
and the result should be written to the destination.  Move the body
of cvtql out of line, since we now always need a call.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:47 -07:00
Richard Henderson
4ed069ab53 target-alpha: Suppress underflow from CVTTQ if DNZ
I.e. respect flush_inputs_to_zero.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:47 -07:00
Richard Henderson
b99e80694c target-alpha: Raise EXC_M_INV properly for fp inputs
Ignore DNZ if software completion isn't used.  Raise INV for
denormals in system mode so the OS completion handler sees them.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:47 -07:00
Richard Henderson
ed0851380c target-alpha: Disallow literal operand to 1C.30 to 1C.37
Before 64f45e49 we used to have literal checks for 4 of these 8 opcodes.
Confirmed that real hardware doesn't allow them.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:47 -07:00
Richard Henderson
2517def6f8 target-alpha: Implement WH64EN
Backward compatible cache insn introduced for EV7.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:47 -07:00
Richard Henderson
4d1628e832 target-alpha: Fix integer overflow checking insns
We need to write the result to the destination register before
raising any exception.  Thus inline the code for each insn, and
check for any exception after we're done.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:47 -07:00
Richard Henderson
7b4dde839e target-alpha: Fix cvttq vs inf
We should raise INV for infinities as well, not OVR+INE.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:46 -07:00
Richard Henderson
7f2e40020c target-alpha: Fix cvttq vs large integers
The range +- 2**63 - 2**64 was returning the wrong truncated
result.  We also incorrectly signaled overflow for -2**63.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:46 -07:00
Richard Henderson
c24a8a0b6d target-alpha: Raise IOV from CVTTQ
Floating-point overflow is a different bit from integer overflow.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:46 -07:00
Richard Henderson
f6b6b7b8a7 target-alpha: Set EXC_M_SWC for exceptions from /S insns
Previously forgotten, the kernel needs the software completion bit to
know that it needs to emulate software completion qualified insns.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:46 -07:00
Richard Henderson
471d493047 target-alpha: Set fpcr_exc_status even for disabled exceptions
The qualifiers can suppress the raising of exceptions, but real
hardware still records that the exceptions occurred.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:46 -07:00
Richard Henderson
f3d3aad4a9 target-alpha: Tidy FPCR representation
Store the fpcr as the hardware represents it.  Convert the softfpu
representation of exceptions into the fpcr representation.

Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:46 -07:00
Richard Henderson
ba9c5de5f2 target-alpha: Set PC correctly for floating-point exceptions
PC should be one past the faulting insn.  Add better commentary
for the machine-check exception path.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:46 -07:00
Richard Henderson
9d5a626b2c target-alpha: Forget installed round mode after MT_FPCR
When we use QUAL_RM_D, we copy fpcr_dyn_round to float_status.
When we install a new FPCR value, we update fpcr_dyn_round.
Reset the status of the cache so that we re-copy for the next
fp insn that requires dynamic rounding.

Signed-off-by: Richard Henderson <rth@twiddle.net>
2015-05-18 13:03:46 -07:00