qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 17871f: virtio-balloon: Remove needless preco


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 17871f: virtio-balloon: Remove needless precompiled direct...
Date: Mon, 10 Oct 2016 12:00:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 17871f71fd2ff5d76196051470e9604bfb6f0c09
      
https://github.com/qemu/qemu/commit/17871f71fd2ff5d76196051470e9604bfb6f0c09
  Author: Liang Li <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/virtio/virtio-balloon.c

  Log Message:
  -----------
  virtio-balloon: Remove needless precompiled directive

Since there in wrapper around madvise(), the virtio-balloon
code is able to work without the precompiled directive, the
directive can be removed.

Signed-off-by: Liang Li <address@hidden>
Suggested-by: Thomas Huth <address@hidden>
Reviewd-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 09da01c3f205b008ce0c7a960092bcc03b383b50
      
https://github.com/qemu/qemu/commit/09da01c3f205b008ce0c7a960092bcc03b383b50
  Author: Sascha Silbe <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/char/virtio-serial-bus.c

  Log Message:
  -----------
  virtio-serial: add plumbing for virtio console emergency write support

Add the infrastructure required for the virtio 1.0 "emergency write"
(VIRTIO_CONSOLE_F_EMERG_WRITE) feature. Because we don't touch the
size of the configuration area, guests will not be able to actually
make use of this without further patches.

Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Sascha Silbe <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: a06b1dae4706fccb9394b35e88d1905dabec85e7
      
https://github.com/qemu/qemu/commit/a06b1dae4706fccb9394b35e88d1905dabec85e7
  Author: Sascha Silbe <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/char/virtio-serial-bus.c
    M include/hw/compat.h
    M include/hw/virtio/virtio-serial.h

  Log Message:
  -----------
  virtio-serial: enable virtio console emergency write feature

Add support for enabling the virtio 1.0 "emergency write"
(VIRTIO_CONSOLE_F_EMERG_WRITE) feature. The previous patch introduced
the plumbing required for this; now we expose the virtio feature to
the guest. The feature is disabled for compatibility machines to avoid
exposing a new feature to existing guests.

As required by the virtio 1.0 spec, the emergency write functionality
is available to the guest even if the guest doesn't negotatiate the
feature, as well as before feature negotation.

Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Sascha Silbe <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 6bea1ddf8b411dcb0ba5d3a83c4479492185a409
      
https://github.com/qemu/qemu/commit/6bea1ddf8b411dcb0ba5d3a83c4479492185a409
  Author: Igor Mammedov <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/arm/virt-acpi-build.c
    M hw/arm/virt.c
    M hw/i386/acpi-build.c
    M hw/i386/pc.c
    M hw/ppc/spapr_cpu_core.c
    M include/sysemu/numa.h
    M numa.c

  Log Message:
  -----------
  numa: reduce code duplication by adding helper numa_get_node_for_cpu()

Replace repeated pattern

    for (i = 0; i < nb_numa_nodes; i++) {
  if (test_bit(idx, numa_info[i].node_cpu)) {
     ...
     break;

with a helper function to lookup numa node index for cpu.

Suggested-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Reviewed-by: Shannon Zhao <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 271119313ca5e179c47cc35c2182ea3ad96d0983
      
https://github.com/qemu/qemu/commit/271119313ca5e179c47cc35c2182ea3ad96d0983
  Author: Igor Mammedov <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/acpi/cpu.c

  Log Message:
  -----------
  acpi: provide _PXM method for CPU devices if QEMU is started numa enabled

Workaround for long standing issue where Linux kernel
assigns hotplugged CPU to 1st numa node as it discards
proximity for possible CPUs from SRAT after it's parsed.

_PXM method allows linux query proximity directly from
hotplugged CPU object, which allows Linux to assing CPU
to the correct numa node.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: d6309c170eb99950c9f1d881a5ff7163ae28d353
      
https://github.com/qemu/qemu/commit/d6309c170eb99950c9f1d881a5ff7163ae28d353
  Author: Igor Mammedov <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M tests/bios-tables-test.c

  Log Message:
  -----------
  tests: acpi: extend cphp testcase with numa check

so it would be possible to verify _PXM generation in
DSDT and SRAT tables.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: af78c91f574dcde3f0bd90914417e3570c5e9c69
      
https://github.com/qemu/qemu/commit/af78c91f574dcde3f0bd90914417e3570c5e9c69
  Author: Igor Mammedov <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M tests/acpi-test-data/pc/DSDT.cphp
    A tests/acpi-test-data/pc/SRAT.cphp
    M tests/acpi-test-data/q35/DSDT.cphp
    A tests/acpi-test-data/q35/SRAT.cphp

  Log Message:
  -----------
  tests: acpi tables expected blobs update

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 2640d2a5ff08978d67bd87518d05d6b499488c9a
      
https://github.com/qemu/qemu/commit/2640d2a5ff08978d67bd87518d05d6b499488c9a
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/virtio/virtio.c
    M include/hw/virtio/virtio.h

  Log Message:
  -----------
  virtio: add virtio_detach_element()

During device reset or similar situations a VirtQueueElement needs to be
freed without pushing it onto the used ring or rewinding the virtqueue.
Extract a new function to do this.

Later patches add virtio_detach_element() calls to existing device so
that scatter-gather lists are unmapped and vq->inuse goes back to zero
during device reset.  Currently some devices don't bother and simply
call g_free(elem) which is not a clean way to throw away a
VirtQueueElement.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Acked-by: Greg Kurz <address@hidden>
Reviewed-by: Ladi Prosek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 97b93c8ad2242c5a5f89ac50f9e696289c5b4947
      
https://github.com/qemu/qemu/commit/97b93c8ad2242c5a5f89ac50f9e696289c5b4947
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/block/virtio-blk.c

  Log Message:
  -----------
  virtio-blk: add missing virtio_detach_element() call

Make sure to unmap the scatter-gather list and decrement vq->inuse
before freeing requests in virtio_blk_reset().

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Ladi Prosek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: d4c19cdeeb2f1e474bc426a6da261f1d7346eb5b
      
https://github.com/qemu/qemu/commit/d4c19cdeeb2f1e474bc426a6da261f1d7346eb5b
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/char/virtio-serial-bus.c

  Log Message:
  -----------
  virtio-serial: add missing virtio_detach_element() call

Ports enter a "throttled" state when writing to the chardev would block.
The current output VirtQueueElement is kept around until the chardev
becomes writable again.

There are several places in the virtio-serial lifecycle where the
VirtQueueElement should be thrown away.  For example, if the virtio
device is reset then virtqueue elements are no longer valid.

This patch adds the discard_throttle_data() function to unmap the
scatter-gather list and decrement vq->inuse.  This ensures that the
VirtQueueElement is freed properly.

Cc: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Tested-by: Ladi Prosek <address@hidden>
Reviewed-by: Ladi Prosek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: e8582891cb10d30e83dd91821e8752098b0b1138
      
https://github.com/qemu/qemu/commit/e8582891cb10d30e83dd91821e8752098b0b1138
  Author: Greg Kurz <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/9pfs/virtio-9p-device.c

  Log Message:
  -----------
  virtio-9p: add parentheses to sizeof operator

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: d14dde5ec7a38df2e00a6f1b58e96ba38359dbb0
      
https://github.com/qemu/qemu/commit/d14dde5ec7a38df2e00a6f1b58e96ba38359dbb0
  Author: Greg Kurz <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/block/virtio-blk.c
    M include/hw/virtio/virtio-blk.h

  Log Message:
  -----------
  virtio-blk: make some functions static

Some functions that were called from the dataplane code are now only used
locally:

virtio_blk_init_request()
virtio_blk_handle_request()
virtio_blk_submit_multireq()

since commit "03de2f527499 virtio-blk: do not use vring in dataplane", and

virtio_blk_free_request()

since commit "6aa46d8ff1ee virtio: move VirtQueueElement at the beginning
of the structs".

This patch converts them to static.

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: d3d74d6fe095e2e49d030e0c163cecfb9c20f1d4
      
https://github.com/qemu/qemu/commit/d3d74d6fe095e2e49d030e0c163cecfb9c20f1d4
  Author: Greg Kurz <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/9pfs/virtio-9p-device.c

  Log Message:
  -----------
  virtio-9p: handle handle_9p_output() error

A broken guest may send a request without providing buffers for the reply
or for the request itself, and virtqueue_pop() will return an element with
either in_num == 0 or out_num == 0.

All 9P requests are expected to start with the following 7-byte header:
       uint32_t size_le;
      uint8_t id;
      uint16_t tag_le;

If iov_to_buf() fails to return these 7 bytes, then something is wrong in
the guest.

In both cases, it is wrong to crash QEMU, since the root cause lies in the
guest.

This patch hence does the following:
- keep the check of in_num since pdu_complete() assumes it has enough
  space to store the reply and we will send something broken to the guest
- let iov_to_buf() handle out_num == 0, since it will return 0 just like
  if the guest had provided an zero-sized buffer.
- call virtio_error() to inform the guest that the device is now broken,
  instead of aborting
- detach the request from the virtqueue and free it

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 20ea686a0cacdec1bde9a39e74afd38bf672424d
      
https://github.com/qemu/qemu/commit/20ea686a0cacdec1bde9a39e74afd38bf672424d
  Author: Greg Kurz <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/block/virtio-blk.c

  Log Message:
  -----------
  virtio-blk: handle virtio_blk_handle_request() errors

All these errors are caused by a buggy guest: QEMU should not exit.

With this patch, if virtio_blk_handle_request() detects a buggy request, it
marks the device as broken and returns an error to the caller so it takes
appropriate action.

In the case of virtio_blk_handle_vq(), we detach the request from the
virtqueue, free its allocated memory and stop popping new requests.
We don't need to bother about multireq since virtio_blk_handle_request()
errors out early and mrb.num_reqs == 0.

In the case of virtio_blk_dma_restart_bh(), we need to detach and free all
queued requests as well.

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: ba7eadb5927633d487064b518bf6fd001369e30c
      
https://github.com/qemu/qemu/commit/ba7eadb5927633d487064b518bf6fd001369e30c
  Author: Greg Kurz <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/net/virtio-net.c

  Log Message:
  -----------
  virtio-net: handle virtio_net_handle_ctrl() error

This error is caused by a buggy guest: let's switch the device to the
broken state instead of terminating QEMU. Also we detach the element
from the virtqueue and free it.

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: ba10b9c0038e201d7ea28a9e3908928439ff7fa4
      
https://github.com/qemu/qemu/commit/ba10b9c0038e201d7ea28a9e3908928439ff7fa4
  Author: Greg Kurz <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/net/virtio-net.c

  Log Message:
  -----------
  virtio-net: handle virtio_net_receive() errors

All these errors are caused by a buggy guest: let's switch the device to
the broken state instead of terminating QEMU. Also we detach the element
from the virtqueue and free it.

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: fa5e56c2a73501427203c34d702fccc2fbcb5eab
      
https://github.com/qemu/qemu/commit/fa5e56c2a73501427203c34d702fccc2fbcb5eab
  Author: Greg Kurz <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/net/virtio-net.c

  Log Message:
  -----------
  virtio-net: handle virtio_net_flush_tx() errors

All these errors are caused by a buggy guest: let's switch the device to
the broken state instead of terminating QEMU. Also we detach the element
from the virtqueue and free it.

If this happens, virtio_net_flush_tx() also returns -EINVAL, so that all
callers can stop processing the virtqueue immediatly.

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 661e32fb3cb71c7e019daee375be4bb487b9917c
      
https://github.com/qemu/qemu/commit/661e32fb3cb71c7e019daee375be4bb487b9917c
  Author: Greg Kurz <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: convert virtio_scsi_bad_req() to use virtio_error()

The virtio_scsi_bad_req() function is called when a guest sends a
request with missing or ill-sized headers. This generally happens
when the virtio_scsi_parse_req() function returns an error.

With this patch, virtio_scsi_bad_req() will mark the device as broken,
detach the request from the virtqueue and free it, instead of forcing
QEMU to exit.

In nearly all locations where virtio_scsi_bad_req() is called, the only
thing to do next is to return to the caller.

The virtio_scsi_handle_cmd_req_prepare() function is an exception though.

It is called in a loop by virtio_scsi_handle_cmd_vq() and passed requests
freshly popped from a cmd virtqueue; virtio_scsi_handle_cmd_req_prepare()
does some sanity checks on the request and returns a boolean flag to
indicate whether the request should be queued or not. In the latter case,
virtio_scsi_handle_cmd_req_prepare() has detected a non-fatal error and
sent a response back to the guest.

We have now a new condition to take into account: the device is broken
and should stop all processing.

The return value of virtio_scsi_handle_cmd_req_prepare() is hence changed
to an int. A return value of zero means that the request should be queued.
Other non-fatal error cases where the request shoudn't be queued  return
a negative errno (values are vaguely inspired by the error condition, but
the only goal here is to discriminate the case we're interested in).

And finally, if virtio_scsi_bad_req() was called, -EINVAL is returned. In
this case, virtio_scsi_handle_cmd_vq() detaches and frees already queued
requests, instead of submitting them.

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: ad14a46a36c6a17bd3d3445a8b0e1f6d421feac2
      
https://github.com/qemu/qemu/commit/ad14a46a36c6a17bd3d3445a8b0e1f6d421feac2
  Author: Greg Kurz <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: handle virtio_scsi_set_config() error

This error is caused by a buggy guest: let's switch the device to the
broken state instead of terminating QEMU.

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 0a73336d96397c80881219d080518fac6f1ecacb
      
https://github.com/qemu/qemu/commit/0a73336d96397c80881219d080518fac6f1ecacb
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hmp.c
    M include/sysemu/char.h
    M net/colo-compare.c
    M net/vhost-user.c
    M qemu-char.c

  Log Message:
  -----------
  net: don't poke at chardev internal QemuOpts

The vhost-user & colo code is poking at the QemuOpts instance
in the CharDriverState struct, not realizing that it is valid
for this to be NULL. e.g. the following crash shows a codepath
where it will be NULL:

 Program terminated with signal SIGSEGV, Segmentation fault.
 #0  0x000055baf6ab4adc in qemu_opt_foreach (opts=0x0, func=0x55baf696b650 
<net_vhost_chardev_opts>, opaque=0x7ffc51368c00, errp=0x7ffc51368e48) at 
util/qemu-option.c:617
 617         QTAILQ_FOREACH(opt, &opts->head, next) {
 [Current thread is 1 (Thread 0x7f1d4970bb40 (LWP 6603))]
 (gdb) bt
 #0  0x000055baf6ab4adc in qemu_opt_foreach (opts=0x0, func=0x55baf696b650 
<net_vhost_chardev_opts>, opaque=0x7ffc51368c00, errp=0x7ffc51368e48) at 
util/qemu-option.c:617
 #1  0x000055baf696b7da in net_vhost_parse_chardev (opts=0x55baf8ff9260, 
errp=0x7ffc51368e48) at net/vhost-user.c:314
 #2  0x000055baf696b985 in net_init_vhost_user (netdev=0x55baf8ff9250, 
name=0x55baf879d270 "hostnet2", peer=0x0, errp=0x7ffc51368e48) at 
net/vhost-user.c:360
 #3  0x000055baf6960216 in net_client_init1 (object=0x55baf8ff9250, 
is_netdev=true, errp=0x7ffc51368e48) at net/net.c:1051
 #4  0x000055baf6960518 in net_client_init (opts=0x55baf776e7e0, 
is_netdev=true, errp=0x7ffc51368f00) at net/net.c:1108
 #5  0x000055baf696083f in netdev_add (opts=0x55baf776e7e0, 
errp=0x7ffc51368f00) at net/net.c:1186
 #6  0x000055baf69608c7 in qmp_netdev_add (qdict=0x55baf7afaf60, 
ret=0x7ffc51368f50, errp=0x7ffc51368f48) at net/net.c:1205
 #7  0x000055baf6622135 in handle_qmp_command (parser=0x55baf77fb590, 
tokens=0x7f1d24011960) at /path/to/qemu.git/monitor.c:3978
 #8  0x000055baf6a9d099 in json_message_process_token (lexer=0x55baf77fb598, 
input=0x55baf75acd20, type=JSON_RCURLY, x=113, y=19) at 
qobject/json-streamer.c:105
 #9  0x000055baf6abf7aa in json_lexer_feed_char (lexer=0x55baf77fb598, ch=125 
'}', flush=false) at qobject/json-lexer.c:319
 #10 0x000055baf6abf8f2 in json_lexer_feed (lexer=0x55baf77fb598, 
buffer=0x7ffc51369170 "}R\204\367\272U", size=1) at qobject/json-lexer.c:369
 #11 0x000055baf6a9d13c in json_message_parser_feed (parser=0x55baf77fb590, 
buffer=0x7ffc51369170 "}R\204\367\272U", size=1) at qobject/json-streamer.c:124
 #12 0x000055baf66221f7 in monitor_qmp_read (opaque=0x55baf77fb530, 
buf=0x7ffc51369170 "}R\204\367\272U", size=1) at 
/path/to/qemu.git/monitor.c:3994
 #13 0x000055baf6757014 in qemu_chr_be_write_impl (s=0x55baf7610a40, 
buf=0x7ffc51369170 "}R\204\367\272U", len=1) at qemu-char.c:387
 #14 0x000055baf6757076 in qemu_chr_be_write (s=0x55baf7610a40, 
buf=0x7ffc51369170 "}R\204\367\272U", len=1) at qemu-char.c:399
 #15 0x000055baf675b3b0 in tcp_chr_read (chan=0x55baf90244b0, cond=G_IO_IN, 
opaque=0x55baf7610a40) at qemu-char.c:2927
 #16 0x000055baf6a5d655 in qio_channel_fd_source_dispatch 
(source=0x55baf7610df0, callback=0x55baf675b25a <tcp_chr_read>, 
user_data=0x55baf7610a40) at io/channel-watch.c:84
 #17 0x00007f1d3e80cbbd in g_main_context_dispatch () from 
/usr/lib64/libglib-2.0.so.0
 #18 0x000055baf69d3720 in glib_pollfds_poll () at main-loop.c:213
 #19 0x000055baf69d37fd in os_host_main_loop_wait (timeout=126000000) at 
main-loop.c:258
 #20 0x000055baf69d38ad in main_loop_wait (nonblocking=0) at main-loop.c:506
 #21 0x000055baf676587b in main_loop () at vl.c:1908
 #22 0x000055baf676d3bf in main (argc=101, argv=0x7ffc5136a6c8, 
envp=0x7ffc5136a9f8) at vl.c:4604
 (gdb) p opts
 $1 = (QemuOpts *) 0x0

The crash occurred when attaching vhost-user net via QMP:

{
    "execute": "chardev-add",
    "arguments": {
  "id": "charnet2",
  "backend": {
      "type": "socket",
      "data": {
          "addr": {
              "type": "unix",
              "data": {
                  "path": "/var/run/openvswitch/vhost-user1"
              }
          },
          "wait": false,
          "server": false
      }
  }
    },
    "id": "libvirt-19"
}
{
    "return": {

    },
    "id": "libvirt-19"
}
{
    "execute": "netdev_add",
    "arguments": {
  "type": "vhost-user",
  "chardev": "charnet2",
  "id": "hostnet2"
    },
    "id": "libvirt-20"
}

Code using chardevs should not be poking at the internals of the
CharDriverState struct. What vhost-user wants is a chardev that is
operating as reconnectable network service, along with the ability
to do FD passing over the connection. The colo code simply wants
a network service. Add a feature concept to the char drivers so
that chardev users can query the actual features they wish to have
supported. The QemuOpts member is removed to prevent future mistakes
in this area.

Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 1a665855d7144bb3df382630a2b5e4039e95e466
      
https://github.com/qemu/qemu/commit/1a665855d7144bb3df382630a2b5e4039e95e466
  Author: Halil Pasic <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/virtio/virtio.c
    M include/hw/virtio/virtio.h

  Log Message:
  -----------
  virtio: prepare change VMSTATE_VIRTIO_DEVICE macro

In most cases the functions passed to VMSTATE_VIRTIO_DEVICE
only call the virtio_load and virtio_save wrappers. Some include some
pre- and post- massaging too. The massaging is better expressed
as such in the VMStateDescription.

Let us prepare for changing the semantic of the VMSTATE_VIRTIO_DEVICE
macro so that it is more similar to the other VMSTATE_*_DEVICE macros
in a sense that it is a field definition.

The preprocessor conditionals are going to be removed as soon as
every usage is converted to the new semantic.

Signed-off-by: Halil Pasic <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 977a117f78f3abcad8ea925f6c8282f2b3386f53
      
https://github.com/qemu/qemu/commit/977a117f78f3abcad8ea925f6c8282f2b3386f53
  Author: Halil Pasic <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/block/virtio-blk.c

  Log Message:
  -----------
  virtio-blk: convert VMSTATE_VIRTIO_DEVICE

Use the new VMSTATE_VIRTIO_DEVICE macro.

Signed-off-by: Halil Pasic <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 4d45dcfbf2bb606316e13f70aeb3f0709384f9f5
      
https://github.com/qemu/qemu/commit/4d45dcfbf2bb606316e13f70aeb3f0709384f9f5
  Author: Halil Pasic <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/net/virtio-net.c

  Log Message:
  -----------
  virtio-net: convert VMSTATE_VIRTIO_DEVICE

Use the new VMSTATE_VIRTIO_DEVICE macro.

Signed-off-by: Halil Pasic <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: dcaf8dda4bc6046c5ecc2bff2076a9449192f937
      
https://github.com/qemu/qemu/commit/dcaf8dda4bc6046c5ecc2bff2076a9449192f937
  Author: Halil Pasic <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/9pfs/virtio-9p-device.c

  Log Message:
  -----------
  virtio-9p: convert VMSTATE_VIRTIO_DEVICE

Use the new VMSTATE_VIRTIO_DEVICE macro.

Signed-off-by: Halil Pasic <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 97eed24ff1144fb0718c2fdf600742b5167e87a3
      
https://github.com/qemu/qemu/commit/97eed24ff1144fb0718c2fdf600742b5167e87a3
  Author: Halil Pasic <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/char/virtio-serial-bus.c

  Log Message:
  -----------
  virtio-serial: convert VMSTATE_VIRTIO_DEVICE

Use the new VMSTATE_VIRTIO_DEVICE macro.

Signed-off-by: Halil Pasic <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 8a502efd0c4beb0bdd7fbcf67cc722db00eddca1
      
https://github.com/qemu/qemu/commit/8a502efd0c4beb0bdd7fbcf67cc722db00eddca1
  Author: Halil Pasic <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/display/virtio-gpu.c

  Log Message:
  -----------
  virtio-gpu: convert VMSTATE_VIRTIO_DEVICE

Use the new VMSTATE_VIRTIO_DEVICE macro. The device virtio-gpu is
special because it actually does not adhere to the virtio migration
schema, because device state is last.

Signed-off-by: Halil Pasic <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 73a17349ffa5dd6dec0947ecb09c657becb2f6e5
      
https://github.com/qemu/qemu/commit/73a17349ffa5dd6dec0947ecb09c657becb2f6e5
  Author: Halil Pasic <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/input/virtio-input.c

  Log Message:
  -----------
  virtio-input: convert VMSTATE_VIRTIO_DEVICE

Use the new VMSTATE_VIRTIO_DEVICE macro.

Signed-off-by: Halil Pasic <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: f20476b9e444e11792d49438fe5ec53ac1470f33
      
https://github.com/qemu/qemu/commit/f20476b9e444e11792d49438fe5ec53ac1470f33
  Author: Halil Pasic <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/scsi/virtio-scsi.c

  Log Message:
  -----------
  virtio-scsi: convert VMSTATE_VIRTIO_DEVICE

Use the new VMSTATE_VIRTIO_DEVICE macro.

Signed-off-by: Halil Pasic <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: c5dc16b726e0279330233c0eb09fd1c708af978f
      
https://github.com/qemu/qemu/commit/c5dc16b726e0279330233c0eb09fd1c708af978f
  Author: Halil Pasic <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/virtio/virtio-balloon.c

  Log Message:
  -----------
  virtio-balloon: convert VMSTATE_VIRTIO_DEVICE

Use the new VMSTATE_VIRTIO_DEVICE macro.

Signed-off-by: Halil Pasic <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: b7de81f697dfb933f4b81d37f35d53f6d1d0332d
      
https://github.com/qemu/qemu/commit/b7de81f697dfb933f4b81d37f35d53f6d1d0332d
  Author: Halil Pasic <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/virtio/virtio-rng.c

  Log Message:
  -----------
  virtio-rng: convert VMSTATE_VIRTIO_DEVICE

Use the new VMSTATE_VIRTIO_DEVICE macro.

Signed-off-by: Halil Pasic <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 81cc8a6566d9fdbe0535b26a33f28a2888dceb77
      
https://github.com/qemu/qemu/commit/81cc8a6566d9fdbe0535b26a33f28a2888dceb77
  Author: Halil Pasic <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/virtio/vhost-vsock.c

  Log Message:
  -----------
  vhost-vsock: convert VMSTATE_VIRTIO_DEVICE

Use the new VMSTATE_VIRTIO_DEVICE macro.

Signed-off-by: Halil Pasic <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 5705653ff8666ffb247971361904f902aa033351
      
https://github.com/qemu/qemu/commit/5705653ff8666ffb247971361904f902aa033351
  Author: Halil Pasic <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/9pfs/virtio-9p-device.c
    M hw/block/virtio-blk.c
    M hw/char/virtio-serial-bus.c
    M hw/display/virtio-gpu.c
    M hw/input/virtio-input.c
    M hw/net/virtio-net.c
    M hw/scsi/virtio-scsi.c
    M hw/virtio/vhost-vsock.c
    M hw/virtio/virtio-balloon.c
    M hw/virtio/virtio-rng.c
    M hw/virtio/virtio.c
    M include/hw/virtio/virtio.h

  Log Message:
  -----------
  virtio: cleanup VMSTATE_VIRTIO_DEVICE

Now all the usages of the old version of VMSTATE_VIRTIO_DEVICE are gone,
so we can get rid of the conditionals, and the old macro.

Signed-off-by: Halil Pasic <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: dea651a95af6dad0997b840241a0bf6059d9a776
      
https://github.com/qemu/qemu/commit/dea651a95af6dad0997b840241a0bf6059d9a776
  Author: Feng Wu <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hw/i386/intel_iommu.c

  Log Message:
  -----------
  intel-iommu: Check IOAPIC's Trigger Mode against the one in IRTE

The Trigger Mode field of IOAPIC must match the Trigger Mode in
the IRTE according to VT-d Spec 5.1.5.1.

Signed-off-by: Feng Wu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Peter Xu <address@hidden>


  Commit: 627eae7d729277c84f8e0ac07a8caab39c92c38d
      
https://github.com/qemu/qemu/commit/627eae7d729277c84f8e0ac07a8caab39c92c38d
  Author: Peter Maydell <address@hidden>
  Date:   2016-10-10 (Mon, 10 Oct 2016)

  Changed paths:
    M hmp.c
    M hw/9pfs/virtio-9p-device.c
    M hw/acpi/cpu.c
    M hw/arm/virt-acpi-build.c
    M hw/arm/virt.c
    M hw/block/virtio-blk.c
    M hw/char/virtio-serial-bus.c
    M hw/display/virtio-gpu.c
    M hw/i386/acpi-build.c
    M hw/i386/intel_iommu.c
    M hw/i386/pc.c
    M hw/input/virtio-input.c
    M hw/net/virtio-net.c
    M hw/ppc/spapr_cpu_core.c
    M hw/scsi/virtio-scsi.c
    M hw/virtio/vhost-vsock.c
    M hw/virtio/virtio-balloon.c
    M hw/virtio/virtio-rng.c
    M hw/virtio/virtio.c
    M include/hw/compat.h
    M include/hw/virtio/virtio-blk.h
    M include/hw/virtio/virtio-serial.h
    M include/hw/virtio/virtio.h
    M include/sysemu/char.h
    M include/sysemu/numa.h
    M net/colo-compare.c
    M net/vhost-user.c
    M numa.c
    M qemu-char.c
    M tests/acpi-test-data/pc/DSDT.cphp
    A tests/acpi-test-data/pc/SRAT.cphp
    M tests/acpi-test-data/q35/DSDT.cphp
    A tests/acpi-test-data/q35/SRAT.cphp
    M tests/bios-tables-test.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

virtio, pc: fixes and features

more guest error handling for virtio devices
virtio migration rework
pc fixes

Signed-off-by: Michael S. Tsirkin <address@hidden>

# gpg: Signature made Mon 10 Oct 2016 00:39:11 BST
# gpg:                using RSA key 0x281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <address@hidden>"
# gpg:                 aka "Michael S. Tsirkin <address@hidden>"
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream: (33 commits)
  intel-iommu: Check IOAPIC's Trigger Mode against the one in IRTE
  virtio: cleanup VMSTATE_VIRTIO_DEVICE
  vhost-vsock: convert VMSTATE_VIRTIO_DEVICE
  virtio-rng: convert VMSTATE_VIRTIO_DEVICE
  virtio-balloon: convert VMSTATE_VIRTIO_DEVICE
  virtio-scsi: convert VMSTATE_VIRTIO_DEVICE
  virtio-input: convert VMSTATE_VIRTIO_DEVICE
  virtio-gpu: convert VMSTATE_VIRTIO_DEVICE
  virtio-serial: convert VMSTATE_VIRTIO_DEVICE
  virtio-9p: convert VMSTATE_VIRTIO_DEVICE
  virtio-net: convert VMSTATE_VIRTIO_DEVICE
  virtio-blk: convert VMSTATE_VIRTIO_DEVICE
  virtio: prepare change VMSTATE_VIRTIO_DEVICE macro
  net: don't poke at chardev internal QemuOpts
  virtio-scsi: handle virtio_scsi_set_config() error
  virtio-scsi: convert virtio_scsi_bad_req() to use virtio_error()
  virtio-net: handle virtio_net_flush_tx() errors
  virtio-net: handle virtio_net_receive() errors
  virtio-net: handle virtio_net_handle_ctrl() error
  virtio-blk: handle virtio_blk_handle_request() errors
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/0f183e679d85...627eae7d7292

reply via email to

[Prev in Thread] Current Thread [Next in Thread]