]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
6 years agofsdev: improve error handling of backend init
Greg Kurz [Mon, 8 Jan 2018 10:18:23 +0000 (11:18 +0100)]
fsdev: improve error handling of backend init

This patch changes some error messages in the backend init code and
convert backends to propagate QEMU Error objects instead of calling
error_report().

One notable improvement is that the local backend now provides a more
detailed error report when it fails to open the shared directory.

Signed-off-by: Greg Kurz <groug@kaod.org>
6 years agofsdev: improve error handling of backend opts parsing
Greg Kurz [Mon, 8 Jan 2018 10:18:23 +0000 (11:18 +0100)]
fsdev: improve error handling of backend opts parsing

This patch changes some error messages in the backend opts parsing
code and convert backends to propagate QEMU Error objects instead
of calling error_report().

Signed-off-by: Greg Kurz <groug@kaod.org>
6 years agotests: virtio-9p: set DRIVER_OK before using the device
Greg Kurz [Mon, 8 Jan 2018 10:18:23 +0000 (11:18 +0100)]
tests: virtio-9p: set DRIVER_OK before using the device

Signed-off-by: Greg Kurz <groug@kaod.org>
6 years agotests: virtio-9p: fix ISR dependence
Greg Kurz [Mon, 8 Jan 2018 10:18:23 +0000 (11:18 +0100)]
tests: virtio-9p: fix ISR dependence

Like other virtio tests, use the used ring APIs instead of assuming ISR
being set means the request has completed.

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
6 years ago9pfs: make pdu_marshal() and pdu_unmarshal() static functions
Greg Kurz [Mon, 8 Jan 2018 10:18:22 +0000 (11:18 +0100)]
9pfs: make pdu_marshal() and pdu_unmarshal() static functions

They're only used by the 9p core code.

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
6 years ago9pfs: fix error path in pdu_submit()
Greg Kurz [Mon, 8 Jan 2018 10:18:22 +0000 (11:18 +0100)]
9pfs: fix error path in pdu_submit()

If we receive an unsupported request id, we first decide to
return -ENOTSUPP to the client, but since the request id
causes is_read_only_op() to return false, we change the
error to be -EROFS if the fsdev is read-only. This doesn't
make sense since we don't know what the client asked for.

This patch ensures that -EROFS can only be returned if the
request id is supported.

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
6 years ago9pfs: fix type in *_parse_opts declarations
Greg Kurz [Mon, 8 Jan 2018 10:18:22 +0000 (11:18 +0100)]
9pfs: fix type in *_parse_opts declarations

To comply with the QEMU coding style.

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
6 years ago9pfs: handle: fix type definition
Greg Kurz [Mon, 8 Jan 2018 10:18:22 +0000 (11:18 +0100)]
9pfs: handle: fix type definition

To comply with the QEMU coding style.

Signed-off-by: Greg Kurz <groug@kaod.org>
6 years ago9pfs: fix some type definitions
Greg Kurz [Mon, 8 Jan 2018 10:18:22 +0000 (11:18 +0100)]
9pfs: fix some type definitions

To comply with the QEMU coding style.

Signed-off-by: Greg Kurz <groug@kaod.org>
6 years agofsdev: fix some type definitions
Greg Kurz [Mon, 8 Jan 2018 10:18:22 +0000 (11:18 +0100)]
fsdev: fix some type definitions

To comply with the QEMU coding style.

Signed-off-by: Greg Kurz <groug@kaod.org>
6 years ago9pfs: fix XattrOperations typedef
Greg Kurz [Mon, 8 Jan 2018 10:18:22 +0000 (11:18 +0100)]
9pfs: fix XattrOperations typedef

To comply with the QEMU coding style.

Signed-off-by: Greg Kurz <groug@kaod.org>
6 years agovirtio-9p: move unrealize/realize after virtio_9p_transport definition
Greg Kurz [Mon, 8 Jan 2018 10:18:22 +0000 (11:18 +0100)]
virtio-9p: move unrealize/realize after virtio_9p_transport definition

And drop the now useless forward declaration of virtio_9p_transport.

Signed-off-by: Greg Kurz <groug@kaod.org>
6 years agoMerge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
Peter Maydell [Mon, 8 Jan 2018 09:15:42 +0000 (09:15 +0000)]
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging

# gpg: Signature made Fri 22 Dec 2017 02:12:29 GMT
# gpg:                using RSA key 0xEF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211

* remotes/jasowang/tags/net-pull-request:
  qemu-doc: Update the deprecation information of -tftp, -bootp, -redir and -smb
  qemu-doc: The "-net nic" option can be used with "netdev=...", too
  net: Remove the legacy "-net channel" parameter
  net: remove unused compute_mcast_idx() function
  rtl8139: use inline net_crc32() and bitshift instead of compute_mcast_idx()
  ne2000: use inline net_crc32() and bitshift instead of compute_mcast_idx()
  ftgmac100: use inline net_crc32() and bitshift instead of compute_mcast_idx()
  lan9118: use inline net_crc32() and bitshift instead of compute_mcast_idx()
  opencores_eth: use inline net_crc32() and bitshift instead of compute_mcast_idx()
  eepro100: use inline net_crc32() and bitshift instead of compute_mcast_idx()
  sungem: fix multicast filter CRC calculation
  sunhme: switch sunhme over to use net_crc32_le()
  eepro100: switch eepro100 e100_compute_mcast_idx() over to use net_crc32()
  pcnet: switch pcnet over to use net_crc32_le()
  net: introduce net_crc32_le() function
  net: move CRC32 calculation from compute_mcast_idx() into its own net_crc32() function
  e1000: Separate TSO and non-TSO contexts, fixing UDP TX corruption
  e1000, e1000e: Move per-packet TX offload flags out of context state

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoqemu-doc: Update the deprecation information of -tftp, -bootp, -redir and -smb
Thomas Huth [Tue, 19 Dec 2017 15:28:56 +0000 (16:28 +0100)]
qemu-doc: Update the deprecation information of -tftp, -bootp, -redir and -smb

The information how to update the deprecated parameters was too scarce,
so that some people did not update to the new syntax yet. Provide some
more information to make sure that it is clear how to update from the
old syntax to the new one.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agoqemu-doc: The "-net nic" option can be used with "netdev=...", too
Thomas Huth [Tue, 19 Dec 2017 15:28:55 +0000 (16:28 +0100)]
qemu-doc: The "-net nic" option can be used with "netdev=...", too

Looks like we missed to document that it is also possible to specify
a netdev with "-net nic" - which is very useful if you want to
configure your on-board NIC to use a backend that has been specified
with "-netdev".

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agonet: Remove the legacy "-net channel" parameter
Thomas Huth [Tue, 19 Dec 2017 15:28:54 +0000 (16:28 +0100)]
net: Remove the legacy "-net channel" parameter

It has never been documented, so hardly anybody knows about this
parameter, and it is marked as deprecated since QEMU v2.6.
Time to let it go now.

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agonet: remove unused compute_mcast_idx() function
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:55 +0000 (18:41 +0000)]
net: remove unused compute_mcast_idx() function

Now that all of the callers have been converted to compute the multicast index
inline using new net CRC functions, this function can now be dropped.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agortl8139: use inline net_crc32() and bitshift instead of compute_mcast_idx()
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:54 +0000 (18:41 +0000)]
rtl8139: use inline net_crc32() and bitshift instead of compute_mcast_idx()

This makes it much easier to compare the multicast CRC calculation endian and
bitshift against the Linux driver implementation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agone2000: use inline net_crc32() and bitshift instead of compute_mcast_idx()
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:53 +0000 (18:41 +0000)]
ne2000: use inline net_crc32() and bitshift instead of compute_mcast_idx()

This makes it much easier to compare the multicast CRC calculation endian and
bitshift against the Linux driver implementation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agoftgmac100: use inline net_crc32() and bitshift instead of compute_mcast_idx()
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:52 +0000 (18:41 +0000)]
ftgmac100: use inline net_crc32() and bitshift instead of compute_mcast_idx()

This makes it much easier to compare the multicast CRC calculation endian and
bitshift against the Linux driver implementation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agolan9118: use inline net_crc32() and bitshift instead of compute_mcast_idx()
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:51 +0000 (18:41 +0000)]
lan9118: use inline net_crc32() and bitshift instead of compute_mcast_idx()

This makes it much easier to compare the multicast CRC calculation endian and
bitshift against the Linux driver implementation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agoopencores_eth: use inline net_crc32() and bitshift instead of compute_mcast_idx()
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:50 +0000 (18:41 +0000)]
opencores_eth: use inline net_crc32() and bitshift instead of compute_mcast_idx()

This makes it much easier to compare the multicast CRC calculation endian and
bitshift against the Linux driver implementation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agoeepro100: use inline net_crc32() and bitshift instead of compute_mcast_idx()
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:49 +0000 (18:41 +0000)]
eepro100: use inline net_crc32() and bitshift instead of compute_mcast_idx()

This makes it much easier to compare the multicast CRC calculation endian and
bitshift against the Linux driver implementation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agosungem: fix multicast filter CRC calculation
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:48 +0000 (18:41 +0000)]
sungem: fix multicast filter CRC calculation

From the Linux sungem driver, we know that the multicast filter CRC is
implemented using ether_crc_le() which isn't the same as calling zlib's
crc32() function (the zlib implementation requires a complemented initial value
and also returns the complemented result).

Fix the multicast filter by simply using the new net_crc32_le() function.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agosunhme: switch sunhme over to use net_crc32_le()
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:47 +0000 (18:41 +0000)]
sunhme: switch sunhme over to use net_crc32_le()

Instead of sunhme_crc32_le() using its own implementation, we can simply call
net_crc32_le() directly and apply the bit shift inline.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agoeepro100: switch eepro100 e100_compute_mcast_idx() over to use net_crc32()
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:46 +0000 (18:41 +0000)]
eepro100: switch eepro100 e100_compute_mcast_idx() over to use net_crc32()

Instead of e100_compute_mcast_idx() using its own implementation, we can
simply call net_crc32() directly and apply the bit shift inline.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agopcnet: switch pcnet over to use net_crc32_le()
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:45 +0000 (18:41 +0000)]
pcnet: switch pcnet over to use net_crc32_le()

Instead of lnc_mchash() using its own implementation, we can simply call
net_crc32_le() directly and apply the bit shift inline.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agonet: introduce net_crc32_le() function
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:44 +0000 (18:41 +0000)]
net: introduce net_crc32_le() function

This provides a standard ethernet CRC32 little-endian implementation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agonet: move CRC32 calculation from compute_mcast_idx() into its own net_crc32() function
Mark Cave-Ayland [Fri, 15 Dec 2017 18:41:43 +0000 (18:41 +0000)]
net: move CRC32 calculation from compute_mcast_idx() into its own net_crc32() function

Separate out the standard ethernet CRC32 calculation into a new net_crc32()
function, renaming the constant POLYNOMIAL to POLYNOMIAL_BE to make it clear
that this is a big-endian CRC32 calculation.

As part of the constant rename, remove the duplicate definition of POLYNOMIAL
from eepro100.c and use the new POLYNOMIAL_BE constant instead.

Once this is complete remove the existing CRC32 implementation from
compute_mcast_idx() and call the new net_crc32() function in its place.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agoe1000: Separate TSO and non-TSO contexts, fixing UDP TX corruption
Ed Swierk via Qemu-devel [Tue, 14 Nov 2017 23:23:34 +0000 (15:23 -0800)]
e1000: Separate TSO and non-TSO contexts, fixing UDP TX corruption

The device is supposed to maintain two distinct contexts for transmit
offloads: one has parameters for both segmentation and checksum
offload, the other only for checksum offload. The guest driver can
send two context descriptors, one for each context (the TSE flag
specifies which). Then the guest can refer to one or the other context
in subsequent transmit data descriptors, depending on what offloads it
wants applied to each packet.

Currently the e1000 device stores just one context, and misinterprets
the TSE flags in the context and data descriptors. This is often okay:
Linux happens to send a fresh context descriptor before every data
descriptor, so forgetting the other context doesn't matter. Windows
does rely on separate contexts for TSO vs. non-TSO packets, but for
mostly-TCP traffic the two contexts have identical TCP-specific
offload parameters so confusing them doesn't matter.

One case where this confusion matters is when a Windows guest sets up
a TSO context for TCP and a non-TSO context for UDP, and then
transmits both TCP and UDP traffic in parallel. The e1000 device
sometimes ends up using TCP-specific parameters while doing checksum
offload on a UDP datagram: it writes the checksum to offset 16 (the
correct location for a TCP checksum), stomping on two bytes of UDP
data, and leaving the wrong value in the actual UDP checksum field at
offset 6. (Even worse, the host network stack may then recompute the
UDP checksum, "correcting" it to match the corrupt data before sending
it out a physical interface.)

Correct this by tracking the TSO context independently of the non-TSO
context, and selecting the appropriate context based on the TSE flag
in each transmit data descriptor.

Signed-off-by: Ed Swierk <eswierk@skyportsystems.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agoe1000, e1000e: Move per-packet TX offload flags out of context state
Ed Swierk via Qemu-devel [Tue, 14 Nov 2017 23:23:33 +0000 (15:23 -0800)]
e1000, e1000e: Move per-packet TX offload flags out of context state

sum_needed and cptse flags are received from the guest within each
transmit data descriptor. They are not part of the offload context;
instead, they determine how to apply a previously received context to
the packet being transmitted:

- If cptse is set, perform both segmentation and checksum offload
  using the parameters in the TSO context; otherwise just do checksum
  offload. (Currently the e1000 device incorrectly stores only one
  context, which will be fixed in a subsequent patch.)

- Depending on the bits set in sum_needed, possibly perform L4
  checksum offload and/or IP checksum offload, using the parameters in
  the appropriate context.

Move these flags out of struct e1000x_txd_props, which is otherwise
dedicated to storing values from a context descriptor, and into the
per-packet TX struct.

Signed-off-by: Ed Swierk <eswierk@skyportsystems.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
6 years agoMerge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.12-pull-request' into...
Peter Maydell [Fri, 22 Dec 2017 00:11:36 +0000 (00:11 +0000)]
Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.12-pull-request' into staging

# gpg: Signature made Thu 21 Dec 2017 19:35:00 GMT
# gpg:                using RSA key 0xF30C38BD3F2FBE3C
# 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.12-pull-request:
  tests/boot-serial-test: Add support for the mcf5208evb board
  target/m68k: fix set_cc_op()
  target/m68k: add monitor.c
  target/m68k: remove unused variable gen_throws_exception
  Split adb.c into adb.c, adb-mouse.c and adb-kbd.c

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/i386/vmport: fix missing definitions with non-log trace backends
Laurent Vivier [Thu, 21 Dec 2017 21:11:03 +0000 (22:11 +0100)]
hw/i386/vmport: fix missing definitions with non-log trace backends

When compiled with anything other than the 'log' trace backend, we have:

   error: implicit declaration of function 'qemu_log_mask'
   error: 'LOG_UNIMP' undeclared (first use in this function)

This patch adds the missing include.

Fixes: 7299e1a411
       ("hw/i386/vmport: replace fprintf() by trace events or LOG_UNIMP")
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-id: 20171221211103.30311-1-laurent@vivier.eu
[PMM: fixed commit message description of when problem occurs]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agotests/boot-serial-test: Add support for the mcf5208evb board
Thomas Huth [Thu, 30 Nov 2017 08:53:04 +0000 (09:53 +0100)]
tests/boot-serial-test: Add support for the mcf5208evb board

We can output a character quite easily here with some few lines of
assembly that we provide as a mini-kernel for this board.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1512031988-32490-4-git-send-email-thuth@redhat.com>
[lv: add boot-serial-test in check-qtest-m68k]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
6 years agotarget/m68k: fix set_cc_op()
Laurent Vivier [Thu, 21 Dec 2017 16:05:58 +0000 (17:05 +0100)]
target/m68k: fix set_cc_op()

The first call of set_cc_op() in a new translation sequence
is done with old_op set to CC_OP_DYNAMIC (-1).

This will do an out of bound access to the array cc_op_live[].

We fix that by adding an entry in cc_op_live[] for CC_OP_DYNAMIC.

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20171221160558.14151-1-laurent@vivier.eu>

6 years agotarget/m68k: add monitor.c
Laurent Vivier [Thu, 21 Dec 2017 08:30:57 +0000 (09:30 +0100)]
target/m68k: add monitor.c

This allows to use registers content in the monitor.

Example:

 BEFORE:
  (qemu) print $d0
  unknown register

 AFTER:
  (qemu) print $d0
  0
  (qemu) print $sr
  0x2000
  (qemu) x/10i $pc
  0x40010a2a:  movew %sr,%d0
  0x40010a2c:  oril #1792,%d0
  0x40010a32:  movew %d0,%sr
  0x40010a34:  movel %a0@,%d0
  0x40010a36:  btst #3,%d0
  0x40010a3a:  beqs 0x40010a26
  0x40010a3c:  movew %sr,%d0
  0x40010a3e:  andil #63743,%d0
  0x40010a44:  movew %d0,%sr
  0x40010a46:  rts

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Message-Id: <20171221083057.17942-1-laurent@vivier.eu>

6 years agotarget/m68k: remove unused variable gen_throws_exception
Laurent Vivier [Wed, 20 Dec 2017 13:08:15 +0000 (14:08 +0100)]
target/m68k: remove unused variable gen_throws_exception

It has been introduced by e6e5906b6e ("ColdFire target."),
but the content is never used.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Message-Id: <20171220130815.20708-1-laurent@vivier.eu>

6 years agoSplit adb.c into adb.c, adb-mouse.c and adb-kbd.c
Laurent Vivier [Wed, 20 Dec 2017 12:14:06 +0000 (13:14 +0100)]
Split adb.c into adb.c, adb-mouse.c and adb-kbd.c

It makes the code clearer to separate the bus implementation
from the devices one.

Replace ADB_DPRINTF() with trace events (and adding new ones in adb-kbd.c).
Some minor changes to make checkpatch.pl happy.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20171220121406.24056-1-laurent@vivier.eu>

6 years agoMerge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Peter Maydell [Thu, 21 Dec 2017 16:34:23 +0000 (16:34 +0000)]
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

* NBD and chardev conversion to QIONetListener (Daniel)
* MTTCG fixes (David)
* Hyper-V fixes (Roman, Evgeny)
* share-rw option (Fam)
* Mux chardev event bugfix (Marc-André)
* Add systemd unit files in contrib/ (me)
* SCSI and block/iscsi.c bugfixes (me, Peter L.)
* unassigned_mem_ops fixes (Peter M.)
* VEX decoding fix (Peter M.)
* "info pic" and "info irq" improvements (Peter Xu)
* vmport trace events (Philippe)
* Braille chardev bugfix (Samuel)
* Compiler warnings fix (Stefan)
* initial support for TCG smoke test of more boards (Thomas)
* New CPU features (Yang)
* Reduce startup memory usage (Yang)
* QemuThread race fix (linhecheng)

# gpg: Signature made Thu 21 Dec 2017 08:30:49 GMT
# gpg:                using RSA key 0xBFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream: (41 commits)
  chardev: convert the socket server to QIONetListener
  blockdev: convert qemu-nbd server to QIONetListener
  blockdev: convert internal NBD server to QIONetListener
  test: add some chardev mux event tests
  chardev: fix backend events regression with mux chardev
  rcu: reduce more than 7MB heap memory by malloc_trim()
  checkpatch: volatile with a comment or sig_atomic_t is okay
  i8259: move TYPE_INTERRUPT_STATS_PROVIDER upper
  kvm-i8259: support "info pic" and "info irq"
  i8259: generalize statistics into common code
  i8259: use DEBUG_IRQ_COUNT always
  i8259: convert DPRINTFs into trace
  Remove legacy -no-kvm-pit option
  scsi: replace hex constants with #defines
  scsi: provide general-purpose functions to manage sense data
  hw/i386/vmport: replace fprintf() by trace events or LOG_UNIMP
  hw/mips/boston: Remove workaround for writes to ROM aborting
  exec: Don't reuse unassigned_mem_ops for io_mem_rom
  block/iscsi: only report an iSCSI Failure if we don't handle it gracefully
  block/iscsi: dont leave allocmap in an invalid state on UNMAP failure
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/famz/tags/staging-pull-request' into staging
Peter Maydell [Thu, 21 Dec 2017 13:14:06 +0000 (13:14 +0000)]
Merge remote-tracking branch 'remotes/famz/tags/staging-pull-request' into staging

# gpg: Signature made Thu 21 Dec 2017 01:51:20 GMT
# gpg:                using RSA key 0xCA35624C6A9171C6
# gpg: Good signature from "Fam Zheng <famz@redhat.com>"
# Primary key fingerprint: 5003 7CB7 9706 0F76 F021  AD56 CA35 624C 6A91 71C6

* remotes/famz/tags/staging-pull-request:
  util: add is_equal to UUID API
  Revert "docker: Enable features explicitly in test-full"

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agochardev: convert the socket server to QIONetListener
Daniel P. Berrange [Mon, 18 Dec 2017 13:54:17 +0000 (13:54 +0000)]
chardev: convert the socket server to QIONetListener

Instead of creating a QIOChannelSocket directly for the chardev
server socket, use a QIONetListener. This provides the ability
to listen on multiple sockets at the same time, so enables
full support for IPv4/IPv6 dual stack.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20171218135417.28301-2-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoblockdev: convert qemu-nbd server to QIONetListener
Daniel P. Berrange [Mon, 18 Dec 2017 10:16:43 +0000 (10:16 +0000)]
blockdev: convert qemu-nbd server to QIONetListener

Instead of creating a QIOChannelSocket directly for the NBD
server socket, use a QIONetListener. This provides the ability
to listen on multiple sockets at the same time, so enables
full support for IPv4/IPv6 dual stack. This also means we can
honour multiple FDs received during socket activation.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20171218101643.20360-3-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoblockdev: convert internal NBD server to QIONetListener
Daniel P. Berrange [Mon, 18 Dec 2017 10:16:42 +0000 (10:16 +0000)]
blockdev: convert internal NBD server to QIONetListener

Instead of creating a QIOChannelSocket directly for the NBD
server socket, use a QIONetListener. This provides the ability
to listen on multiple sockets at the same time, so enables
full support for IPv4/IPv6 dual stack.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20171218101643.20360-2-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agotest: add some chardev mux event tests
Marc-André Lureau [Fri, 3 Nov 2017 15:28:24 +0000 (16:28 +0100)]
test: add some chardev mux event tests

Check the expected behaviour of qemu_chr_be_event() on a mux chardev.

For some reason, sending the event on the base chardev broadcast to
all frontends, while sending it on the mux chardev itself should
trigger the event on the currently focused chardev frontend.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20171103152824.21948-3-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agochardev: fix backend events regression with mux chardev
Marc-André Lureau [Fri, 3 Nov 2017 15:28:23 +0000 (16:28 +0100)]
chardev: fix backend events regression with mux chardev

Kirill noticied that on recent versions on QEMU he was not able to
trigger SysRq to invoke debug capabilites of Linux Kernel.  He tracked
it down to qemu_chr_be_event() ignoring CHR_EVENT_BREAK due s->be
being NULL. The bug was introduced in 2.8, commit a4afa548fc6d ("char:
move front end handlers in CharBackend"). Since the commit, the
qemu_chr_be_event() failed to deliver CHR_EVENT_BREAK due to
qemu_chr_fe_init() does not set s->be in case of mux.

Let's fix this by teaching mux to send an event to the frontend with
the focus.

Reported-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Fixes: a4afa548fc6d ("char: move front end handlers in CharBackend")
Message-Id: <20171103152824.21948-2-marcandre.lureau@redhat.com>
Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agorcu: reduce more than 7MB heap memory by malloc_trim()
Yang Zhong [Wed, 20 Dec 2017 13:16:46 +0000 (21:16 +0800)]
rcu: reduce more than 7MB heap memory by malloc_trim()

Since there are some issues in memory alloc/free machenism
in glibc for little chunk memory, if Qemu frequently
alloc/free little chunk memory, the glibc doesn't alloc
little chunk memory from free list of glibc and still
allocate from OS, which make the heap size bigger and bigger.

This patch introduce malloc_trim(), which will free heap
memory when there is no rcu call during rcu thread loop.
malloc_trim() can be enabled/disabled by --enable-malloc-trim/
--disable-malloc-trim in the Qemu configure command. The
default malloc_trim() is enabled for libc.

Below are test results from smaps file.
(1)without patch
55f0783e1000-55f07992a000 rw-p 00000000 00:00 0  [heap]
Size:              21796 kB
Rss:               14260 kB
Pss:               14260 kB

(2)with patch
55cc5fadf000-55cc61008000 rw-p 00000000 00:00 0  [heap]
Size:              21668 kB
Rss:                6940 kB
Pss:                6940 kB

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <1513775806-19779-1-git-send-email-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agocheckpatch: volatile with a comment or sig_atomic_t is okay
Marc-André Lureau [Fri, 15 Dec 2017 18:18:10 +0000 (19:18 +0100)]
checkpatch: volatile with a comment or sig_atomic_t is okay

This assumes that the comment gives some justification;
"volatile sig_atomic_t" is also self-explanatory and usually
correct.

Discussed in:
'[Qemu-devel] [PATCH] dump-guest-memory.py: fix "You can't do that without a process to debug"'

Suggested-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20171215181810.4122-1-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoi8259: move TYPE_INTERRUPT_STATS_PROVIDER upper
Peter Xu [Sun, 10 Dec 2017 06:38:19 +0000 (14:38 +0800)]
i8259: move TYPE_INTERRUPT_STATS_PROVIDER upper

Now both classes (i8259, i8259-kvm) support this.  Move this upper to
the common class code.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20171210063819.14892-6-peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agokvm-i8259: support "info pic" and "info irq"
Peter Xu [Sun, 10 Dec 2017 06:38:18 +0000 (14:38 +0800)]
kvm-i8259: support "info pic" and "info irq"

Let's leverage the i8259 common code for kvm-i8259 too.

I think it's still possible that stats can lost when i8259 is in kernel
and meanwhile when irqfd is used, e.g., by vfio or vhost devices.
However that should be rare IMHO since they should be using MSIs mostly
if they really want performance (that's why people use vhost and device
assignment), and no old INTx should be used.  As long as the INTx users
are emulated in QEMU the stats will be correct.

For "info pic", it should be always accurate since we fetch kvm regs
before dump.

More importantly, it's just too simple to do this now - it's only 10+
LOC to gain this feature.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20171210063819.14892-5-peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoi8259: generalize statistics into common code
Peter Xu [Sun, 10 Dec 2017 06:38:17 +0000 (14:38 +0800)]
i8259: generalize statistics into common code

It was only for userspace i8259.  Move it to general code so that
kvm-i8259 can also use it in the future.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20171210063819.14892-4-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoi8259: use DEBUG_IRQ_COUNT always
Peter Xu [Sun, 10 Dec 2017 06:38:16 +0000 (14:38 +0800)]
i8259: use DEBUG_IRQ_COUNT always

It's not really scary to even enable it forever.  After all it's i8259,
and it's even not the kernel one.

Then we can remove quite a few of lines to make it cleaner.  And "info
irq" will always work for it.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20171210063819.14892-3-peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoi8259: convert DPRINTFs into trace
Peter Xu [Sun, 10 Dec 2017 06:38:15 +0000 (14:38 +0800)]
i8259: convert DPRINTFs into trace

One thing to mention is that in pic_set_irq() I need to uncomment a few
lines in the macros to make sure IRQ value calculation is correct.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20171210063819.14892-2-peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoRemove legacy -no-kvm-pit option
Thomas Huth [Mon, 18 Dec 2017 17:44:25 +0000 (18:44 +0100)]
Remove legacy -no-kvm-pit option

It's only printing a warning since QEMU v1.3.0, so nobody should use
this anymore today. Let's get rid of this now.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1513619065-31722-1-git-send-email-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoscsi: replace hex constants with #defines
Paolo Bonzini [Mon, 27 Nov 2017 12:45:59 +0000 (13:45 +0100)]
scsi: replace hex constants with #defines

Sense keys have nice #defines in scsi/constants.h, use them.

Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoscsi: provide general-purpose functions to manage sense data
Paolo Bonzini [Mon, 27 Nov 2017 12:27:41 +0000 (13:27 +0100)]
scsi: provide general-purpose functions to manage sense data

Extract the common parts of scsi_sense_buf_to_errno, scsi_convert_sense
and scsi_target_send_command's REQUEST SENSE handling into two new
functions scsi_parse_sense_buf and scsi_build_sense_buf.

Fix a bug in scsi_target_send_command along the way; the length was
written in buf[10] rather than buf[7].

Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Fixes: b07fbce634 ("scsi-bus: correct responses for INQUIRY and REQUEST SENSE")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agohw/i386/vmport: replace fprintf() by trace events or LOG_UNIMP
Philippe Mathieu-Daudé [Fri, 15 Dec 2017 03:43:55 +0000 (00:43 -0300)]
hw/i386/vmport: replace fprintf() by trace events or LOG_UNIMP

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20171215034356.4449-2-f4bug@amsat.org>
[Replace unknown command tracepoint with LOG_UNIMP, add
 generic tracepoint for vmport commands. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agohw/mips/boston: Remove workaround for writes to ROM aborting
Peter Maydell [Wed, 13 Dec 2017 17:52:29 +0000 (17:52 +0000)]
hw/mips/boston: Remove workaround for writes to ROM aborting

Now that the memory system correctly handles writes to ROM for
guest CPUs that may generate exceptions for decode errors, we
can remove the workaround from the boston board.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <1513187549-2435-3-git-send-email-peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoexec: Don't reuse unassigned_mem_ops for io_mem_rom
Peter Maydell [Wed, 13 Dec 2017 17:52:28 +0000 (17:52 +0000)]
exec: Don't reuse unassigned_mem_ops for io_mem_rom

We set up the io_mem_rom special memory region using the
unassigned_mem_ops structure; this is then used when a guest tries to
write to ROM.  This is incorrect, because the behaviour of unassigned
memory may be different from that of ROM for writes.  In particular,
on some architectures writing to unassigned memory generates a guest
exception, whereas writing to ROM is generally ignored.  Use a
special readonly_mem_ops for this purpose instead, so writes to
ROM are ignored for all guest CPUs.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <1513187549-2435-2-git-send-email-peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoblock/iscsi: only report an iSCSI Failure if we don't handle it gracefully
Peter Lieven [Fri, 8 Dec 2017 11:51:08 +0000 (12:51 +0100)]
block/iscsi: only report an iSCSI Failure if we don't handle it gracefully

we currently report an "iSCSI Failure" in iscsi_co_generic_cb if the task
hasn't completed with SCSI_STATUS_GOOD. However, we expect a failure in
some cases and handle it gracefully. This is the case for misaligned UNMAPs
and WRITESAME10/16 calls without UNMAP. In this case a failure in the
logs can be quite misleading.

While we are at it improve the logging to reveal which operation failed
at what LBA.

Signed-off-by: Peter Lieven <pl@kamp.de>
Message-Id: <1512733868-9009-3-git-send-email-pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoblock/iscsi: dont leave allocmap in an invalid state on UNMAP failure
Peter Lieven [Fri, 8 Dec 2017 11:51:07 +0000 (12:51 +0100)]
block/iscsi: dont leave allocmap in an invalid state on UNMAP failure

we forgot to set the allocmap to invalid if an UNMAP call fails.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Lieven <pl@kamp.de>
Message-Id: <1512733868-9009-2-git-send-email-pl@kamp.de>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agocpu: suffix cpu address spaces with cpu index
Peter Xu [Thu, 23 Nov 2017 09:23:33 +0000 (17:23 +0800)]
cpu: suffix cpu address spaces with cpu index

Renaming cpu address space names so that they won't be the same when
there are more than one.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20171123092333.16085-4-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agocpu: refactor cpu_address_space_init()
Peter Xu [Thu, 23 Nov 2017 09:23:32 +0000 (17:23 +0800)]
cpu: refactor cpu_address_space_init()

Normally we create an address space for that CPU and pass that address
space into the function.  Let's just do it inside to unify address space
creations.  It'll simplify my next patch to rename those address spaces.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20171123092333.16085-3-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agohw/moxie/moxiesim: Add support for loading a BIOS on moxiesim
Thomas Huth [Thu, 30 Nov 2017 08:53:06 +0000 (09:53 +0100)]
hw/moxie/moxiesim: Add support for loading a BIOS on moxiesim

The moxiesim machine already defines a memory region for a firmware,
but does not provide the possibility to load an image via "-bios" yet.
This will be needed for the boot-serial tester, so let's add support
for "-bios" here now.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1512031988-32490-6-git-send-email-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agotests/boot-serial-test: Add code to allow to specify our own kernel or bios
Thomas Huth [Thu, 30 Nov 2017 08:53:03 +0000 (09:53 +0100)]
tests/boot-serial-test: Add code to allow to specify our own kernel or bios

QEMU only ships with some few firmware images, i.e. we can currently run
the boot-serial test only on a very limited set of machines. But writing
some characters to the default UART of a machine can often be done with
some few lines of assembly, so we add the possibility to the boot-serial
tester to use its own mini-kernels or mini-firmwares. We write such images
then into a file that we can load with the "-kernel" or "-bios" parameter
when we launch QEMU.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1512031988-32490-3-git-send-email-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agotests/boot-serial-test: Make sure that we check the timeout regularly
Thomas Huth [Thu, 30 Nov 2017 08:53:02 +0000 (09:53 +0100)]
tests/boot-serial-test: Make sure that we check the timeout regularly

If the guest continuesly writes characters to the UART, we never leave
the inner while loop and thus never check whether we've reached the
timeout value. So if we fail to find the expected string in the UART
output, the test just hangs and never finishs. Use a counter to regularly
break out of the while loop to check the timeout.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1512031988-32490-2-git-send-email-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agotarget/i386: Fix handling of VEX prefixes
Peter Maydell [Wed, 13 Dec 2017 11:19:19 +0000 (11:19 +0000)]
target/i386: Fix handling of VEX prefixes

In commit e3af7c788b73a6495eb9d94992ef11f6ad6f3c56 we
replaced direct calls to to cpu_ld*_code() with calls
to the x86_ld*_code() wrappers which incorporate an
advance of s->pc. Unfortunately we didn't notice that
in one place the old code was deliberately not incrementing
s->pc:

@@ -4501,7 +4528,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
             static const int pp_prefix[4] = {
                 0, PREFIX_DATA, PREFIX_REPZ, PREFIX_REPNZ
             };
-            int vex3, vex2 = cpu_ldub_code(env, s->pc);
+            int vex3, vex2 = x86_ldub_code(env, s);

             if (!CODE64(s) && (vex2 & 0xc0) != 0xc0) {
                 /* 4.1.4.6: In 32-bit mode, bits [7:6] must be 11b,

This meant we were mishandling this set of instructions.
Remove the manual advance of s->pc for the "is VEX" case
(which is now done by x86_ldub_code()) and instead rewind
PC in the case where we decide that this isn't really VEX.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-stable@nongnu.org
Reported-by: Alexandro Sanchez Bach <alexandro@phi.nz>
Message-Id: <1513163959-17545-1-git-send-email-peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agosockets: remove obsolete code that updated listen address
Daniel P. Berrange [Tue, 12 Dec 2017 11:12:19 +0000 (11:12 +0000)]
sockets: remove obsolete code that updated listen address

When listening on unix/tcp sockets there was optional code that would update
the original SocketAddress struct with the info about the actual address that
was listened on. Since the conversion of everything to QIOChannelSocket, no
remaining caller made use of this feature. It has been replaced with the ability
to query the listen address after the fact using the function
qio_channel_socket_get_local_address. This is a better model when the input
address can result in listening on multiple distinct sockets.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Message-Id: <20171212111219.32601-1-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agobaum: Truncate braille device size to 84x1
Samuel Thibault [Mon, 11 Dec 2017 00:19:50 +0000 (01:19 +0100)]
baum: Truncate braille device size to 84x1

Baum device bigger than 84 do not actually exist, but the user's own
Braille device might be wider than 84 columns.  Some guest drivers
would be upset by such sizes, so clamp the device size.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-Id: <20171211001950.27843-1-samuel.thibault@ens-lyon.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agotarget/i386: Fix compiler warnings
Stefan Weil [Mon, 13 Nov 2017 06:48:45 +0000 (07:48 +0100)]
target/i386: Fix compiler warnings

These gcc warnings are fixed:

target/i386/translate.c:4461:12: warning:
 variable 'prefixes' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
target/i386/translate.c:4466:9: warning:
 variable 'rex_w' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
target/i386/translate.c:4466:16: warning:
 variable 'rex_r' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]

Tested with x86_64-w64-mingw32-gcc from Debian stretch.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-Id: <20171113064845.29142-1-sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agocpu-exec: fix missed CPU kick during interrupt injection
David Hildenbrand [Wed, 29 Nov 2017 19:13:19 +0000 (20:13 +0100)]
cpu-exec: fix missed CPU kick during interrupt injection

The conditional memory barrier not only looks strange but actually is
wrong.

On s390x, I can reproduce interrupts via cpu_interrupt() not leading to
a proper kick out of emulation every now and then. cpu_interrupt() is
especially used for inter CPU communication via SIGP (esp. external
calls and emergency interrupts).

With this patch, I was not able to reproduce. (esp. no stalls or hangs
in the guest).

My setup is s390x MTTCG with 16 VCPUs on 8 CPU host, running make -j16.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20171129191319.11483-1-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agocpus: make pause_all_cpus() play with SMP on single threaded TCG
David Hildenbrand [Wed, 29 Nov 2017 19:12:15 +0000 (20:12 +0100)]
cpus: make pause_all_cpus() play with SMP on single threaded TCG

pause_all_cpus() is sometimes called from a VCPU thread (e.g. s390x
during special reset). It cannot deal with multiple VCPUs per Thread
(single threaded TCG) yet.

Booting an s390x guest with -smp 2 and single threaded TCG from disk
currently fails. The DIAG 308 will issue a pause_all_cpus() and wait
forever for the CPUs to actually stop. But it is waiting for itself.

So let's stop all VCPUs belonging to the current thread. Factor out
stopping of a VCPU.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20171129191215.11323-1-david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agohyperv: make SynIC version msr constant
Roman Kagan [Wed, 22 Nov 2017 18:14:18 +0000 (21:14 +0300)]
hyperv: make SynIC version msr constant

The value of HV_X64_MSR_SVERSION is initialized once at vcpu init, and
is reset to zero on vcpu reset, which is wrong.

It is supposed to be a constant, so drop the field from X86CPU, set the
msr with the constant value, and don't bother getting it.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Message-Id: <20171122181418.14180-4-rkagan@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agohyperv: ensure SINTx msrs are reset properly
Roman Kagan [Wed, 22 Nov 2017 18:14:17 +0000 (21:14 +0300)]
hyperv: ensure SINTx msrs are reset properly

Initially SINTx msrs should be in "masked" state.  To ensure that
happens on *every* reset, move setting their values to
kvm_arch_vcpu_reset.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Message-Id: <20171122181418.14180-3-rkagan@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agohyperv: set partition-wide MSRs only on first vcpu
Evgeny Yakovlev [Wed, 22 Nov 2017 18:14:16 +0000 (21:14 +0300)]
hyperv: set partition-wide MSRs only on first vcpu

Hyper-V has a notion of partition-wide MSRs.  Those MSRs are read and
written as usual on each VCPU, however the hypervisor maintains a single
global value for all VCPUs.  Thus writing such an MSR from any single
VCPU affects the global value that is read by all other VCPUs.

This leads to an issue during VCPU hotplug: the zero-initialzied values
of those MSRs get synced into KVM and override the global values as has
already been set by the guest.

This change makes the partition-wide MSRs only be synchronized on the
first vcpu.

Signed-off-by: Evgeny Yakovlev <eyakovlev@virtuozzo.com>
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Message-Id: <20171122181418.14180-2-rkagan@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agox86/cpu: Enable new SSE/AVX/AVX512 cpu features
Yang Zhong [Wed, 22 Nov 2017 07:27:56 +0000 (15:27 +0800)]
x86/cpu: Enable new SSE/AVX/AVX512 cpu features

Intel IceLake cpu has added new cpu features,AVX512_VBMI2/GFNI/
VAES/VPCLMULQDQ/AVX512_VNNI/AVX512_BITALG. Those new cpu features
need expose to guest VM.

The bit definition:
CPUID.(EAX=7,ECX=0):ECX[bit 06] AVX512_VBMI2
CPUID.(EAX=7,ECX=0):ECX[bit 08] GFNI
CPUID.(EAX=7,ECX=0):ECX[bit 09] VAES
CPUID.(EAX=7,ECX=0):ECX[bit 10] VPCLMULQDQ
CPUID.(EAX=7,ECX=0):ECX[bit 11] AVX512_VNNI
CPUID.(EAX=7,ECX=0):ECX[bit 12] AVX512_BITALG

The release document ref below link:
https://software.intel.com/sites/default/files/managed/c5/15/\
architecture-instruction-set-extensions-programming-reference.pdf

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <1511335676-20797-1-git-send-email-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoMAITAINERS: List Fam Zheng as reviewer for SCSI patches
Fam Zheng [Tue, 5 Dec 2017 07:22:20 +0000 (15:22 +0800)]
MAITAINERS: List Fam Zheng as reviewer for SCSI patches

Just so that I notice those patches more easily.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20171205072220.885-1-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoscsi-block: Add share-rw option
Fam Zheng [Tue, 5 Dec 2017 07:19:28 +0000 (15:19 +0800)]
scsi-block: Add share-rw option

Scsi-block doesn't use the DEFINE_BLOCK_PROPERTIES() macro so it didn't
gain the share-rw back when it was added to all other storage devices.
This option is meaningful here, and need to be used when attaching a
shared storage to guest.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20171205071928.30242-1-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agocontrib: add systemd unit files
Paolo Bonzini [Fri, 24 Nov 2017 16:44:22 +0000 (17:44 +0100)]
contrib: add systemd unit files

This lets distros standardize on how QEMU should install systemd
services for qemu-ga and qemu-pr-helper.

The qemu-ga unit file comes from Fedora, but I checked that
Debian is using the same path for the virtio-serisal port.

I would like to include this in 2.11, so that the qemu-pr-helper
socket can be standardized across distros.  Note however that
the files are not installed.  We can add a configure option
in 2.12 perhaps, but it's too late now; documenting the files
in the release notes should do.

Suggested-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20171124164422.3960-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoqemu-pr-helper: miscellaneous fixes
Paolo Bonzini [Fri, 1 Dec 2017 17:40:06 +0000 (18:40 +0100)]
qemu-pr-helper: miscellaneous fixes

1) Return a generic sense if TEST UNIT READY does not provide one;

2) Fix two mistakes in copying from the spec.

Cc: qemu-stable@nongnu.org
Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoqemu-thread: fix races on threads that exit very quickly
linzhecheng [Tue, 28 Nov 2017 04:46:56 +0000 (12:46 +0800)]
qemu-thread: fix races on threads that exit very quickly

If we create a thread with QEMU_THREAD_DETACHED mode, QEMU may get a segfault with low probability.

The backtrace is:
   #0  0x00007f46c60291d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
   #1  0x00007f46c602a8c8 in __GI_abort () at abort.c:90
   #2  0x00000000008543c9 in PAT_abort ()
   #3  0x000000000085140d in patchIllInsHandler ()
   #4  <signal handler called>
   #5  pthread_detach (th=139933037614848) at pthread_detach.c:50
   #6  0x0000000000829759 in qemu_thread_create (thread=thread@entry=0x7ffdaa8205e0, name=name@entry=0x94d94a "io-task-worker", start_routine=start_routine@entry=0x7eb9a0 <qio_task_thread_worker>,
       arg=arg@entry=0x3f5cf70, mode=mode@entry=1) at util/qemu_thread_posix.c:512
   #7  0x00000000007ebc96 in qio_task_run_in_thread (task=0x31db2c0, worker=worker@entry=0x7e7e40 <qio_channel_socket_connect_worker>, opaque=0xcd23380, destroy=0x7f1180 <qapi_free_SocketAddress>)
       at io/task.c:141
   #8  0x00000000007e7f33 in qio_channel_socket_connect_async (ioc=ioc@entry=0x626c0b0, addr=<optimized out>, callback=callback@entry=0x55e080 <qemu_chr_socket_connected>, opaque=opaque@entry=0x42862c0,
       destroy=destroy@entry=0x0) at io/channel_socket.c:194
   #9  0x000000000055bdd1 in socket_reconnect_timeout (opaque=0x42862c0) at qemu_char.c:4744
   #10 0x00007f46c72483b3 in g_timeout_dispatch () from /usr/lib64/libglib-2.0.so.0
   #11 0x00007f46c724799a in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
   #12 0x000000000076c646 in glib_pollfds_poll () at main_loop.c:228
   #13 0x000000000076c6eb in os_host_main_loop_wait (timeout=348000000) at main_loop.c:273
   #14 0x000000000076c815 in main_loop_wait (nonblocking=nonblocking@entry=0) at main_loop.c:521
   #15 0x000000000056a511 in main_loop () at vl.c:2076
   #16 0x0000000000420705 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4940

The cause of this problem is a glibc bug; for more information, see
https://sourceware.org/bugzilla/show_bug.cgi?id=19951.
The solution for this bug is to use pthread_attr_setdetachstate.

There is a similar issue with pthread_setname_np, which is moved
from creating thread to created thread.

Signed-off-by: linzhecheng <linzhecheng@huawei.com>
Message-Id: <20171128044656.10592-1-linzhecheng@huawei.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
[Simplify the code by removing qemu_thread_set_name, and free the arguments
 before invoking the start routine. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agomemfd: fix configure test
Paolo Bonzini [Tue, 28 Nov 2017 10:51:27 +0000 (11:51 +0100)]
memfd: fix configure test

Recent glibc added memfd_create in sys/mman.h.  This conflicts with
the definition in util/memfd.c:

    /builddir/build/BUILD/qemu-2.11.0-rc1/util/memfd.c:40:12: error: static declaration of memfd_create follows non-static declaration

Fix the configure test, and remove the sys/memfd.h inclusion since the
file actually does not exist---it is a typo in the memfd_create(2) man
page.

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
6 years agoMerge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-12-20' into staging
Peter Maydell [Wed, 20 Dec 2017 20:38:36 +0000 (20:38 +0000)]
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-12-20' into staging

QAPI patches for 2017-12-20

# gpg: Signature made Wed 20 Dec 2017 18:53:28 GMT
# gpg:                using RSA key 0x3870B400EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qapi-2017-12-20:
  qmp: remove qmp_cpu
  qapi-docs: fix a comment typo
  qapi2texi: De-duplicate code to add blank line before symbol
  qapi: Rename QAPIDoc.parser, .section to ._parser, ._section
  qapi2texi: Simplify representation of section text
  qapi: Simplify representation of QAPIDoc section text
  qapi: Unify representation of doc section without name
  qapi2texi: Clean up texi_sections()
  tests/qapi-schema/doc-bad-section: New, factored out of doc-good
  qapi: Make cur_doc local to QAPISchemaParser.__init__()
  qapi: Eliminate QAPISchemaParser.__init__()'s local fname
  qapi: Stop rejecting #optional
  qapi-schema: Fix query-vm-generation-id's doc comment markup

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoqmp: remove qmp_cpu
Daniel Henrique Barboza [Wed, 20 Dec 2017 10:23:04 +0000 (08:23 -0200)]
qmp: remove qmp_cpu

'qmp_cpu' was implemented in commit 755f196898 ("qapi: Convert the cpu
command") as a functional no-op, a QMP call that does nothing and
return success. The idea, apparently, was to provide a counterpart
for the HMP 'hmp_cpu' command, introduced in the same commit.

After 6 years of its creation, qmp_cpu remains a functional no-op
that does nothing, having no value for any caller/user. A proposal
was sent to implement qmp_cpu like hmp_cpu works, but it was denied
[1]. The reason is that QMP must be as stateless as possible and a
function that changes its state (the current CPU monitor in the case
of qmp_cpu) goes against it. Any QMP command that needs a specific
monitor CPU setup must provide it in its arguments, instead of relying
in the current QMP monitor state.

After discussions that happened in [2] it was decided that a command
that does nothing since its birth, no one uses for anything and will
not be implemented, should be deprecated and erased. Given that we will
*not* provide any replacement for qmp_cpu and we believe that there
is no user relying on it, there is no point in adding a deprecation
delay for it.

So, this patch nukes qmp_cpu from QEMU code, removing both its blank
implementation in qmp.c and its doc in qapi-schema.json.

[1] https://lists.gnu.org/archive/html/qemu-devel/2017-12/msg02283.html
[2] https://lists.gnu.org/archive/html/qemu-devel/2017-12/msg03696.html

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
CC: Markus Armbruster <armbru@redhat.com>
CC: Eric Blake <eblake@redhat.com>
CC: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20171220102304.8288-1-danielhb@linux.vnet.ibm.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
6 years agoqapi-docs: fix a comment typo
Chen Hanxiao [Thu, 12 Oct 2017 06:44:48 +0000 (14:44 +0800)]
qapi-docs: fix a comment typo

  s/Subection/Subsection

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Message-Id: <20171012064448.20276-1-chen_han_xiao@126.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
6 years agoqapi2texi: De-duplicate code to add blank line before symbol
Markus Armbruster [Mon, 2 Oct 2017 14:13:41 +0000 (16:13 +0200)]
qapi2texi: De-duplicate code to add blank line before symbol

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-12-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agoqapi: Rename QAPIDoc.parser, .section to ._parser, ._section
Markus Armbruster [Mon, 2 Oct 2017 14:13:40 +0000 (16:13 +0200)]
qapi: Rename QAPIDoc.parser, .section to ._parser, ._section

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-11-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agoqapi2texi: Simplify representation of section text
Markus Armbruster [Mon, 2 Oct 2017 14:13:39 +0000 (16:13 +0200)]
qapi2texi: Simplify representation of section text

Use a string instead of a list of strings.  While there, generate
fewer superfluous blank lines.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-10-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agoqapi: Simplify representation of QAPIDoc section text
Markus Armbruster [Mon, 2 Oct 2017 14:13:38 +0000 (16:13 +0200)]
qapi: Simplify representation of QAPIDoc section text

Use a string instead of a list of strings.

This makes qapi2texi.py generate additional blank lines.  They're
harmless, and the next commit will get rid of them again.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-9-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agoqapi: Unify representation of doc section without name
Markus Armbruster [Mon, 2 Oct 2017 14:13:37 +0000 (16:13 +0200)]
qapi: Unify representation of doc section without name

We have two representations of sections without a name: the main
section uses name=None, the others name=''.  Standardize on name=None.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-8-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agoqapi2texi: Clean up texi_sections()
Markus Armbruster [Mon, 2 Oct 2017 14:13:36 +0000 (16:13 +0200)]
qapi2texi: Clean up texi_sections()

Repurposing the function parameter doc for stepping through
doc.sections.__str__() is not nice.  Use new variable @text instead.

While there, eliminate variables name and func.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-7-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agotests/qapi-schema/doc-bad-section: New, factored out of doc-good
Markus Armbruster [Mon, 2 Oct 2017 14:13:35 +0000 (16:13 +0200)]
tests/qapi-schema/doc-bad-section: New, factored out of doc-good

A negative test case crept into doc-good.json: invalid use of section
markup we currently fail to reject.  Move this into its own
doc-bad-section.json.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-6-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agoqapi: Make cur_doc local to QAPISchemaParser.__init__()
Markus Armbruster [Mon, 2 Oct 2017 14:13:34 +0000 (16:13 +0200)]
qapi: Make cur_doc local to QAPISchemaParser.__init__()

QAPISchemaParser.cur_doc is used only by .__init__() and its helper
.reject_expr_doc().  Make it local to __init__() and pass it to
.reject_expr_doc() explicitly.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-5-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agoqapi: Eliminate QAPISchemaParser.__init__()'s local fname
Markus Armbruster [Mon, 2 Oct 2017 14:13:33 +0000 (16:13 +0200)]
qapi: Eliminate QAPISchemaParser.__init__()'s local fname

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-4-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agoqapi: Stop rejecting #optional
Markus Armbruster [Mon, 2 Oct 2017 14:13:32 +0000 (16:13 +0200)]
qapi: Stop rejecting #optional

Commit 1d8bda1 got rid of #optional tags, and added a check to keep
them from getting added back, to make sure patches then in flight
don't add them back.  It's been six months, time to drop that check.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-3-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agoqapi-schema: Fix query-vm-generation-id's doc comment markup
Markus Armbruster [Mon, 2 Oct 2017 14:13:31 +0000 (16:13 +0200)]
qapi-schema: Fix query-vm-generation-id's doc comment markup

Reported-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171002141341.24616-2-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6 years agoutil: add is_equal to UUID API
Roman Kagan [Mon, 27 Nov 2017 12:43:55 +0000 (15:43 +0300)]
util: add is_equal to UUID API

It's going to be useful, in particular, in VMBus code massively using
uuids aka GUIDs.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Message-Id: <20171127124355.26015-1-rkagan@virtuozzo.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
6 years agoRevert "docker: Enable features explicitly in test-full"
Fam Zheng [Wed, 18 Oct 2017 08:20:02 +0000 (16:20 +0800)]
Revert "docker: Enable features explicitly in test-full"

This reverts commit 5e8a7fe673ca5949bd51939ee36faaf3b1320de8.

It's hard to get all images to have all these packages, the usual
"FEATURES" and "require" mechanism doesn't scale with so many features.
With that change, the test basically only works in ubuntu.

Until a better way comes up, leave the feature enabling to ./configure
detection.

But don't remove the "-e" removal.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20171018082002.9406-1-famz@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
6 years agoMerge remote-tracking branch 'remotes/armbru/tags/pull-cmdline-2017-12-18-v2' into...
Peter Maydell [Wed, 20 Dec 2017 13:20:47 +0000 (13:20 +0000)]
Merge remote-tracking branch 'remotes/armbru/tags/pull-cmdline-2017-12-18-v2' into staging

Command line patches for 2017-12-18

# gpg: Signature made Wed 20 Dec 2017 08:11:57 GMT
# gpg:                using RSA key 0x3870B400EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-cmdline-2017-12-18-v2:
  option: Drop unused get_param_value(), get_next_param_value()
  option: Remove shadowing opt decl from qemu_opt_print()
  qemu-options: Belatedly document --watchdog-action inject-nmi
  qemu-options: Polish section "Character device options"
  qemu-options: Polish section "TPM device options"
  qemu-options: Add missing -iscsi Texinfo documentation
  qemu-options: Move -iscsi under "Block device options"
  qemu-options qemu-doc: Move "Device URL Syntax" to qemu-doc
  qemu-options: Fix markup of -netdev l2tpv3
  qemu-options: Remove stray colons from output of --help

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Wed, 20 Dec 2017 11:30:55 +0000 (11:30 +0000)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

Pull request

v2:
 * Fixed incorrect virtio_blk_data_plane_create() local_err refactoring in
   "hw/block: Use errp directly rather than local_err" that broke virtio-blk
   over virtio-mmio [Peter]

# gpg: Signature made Tue 19 Dec 2017 15:08:14 GMT
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# 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: (23 commits)
  qemu-iotests: add 203 savevm with IOThreads test
  iothread: fix iothread_stop() race condition
  iotests: add VM.add_object()
  blockdev: add x-blockdev-set-iothread force boolean
  docs: mark nested AioContext locking as a legacy API
  block: avoid recursive AioContext acquire in bdrv_inactivate_all()
  virtio-blk: reject configs with logical block size > physical block size
  virtio-blk: make queue size configurable
  qemu-iotests: add 202 external snapshots IOThread test
  blockdev: add x-blockdev-set-iothread testing command
  iothread: add iothread_by_id() API
  block: drop unused BlockDirtyBitmapState->aio_context field
  block: don't keep AioContext acquired after internal_snapshot_prepare()
  block: don't keep AioContext acquired after blockdev_backup_prepare()
  block: don't keep AioContext acquired after drive_backup_prepare()
  block: don't keep AioContext acquired after external_snapshot_prepare()
  blockdev: hold AioContext for bdrv_unref() in external_snapshot_clean()
  qdev: drop unused #include "sysemu/iothread.h"
  dev-storage: Fix the unusual function name
  hw/block: Use errp directly rather than local_err
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
# Conflicts:
# hw/core/qdev-properties-system.c

6 years agooption: Drop unused get_param_value(), get_next_param_value()
Markus Armbruster [Fri, 6 Oct 2017 13:16:45 +0000 (15:16 +0200)]
option: Drop unused get_param_value(), get_next_param_value()

Their last user went away in commit f51074cdc6, "pci-hotplug-old: Has
been dead for five major releases, bury", v2.3.0.  Remove them, as new
code should use QemuOpts or maybe keyval_parse() instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20171006131645.17729-1-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>