Commit Graph

60973 Commits

Author SHA1 Message Date
Kevin Wolf f05fee508f blockjob: Move RateLimit to BlockJob
Every block job has a RateLimit, and they all do the exact same thing
with it, so it should be common infrastructure. Move the struct field
for a start.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
2018-05-15 16:11:50 +02:00
Kevin Wolf 05df8a6a2b blockjob: Wrappers for progress counter access
Block job drivers are not expected to mess with the internals of the
BlockJob object, so provide wrapper functions for one of the cases where
they still do it: Updating the progress counter.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
2018-05-15 16:11:49 +02:00
Kevin Wolf 37aa19b63c blockjob: Fix assertion in block_job_finalize()
Every job gets a non-NULL job->txn on creation, but it doesn't
necessarily keep it until it is decommissioned: Finalising a job removes
it from its transaction. Therefore, calling 'blockdev-job-finalize' a
second time on an already concluded job causes an assertion failure.

Remove job->txn from the assertion in block_job_finalize() to fix this.
block_job_do_finalize() still has the same assertion, but if a job is
already removed from its transaction, block_job_apply_verb() will
already error out before we run into that assertion.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
2018-05-15 16:11:49 +02:00
John Snow ab9ba61455 blockjob: expose error string via query
When we've reached the concluded state, we need to expose the error
state if applicable. Add the new field.

This should be sufficient for determining if a job completed
successfully or not after concluding; if we want to discriminate
based on how it failed more mechanically, we can always add an
explicit return code enumeration later.

I didn't bother to make it only show up if we are in the concluded
state; I don't think it's necessary.

Cc: qemu-stable@nongnu.org
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-05-15 16:11:41 +02:00
Alberto Garcia 83592184d8 hmp: Allow using a qdev id in block_set_io_throttle
The QMP version of this command can take a qdev ID since 7a9877a026,
but the HMP version is still using the deprecated block device name so
there's no way to refer to a block device added like this:

  -blockdev node-name=disk0,driver=qcow2,file.driver=file,file.filename=hd.qcow2
  -device virtio-blk-pci,id=virtio-blk-pci0,drive=disk0

This patch works around this problem by using the specified name as a
qdev ID if the block device name is not found.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-05-15 16:11:41 +02:00
Eric Blake e18a58b4e3 block: Merge .bdrv_co_writev{,_flags} in drivers
We have too many driver callback interfaces; simplify the mess
somewhat by merging the flags parameter of .bdrv_co_writev_flags()
into .bdrv_co_writev().  Note that as long as a driver doesn't set
.supported_write_flags, the flags argument will be 0 and behavior is
identical.  Also note that the public function bdrv_co_writev() still
lacks a flags argument; so the driver signature is thus intentionally
slightly different.  But that's not the end of the world, nor the first
time that the driver interface differs slightly from the public
interface.

Ideally, we should be rewriting all of these drivers to use modern
byte-based interfaces.  But that's a more invasive patch to write
and audit, compared to the simplification done here.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-05-15 16:11:41 +02:00
Eric Blake edfab6a08b block: Drop last of the sector-based aio callbacks
We are gradually moving away from sector-based interfaces, towards
byte-based.  Now that all drivers with aio callbacks are using the
byte-based interfaces, we can remove the sector-based versions.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-05-15 16:11:41 +02:00
Eric Blake 918889b291 vxhs: Switch to byte-based callbacks
We are gradually moving away from sector-based interfaces, towards
byte-based.  Make the change for the last few sector-based callbacks
in the vxhs driver.

Note that the driver was already using byte-based calls for
performing actual I/O, so this just gets rid of a round trip
of scaling; however, as I don't know if VxHS is tolerant of
non-sector AIO operations, I went with the conservative approach
of adding .bdrv_refresh_limits to override the block layer
defaults back to the pre-patch value of 512.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-05-15 16:11:41 +02:00
Eric Blake e8e16d4baf rbd: Switch to byte-based callbacks
We are gradually moving away from sector-based interfaces, towards
byte-based.  Make the change for the last few sector-based callbacks
in the rbd driver.

Note that the driver was already using byte-based calls for
performing actual I/O, so this just gets rid of a round trip
of scaling; however, as I don't know if RBD is tolerant of
non-sector AIO operations, I went with the conservate approach
of adding .bdrv_refresh_limits to override the block layer
defaults back to the pre-patch value of 512.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-05-15 16:11:41 +02:00
Eric Blake b3241e9274 null: Switch to byte-based read/write
We are gradually moving away from sector-based interfaces, towards
byte-based.  Make the change for the last few sector-based callbacks
in the null-co and null-aio drivers.

Note that since the null driver does nothing on writes, it trivially
supports the BDRV_REQ_FUA flag (all writes have already landed to
the same bit-bucket without needing an extra flush call).  Also, since
the null driver does just as well with byte-based requests, we can
now avoid cycles wasted on read-modify-write by taking advantage of
the block layer now defaulting the alignment to 1 instead of 512.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-05-15 16:11:41 +02:00
Eric Blake de7056a3f9 file-win32: Switch to byte-based callbacks
We are gradually moving away from sector-based interfaces, towards
byte-based.  Make the change for the last few sector-based callbacks
in the file-win32 driver.

Note that the driver was already using byte-based calls for
performing actual I/O, so this just gets rid of a round trip
of scaling; however, as I don't know if Windows is tolerant of
non-sector AIO operations, I went with the conservative approach
of modifying .bdrv_refresh_limits to override the block layer
defaults back to the pre-patch value of 512.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-05-15 16:11:41 +02:00
Eric Blake e31f6864a6 block: Support byte-based aio callbacks
We are gradually moving away from sector-based interfaces, towards
byte-based.  Add new sector-based aio callbacks for read and write,
to match the fact that bdrv_aio_pdiscard is already byte-based.

Ideally, drivers should be converted to use coroutine callbacks
rather than aio; but that is not quite as trivial (and if we were
to do that conversion, the null-aio driver would disappear), so for
the short term, converting the signature but keeping things with
aio is easier.  However, we CAN declare that a driver that uses
the byte-based aio interfaces now defaults to byte-based
operations, and must explicitly provide a refresh_limits override
to stick with larger alignments (making the alignment issues more
obvious directly in the drivers touched in the next few patches).

Once all drivers are converted, the sector-based aio callbacks will
be removed; in the meantime, a FIXME comment is added due to a
slight inefficiency that will be touched up as part of that later
cleanup.

Simplify some instances of 'bs->drv' into 'drv' while touching this,
since the local variable already exists to reduce typing.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-05-15 16:11:41 +02:00
Daniel Henrique Barboza 7803696d85 block-backend: simplify blk_get_aio_context
blk_get_aio_context verifies if BlockDriverState bs is not NULL,
return bdrv_get_aio_context(bs) if true or qemu_get_aio_context()
otherwise. However, bdrv_get_aio_context from block.c already does
this verification itself, also returning qemu_get_aio_context()
if bs is NULL:

AioContext *bdrv_get_aio_context(BlockDriverState *bs)
{
    return bs ? bs->aio_context : qemu_get_aio_context();
}

This patch simplifies blk_get_aio_context to simply call
bdrv_get_aio_context instead of replicating the same logic.

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-05-15 16:11:41 +02:00
Peter Maydell ad1b4ec39c input: ps2 fixes.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJa+qu4AAoJEEy22O7T6HE47msQAI0SIQEPgHYmDmr8iNSggLBK
 cInvCdOw1QzGiyViIKAgj+wUqDjnRv2eM9bmRTzhM5BdESxw4BLmK5zC/kq8bmd6
 QhQZRBpGqk96evD2PbgShv4Vt732+gWIPJqnh4ZuxjDtLmHlCYdZfOC/fCeSNySr
 MbLMR2dqQzJNCll3W8seCDQveaYja9m+l9TSvoJAaZwh6f6PhAOl0linihniDX4a
 aCaa23jWs+M64+3Boo4wLSlhXVRz5vKvaGyiTBdvUhy0Pxe3PCKKNxtzUujg/5t7
 E7xaCEmGFR/WnzMmTYrDMEBqsp0F8sMaNDDQVWbFeWdzZVRXG9+aHJsOIATzSsrf
 KuVwJRtle55G8rvc21L8PELqHy3fGI0CkipjQpEtDiQZV481dkHV/+ytWDUQW6t5
 HgTIhCo4xI7GyHfwo8DjfqejSZKlRBb104SeonlE0oiDvjgEbBnJmnKW2ryNUOSD
 JkZYRxddrHKkgbspYlLHW2/EBJfc4xScbjfvaAjeafaZXKMXI37CRxUxdsXBMoUK
 4IZ2UmIMpWM1P+5L9f5OYJcboGeeV0lbUi22tc9RWGGUG5nCAXZ6r10PZRlI6PHv
 36NUBNLRL4LeC24XKpgWRekMX052lDgwPT0oXGjWfrqc+T1QfK8wafr7KjOnAXRE
 huKY5PiPrGKbzyfBzbXo
 =qt2Q
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/input-20180515-pull-request' into staging

input: ps2 fixes.

# gpg: Signature made Tue 15 May 2018 10:43:20 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# 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/input-20180515-pull-request:
  ps2: Fix mouse stream corruption due to lost data
  ps2: Clear the PS/2 queue and obey disable

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-05-15 12:50:06 +01:00
Peter Maydell c13547feee ui: qapi parser for -display cmd line.
gtk: multiple fixes.
 sdl: opts bugfix.
 vnc: magic cookie.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJa+qX7AAoJEEy22O7T6HE4XYAQALWBtR3E0zuS3UFpvMJMIiMY
 GyZ/3AQ0QH/W5+nHlDi6VrwCJAyT7GQENuiMH/yoXe8o3LrdWrsFgdg0oCUrT6Uz
 28csuymGZprGw5YxZYMjdZgi2dcxXAR3KvBasY5/UlgT6wOSazV7JJDIuGRGcnvA
 UWtBl7fQ4O3lXxypFklCuHtNR0Jc7tLdF7HdG/ATSaFOnV44FRp+E1u2QRYi+gYs
 7Qras/fXl4m7pMSifzACFGJCY4FJ/uopFu1MDItm/jm881KOjhZzIBYcTo5skw4n
 5IKrl04O/c2iubs/cJi6Qye3Q2H8ijZUYO6ItRz71/upOodfIzXvotPBKh075s9V
 iOnlT+ajNvZ9ArEp/dGQfFrV0h/rJUjhmn4Lh21OJTqLpAvqKi4V48LS5cUQBFbx
 ZZ/yAzaTt06AIayHttTHrUYWdKLVwfEHtRzrAWVr8JmlwW8q1LvXytG21kXBjpT4
 qjzPNhRGq2Q0GLUirskltEaLoJtcfCvqYNnPTDLLRov5MfLxnu8v0rOFC/JTAK3N
 w4PKBzXGB6mAY2Dq5QoOqK1JW+pGLiVa5dblaf69yEVjOzF9dVFlNXNc4G6Br0mH
 lyiBjqdaoMuT9/GpYNOO/Yj+XHNHU1M2EaNXvmc/NtdR2qSwsQ4Up1czn2Z7X4J0
 8BSNswMiUrv4GOCSA/4l
 =R3f9
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180515-pull-request' into staging

ui: qapi parser for -display cmd line.
gtk: multiple fixes.
sdl: opts bugfix.
vnc: magic cookie.

# gpg: Signature made Tue 15 May 2018 10:18:51 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# 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/ui-20180515-pull-request:
  gtk: disable the F10 menubar key
  console: use linked list for QemuConsoles
  ui: document non-qapi parser cases.
  ui: switch gtk display to qapi parser
  ui: switch trivial displays to qapi parser
  ui: add qapi parser for -display
  vnc: add magic cookie to VncState
  ui/gtk: Only try to initialize EGL/X11 if GtkGlArea failed
  gtk: make it possible to hide the menu bar
  sdl2: move opts assignment into loop

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-05-15 12:00:23 +01:00
Peter Maydell 46cc2fc4f5 Convert openrisc to decodetree.py
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJa+gzkAAoJEGTfOOivfiFfvA4H/iXi7Jf+nfeNaRWq5uVRz+Rr
 xYkDp8DbyqIm1LIIJbJ30hW/UaG8Wj6uO/XM2D/9Kb1qlTghO33n9aBcQOKZ8inf
 aurY5nbFm19QsJtPVuOfkIeVWoM3vJ7VZpUdEJU0eh7RYDpRN620hBeyUgduXou7
 EfcMRGUMk0mwBttHyp04jlWacZRuVYSlYn73f4IdRlfaUEe0JMaMltnxb3P24lQ3
 O9G4ivqz3+hV8CnkdVo09vLk/A51YvRZQESYaHiBTmNnZgZFcBKcLfPOfYrWFYvM
 Qlkm3lrQcf/tJPHUTj9iAaDWGiukLZ7oH/LnLH5V6ZQSQscZm9v2VLhVLNhm1CE=
 =TiZl
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/rth/tags/tgt-openrisc-pull-request' into staging

Convert openrisc to decodetree.py

# gpg: Signature made Mon 14 May 2018 23:25:40 BST
# gpg:                using RSA key 64DF38E8AF7E215F
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>"
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/tgt-openrisc-pull-request:
  target/openrisc: Merge disas_openrisc_insn
  target/openrisc: Convert dec_float
  target/openrisc: Convert dec_compi
  target/openrisc: Convert dec_comp
  target/openrisc: Convert dec_M
  target/openrisc: Convert dec_logic
  target/openrisc: Convert dec_mac
  target/openrisc: Convert dec_calc
  target/openrisc: Convert remainder of dec_misc insns
  target/openrisc: Convert memory insns
  target/openrisc: Convert branch insns
  target/openrisc: Start conversion to decodetree.py
  target-openrisc: Write back result before FPE exception

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-05-15 11:11:36 +01:00
Geoffrey McRae 7abe7eb294 ps2: Fix mouse stream corruption due to lost data
This fixes an issue by adding bounds checking to multi-byte packets
where the PS/2 mouse data stream may become corrupted due to data being
discarded when the PS/2 ringbuffer is full.

Interrupts for Multi-byte responses are postponed until the final byte
has been queued.

These changes fix a bug where windows guests drop the mouse device
entirely requring the guest to be restarted.

Signed-off-by: Geoffrey McRae <geoff@hostfission.com>
Message-Id: <20180507150310.2FEA0381924@moya.office.hostfission.com>

[ kraxel: codestyle fixes ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-05-15 11:31:33 +02:00
Geoffrey McRae 143c04c7e0 ps2: Clear the PS/2 queue and obey disable
This allows guest's to correctly reinitialize and identify the mouse
should the guest decide to re-scan or reset during mouse input events.

When the guest sends the "Identify" command, due to the PC's hardware
architecutre it is impossible to reliably determine the response from
the command amongst other streaming data, such as mouse or keyboard
events. Standard practice is for the guest to disable the device and
then issue the identify command, so this must be obeyed.

Signed-off-by: Geoffrey McRae <geoff@hostfission.com>
Message-Id: <20180507150303.7486B381924@moya.office.hostfission.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-05-15 11:22:33 +02:00
Peter Maydell f39ddb3a08 -----BEGIN PGP SIGNATURE-----
iQIcBAABAgAGBQJa+dImAAoJEPMMOL0/L748umMP/R9miqzm3/Pj1gssD/yA5lZE
 7rx/d14Sefo2T/L1kmg6vbbyOJyLnHf9DtTI/JCgOnC9otOQ1IKfeI4c0coJjI5R
 G0yNHswLB+VMIJ830ivF0QE4Z8f6K1UbBD9y+iQfpFk55rrT+dt9U3YJBrCY7bQ8
 Sk+2dFpk+oVh9oz3GPHRkWua/KGMDrqCjAOlkVCXyNZuJ8yp69wHWI2j81nFQv3v
 1AnXOm6bbjy9zwRuRUJ6yco2vu8uXyor/usA465C66A5XZ7xcrgKIZQge3hV31fo
 4BmnxEviMKM5dM013e2nk0Hh5YwG/Vv+t8YYgco79Mcy9QJIEO4J1JXedUYZ3FJ/
 JhV5nTcYNi1hQMkSxzXWoxyOMElwL8DaPQIZS7c++pOSXCS9oD/baBuPzC/dWBTH
 VThuCYd1EsBe8ZFkgph/oUMYZQHcS2/paGE1RuHlLXVOqd1k9v/d27yxngo1/wn7
 +zesaWkp9aQOC6pij23cgKAq8S1X8KeaOM0UK+KmMNSr1h9nQY146D3/SOqUfAfS
 2DzW7PBnUHFzi6uXE99ZiUSSWWIyIjJEgAOnqnZCrl5LbPCKnjp4/BYupxoUwAWF
 Nr9Gk34R2FhoqqJtplzYWxXfyyCFujQMXHUe/yYx5ITG18totKb+09GbeeSep8Is
 myxrDirmbaqCnj8zfd+M
 =yjsX
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.13-pull-request' into staging

# gpg: Signature made Mon 14 May 2018 19:15:02 BST
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>"
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-2.13-pull-request:
  linux-user: correctly align types in thunking code
  linux-user: fix UNAME_MACHINE for sparc/sparc64
  linux-user: add sparc/sparc64 specific errno
  linux-user: fix conversion of flock/flock64 l_type field
  linux-user: update sparc/syscall_nr.h to linux header 4.16
  linux-user: fix flock/flock64 padding
  linux-user: define correct fcntl() values for sparc

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-05-15 10:04:22 +01:00
Peter Wu 677b490501 gtk: disable the F10 menubar key
The F10 key is used in various applications, disable it unconditionally
(do not limit it to grab mode). Note that this property is deprecated
and might be removed in the future (GTK+ commit b082fb598d).

Fixes: https://bugs.launchpad.net/qemu/+bug/1726910
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Message-id: 20180510230739.28459-2-peter@lekensteyn.nl
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-05-15 10:47:01 +02:00
Gerd Hoffmann cd6cd8fa0d console: use linked list for QemuConsoles
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180507095424.16220-1-kraxel@redhat.com
2018-05-15 10:37:46 +02:00
Gerd Hoffmann 7a61f43859 ui: document non-qapi parser cases.
Add comments to the cases not (yet) switched
over to parse_display_qapi().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180507095539.19584-5-kraxel@redhat.com
2018-05-15 10:37:40 +02:00
Gerd Hoffmann 002b2902f3 ui: switch gtk display to qapi parser
Drop the gtk option parser from parse_display(), so parse_display_qapi()
will handle it instead.

With this change the parser will accept gl=core and gl=es too, gtk
must catch the unsupported gles variant now.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180507095539.19584-4-kraxel@redhat.com
2018-05-15 10:37:40 +02:00
Gerd Hoffmann 2c9498c3e4 ui: switch trivial displays to qapi parser
Drop the option-less display types (egl-headless, curses, none) from
parse_display(), so they'll be handled by parse_display_qapi().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180507095539.19584-3-kraxel@redhat.com
2018-05-15 10:37:40 +02:00
Gerd Hoffmann 776d1344bd ui: add qapi parser for -display
Add parse_display_qapi() function which parses the -display command line
using a qapi visitor for DisplayOptions.  Wire up as default catch in
parse_display().

Improves the error message for unknown display types.

Also enables json as -display argument, i.e. -display "{ 'type': 'gtk' }"

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180507095539.19584-2-kraxel@redhat.com
2018-05-15 10:37:40 +02:00
Gerd Hoffmann f31f9c1080 vnc: add magic cookie to VncState
Set magic cookie on initialization.  Clear on cleanup.  Sprinkle a bunch
of assert()s checking the cookie, to verify the pointer is valid.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180507102254.12107-1-kraxel@redhat.com
2018-05-15 10:36:55 +02:00
Tomeu Vizoso 4f4cb8282d ui/gtk: Only try to initialize EGL/X11 if GtkGlArea failed
The commit referenced below changed the logic by causing the gtk-egl
backend to be initialized regardless of whether GtkGlArea initialization
succeeded. This causes eglInitialize to crash in Wayland systems without
XWayland.

This patch restores the previous logic.

Fixes: 4c70280592 ("ui/gtk: use GtkGlArea on wayland only")
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Message-id: 20180507134237.14996-1-tomeu.vizoso@collabora.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-05-15 10:34:17 +02:00
Peter Wu 1d18774579 gtk: make it possible to hide the menu bar
Saves some space and disables the F10 button as side-effect.

Fixes: https://bugs.launchpad.net/qemu/+bug/1726910
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Message-Id: <20180510230739.28459-1-peter@lekensteyn.nl>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-05-15 10:31:09 +02:00
Gerd Hoffmann f88e5c5744 sdl2: move opts assignment into loop
So the opts pointer is set for all sdl2_consoles.

Fixes: 844fd50dbb
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-05-15 10:22:12 +02:00
Richard Henderson c7b6f54bf8 target/openrisc: Merge disas_openrisc_insn
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-05-14 14:58:08 -07:00
Richard Henderson 6fd204a2e9 target/openrisc: Convert dec_float
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-05-14 14:55:29 -07:00
Richard Henderson 032de4fc38 target/openrisc: Convert dec_compi
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-05-14 14:54:24 -07:00
Richard Henderson fbb3e29aac target/openrisc: Convert dec_comp
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-05-14 14:54:24 -07:00
Richard Henderson e720a5713d target/openrisc: Convert dec_M
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-05-14 14:54:24 -07:00
Richard Henderson e20c2592bc target/openrisc: Convert dec_logic
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-05-14 14:54:24 -07:00
Richard Henderson 99d863d6d6 target/openrisc: Convert dec_mac
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-05-14 14:54:24 -07:00
Richard Henderson 6ad216abfd target/openrisc: Convert dec_calc
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-05-14 14:54:24 -07:00
Richard Henderson 8816f70b93 target/openrisc: Convert remainder of dec_misc insns
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-05-14 14:54:24 -07:00
Richard Henderson d80bff19f9 target/openrisc: Convert memory insns
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-05-14 14:51:48 -07:00
Richard Henderson 136e13ae65 target/openrisc: Convert branch insns
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-05-14 14:51:48 -07:00
Richard Henderson 7de9729f08 target/openrisc: Start conversion to decodetree.py
Begin with the 0x08 major opcode, the system instructions.

Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2018-05-14 14:44:26 -07:00
Richard Henderson 4e2d30079c target-openrisc: Write back result before FPE exception
The architecture manual is unclear about this, but the or1ksim
does writeback before the exception.  This requires splitting
the helpers in half, with the exception raised by the second.

Acked-by: Stafford Horne <shorne@gmail.com>
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
2018-05-14 14:35:02 -07:00
Peter Maydell c691c87616 -----BEGIN PGP SIGNATURE-----
iQIcBAABAgAGBQJa+c8qAAoJEPMMOL0/L748XiwP/1f9pHsH0o6ilaA8BqrPwl7g
 A2Oq9DSVi8ez4rw6p/OS+yl9N3fVoAFi3KFtEZG54ULQo0JI8oSJWTIFQjgIFKZg
 4yz3GbjS/3gFu2vjGPP+CnfNqTLxXcfTG8p7sig+OYjP8T/OgzZWIepWPj7jCf13
 iwfJhlht+IJ7/j9grmNDxIC22IwcckRmwjKi9XNpRWGI7UAYj6kvYyteT3JnLeAQ
 viTfw6kKP9zsmafTeSmPFlMAWSc2B1hykdZTVxzaXwkc1DuvfY2zyoOE5kqwsZKX
 BnNpZ9hKABr3yuLYaBJf1J9XjqDfmMTF/RPVVMkoB/tQ9T1o9I6XezeZcRAkAdd3
 63XIKaeuaJdxBKCnv19S15JWHRAm0y0euHliyrNtdtFQ6odmQYnbJeB6AvDJ1Z7J
 snMqGZYQI8rbcDuAn0VrrgQz8NzORD2mmX7kCE6VPNowFZJ+m4mny2oiIX/QCzVr
 /g33Be6IJETsXXZMAb2k1B8d1qUM8XDlOSffE9IMGUpvFHgwXzMSEXlJYWyhyJk7
 z686tt/CJEu/l5YhlLaWadeEs3wSmu1PXDCK4K5DFhETIIJDYFrb3mpziJlk/11d
 b4LIs3RYZp3r5M6AU1GLi3riyRwxpNLv3ER3GZ9rm9ZmqgqEIZx/roP3farTfPob
 Xkg2gtfKNX1eMcDDJF1Q
 =daef
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.13-pull-request' into staging

# gpg: Signature made Mon 14 May 2018 19:02:18 BST
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>"
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier/tags/m68k-for-2.13-pull-request:
  m68k: fix floatx80_mod() (Coverity CID1390568)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-05-14 19:38:41 +01:00
Peter Maydell fbd3a489df Some s390x fixes/cleanups, mainly in the reset area and build fixes
for recent compilers (GCC 8 and clang 6.0.0).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEw9DWbcNiT/aowBjO3s9rk8bwL68FAlr5rAQSHGNvaHVja0By
 ZWRoYXQuY29tAAoJEN7Pa5PG8C+vczoQAIjJUt9as1PvBjgZOa2ynHe9ZgCDEurU
 7aTVLB3Ss75Bm05TgWcQDHyCFVSSYnUqS1p/iMMh7I59arQwWqmkc2ZIH33tFBAR
 GtmOQbxJF/0t7SOyL26Rn2xrHfuJoLHLPRYiWs/CSAW9YCjgfEUY0WZJli79SULV
 DnTv6AQYlKZgM6KDHhxenL3ejIoZDxTEK/VHV/EKSerASxMPmUl8zVansCu5lG7r
 doUfBxuI9aAbkLFhTtX0H6fc1qDYEAxvZcoWkiUMtn/qAtQ2ij/YvvKj4/NZ9X8G
 ipM3s6iwyYwBmqK9w4cYV3Ka3NK+dOMA33IgN8NgP0ahtMhKm5N535pgdEkvSEsa
 r58k5xr9xJfOi1ctvKa4iErIerXlBqbdsTcFphMo5rWkoA9EzgXC8dhzxory87B8
 Yl2fvinKHne3+1+VtF9kXhUeLCRA9GYtE2QBV65eRPUwvyRsGepdYYThr+bTku4N
 IdR6UpxxNKKWf8HSCnL3D6yUq0f3/znFHItIOcKnVN95l90y2uMNGTR/jk/CF7uN
 VFA+EXjCTp94hhIy9SQp5vtjW4Rpdmwu6pYgwbLQ17rHbVZCvxe4NgXRESpAXgZg
 /nWLIkjjRaU2WUDFQhDKVed3r1fFc7uJnD6N3jM8k+ivXyeyO7OcM0jqQdZa4iW7
 HEkymnhU/Akp
 =9P5N
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20180514' into staging

Some s390x fixes/cleanups, mainly in the reset area and build fixes
for recent compilers (GCC 8 and clang 6.0.0).

# gpg: Signature made Mon 14 May 2018 16:32:20 BST
# gpg:                using RSA key DECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>"
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>"
# gpg:                 aka "Cornelia Huck <cohuck@redhat.com>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20180514:
  target/s390x: Fix brace Werror with clang 6.0.0
  s390x: refactor reset/reipl handling
  s390x/ccw: make sure all ccw devices are properly reset
  virtio-ccw: common reset handler
  pc-bios/s390-ccw: struct tpi_info must be declared as aligned(4)
  s390x/css: disabled subchannels cannot be status pending

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-05-14 18:53:42 +01:00
Laurent Vivier 5a73e7f313 m68k: fix floatx80_mod() (Coverity CID1390568)
Update the variable checked by the loop condition (expDiff).
Backport the update from Previous.

Fixes: 591596b77a ("target/m68k: add fmod/frem")
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Message-Id: <20180508203937.16796-1-laurent@vivier.eu>
2018-05-14 19:13:07 +02:00
Peter Maydell a9cb55a356 Block pull request
* Support -drive cache.direct=off live migration for POSIX files
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJa9rOXAAoJEJykq7OBq3PIsEYH/RQtBexXbqiosBvHkoZUwEjG
 +lepQXEgJjhNoHil23q/2Ilo16w4gSoV0HA1AGs2Ka5eoWvOj+mwmE+mxPV3mdBy
 jJt0FVWJxh0Ak9bKEEl3LYDu/yRt2gAyiCWVZcgTJNXepXagLMcwZ8mNsyb4R+Lh
 EWroCBGp1de4kUhNmx/639DQCc5Wm9c6rTHnBt/jfCo2IRA6Wm/AsBXZKhZ4+RY9
 4qyujA7rUjCK2lOHHOw2tsABxhsfMiLlbW4K78Z5cIzjudMHhUMgvkFp7FvDEmQC
 61b0ogLErewhKwGdaVrjN4iSnFv2mJz1GJQGe5n9C2CYvUzxlEW7l+mV5kxNjsk=
 =GmNn
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

Block pull request

 * Support -drive cache.direct=off live migration for POSIX files

# gpg: Signature made Sat 12 May 2018 10:27:51 BST
# gpg:                using RSA key 9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  block/file-posix: add x-check-page-cache=on|off option
  block/file-posix: implement bdrv_co_invalidate_cache() on Linux
  checkpatch: reduce MAINTAINERS update message frequency
  checkpatch: emit a warning on file add/move/delete
  checkpatch: ignore email headers better
  checkpatch: check utf-8 content from a commit log when it's missing from charset
  checkpatch: add a --strict check for utf-8 in commit logs
  blockjob: drop block_job_pause/resume_all()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-05-14 17:52:46 +01:00
Richard Henderson b0dad618ba target/s390x: Fix brace Werror with clang 6.0.0
The warning is

target/s390x/misc_helper.c:209:21: error: suggest
      braces around initialization of subobject [-Werror,-Wmissing-braces]
    SysIB sysib = { 0 };
                    ^
                    {}

While the original code is correct, and technically exactly correct
as per ISO C89, both GCC and Clang support plain empty set of braces
as an extension.

Cc: Alexander Graf <agraf@suse.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20180512045950.12386-5-richard.henderson@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2018-05-14 17:10:02 +02:00
David Hildenbrand a30fb811cb s390x: refactor reset/reipl handling
Calling pause_all_vcpus()/resume_all_vcpus() from a VCPU thread might
not be the best idea. As pause_all_vcpus() temporarily drops the qemu
mutex, two parallel calls to pause_all_vcpus() can be active at a time,
resulting in a deadlock. (either by two VCPUs or by the main thread and a
VCPU)

Let's handle it via the main loop instead, as suggested by Paolo. If we
would have two parallel reset requests by two different VCPUs at the
same time, the last one would win.

We use the existing ipl device to handle it. The nice side effect is
that we can get rid of reipl_requested.

This change implies that all reset handling now goes via the common
path, so "no-reboot" handling is now active for all kinds of reboots.

Let's execute any CPU initialization code on the target CPU using
run_on_cpu.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180424101859.10239-1-david@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2018-05-14 17:10:02 +02:00
Cornelia Huck 838fb84f83 s390x/ccw: make sure all ccw devices are properly reset
Thomas reported that the subchannel for a  3270 device that ended up
in a broken state (status pending even though not enabled) did not
get out of that state even after a reboot (which involves a subsytem
reset). The reason for this is that the 3270 device did not define
a reset handler.

Let's fix this by introducing a base reset handler (set up for all
ccw devices) that resets the subchannel and have virtio-ccw call
its virtio-specific reset procedure in addition to that.

CC: qemu-stable@nongnu.org
Reported-by: Thomas Huth <thuth@redhat.com>
Suggested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2018-05-14 17:10:02 +02:00
Cornelia Huck 0c53057adb virtio-ccw: common reset handler
All the different virtio ccw devices use the same reset handler,
so let's move setting it into the base virtio ccw device class.

CC: qemu-stable@nongnu.org
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2018-05-14 17:10:02 +02:00