Skip to contentSkip to conversation

Implementation of vhost-pci for inter-vm commucation

PATCH Superseded Wei Wang 2 participants 40 messages Dec 17, 2016 Networking

lore
Share & tools
lore

Wei Wang

author
#0 lore raw

cover Implementation of vhost-pci for inter-vm commucation

This patch series implements vhost-pci, which is a point-to-point based inter-vm communication solution. The QEMU side implementation includes the vhost-user extension, vhost-pci device emulation and management. The current device part implementation is based on virtio 1.0, but it can be easily upgraded to support the upcoming virtio 1.1.

The current QEMU implementation supports the polling mode driver on both sides to receive packets. More features, such as interrupt support, live migration support, protection memory accesses will be added later.

Wei Wang (37):
vhost-pci-net: the fundamental vhost-pci-net device emulation
vhost-pci-net: the fundamental implementation of vhost-pci-net-pci
vhost-user: share the vhost-user protocol related structures
vl: add the vhost-pci-slave command line option
vhost-pci-slave: start the implementation of vhost-pci-slave
vhost-pci-slave: set up the fundamental handlers for the server socket vhost-pci-slave/msg: VHOST_USER_GET_FEATURES vhost-pci-slave/msg: VHOST_USER_SET_FEATURES vhost-pci-slave/msg: VHOST_USER_GET_PROTOCOL_FEATURES vhost-pci-slave/msg: VHOST_USER_SET_PROTOCOL_FEATURES vhost-user/msg: VHOST_USER_PROTOCOL_F_SET_DEVICE_ID vhost-pci-slave/msg: VHOST_USER_SET_DEVICE_ID vhost-pci-slave/msg: VHOST_USER_GET_QUEUE_NUM vhost-pci-slave/msg: VHOST_USER_SET_OWNER vhost-pci-slave/msg: VHOST_USER_SET_MEM_TABLE vhost-pci-slave/msg: VHOST_USER_SET_VRING_NUM vhost-pci-slave/msg: VHOST_USER_SET_VRING_BASE
vhost-user: send guest physical address of virtqueues to the slave vhost-pci-slave/msg: VHOST_USER_SET_VRING_ADDR vhost-pci-slave/msg: VHOST_USER_SET_VRING_KICK vhost-pci-slave/msg: VHOST_USER_SET_VRING_CALL vhost-pci-slave/msg: VHOST_USER_SET_VRING_ENABLE vhost-pci-slave/msg: VHOST_USER_SET_LOG_BASE vhost-pci-slave/msg: VHOST_USER_SET_LOG_FD vhost-pci-slave/msg: VHOST_USER_SEND_RARP vhost-pci-slave/msg: VHOST_USER_GET_VRING_BASE
vhost-pci-net: pass the info collected by vp_slave to the device
vhost-pci-net: pass the mem and vring info to the driver vhost-pci-slave/msg: VHOST_USER_SET_VHOST_PCI (start) vhost-pci-slave/msg: VHOST_USER_SET_VHOST_PCI (stop) vhost-user/msg: send VHOST_USER_SET_VHOST_PCI (start/stop)
vhost-user: add asynchronous read for the vhost-user master
vhost-pci-net: send the negotiated feature bits to the master
vhost-pci-slave: add "peer_reset"
vhost-pci-net: start the vhost-pci-net device vhost-user/msg: handling VHOST_USER_SET_FEATURES
vl: enable vhost-pci-slave

 hw/net/Makefile.objs                           |   2 +-
 hw/net/vhost-pci-net.c                         | 263 ++++++++++++
 hw/net/vhost_net.c                             |  37 ++
 hw/virtio/Makefile.objs                        |   1 +
 hw/virtio/vhost-pci-slave.c                    | 552 +++++++++++++++++++++++++
 hw/virtio/vhost-user.c                         | 184 +++++----
 hw/virtio/vhost.c                              |  61 ++-
 hw/virtio/virtio-pci.c                         |  80 ++++
 hw/virtio/virtio-pci.h                         |  16 +
 include/hw/pci/pci.h                           |   1 +
 include/hw/virtio/vhost-backend.h              |   2 +
 include/hw/virtio/vhost-pci-net.h              |  45 ++
 include/hw/virtio/vhost-pci-slave.h            |  46 +++
 include/hw/virtio/vhost-user.h                 | 109 +++++
 include/hw/virtio/vhost.h                      |   3 +
 include/net/vhost-user.h                       |  22 +-
 include/net/vhost_net.h                        |   2 +
 include/standard-headers/linux/vhost_pci_net.h |  85 ++++
 include/standard-headers/linux/virtio_ids.h    |  29 +-
 net/vhost-user.c                               |  34 +-
 qemu-options.hx                                |   4 +
 vl.c                                           |  41 ++
 22 files changed, 1485 insertions(+), 134 deletions(-)
 create mode 100644 hw/net/vhost-pci-net.c
 create mode 100644 hw/virtio/vhost-pci-slave.c
 create mode 100644 include/hw/virtio/vhost-pci-net.h
 create mode 100644 include/hw/virtio/vhost-pci-slave.h
 create mode 100644 include/hw/virtio/vhost-user.h
 create mode 100644 include/standard-headers/linux/vhost_pci_net.h
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/37 vhost-pci-net: the fundamental vhost-pci-net device emulation

This patch introduces the fundamental parts of the device emulation.

---
 hw/net/Makefile.objs                           |   2 +-
 hw/net/vhost-pci-net.c                         | 136 +++++++++++++++++++++++++
 include/hw/virtio/vhost-pci-net.h              |  36 +++++++
 include/standard-headers/linux/vhost_pci_net.h |  43 ++++++++
 include/standard-headers/linux/virtio_ids.h    |  29 +++---
 5 files changed, 231 insertions(+), 15 deletions(-)
 create mode 100644 hw/net/vhost-pci-net.c
 create mode 100644 include/hw/virtio/vhost-pci-net.h
 create mode 100644 include/standard-headers/linux/vhost_pci_net.h
hw/net/Makefile.objs +1 -1
index 610ed3e..71d6d2e 100644
@@ -33,7 +33,7 @@ obj-$(CONFIG_MILKYMIST) += milkymist-minimac2.o
 obj-$(CONFIG_PSERIES) += spapr_llan.o
 obj-$(CONFIG_XILINX_ETHLITE) += xilinx_ethlite.o
 
-obj-$(CONFIG_VIRTIO) += virtio-net.o
+obj-$(CONFIG_VIRTIO) += virtio-net.o vhost-pci-net.o
 obj-y += vhost_net.o
 
 obj-$(CONFIG_ETSEC) += fsl_etsec/etsec.o fsl_etsec/registers.o \
hw/net/vhost-pci-net.c new file +136 -0

136 lines not on this page · raw message

include/hw/virtio/vhost-pci-net.h new file +36 -0
new file mode 100644
index 0000000..8f2e65f
@@ -0,0 +1,36 @@
+/*
+ * Virtio Network Device
+ *
+ * Copyright Intel, Corp. 2016
+ *
+ * Authors:
+ *  Wei Wang   <[email protected]>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef _QEMU_VHOST_PCI_NET_H
+#define _QEMU_VHOST_PCI_NET_H
+
+#include "standard-headers/linux/vhost_pci_net.h"
+#include "hw/virtio/virtio.h"
+
+#define TYPE_VHOST_PCI_NET "vhost-pci-net-device"
+#define VHOST_PCI_NET(obj) \
+        OBJECT_CHECK(VhostPCINet, (obj), TYPE_VHOST_PCI_NET)
+
+typedef struct VhostPCINet {
+    VirtIODevice parent_obj;
+    /* Control receiveq: msg from host to guest */
+    VirtQueue *crq;
+    /* Datapath receiveq */
+    VirtQueue **rqs;
+    uint16_t status;
+    uint16_t peer_vq_num;
+    size_t config_size;
+    uint64_t device_features;
+} VhostPCINet;
+
+#endif
include/standard-headers/linux/vhost_pci_net.h new file +43 -0

43 lines not on this page · raw message

include/standard-headers/linux/virtio_ids.h +15 -14
index fe74e42..d581c92 100644
@@ -29,18 +29,19 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE. */
 
-#define VIRTIO_ID_NET		1 /* virtio net */
-#define VIRTIO_ID_BLOCK		2 /* virtio block */
-#define VIRTIO_ID_CONSOLE	3 /* virtio console */
-#define VIRTIO_ID_RNG		4 /* virtio rng */
-#define VIRTIO_ID_BALLOON	5 /* virtio balloon */
-#define VIRTIO_ID_RPMSG		7 /* virtio remote processor messaging */
-#define VIRTIO_ID_SCSI		8 /* virtio scsi */
-#define VIRTIO_ID_9P		9 /* 9p virtio console */
-#define VIRTIO_ID_RPROC_SERIAL 11 /* virtio remoteproc serial link */
-#define VIRTIO_ID_CAIF	       12 /* Virtio caif */
-#define VIRTIO_ID_GPU          16 /* virtio GPU */
-#define VIRTIO_ID_INPUT        18 /* virtio input */
-#define VIRTIO_ID_VSOCK        19 /* virtio vsock transport */
-#define VIRTIO_ID_CRYPTO       20 /* virtio crypto */
+#define VIRTIO_ID_NET		 1 /* virtio net */
+#define VIRTIO_ID_BLOCK		 2 /* virtio block */
+#define VIRTIO_ID_CONSOLE	 3 /* virtio console */
+#define VIRTIO_ID_RNG		 4 /* virtio rng */
+#define VIRTIO_ID_BALLOON	 5 /* virtio balloon */
+#define VIRTIO_ID_RPMSG		 7 /* virtio remote processor messaging */
+#define VIRTIO_ID_SCSI		 8 /* virtio scsi */
+#define VIRTIO_ID_9P		 9 /* 9p virtio console */
+#define VIRTIO_ID_RPROC_SERIAL  11 /* virtio remoteproc serial link */
+#define VIRTIO_ID_CAIF	        12 /* Virtio caif */
+#define VIRTIO_ID_GPU           16 /* virtio GPU */
+#define VIRTIO_ID_INPUT         18 /* virtio input */
+#define VIRTIO_ID_VSOCK         19 /* virtio vsock transport */
+#define VIRTIO_ID_CRYPTO        20 /* virtio crypto */
+#define VIRTIO_ID_VHOST_PCI_NET 21 /* vhost-pci-net */
 #endif /* _LINUX_VIRTIO_IDS_H */
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/37 vhost-pci-net: the fundamental implementation of vhost-pci-net-pci

In reply to Wei Wang
---
 hw/virtio/virtio-pci.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 hw/virtio/virtio-pci.h | 14 ++++++++++++++
 include/hw/pci/pci.h   |  1 +
 3 files changed, 61 insertions(+)
hw/virtio/virtio-pci.c +46 -0
index 21c2b9d..baf70b4 100644
@@ -21,6 +21,7 @@
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-blk.h"
 #include "hw/virtio/virtio-net.h"
+#include "hw/virtio/vhost-pci-net.h"
 #include "hw/virtio/virtio-serial.h"
 #include "hw/virtio/virtio-scsi.h"
 #include "hw/virtio/virtio-balloon.h"
@@ -2309,6 +2310,50 @@ static const TypeInfo virtio_net_pci_info = {
     .class_init    = virtio_net_pci_class_init,
 };
 
+/* vhost-pci-net */
+
+static Property vpnet_pci_properties[] = {
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void vpnet_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
+{
+    VhostPCINetPCI *dev = VHOST_PCI_NET_PCI(vpci_dev);
+    DeviceState *vdev = DEVICE(&dev->vdev);
+
+    object_property_set_bool(OBJECT(vdev), true, "realized", errp);
+}
+
+static void vpnet_pci_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+    VirtioPCIClass *vpciklass = VIRTIO_PCI_CLASS(klass);
+
+    k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
+    k->device_id = PCI_DEVICE_ID_VHOST_PCI_NET;
+    k->class_id = PCI_CLASS_NETWORK_ETHERNET;
+    set_bit(DEVICE_CATEGORY_NETWORK, dc->categories);
+    dc->props = vpnet_pci_properties;
+    vpciklass->realize = vpnet_pci_realize;
+}
+
+static void vpnet_pci_instance_init(Object *obj)
+{
+    VhostPCINetPCI *dev = VHOST_PCI_NET_PCI(obj);
+
+    virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
+                                TYPE_VHOST_PCI_NET);
+}
+
+static const TypeInfo vpnet_pci_info = {
+    .name          = TYPE_VHOST_PCI_NET_PCI,
+    .parent        = TYPE_VIRTIO_PCI,
+    .instance_size = sizeof(VhostPCINetPCI),
+    .instance_init = vpnet_pci_instance_init,
+    .class_init    = vpnet_pci_class_init,
+};
+
 /* virtio-rng-pci */
 
 static void virtio_rng_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
@@ -2537,6 +2582,7 @@ static void virtio_pci_register_types(void)
     type_register_static(&virtio_keyboard_pci_info);
     type_register_static(&virtio_mouse_pci_info);
     type_register_static(&virtio_tablet_pci_info);
+    type_register_static(&vpnet_pci_info);
 #ifdef CONFIG_LINUX
     type_register_static(&virtio_host_pci_info);
 #endif
hw/virtio/virtio-pci.h +14 -0
index 5e07886..0b4b04f 100644
@@ -18,6 +18,7 @@
 #include "hw/pci/msi.h"
 #include "hw/virtio/virtio-blk.h"
 #include "hw/virtio/virtio-net.h"
+#include "hw/virtio/vhost-pci-net.h"
 #include "hw/virtio/virtio-rng.h"
 #include "hw/virtio/virtio-serial.h"
 #include "hw/virtio/virtio-scsi.h"
@@ -43,6 +44,7 @@ typedef struct VirtIOSCSIPCI VirtIOSCSIPCI;
 typedef struct VirtIOBalloonPCI VirtIOBalloonPCI;
 typedef struct VirtIOSerialPCI VirtIOSerialPCI;
 typedef struct VirtIONetPCI VirtIONetPCI;
+typedef struct VhostPCINetPCI VhostPCINetPCI;
 typedef struct VHostSCSIPCI VHostSCSIPCI;
 typedef struct VirtIORngPCI VirtIORngPCI;
 typedef struct VirtIOInputPCI VirtIOInputPCI;
@@ -262,6 +264,18 @@ struct VirtIONetPCI {
     VirtIONet vdev;
 };
 
+ /*
+ * vhost-pci-net-pci: This extends VirtioPCIProxy.
+ */
+#define TYPE_VHOST_PCI_NET_PCI "vhost-pci-net-pci"
+#define VHOST_PCI_NET_PCI(obj) \
+        OBJECT_CHECK(VhostPCINetPCI, (obj), TYPE_VHOST_PCI_NET_PCI)
+
+struct VhostPCINetPCI {
+    VirtIOPCIProxy parent_obj;
+    VhostPCINet vdev;
+};
+
 /*
  * virtio-9p-pci: This extends VirtioPCIProxy.
  */
include/hw/pci/pci.h +1 -0
index 772692f..ef8468b 100644
@@ -83,6 +83,7 @@
 #define PCI_DEVICE_ID_VIRTIO_RNG         0x1005
 #define PCI_DEVICE_ID_VIRTIO_9P          0x1009
 #define PCI_DEVICE_ID_VIRTIO_VSOCK       0x1012
+#define PCI_DEVICE_ID_VHOST_PCI_NET      0x1014
 
 #define PCI_VENDOR_ID_REDHAT             0x1b36
 #define PCI_DEVICE_ID_REDHAT_BRIDGE      0x0001
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH 3/37 vhost-user: share the vhost-user protocol related structures

In reply to Wei Wang

Put the vhost-user protocol related data structures into vhost-user.h, so that they can be used in other implementations (e.g. a slave implementation).

---
 hw/virtio/vhost-user.c         | 87 +---------------------------------------
 include/hw/virtio/vhost-user.h | 91 ++++++++++++++++++++++++++++++++++++++++++
 include/net/vhost-user.h       |  4 +-
 3 files changed, 94 insertions(+), 88 deletions(-)
 create mode 100644 include/hw/virtio/vhost-user.h
hw/virtio/vhost-user.c +1 -86
index 7ee92b3..9e089d4 100644
@@ -12,6 +12,7 @@
 #include "qapi/error.h"
 #include "hw/virtio/vhost.h"
 #include "hw/virtio/vhost-backend.h"
+#include "hw/virtio/vhost-user.h"
 #include "hw/virtio/virtio-net.h"
 #include "sysemu/char.h"
 #include "sysemu/kvm.h"
@@ -22,92 +23,6 @@
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <sys/un.h>
-#include <linux/vhost.h>
-
-#define VHOST_MEMORY_MAX_NREGIONS    8
-#define VHOST_USER_F_PROTOCOL_FEATURES 30
-
-enum VhostUserProtocolFeature {
-    VHOST_USER_PROTOCOL_F_MQ = 0,
-    VHOST_USER_PROTOCOL_F_LOG_SHMFD = 1,
-    VHOST_USER_PROTOCOL_F_RARP = 2,
-    VHOST_USER_PROTOCOL_F_REPLY_ACK = 3,
-
-    VHOST_USER_PROTOCOL_F_MAX
-};
-
-#define VHOST_USER_PROTOCOL_FEATURE_MASK ((1 << VHOST_USER_PROTOCOL_F_MAX) - 1)
-
-typedef enum VhostUserRequest {
-    VHOST_USER_NONE = 0,
-    VHOST_USER_GET_FEATURES = 1,
-    VHOST_USER_SET_FEATURES = 2,
-    VHOST_USER_SET_OWNER = 3,
-    VHOST_USER_RESET_OWNER = 4,
-    VHOST_USER_SET_MEM_TABLE = 5,
-    VHOST_USER_SET_LOG_BASE = 6,
-    VHOST_USER_SET_LOG_FD = 7,
-    VHOST_USER_SET_VRING_NUM = 8,
-    VHOST_USER_SET_VRING_ADDR = 9,
-    VHOST_USER_SET_VRING_BASE = 10,
-    VHOST_USER_GET_VRING_BASE = 11,
-    VHOST_USER_SET_VRING_KICK = 12,
-    VHOST_USER_SET_VRING_CALL = 13,
-    VHOST_USER_SET_VRING_ERR = 14,
-    VHOST_USER_GET_PROTOCOL_FEATURES = 15,
-    VHOST_USER_SET_PROTOCOL_FEATURES = 16,
-    VHOST_USER_GET_QUEUE_NUM = 17,
-    VHOST_USER_SET_VRING_ENABLE = 18,
-    VHOST_USER_SEND_RARP = 19,
-    VHOST_USER_MAX
-} VhostUserRequest;
-
-typedef struct VhostUserMemoryRegion {
-    uint64_t guest_phys_addr;
-    uint64_t memory_size;
-    uint64_t userspace_addr;
-    uint64_t mmap_offset;
-} VhostUserMemoryRegion;
-
-typedef struct VhostUserMemory {
-    uint32_t nregions;
-    uint32_t padding;
-    VhostUserMemoryRegion regions[VHOST_MEMORY_MAX_NREGIONS];
-} VhostUserMemory;
-
-typedef struct VhostUserLog {
-    uint64_t mmap_size;
-    uint64_t mmap_offset;
-} VhostUserLog;
-
-typedef struct VhostUserMsg {
-    VhostUserRequest request;
-
-#define VHOST_USER_VERSION_MASK     (0x3)
-#define VHOST_USER_REPLY_MASK       (0x1<<2)
-#define VHOST_USER_NEED_REPLY_MASK  (0x1 << 3)
-    uint32_t flags;
-    uint32_t size; /* the following payload size */
-    union {
-#define VHOST_USER_VRING_IDX_MASK   (0xff)
-#define VHOST_USER_VRING_NOFD_MASK  (0x1<<8)
-        uint64_t u64;
-        struct vhost_vring_state state;
-        struct vhost_vring_addr addr;
-        VhostUserMemory memory;
-        VhostUserLog log;
-    } payload;
-} QEMU_PACKED VhostUserMsg;
-
-static VhostUserMsg m __attribute__ ((unused));
-#define VHOST_USER_HDR_SIZE (sizeof(m.request) \
-                            + sizeof(m.flags) \
-                            + sizeof(m.size))
-
-#define VHOST_USER_PAYLOAD_SIZE (sizeof(m) - VHOST_USER_HDR_SIZE)
-
-/* The version of the protocol we support */
-#define VHOST_USER_VERSION    (0x1)
 
 static bool ioeventfd_enabled(void)
 {
include/hw/virtio/vhost-user.h new file +91 -0

91 lines not on this page · raw message

include/net/vhost-user.h +2 -2
index 5bcd8a6..d9e328d 100644
@@ -8,8 +8,8 @@
  *
  */
 
-#ifndef VHOST_USER_H
-#define VHOST_USER_H
+#ifndef NET_VHOST_USER_H
+#define NET_VHOST_USER_H
 
 struct vhost_net;
 struct vhost_net *vhost_user_get_vhost_net(NetClientState *nc);
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH 4/37 vl: add the vhost-pci-slave command line option

In reply to Wei Wang

An example of the command line option to create a vhost-pci-slave is:

-chardev socket,id=slave1,server,wait=off,path=/opt/vhost-pci-slave -vhost-pci-slave socket,chardev=slave1

---
 qemu-options.hx |  4 ++++
 vl.c            | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+)
qemu-options.hx +4 -0
index c534a2f..5d60a1d 100644
@@ -4068,6 +4068,10 @@ contents of @code{iv.b64} to the second secret
 
 ETEXI
 
+DEF("vhost-pci-slave", HAS_ARG, QEMU_OPTION_vhost_pci_slave,
+    "-vhost-pci-slave socket,chrdev={id}\n"
+    "                  creates a vhost-pci-slave",
+    QEMU_ARCH_I386)
 
 HXCOMM This is the last statement. Insert new options before this line!
 STEXI
vl.c +21 -0
index d77dd86..10d7f89 100644
@@ -509,6 +509,20 @@ static QemuOptsList qemu_fw_cfg_opts = {
     },
 };
 
+static QemuOptsList qemu_vhost_pci_slave_opts = {
+    .name = "vhost-pci-slave",
+    .implied_opt_name = "chardev",
+    .head = QTAILQ_HEAD_INITIALIZER(qemu_vhost_pci_slave_opts.head),
+    .desc = {
+        /*
+         * no elements => accept any
+         * sanity checking will happen later
+         * when setting device properties
+         */
+        { /* end of list */ }
+    },
+};
+
 #ifdef CONFIG_LIBISCSI
 static QemuOptsList qemu_iscsi_opts = {
     .name = "iscsi",
@@ -3073,6 +3087,7 @@ int main(int argc, char **argv, char **envp)
     qemu_add_opts(&qemu_icount_opts);
     qemu_add_opts(&qemu_semihosting_config_opts);
     qemu_add_opts(&qemu_fw_cfg_opts);
+    qemu_add_opts(&qemu_vhost_pci_slave_opts);
 #ifdef CONFIG_LIBISCSI
     qemu_add_opts(&qemu_iscsi_opts);
 #endif
@@ -4044,6 +4059,12 @@ int main(int argc, char **argv, char **envp)
                     exit(1);
                 }
                 break;
+            case QEMU_OPTION_vhost_pci_slave:
+                opts = qemu_opts_parse_noisily(qemu_find_opts("vhost-pci-slave"), optarg, false);
+                if (!opts) {
+                    exit(1);
+                }
+                break;
             default:
                 os_parse_cmd_args(popt->index, optarg);
             }
Signature · 1 line
2.7.4
author
#5 lore raw

PATCH 5/37 vhost-pci-slave: start the implementation of vhost-pci-slave

In reply to Wei Wang

Vhost-pci-slave uses a QEMU socket to talk to the master. This patch associates the slave with the qemu sever socket.

---
 hw/virtio/Makefile.objs             |  1 +
 hw/virtio/vhost-pci-slave.c         | 53 +++++++++++++++++++++++++++++++++++++
 include/hw/virtio/vhost-pci-slave.h | 16 +++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 hw/virtio/vhost-pci-slave.c
 create mode 100644 include/hw/virtio/vhost-pci-slave.h
hw/virtio/Makefile.objs +1 -0
index 95c4c30..3af6787 100644
@@ -2,6 +2,7 @@ common-obj-y += virtio-rng.o
 common-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o
 common-obj-y += virtio-bus.o
 common-obj-y += virtio-mmio.o
+common-obj-y += vhost-pci-slave.o
 
 obj-y += virtio.o virtio-balloon.o 
 obj-$(CONFIG_LINUX) += vhost.o vhost-backend.o vhost-user.o
hw/virtio/vhost-pci-slave.c new file +53 -0

53 lines not on this page · raw message

include/hw/virtio/vhost-pci-slave.h new file +16 -0
new file mode 100644
index 0000000..c82c775
@@ -0,0 +1,16 @@
+#ifndef QEMU_VHOST_PCI_SLAVE_H
+#define QEMU_VHOST_PCI_SLAVE_H
+
+#include "sysemu/char.h"
+
+typedef struct VhostPCISlave {
+    CharBackend chr_be;
+} VhostPCISlave;
+
+extern VhostPCISlave *vp_slave;
+
+extern int vhost_pci_slave_init(QemuOpts *opts);
+
+extern int vhost_pci_slave_cleanup(void);
+
+#endif
Signature · 1 line
2.7.4
author
#6 lore raw

PATCH 6/37 vhost-pci-slave: set up the fundamental handlers for the server socket

In reply to Wei Wang
---
 hw/virtio/vhost-pci-slave.c | 53 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
hw/virtio/vhost-pci-slave.c +53 -0
index 5ff9a09..2278f63 100644
@@ -15,9 +15,59 @@
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "hw/virtio/vhost-pci-slave.h"
+#include "hw/virtio/vhost-user.h"
 
 VhostPCISlave *vp_slave;
 
+static void vp_slave_event(void *opaque, int event)
+{
+    switch (event) {
+    case CHR_EVENT_OPENED:
+        break;
+    case CHR_EVENT_CLOSED:
+        break;
+    }
+}
+
+static int vp_slave_can_read(void *opaque)
+{
+    return VHOST_USER_HDR_SIZE;
+}
+
+static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
+{
+    VhostUserMsg msg;
+    uint8_t *p = (uint8_t *) &msg;
+    CharBackend *chr_be = (CharBackend *)opaque;
+
+    if (size != VHOST_USER_HDR_SIZE) {
+        error_report("Wrong message size received %d", size);
+        return;
+    }
+
+    memcpy(p, buf, VHOST_USER_HDR_SIZE);
+
+    if (msg.size) {
+        p += VHOST_USER_HDR_SIZE;
+        size = qemu_chr_fe_read_all(chr_be, p, msg.size);
+        if (size != msg.size) {
+            error_report("Wrong message size received %d != %d",
+                           size, msg.size);
+            return;
+        }
+    }
+
+    if (msg.request > VHOST_USER_MAX)
+        error_report("vhost-pci-slave read incorrect msg");
+
+    switch(msg.request) {
+    default:
+        error_report("vhost-pci-slave does not support msg request = %d",
+                     msg.request);
+        break;
+    }
+}
+
 static CharDriverState *vp_slave_parse_chardev(const char *id)
 {
     CharDriverState *chr = qemu_chr_find(id);
@@ -40,6 +90,9 @@ int vhost_pci_slave_init(QemuOpts *opts)
         return -1;
     }
     qemu_chr_fe_init(&vp_slave->chr_be, chr, &error_abort);
+    qemu_chr_fe_set_handlers(&vp_slave->chr_be, vp_slave_can_read,
+                             vp_slave_read, vp_slave_event,
+                             &vp_slave->chr_be, NULL, true);
 
     return 0;
 }
Signature · 1 line
2.7.4
author
#7 lore raw

PATCH 7/37 vhost-pci-slave/msg: VHOST_USER_GET_FEATURES

In reply to Wei Wang

Offer the initial feature bits, which haven't been negotiated with the slave driver, to the master.

---
 hw/virtio/vhost-pci-slave.c         | 42 +++++++++++++++++++++++++++++++++++++
 include/hw/virtio/vhost-pci-slave.h |  1 +
 2 files changed, 43 insertions(+)
hw/virtio/vhost-pci-slave.c +42 -0
index 2278f63..4f445c2 100644
@@ -14,11 +14,42 @@
 
 #include "qapi/error.h"
 #include "qemu/error-report.h"
+#include "hw/virtio/virtio-pci.h"
 #include "hw/virtio/vhost-pci-slave.h"
 #include "hw/virtio/vhost-user.h"
 
+#define VHOST_PCI_FEATURE_BITS (1ULL << VIRTIO_F_VERSION_1)
+
+#define VHOST_PCI_NET_FEATURE_BITS (1ULL << VIRTIO_NET_F_MRG_RXBUF) | \
+                                   (1ULL << VIRTIO_NET_F_CTRL_VQ) | \
+                                   (1ULL << VIRTIO_NET_F_MQ)
+
 VhostPCISlave *vp_slave;
 
+static int vp_slave_write(CharBackend *chr_be, VhostUserMsg *msg)
+{
+    int size;
+
+    if (!msg)
+        return 0;
+
+    size = msg->size + VHOST_USER_HDR_SIZE;
+    msg->flags &= ~VHOST_USER_VERSION_MASK;
+    msg->flags |= VHOST_USER_VERSION;
+
+    return qemu_chr_fe_write_all(chr_be, (const uint8_t *)msg, size)
+           == size ? 0 : -1;
+}
+
+static int vp_slave_get_features(CharBackend *chr_be, VhostUserMsg *msg)
+{
+    msg->payload.u64 = vp_slave->feature_bits;
+    msg->size = sizeof(msg->payload.u64);
+    msg->flags |= VHOST_USER_REPLY_MASK;
+
+    return vp_slave_write(chr_be, msg);
+}
+
 static void vp_slave_event(void *opaque, int event)
 {
     switch (event) {
@@ -36,6 +67,7 @@ static int vp_slave_can_read(void *opaque)
 
 static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
 {
+    int ret;
     VhostUserMsg msg;
     uint8_t *p = (uint8_t *) &msg;
     CharBackend *chr_be = (CharBackend *)opaque;
@@ -61,11 +93,20 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
         error_report("vhost-pci-slave read incorrect msg");
 
     switch(msg.request) {
+    case VHOST_USER_GET_FEATURES:
+        ret = vp_slave_get_features(chr_be, &msg);
+        if (ret < 0)
+            goto err_handling;
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
         break;
     }
+    return;
+
+err_handling:
+    error_report("vhost-pci-slave handle request %d failed", msg.request);
 }
 
 static CharDriverState *vp_slave_parse_chardev(const char *id)
@@ -89,6 +130,7 @@ int vhost_pci_slave_init(QemuOpts *opts)
     if (!chr) {
         return -1;
     }
+    vp_slave->feature_bits =  1ULL << VHOST_USER_F_PROTOCOL_FEATURES;
     qemu_chr_fe_init(&vp_slave->chr_be, chr, &error_abort);
     qemu_chr_fe_set_handlers(&vp_slave->chr_be, vp_slave_can_read,
                              vp_slave_read, vp_slave_event,
include/hw/virtio/vhost-pci-slave.h +1 -0
index c82c775..4ec25d4 100644
@@ -5,6 +5,7 @@
 
 typedef struct VhostPCISlave {
     CharBackend chr_be;
+    uint64_t feature_bits;
 } VhostPCISlave;
 
 extern VhostPCISlave *vp_slave;
Signature · 1 line
2.7.4
author
#8 lore raw

PATCH 8/37 vhost-pci-slave/msg: VHOST_USER_SET_FEATURES

In reply to Wei Wang

Store the feature bits that have been negotiated between the master device and driver. The feature bits will be negotiated with the slave driver.

---
 hw/virtio/vhost-pci-slave.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
hw/virtio/vhost-pci-slave.c +10 -0
index 4f445c2..bc6120c 100644
@@ -50,6 +50,13 @@ static int vp_slave_get_features(CharBackend *chr_be, VhostUserMsg *msg)
     return vp_slave_write(chr_be, msg);
 }
 
+static void vp_slave_set_features(VhostUserMsg *msg)
+{
+   /* Clear the protocol feature bit, which is useless for the device */
+    vp_slave->feature_bits = msg->payload.u64
+                             & ~(1 << VHOST_USER_F_PROTOCOL_FEATURES);
+}
+
 static void vp_slave_event(void *opaque, int event)
 {
     switch (event) {
@@ -98,6 +105,9 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
         if (ret < 0)
             goto err_handling;
         break;
+    case VHOST_USER_SET_FEATURES:
+        vp_slave_set_features(&msg);
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
Signature · 1 line
2.7.4
author
#9 lore raw

PATCH 9/37 vhost-pci-slave/msg: VHOST_USER_GET_PROTOCOL_FEATURES

In reply to Wei Wang

Add a new protocol feature, VHOST_USER_PROTOCOL_F_VHOST_PCI. This feature indicates the support of the vhost-pci extension for inter-vm communiaction.

---
 hw/virtio/vhost-pci-slave.c    | 14 ++++++++++++++
 include/hw/virtio/vhost-user.h |  6 ++++++
 2 files changed, 20 insertions(+)
hw/virtio/vhost-pci-slave.c +14 -0
index bc6120c..ac9deae 100644
@@ -67,6 +67,15 @@ static void vp_slave_event(void *opaque, int event)
     }
 }
 
+static int vp_slave_get_protocol_features(CharBackend *chr_be, VhostUserMsg *msg)
+{
+    msg->payload.u64 = VHOST_USER_PROTOCOL_FEATURES;
+    msg->size = sizeof(msg->payload.u64);
+    msg->flags |= VHOST_USER_REPLY_MASK;
+
+    return vp_slave_write(chr_be, msg);
+}
+
 static int vp_slave_can_read(void *opaque)
 {
     return VHOST_USER_HDR_SIZE;
@@ -108,6 +117,11 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
     case VHOST_USER_SET_FEATURES:
         vp_slave_set_features(&msg);
         break;
+    case VHOST_USER_GET_PROTOCOL_FEATURES:
+        ret = vp_slave_get_protocol_features(chr_be, &msg);
+        if (ret < 0)
+            goto err_handling;
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
include/hw/virtio/vhost-user.h +6 -0
index c189b26..a303513 100644
@@ -11,12 +11,18 @@ enum VhostUserProtocolFeature {
     VHOST_USER_PROTOCOL_F_LOG_SHMFD = 1,
     VHOST_USER_PROTOCOL_F_RARP = 2,
     VHOST_USER_PROTOCOL_F_REPLY_ACK = 3,
+    VHOST_USER_PROTOCOL_F_VHOST_PCI =4,
 
     VHOST_USER_PROTOCOL_F_MAX
 };
 
 #define VHOST_USER_PROTOCOL_FEATURE_MASK ((1 << VHOST_USER_PROTOCOL_F_MAX) - 1)
 
+#define VHOST_USER_PROTOCOL_FEATURES ((1ULL << VHOST_USER_PROTOCOL_F_MQ) | \
+                                      (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) | \
+                                      (1ULL << VHOST_USER_PROTOCOL_F_RARP)) | \
+                                      (1ULL << VHOST_USER_PROTOCOL_F_VHOST_PCI)
+
 typedef enum VhostUserRequest {
     VHOST_USER_NONE = 0,
     VHOST_USER_GET_FEATURES = 1,
Signature · 1 line
2.7.4
author
#10 lore raw

PATCH 10/37 vhost-pci-slave/msg: VHOST_USER_SET_PROTOCOL_FEATURES

In reply to Wei Wang

Not used currently.

---
 hw/virtio/vhost-pci-slave.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/vhost-pci-slave.c +2 -0
index ac9deae..ef2b66a 100644
@@ -122,6 +122,8 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
         if (ret < 0)
             goto err_handling;
         break;
+    case VHOST_USER_SET_PROTOCOL_FEATURES:
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
Signature · 1 line
2.7.4
author
#11 lore raw

PATCH 11/37 vhost-user/msg: VHOST_USER_PROTOCOL_F_SET_DEVICE_ID

In reply to Wei Wang

The feature, VHOST_USER_PROTOCOL_F_SET_DEVICE_ID, indicates that the slave side implementation supports different types of devices. The master tells the slave what type of device to create by sending the VHOST_USER_SET_DEVICE_ID message. Currently, only the net type is supported.

---
 hw/net/vhost_net.c             |  1 +
 hw/virtio/vhost-user.c         | 19 +++++++++++++++++++
 include/hw/virtio/vhost-user.h |  5 ++++-
 include/hw/virtio/vhost.h      |  1 +
 4 files changed, 25 insertions(+), 1 deletion(-)
hw/net/vhost_net.c +1 -0
index f2d49ad..6524503 100644
@@ -152,6 +152,7 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options)
     net->dev.max_queues = 1;
     net->dev.nvqs = 2;
     net->dev.vqs = net->vqs;
+    net->dev.dev_type = VIRTIO_ID_NET;
 
     if (backend_kernel) {
         r = vhost_net_get_fd(options->net_backend);
hw/virtio/vhost-user.c +19 -0
index 9e089d4..8b5ac0b 100644
@@ -452,6 +452,18 @@ static int vhost_user_get_features(struct vhost_dev *dev, uint64_t *features)
     return vhost_user_get_u64(dev, VHOST_USER_GET_FEATURES, features);
 }
 
+static int vhost_user_set_dev_id(struct vhost_dev *dev, uint16_t virtio_id)
+{
+    VhostUserMsg msg = {
+        .request = VHOST_USER_SET_DEVICE_ID,
+        .flags = VHOST_USER_VERSION,
+        .payload.u64 = virtio_id,
+        .size = sizeof(msg.payload.u64),
+    };
+
+    return vhost_user_write(dev, &msg, NULL, 0);
+}
+
 static int vhost_user_set_owner(struct vhost_dev *dev)
 {
     VhostUserMsg msg = {
@@ -509,6 +521,13 @@ static int vhost_user_init(struct vhost_dev *dev, void *opaque)
             return err;
         }
 
+        if (dev->protocol_features & (1ULL << VHOST_USER_PROTOCOL_F_SET_DEVICE_ID)) {
+            err = vhost_user_set_dev_id(dev, dev->dev_type);
+            if (err < 0) {
+                return err;
+            }
+        }
+
         /* query the max queues we support if backend supports Multiple Queue */
         if (dev->protocol_features & (1ULL << VHOST_USER_PROTOCOL_F_MQ)) {
             err = vhost_user_get_u64(dev, VHOST_USER_GET_QUEUE_NUM,
include/hw/virtio/vhost-user.h +4 -1
index a303513..45f11be 100644
@@ -12,6 +12,7 @@ enum VhostUserProtocolFeature {
     VHOST_USER_PROTOCOL_F_RARP = 2,
     VHOST_USER_PROTOCOL_F_REPLY_ACK = 3,
     VHOST_USER_PROTOCOL_F_VHOST_PCI =4,
+    VHOST_USER_PROTOCOL_F_SET_DEVICE_ID = 5,
 
     VHOST_USER_PROTOCOL_F_MAX
 };
@@ -21,7 +22,8 @@ enum VhostUserProtocolFeature {
 #define VHOST_USER_PROTOCOL_FEATURES ((1ULL << VHOST_USER_PROTOCOL_F_MQ) | \
                                       (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) | \
                                       (1ULL << VHOST_USER_PROTOCOL_F_RARP)) | \
-                                      (1ULL << VHOST_USER_PROTOCOL_F_VHOST_PCI)
+                                      (1ULL << VHOST_USER_PROTOCOL_F_VHOST_PCI) | \
+                                      (1ULL << VHOST_USER_PROTOCOL_F_SET_DEVICE_ID)
 
 typedef enum VhostUserRequest {
     VHOST_USER_NONE = 0,
@@ -44,6 +46,7 @@ typedef enum VhostUserRequest {
     VHOST_USER_GET_QUEUE_NUM = 17,
     VHOST_USER_SET_VRING_ENABLE = 18,
     VHOST_USER_SEND_RARP = 19,
+    VHOST_USER_SET_DEVICE_ID = 20,
     VHOST_USER_MAX
 } VhostUserRequest;
 
include/hw/virtio/vhost.h +1 -0
index 1fe5aad..9cf32e2 100644
@@ -43,6 +43,7 @@ struct vhost_dev {
     int n_mem_sections;
     MemoryRegionSection *mem_sections;
     struct vhost_virtqueue *vqs;
+    uint16_t dev_type;
     int nvqs;
     /* the first virtqueue which would be used by this vhost dev */
     int vq_index;
Signature · 1 line
2.7.4
author
#12 lore raw

PATCH 12/37 vhost-pci-slave/msg: VHOST_USER_SET_DEVICE_ID

In reply to Wei Wang

Initialize the feature bits according to the device type.

---
 hw/virtio/vhost-pci-slave.c         | 17 +++++++++++++++++
 include/hw/virtio/vhost-pci-slave.h |  1 +
 2 files changed, 18 insertions(+)
hw/virtio/vhost-pci-slave.c +17 -0
index ef2b66a..9b00be4 100644
@@ -76,6 +76,20 @@ static int vp_slave_get_protocol_features(CharBackend *chr_be, VhostUserMsg *msg
     return vp_slave_write(chr_be, msg);
 }
 
+static void vp_slave_set_device_type(VhostUserMsg *msg)
+{
+    vp_slave->dev_type = (uint16_t)msg->payload.u64;
+
+    switch (vp_slave->dev_type) {
+    case VIRTIO_ID_NET:
+        vp_slave->feature_bits |= (VHOST_PCI_FEATURE_BITS
+                                   | VHOST_PCI_NET_FEATURE_BITS);
+        break;
+    default:
+        error_report("device type %d is not supported", vp_slave->dev_type);
+    }
+}
+
 static int vp_slave_can_read(void *opaque)
 {
     return VHOST_USER_HDR_SIZE;
@@ -124,6 +138,9 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
         break;
     case VHOST_USER_SET_PROTOCOL_FEATURES:
         break;
+    case VHOST_USER_SET_DEVICE_ID:
+        vp_slave_set_device_type(&msg);
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
include/hw/virtio/vhost-pci-slave.h +1 -0
index 4ec25d4..8b162dc 100644
@@ -5,6 +5,7 @@
 
 typedef struct VhostPCISlave {
     CharBackend chr_be;
+    uint16_t dev_type;
     uint64_t feature_bits;
 } VhostPCISlave;
 
Signature · 1 line
2.7.4
author
#13 lore raw

PATCH 13/37 vhost-pci-slave/msg: VHOST_USER_GET_QUEUE_NUM

In reply to Wei Wang

Send the max supported queue num according to the device type back to the master.

---
 hw/virtio/vhost-pci-slave.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
hw/virtio/vhost-pci-slave.c +22 -0
index 9b00be4..8e5ecf8 100644
@@ -90,6 +90,23 @@ static void vp_slave_set_device_type(VhostUserMsg *msg)
     }
 }
 
+static int vp_slave_get_queue_num(CharBackend *chr_be, VhostUserMsg *msg)
+{
+    switch (vp_slave->dev_type) {
+    case VIRTIO_ID_NET:
+        msg->payload.u64 = VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX;
+        break;
+    default:
+        error_report("GET_QUEUE_NUM: device type %d is not supported",
+                     vp_slave->dev_type);
+        return -1;
+    }
+    msg->size = sizeof(msg->payload.u64);
+    msg->flags |= VHOST_USER_REPLY_MASK;
+
+    return vp_slave_write(chr_be, msg);
+}
+
 static int vp_slave_can_read(void *opaque)
 {
     return VHOST_USER_HDR_SIZE;
@@ -141,6 +158,11 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
     case VHOST_USER_SET_DEVICE_ID:
         vp_slave_set_device_type(&msg);
         break;
+    case VHOST_USER_GET_QUEUE_NUM:
+        ret = vp_slave_get_queue_num(chr_be, &msg);
+        if (ret < 0)
+            goto err_handling;
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
Signature · 1 line
2.7.4
author
#14 lore raw

PATCH 14/37 vhost-pci-slave/msg: VHOST_USER_SET_OWNER

In reply to Wei Wang

Do nothing currently.

---
 hw/virtio/vhost-pci-slave.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/vhost-pci-slave.c +2 -0
index 8e5ecf8..9b854b1 100644
@@ -163,6 +163,8 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
         if (ret < 0)
             goto err_handling;
         break;
+    case VHOST_USER_SET_OWNER:
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
Signature · 1 line
2.7.4
author
#15 lore raw

PATCH 15/37 vhost-pci-slave/msg: VHOST_USER_SET_MEM_TABLE

In reply to Wei Wang

Map the peer memory in QEMU, and prepare the memory for the guest using MemoryRegion. The controlq message of the memory info is constructed here, and it will be sent to the guest when the guest controlq is ready. With the the peer memory info reveived in the message, the guest will be able to translate any peer guest physical address to its own guest physical address.

Also add a cleanup function to free the related memory that has been set up.

---
 hw/virtio/vhost-pci-slave.c                    | 91 +++++++++++++++++++++++++-
 include/hw/virtio/vhost-pci-slave.h            |  9 +++
 include/standard-headers/linux/vhost_pci_net.h | 11 ++++
 3 files changed, 110 insertions(+), 1 deletion(-)
hw/virtio/vhost-pci-slave.c +90 -1
index 9b854b1..5170ab5 100644
@@ -26,6 +26,20 @@
 
 VhostPCISlave *vp_slave;
 
+static void vp_slave_cleanup(void)
+{
+    int ret;
+    uint32_t i, nregions;
+
+    nregions = vp_slave->pmem_msg.nregions;
+    for (i = 0; i < nregions; i++) {
+        ret = munmap(vp_slave->mr_map_base[i], vp_slave->mr_map_size[i]);
+        if (ret < 0)
+            error_report("cleanup: failed to unmap mr");
+        memory_region_del_subregion(vp_slave->bar_mr, vp_slave->sub_mr+i);
+    }
+}
+
 static int vp_slave_write(CharBackend *chr_be, VhostUserMsg *msg)
 {
     int size;
@@ -107,6 +121,72 @@ static int vp_slave_get_queue_num(CharBackend *chr_be, VhostUserMsg *msg)
     return vp_slave_write(chr_be, msg);
 }
 
+static uint64_t vp_slave_peer_mem_size_get(VhostUserMemory *pmem)
+{
+    int i;
+    uint64_t total_size = 0;
+    uint32_t nregions = pmem->nregions;
+    VhostUserMemoryRegion *pmem_regions = pmem->regions;
+
+    for (i = 0; i < nregions; i++) {
+        total_size += pmem_regions[i].memory_size;
+    }
+
+    return total_size;
+}
+
+static int vp_slave_set_mem_table(VhostUserMsg *msg, int *fds, int fd_num)
+{
+    VhostUserMemory *pmem = &msg->payload.memory;
+    VhostUserMemoryRegion *pmem_region = pmem->regions;
+    uint32_t i, nregions = pmem->nregions;
+    struct peer_mem_msg *pmem_msg = &vp_slave->pmem_msg;
+    pmem_msg->nregions = nregions;
+    MemoryRegion *bar_mr, *sub_mr;
+    uint64_t bar_size, bar_map_offset = 0;
+    void *mr_qva;
+
+    /* Sanity Check */
+    if (fd_num != nregions)
+        error_report("SET_MEM_TABLE: fd num doesn't match region num");
+
+    if (vp_slave->bar_mr == NULL)
+        vp_slave->bar_mr = g_malloc(sizeof(MemoryRegion));
+    if (vp_slave->sub_mr == NULL)
+        vp_slave->sub_mr = g_malloc(nregions * sizeof(MemoryRegion));
+    bar_mr = vp_slave->bar_mr;
+    sub_mr = vp_slave->sub_mr;
+
+    /*
+     * The top half of the bar area holds the peer memory, and the bottom
+     * half is reserved for memory hotplug
+     */
+    bar_size = 2 * vp_slave_peer_mem_size_get(pmem);
+    bar_size = pow2ceil(bar_size);
+    memory_region_init(bar_mr, NULL, "Peer Memory", bar_size);
+    for (i = 0; i < nregions; i++) {
+        vp_slave->mr_map_size[i] = pmem_region[i].memory_size
+                                       + pmem_region[i].mmap_offset;
+        vp_slave->mr_map_base[i] = mmap(NULL, vp_slave->mr_map_size[i],
+                      PROT_READ | PROT_WRITE, MAP_SHARED, fds[i], 0);
+        if (vp_slave->mr_map_base[i] == MAP_FAILED) {
+            error_report("SET_MEM_TABLE: map peer memory region %d failed", i);
+            return -1;
+        }
+
+        mr_qva = vp_slave->mr_map_base[i] + pmem_region[i].mmap_offset;
+        memory_region_init_ram_ptr(&sub_mr[i], NULL, "Peer Memory",
+                                   pmem_region[i].memory_size, mr_qva);
+        memory_region_add_subregion(bar_mr, bar_map_offset, &sub_mr[i]);
+        bar_map_offset += pmem_region[i].memory_size;
+        pmem_msg->regions[i].gpa = pmem_region[i].guest_phys_addr;
+        pmem_msg->regions[i].size = pmem_region[i].memory_size;
+    }
+    vp_slave->bar_map_offset = bar_map_offset;
+
+    return 0;
+}
+
 static int vp_slave_can_read(void *opaque)
 {
     return VHOST_USER_HDR_SIZE;
@@ -114,7 +194,7 @@ static int vp_slave_can_read(void *opaque)
 
 static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
 {
-    int ret;
+    int ret, fd_num, fds[MAX_GUEST_REGION];
     VhostUserMsg msg;
     uint8_t *p = (uint8_t *) &msg;
     CharBackend *chr_be = (CharBackend *)opaque;
@@ -165,6 +245,10 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
         break;
     case VHOST_USER_SET_OWNER:
         break;
+    case VHOST_USER_SET_MEM_TABLE:
+        fd_num = qemu_chr_fe_get_msgfds(chr_be, fds, sizeof(fds) / sizeof(int));
+        vp_slave_set_mem_table(&msg, fds, fd_num);
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
@@ -198,6 +282,8 @@ int vhost_pci_slave_init(QemuOpts *opts)
         return -1;
     }
     vp_slave->feature_bits =  1ULL << VHOST_USER_F_PROTOCOL_FEATURES;
+    vp_slave->bar_mr = NULL;
+    vp_slave->sub_mr = NULL;
     qemu_chr_fe_init(&vp_slave->chr_be, chr, &error_abort);
     qemu_chr_fe_set_handlers(&vp_slave->chr_be, vp_slave_can_read,
                              vp_slave_read, vp_slave_event,
@@ -208,7 +294,10 @@ int vhost_pci_slave_init(QemuOpts *opts)
 
 int vhost_pci_slave_cleanup(void)
 {
+    vp_slave_cleanup();
     qemu_chr_fe_deinit(&vp_slave->chr_be);
+    g_free(vp_slave->sub_mr);
+    g_free(vp_slave->bar_mr);
     g_free(vp_slave);
 
     return 0;
include/hw/virtio/vhost-pci-slave.h +9 -0
index 8b162dc..03e23eb 100644
@@ -2,11 +2,20 @@
 #define QEMU_VHOST_PCI_SLAVE_H
 
 #include "sysemu/char.h"
+#include "exec/memory.h"
+#include "standard-headers/linux/vhost_pci_net.h"
 
 typedef struct VhostPCISlave {
     CharBackend chr_be;
     uint16_t dev_type;
     uint64_t feature_bits;
+    /* hotplugged memory should be mapped following the offset */
+    uint64_t bar_map_offset;
+    MemoryRegion *bar_mr;
+    MemoryRegion *sub_mr;
+    void *mr_map_base[MAX_GUEST_REGION];
+    uint64_t mr_map_size[MAX_GUEST_REGION];
+    struct peer_mem_msg pmem_msg;
 } VhostPCISlave;
 
 extern VhostPCISlave *vp_slave;
include/standard-headers/linux/vhost_pci_net.h +11 -0
index bac293f..f4c8d0b 100644
@@ -29,6 +29,17 @@
 
 #include "standard-headers/linux/virtio_ids.h"
 
+struct pmem_region_msg {
+	uint64_t gpa;
+	uint64_t size;
+};
+
+#define MAX_GUEST_REGION 8
+struct peer_mem_msg {
+	uint32_t nregions;
+	struct pmem_region_msg regions[MAX_GUEST_REGION];
+};
+
 #define VPNET_S_LINK_UP	1	/* Link is up */
 
 struct vhost_pci_net_config {
Signature · 1 line
2.7.4
author
#16 lore raw

PATCH 16/37 vhost-pci-slave/msg: VHOST_USER_SET_VRING_NUM

In reply to Wei Wang

The protocol doesn't have a message to tell the slave how many virtqueues that the master device has. So, the slave side implementation uses a list to manage the virtqueue info sent from the master. SET_VRING_NUM is the first virtqueue info passed from the master, so the slave allocates a node when receiving this message, and inserts the node to the head of the list. Subsequent virtqueue info (e.g. base, addresses) will be updated to the head node.

The list of virtqueue info will be packed together and delievered to the driver via the controlq.

---
 hw/virtio/vhost-pci-slave.c         | 28 ++++++++++++++++++++++++++++
 include/hw/virtio/vhost-pci-slave.h |  7 +++++++
 2 files changed, 35 insertions(+)
hw/virtio/vhost-pci-slave.c +28 -0
index 5170ab5..0deab2d 100644
@@ -30,6 +30,7 @@ static void vp_slave_cleanup(void)
 {
     int ret;
     uint32_t i, nregions;
+    PeerVqNode *pvq_node;
 
     nregions = vp_slave->pmem_msg.nregions;
     for (i = 0; i < nregions; i++) {
@@ -38,6 +39,13 @@ static void vp_slave_cleanup(void)
             error_report("cleanup: failed to unmap mr");
         memory_region_del_subregion(vp_slave->bar_mr, vp_slave->sub_mr+i);
     }
+
+    if (!QLIST_EMPTY(&vp_slave->pvq_list)) {
+        QLIST_FOREACH(pvq_node, &vp_slave->pvq_list, node)
+            g_free(pvq_node);
+    }
+    QLIST_INIT(&vp_slave->pvq_list);
+    vp_slave->pvq_num = 0;
 }
 
 static int vp_slave_write(CharBackend *chr_be, VhostUserMsg *msg)
@@ -187,6 +195,20 @@ static int vp_slave_set_mem_table(VhostUserMsg *msg, int *fds, int fd_num)
     return 0;
 }
 
+static void vp_slave_alloc_pvq_node(void)
+{
+    PeerVqNode *pvq_node = g_malloc0(sizeof(PeerVqNode));
+    QLIST_INSERT_HEAD(&vp_slave->pvq_list, pvq_node, node);
+    vp_slave->pvq_num++;
+}
+
+static void vp_slave_set_vring_num(VhostUserMsg *msg)
+{
+    PeerVqNode *pvq_node = QLIST_FIRST(&vp_slave->pvq_list);
+
+    pvq_node->vring_num = msg->payload.u64;
+}
+
 static int vp_slave_can_read(void *opaque)
 {
     return VHOST_USER_HDR_SIZE;
@@ -249,6 +271,10 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
         fd_num = qemu_chr_fe_get_msgfds(chr_be, fds, sizeof(fds) / sizeof(int));
         vp_slave_set_mem_table(&msg, fds, fd_num);
         break;
+    case VHOST_USER_SET_VRING_NUM:
+        vp_slave_alloc_pvq_node();
+        vp_slave_set_vring_num(&msg);
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
@@ -284,6 +310,8 @@ int vhost_pci_slave_init(QemuOpts *opts)
     vp_slave->feature_bits =  1ULL << VHOST_USER_F_PROTOCOL_FEATURES;
     vp_slave->bar_mr = NULL;
     vp_slave->sub_mr = NULL;
+    QLIST_INIT(&vp_slave->pvq_list);
+    vp_slave->pvq_num = 0;
     qemu_chr_fe_init(&vp_slave->chr_be, chr, &error_abort);
     qemu_chr_fe_set_handlers(&vp_slave->chr_be, vp_slave_can_read,
                              vp_slave_read, vp_slave_event,
include/hw/virtio/vhost-pci-slave.h +7 -0
index 03e23eb..fe4824c 100644
@@ -5,6 +5,11 @@
 #include "exec/memory.h"
 #include "standard-headers/linux/vhost_pci_net.h"
 
+typedef struct PeerVqNode {
+    uint32_t vring_num;
+    QLIST_ENTRY(PeerVqNode) node;
+} PeerVqNode;
+
 typedef struct VhostPCISlave {
     CharBackend chr_be;
     uint16_t dev_type;
@@ -16,6 +21,8 @@ typedef struct VhostPCISlave {
     void *mr_map_base[MAX_GUEST_REGION];
     uint64_t mr_map_size[MAX_GUEST_REGION];
     struct peer_mem_msg pmem_msg;
+    uint16_t pvq_num;
+    QLIST_HEAD(, PeerVqNode) pvq_list;
 } VhostPCISlave;
 
 extern VhostPCISlave *vp_slave;
Signature · 1 line
2.7.4
author
#17 lore raw

PATCH 17/37 vhost-pci-slave/msg: VHOST_USER_SET_VRING_BASE

In reply to Wei Wang

Update last_avail_idx to the head node in the list.

---
 hw/virtio/vhost-pci-slave.c         | 10 ++++++++++
 include/hw/virtio/vhost-pci-slave.h |  1 +
 2 files changed, 11 insertions(+)
hw/virtio/vhost-pci-slave.c +10 -0
index 0deab2d..e33c59e 100644
@@ -209,6 +209,13 @@ static void vp_slave_set_vring_num(VhostUserMsg *msg)
     pvq_node->vring_num = msg->payload.u64;
 }
 
+static void vp_slave_set_vring_base(VhostUserMsg *msg)
+{
+    PeerVqNode *pvq_node = QLIST_FIRST(&vp_slave->pvq_list);
+
+    pvq_node->last_avail_idx = msg->payload.u64;
+}
+
 static int vp_slave_can_read(void *opaque)
 {
     return VHOST_USER_HDR_SIZE;
@@ -275,6 +282,9 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
         vp_slave_alloc_pvq_node();
         vp_slave_set_vring_num(&msg);
         break;
+    case VHOST_USER_SET_VRING_BASE:
+        vp_slave_set_vring_base(&msg);
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
include/hw/virtio/vhost-pci-slave.h +1 -0
index fe4824c..cfe4107 100644
@@ -6,6 +6,7 @@
 #include "standard-headers/linux/vhost_pci_net.h"
 
 typedef struct PeerVqNode {
+    uint16_t last_avail_idx;
     uint32_t vring_num;
     QLIST_ENTRY(PeerVqNode) node;
 } PeerVqNode;
Signature · 1 line
2.7.4
author
#18 lore raw

PATCH 18/37 vhost-user: send guest physical address of virtqueues to the slave

In reply to Wei Wang

In the vhost-pci case, the slave needs the master side guest physical address, rather than the qemu virtual address.

---
 hw/virtio/vhost.c         | 61 ++++++++++++++++++++++++++++++++---------------
 include/hw/virtio/vhost.h |  2 ++
 2 files changed, 44 insertions(+), 19 deletions(-)
hw/virtio/vhost.c +42 -19
index f7f7023..df04375 100644
@@ -26,6 +26,7 @@
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
 #include "migration/migration.h"
+#include "hw/virtio/vhost-user.h"
 
 /* enabled until disconnected backend stabilizes */
 #define _VHOST_DEBUG 1
@@ -858,6 +859,12 @@ static int vhost_virtqueue_set_vring_endian_legacy(struct vhost_dev *dev,
     return -errno;
 }
 
+bool vhost_pci_enabled(struct vhost_dev *dev)
+{
+    return ((dev->protocol_features &
+            (1ULL << VHOST_USER_PROTOCOL_F_VHOST_PCI)) != 0);
+}
+
 static int vhost_virtqueue_start(struct vhost_dev *dev,
                                 struct VirtIODevice *vdev,
                                 struct vhost_virtqueue *vq,
@@ -901,26 +908,40 @@ static int vhost_virtqueue_start(struct vhost_dev *dev,
         }
     }
 
-    vq->desc_size = s = l = virtio_queue_get_desc_size(vdev, idx);
     vq->desc_phys = a = virtio_queue_get_desc_addr(vdev, idx);
-    vq->desc = cpu_physical_memory_map(a, &l, 0);
-    if (!vq->desc || l != s) {
-        r = -ENOMEM;
-        goto fail_alloc_desc;
+    if (vhost_pci_enabled(dev)) {
+        vq->desc = (void *)a;
+    } else {
+        vq->desc_size = s = l = virtio_queue_get_desc_size(vdev, idx);
+        vq->desc = cpu_physical_memory_map(a, &l, 0);
+        if (!vq->desc || l != s) {
+            r = -ENOMEM;
+            goto fail_alloc_desc;
+        }
     }
+
     vq->avail_size = s = l = virtio_queue_get_avail_size(vdev, idx);
     vq->avail_phys = a = virtio_queue_get_avail_addr(vdev, idx);
-    vq->avail = cpu_physical_memory_map(a, &l, 0);
-    if (!vq->avail || l != s) {
-        r = -ENOMEM;
-        goto fail_alloc_avail;
+    if (vhost_pci_enabled(dev)) {
+        vq->avail = (void *)a;
+    } else {
+        vq->avail = cpu_physical_memory_map(a, &l, 0);
+        if (!vq->avail || l != s) {
+            r = -ENOMEM;
+            goto fail_alloc_avail;
+        }
     }
+
     vq->used_size = s = l = virtio_queue_get_used_size(vdev, idx);
     vq->used_phys = a = virtio_queue_get_used_addr(vdev, idx);
-    vq->used = cpu_physical_memory_map(a, &l, 1);
-    if (!vq->used || l != s) {
-        r = -ENOMEM;
-        goto fail_alloc_used;
+    if (vhost_pci_enabled(dev)) {
+        vq->used = (void *)a;
+    } else {
+        vq->used = cpu_physical_memory_map(a, &l, 1);
+        if (!vq->used || l != s) {
+            r = -ENOMEM;
+            goto fail_alloc_used;
+        }
     }
 
     r = vhost_virtqueue_set_addr(dev, vq, vhost_vq_index, dev->log_enabled);
@@ -1003,12 +1024,14 @@ static void vhost_virtqueue_stop(struct vhost_dev *dev,
                                                 vhost_vq_index);
     }
 
-    cpu_physical_memory_unmap(vq->used, virtio_queue_get_used_size(vdev, idx),
-                              1, virtio_queue_get_used_size(vdev, idx));
-    cpu_physical_memory_unmap(vq->avail, virtio_queue_get_avail_size(vdev, idx),
-                              0, virtio_queue_get_avail_size(vdev, idx));
-    cpu_physical_memory_unmap(vq->desc, virtio_queue_get_desc_size(vdev, idx),
-                              0, virtio_queue_get_desc_size(vdev, idx));
+    if (!vhost_pci_enabled(dev)) {
+        cpu_physical_memory_unmap(vq->used, virtio_queue_get_used_size(vdev, idx),
+                                  1, virtio_queue_get_used_size(vdev, idx));
+        cpu_physical_memory_unmap(vq->avail, virtio_queue_get_avail_size(vdev, idx),
+                                  0, virtio_queue_get_avail_size(vdev, idx));
+        cpu_physical_memory_unmap(vq->desc, virtio_queue_get_desc_size(vdev, idx),
+                                  0, virtio_queue_get_desc_size(vdev, idx));
+    }
 }
 
 static void vhost_eventfd_add(MemoryListener *listener,
include/hw/virtio/vhost.h +2 -0
index 9cf32e2..9955e07 100644
@@ -92,4 +92,6 @@ bool vhost_has_free_slot(void);
 int vhost_net_set_backend(struct vhost_dev *hdev,
                           struct vhost_vring_file *file);
 
+bool vhost_pci_enabled(struct vhost_dev *dev);
+
 #endif
Signature · 1 line
2.7.4
author
#19 lore raw

PATCH 19/37 vhost-pci-slave/msg: VHOST_USER_SET_VRING_ADDR

In reply to Wei Wang

Update the virtqueue addresses to the head node of the list.

---
 hw/virtio/vhost-pci-slave.c         | 10 ++++++++++
 include/hw/virtio/vhost-pci-slave.h |  3 +++
 2 files changed, 13 insertions(+)
hw/virtio/vhost-pci-slave.c +10 -0
index e33c59e..a55861a 100644
@@ -216,6 +216,13 @@ static void vp_slave_set_vring_base(VhostUserMsg *msg)
     pvq_node->last_avail_idx = msg->payload.u64;
 }
 
+static void vp_slave_set_vring_addr(VhostUserMsg *msg)
+{
+    PeerVqNode *pvq_node = QLIST_FIRST(&vp_slave->pvq_list);
+    memcpy(&pvq_node->addr, &msg->payload.addr,
+           sizeof(struct vhost_vring_addr));
+}
+
 static int vp_slave_can_read(void *opaque)
 {
     return VHOST_USER_HDR_SIZE;
@@ -285,6 +292,9 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
     case VHOST_USER_SET_VRING_BASE:
         vp_slave_set_vring_base(&msg);
         break;
+    case VHOST_USER_SET_VRING_ADDR:
+        vp_slave_set_vring_addr(&msg);
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
include/hw/virtio/vhost-pci-slave.h +3 -0
index cfe4107..439198d 100644
@@ -1,6 +1,8 @@
 #ifndef QEMU_VHOST_PCI_SLAVE_H
 #define QEMU_VHOST_PCI_SLAVE_H
 
+#include <linux/vhost.h>
+
 #include "sysemu/char.h"
 #include "exec/memory.h"
 #include "standard-headers/linux/vhost_pci_net.h"
@@ -8,6 +10,7 @@
 typedef struct PeerVqNode {
     uint16_t last_avail_idx;
     uint32_t vring_num;
+    struct vhost_vring_addr addr;
     QLIST_ENTRY(PeerVqNode) node;
 } PeerVqNode;
 
Signature · 1 line
2.7.4
author
#20 lore raw

PATCH 20/37 vhost-pci-slave/msg: VHOST_USER_SET_VRING_KICK

In reply to Wei Wang

Update the kickfd to the head node in the list.

This version of vhost-pci expects the driver to use polling to receive packets. So, other than storing the kickfd, we don't do anything more.

---
 hw/virtio/vhost-pci-slave.c         | 19 +++++++++++++++++++
 include/hw/virtio/vhost-pci-slave.h |  1 +
 2 files changed, 20 insertions(+)
hw/virtio/vhost-pci-slave.c +19 -0
index a55861a..dff1c88 100644
@@ -11,6 +11,7 @@
  */
 
 #include <qemu/osdep.h>
+#include <qemu/sockets.h>
 
 #include "qapi/error.h"
 #include "qemu/error-report.h"
@@ -223,6 +224,13 @@ static void vp_slave_set_vring_addr(VhostUserMsg *msg)
            sizeof(struct vhost_vring_addr));
 }
 
+static void vp_slave_set_vring_kick(int fd)
+{
+    PeerVqNode *pvq_node = QLIST_FIRST(&vp_slave->pvq_list);
+    if (!pvq_node)
+        pvq_node->kickfd = fd;
+}
+
 static int vp_slave_can_read(void *opaque)
 {
     return VHOST_USER_HDR_SIZE;
@@ -295,6 +303,17 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
     case VHOST_USER_SET_VRING_ADDR:
         vp_slave_set_vring_addr(&msg);
         break;
+    case VHOST_USER_SET_VRING_KICK:
+        /* consume the fd */
+        qemu_chr_fe_get_msgfds(chr_be, fds, 1);
+        vp_slave_set_vring_kick(fds[0]);
+        /*
+         * This is a non-blocking eventfd.
+         * The receive function forces it to be blocking,
+         * so revert it back to non-blocking.
+         */
+        qemu_set_nonblock(fds[0]);
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
include/hw/virtio/vhost-pci-slave.h +1 -0
index 439198d..4b6b213 100644
@@ -10,6 +10,7 @@
 typedef struct PeerVqNode {
     uint16_t last_avail_idx;
     uint32_t vring_num;
+    int kickfd;
     struct vhost_vring_addr addr;
     QLIST_ENTRY(PeerVqNode) node;
 } PeerVqNode;
Signature · 1 line
2.7.4
author
#21 lore raw

PATCH 21/37 vhost-pci-slave/msg: VHOST_USER_SET_VRING_CALL

In reply to Wei Wang

Update the callfd to the head node in the list.

This version of vhost-pci expects the master device to use polling to receive packets, so callfd is recorded here for tomorrow's implementation.

---
 hw/virtio/vhost-pci-slave.c         | 18 ++++++++++++++++++
 include/hw/virtio/vhost-pci-slave.h |  1 +
 2 files changed, 19 insertions(+)
hw/virtio/vhost-pci-slave.c +18 -0
index dff1c88..e176d59 100644
@@ -231,6 +231,13 @@ static void vp_slave_set_vring_kick(int fd)
         pvq_node->kickfd = fd;
 }
 
+static void vp_slave_set_vring_call(int fd)
+{
+    PeerVqNode *pvq_node = QLIST_FIRST(&vp_slave->pvq_list);
+    if (pvq_node)
+        pvq_node->callfd = fd;
+}
+
 static int vp_slave_can_read(void *opaque)
 {
     return VHOST_USER_HDR_SIZE;
@@ -314,6 +321,17 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
          */
         qemu_set_nonblock(fds[0]);
         break;
+    case VHOST_USER_SET_VRING_CALL:
+        /* consume the fd */
+        qemu_chr_fe_get_msgfds(chr_be, fds, 1);
+        vp_slave_set_vring_call(fds[0]);
+        /*
+         * This is a non-blocking eventfd.
+         * The receive function forces it to be blocking,
+         * so revert it back to non-blocking.
+         */
+        qemu_set_nonblock(fds[0]);
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
include/hw/virtio/vhost-pci-slave.h +1 -0
index 4b6b213..f6206a1 100644
@@ -11,6 +11,7 @@ typedef struct PeerVqNode {
     uint16_t last_avail_idx;
     uint32_t vring_num;
     int kickfd;
+    int callfd;
     struct vhost_vring_addr addr;
     QLIST_ENTRY(PeerVqNode) node;
 } PeerVqNode;
Signature · 1 line
2.7.4
author
#22 lore raw

PATCH 22/37 vhost-pci-slave/msg: VHOST_USER_SET_VRING_ENABLE

In reply to Wei Wang

Enable/Disable the corresponding virtqueue pairs in the list.

---
 hw/virtio/vhost-pci-slave.c         | 15 +++++++++++++++
 include/hw/virtio/vhost-pci-slave.h |  1 +
 2 files changed, 16 insertions(+)
hw/virtio/vhost-pci-slave.c +15 -0
index e176d59..3e00e35 100644
@@ -238,6 +238,18 @@ static void vp_slave_set_vring_call(int fd)
         pvq_node->callfd = fd;
 }
 
+static void vp_slave_set_vring_enable(VhostUserMsg *msg)
+{
+    struct vhost_vring_state *state = &msg->payload.state;
+    PeerVqNode *pvq_node;
+    QLIST_FOREACH(pvq_node, &vp_slave->pvq_list, node) {
+        if (pvq_node->vring_num == state->index) {
+            pvq_node->enabled = (int)state->num;
+            break;
+        }
+    }
+}
+
 static int vp_slave_can_read(void *opaque)
 {
     return VHOST_USER_HDR_SIZE;
@@ -332,6 +344,9 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
          */
         qemu_set_nonblock(fds[0]);
         break;
+    case VHOST_USER_SET_VRING_ENABLE:
+        vp_slave_set_vring_enable(&msg);
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
include/hw/virtio/vhost-pci-slave.h +1 -0
index f6206a1..3e0f4c7 100644
@@ -12,6 +12,7 @@ typedef struct PeerVqNode {
     uint32_t vring_num;
     int kickfd;
     int callfd;
+    int enabled;
     struct vhost_vring_addr addr;
     QLIST_ENTRY(PeerVqNode) node;
 } PeerVqNode;
Signature · 1 line
2.7.4
author
#23 lore raw

PATCH 23/37 vhost-pci-slave/msg: VHOST_USER_SET_LOG_BASE

In reply to Wei Wang

Live migration is not supported in this version, so do nothing here.

---
 hw/virtio/vhost-pci-slave.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/vhost-pci-slave.c +2 -0
index 3e00e35..61299e4 100644
@@ -347,6 +347,8 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
     case VHOST_USER_SET_VRING_ENABLE:
         vp_slave_set_vring_enable(&msg);
         break;
+    case VHOST_USER_SET_LOG_BASE:
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
Signature · 1 line
2.7.4
author
#24 lore raw

PATCH 24/37 vhost-pci-slave/msg: VHOST_USER_SET_LOG_FD

In reply to Wei Wang

Not implemented in this version.

---
 hw/virtio/vhost-pci-slave.c | 4 ++++
 1 file changed, 4 insertions(+)
hw/virtio/vhost-pci-slave.c +4 -0
index 61299e4..4e99fd9 100644
@@ -349,6 +349,10 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
         break;
     case VHOST_USER_SET_LOG_BASE:
         break;
+    case VHOST_USER_SET_LOG_FD:
+        qemu_chr_fe_get_msgfds(chr_be, fds, 1);
+        close(fds[0]);
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
Signature · 1 line
2.7.4
author
#25 lore raw

PATCH 25/37 vhost-pci-slave/msg: VHOST_USER_SEND_RARP

In reply to Wei Wang

Not implemented in this version.

---
 hw/virtio/vhost-pci-slave.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/vhost-pci-slave.c +2 -0
index 4e99fd9..1957d3f 100644
@@ -353,6 +353,8 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
         qemu_chr_fe_get_msgfds(chr_be, fds, 1);
         close(fds[0]);
         break;
+    case VHOST_USER_SEND_RARP:
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
Signature · 1 line
2.7.4
author
#26 lore raw

PATCH 26/37 vhost-pci-slave/msg: VHOST_USER_GET_VRING_BASE

In reply to Wei Wang
---
 hw/virtio/vhost-pci-slave.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
hw/virtio/vhost-pci-slave.c +15 -0
index 1957d3f..cdeb710 100644
@@ -217,6 +217,16 @@ static void vp_slave_set_vring_base(VhostUserMsg *msg)
     pvq_node->last_avail_idx = msg->payload.u64;
 }
 
+static int vp_slave_get_vring_base(CharBackend *chr_be, VhostUserMsg *msg)
+{
+    /* send back vring base to qemu */
+    msg->flags |= VHOST_USER_REPLY_MASK;
+    msg->size = sizeof(m.payload.state);
+    msg->payload.state.num = 0;
+
+    return vp_slave_write(chr_be, msg);
+}
+
 static void vp_slave_set_vring_addr(VhostUserMsg *msg)
 {
     PeerVqNode *pvq_node = QLIST_FIRST(&vp_slave->pvq_list);
@@ -319,6 +329,11 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
     case VHOST_USER_SET_VRING_BASE:
         vp_slave_set_vring_base(&msg);
         break;
+    case VHOST_USER_GET_VRING_BASE:
+        ret = vp_slave_get_vring_base(chr_be, &msg);
+        if (ret < 0)
+            goto err_handling;
+        break;
     case VHOST_USER_SET_VRING_ADDR:
         vp_slave_set_vring_addr(&msg);
         break;
Signature · 1 line
2.7.4
author
#27 lore raw

PATCH 27/37 vhost-pci-net: pass the info collected by vp_slave to the device

In reply to Wei Wang

When the device is realized, pass the vring info to the device from the slave maintained list. The device uses bar2 to hold the peer VM memory.

---
 hw/net/vhost-pci-net.c                         | 27 ++++++++++++++++++++++++++
 hw/virtio/virtio-pci.c                         | 14 +++++++++++++
 include/hw/virtio/vhost-pci-net.h              |  9 +++++++++
 include/standard-headers/linux/vhost_pci_net.h | 14 +++++++++++++
 4 files changed, 64 insertions(+)
hw/net/vhost-pci-net.c +27 -0
index 2050e5f..38f69d1 100644
@@ -20,6 +20,33 @@
 #define VPNET_CQ_SIZE 32
 #define VPNET_RQ_SIZE 256
 
+void vpnet_set_peer_vq_num(VhostPCINet *vpnet, uint16_t num)
+{
+    vpnet->peer_vq_num = num;
+}
+
+void vpnet_init_device_features(VhostPCINet *vpnet, uint64_t features)
+{
+    vpnet->device_features = features;
+}
+
+void vpnet_set_peer_vq_msg(VhostPCINet *vpnet, PeerVqNode *vq_node)
+{
+    struct peer_vq_msg *pvq_msg;
+    uint32_t vring_num = vq_node->vring_num;
+
+    if (vpnet->pvq_msg == NULL)
+        vpnet->pvq_msg = g_malloc0(sizeof(struct peer_vq_msg) * (vring_num + 1));
+
+    pvq_msg = vpnet->pvq_msg + vring_num;
+    pvq_msg->last_avail_idx = vq_node->last_avail_idx;
+    pvq_msg->vring_num = vring_num;
+    pvq_msg->vring_enable = vq_node->enabled;
+    pvq_msg->desc_gpa = vq_node->addr.desc_user_addr;
+    pvq_msg->avail_gpa = vq_node->addr.avail_user_addr;
+    pvq_msg->used_gpa = vq_node->addr.used_user_addr;
+}
+
 static void vpnet_handle_rq(VirtIODevice *vdev, VirtQueue *vq)
 {
 }
hw/virtio/virtio-pci.c +14 -0
index baf70b4..20cbefc 100644
@@ -2320,7 +2320,21 @@ static void vpnet_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
     VhostPCINetPCI *dev = VHOST_PCI_NET_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
+    int bar_id = 2;
+    PeerVqNode *vq_node;
 
+    qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
+
+    pci_register_bar(&vpci_dev->pci_dev, bar_id,
+                      PCI_BASE_ADDRESS_SPACE_MEMORY |
+                      PCI_BASE_ADDRESS_MEM_PREFETCH |
+                      PCI_BASE_ADDRESS_MEM_TYPE_64,
+                      vp_slave->bar_mr);
+    vpnet_set_peer_vq_num(&dev->vdev, vp_slave->pvq_num);
+    vpnet_init_device_features(&dev->vdev, vp_slave->feature_bits);
+    QLIST_FOREACH(vq_node, &vp_slave->pvq_list, node) {
+        vpnet_set_peer_vq_msg(&dev->vdev, vq_node);
+    }
     object_property_set_bool(OBJECT(vdev), true, "realized", errp);
 }
 
include/hw/virtio/vhost-pci-net.h +9 -0
index 8f2e65f..e813119 100644
@@ -16,6 +16,7 @@
 
 #include "standard-headers/linux/vhost_pci_net.h"
 #include "hw/virtio/virtio.h"
+#include "hw/virtio/vhost-pci-slave.h"
 
 #define TYPE_VHOST_PCI_NET "vhost-pci-net-device"
 #define VHOST_PCI_NET(obj) \
@@ -31,6 +32,14 @@ typedef struct VhostPCINet {
     uint16_t peer_vq_num;
     size_t config_size;
     uint64_t device_features;
+    struct peer_mem_msg pmem_msg;
+    struct peer_vq_msg *pvq_msg;
 } VhostPCINet;
 
+void vpnet_set_peer_vq_num(VhostPCINet *vpnet, uint16_t num);
+
+void vpnet_init_device_features(VhostPCINet *vpnet, uint64_t features);
+
+void vpnet_set_peer_vq_msg(VhostPCINet *vpnet, PeerVqNode *vq_node);
+
 #endif
include/standard-headers/linux/vhost_pci_net.h +14 -0
index f4c8d0b..e525569 100644
@@ -51,4 +51,18 @@ struct vhost_pci_net_config {
 	uint16_t status;
 } QEMU_PACKED;
 
+struct peer_vq_msg {
+	uint16_t last_avail_idx;
+        int32_t  vring_enable;
+	uint32_t vring_num;
+	uint64_t desc_gpa;
+	uint64_t avail_gpa;
+	uint64_t used_gpa;
+};
+
+struct peer_vqs_msg {
+	uint32_t nvqs;
+	struct peer_vq_msg pvq_msg[];
+};
+
 #endif
Signature · 1 line
2.7.4
author
#28 lore raw

PATCH 28/37 vhost-pci-net: pass the mem and vring info to the driver

In reply to Wei Wang

When DRIVER_OK, the device sends the mem and vring info to the driver via the controlq.

---
 hw/net/vhost-pci-net.c                         | 68 ++++++++++++++++++++++++++
 include/standard-headers/linux/vhost_pci_net.h | 17 +++++++
 2 files changed, 85 insertions(+)
hw/net/vhost-pci-net.c +68 -0
index 38f69d1..d8b13c8 100644
@@ -14,6 +14,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/iov.h"
 #include "hw/virtio/virtio-access.h"
 #include "hw/virtio/vhost-pci-net.h"
 
@@ -55,8 +56,75 @@ static void vpnet_handle_crq(VirtIODevice *vdev, VirtQueue *vq)
 {
 }
 
+static size_t vpnet_send_crq_msg(VhostPCINet *vpnet,
+                                 struct vpnet_controlq_msg *msg)
+{
+    VirtQueueElement *elem;
+    VirtQueue *vq;
+    size_t msg_len = VPNET_CQ_MSG_HDR_SIZE + msg->size;
+
+    vq = vpnet->crq;
+    if (!virtio_queue_ready(vq)) {
+        return 0;
+    }
+
+    elem = virtqueue_pop(vq, sizeof(VirtQueueElement));
+    if (!elem) {
+        return 0;
+    }
+
+    /* TODO: detect a buffer that's too short, set NEEDS_RESET */
+    iov_from_buf(elem->in_sg, elem->in_num, 0, msg, msg_len);
+
+    virtqueue_push(vq, elem, msg_len);
+    virtio_notify(VIRTIO_DEVICE(vpnet), vq);
+    g_free(elem);
+
+    return msg_len;
+}
+
+static void vpnet_send_peer_mem_msg(VhostPCINet *vpnet)
+{
+    struct vpnet_controlq_msg msg = {
+        .class = VHOST_PCI_CTRL_PEER_MEM_MSG,
+        .size = sizeof(struct peer_mem_msg),
+    };
+    memcpy(&msg.payload.pmem_msg, &vp_slave->pmem_msg, msg.size);
+    vpnet_send_crq_msg(vpnet, &msg);
+}
+
+static void vpnet_send_peer_vq_msg(VhostPCINet *vpnet)
+{
+    struct vpnet_controlq_msg *msg;
+    struct peer_vqs_msg *pvqs_msg;
+    struct peer_vq_msg *pvq_msg;
+    uint16_t pvq_num, msg_size, payload_size;
+
+    pvq_num = vpnet->peer_vq_num;
+    payload_size = sizeof(struct peer_vqs_msg)
+                   + sizeof(struct peer_vq_msg) * pvq_num;
+    msg_size = VPNET_CQ_MSG_HDR_SIZE + payload_size;
+    msg = g_malloc(msg_size);
+    msg->class = VHOST_PCI_CTRL_PEER_VQ_MSG,
+    msg->size = msg_size;
+
+    pvqs_msg = &msg->payload.pvqs_msg;
+    pvqs_msg->nvqs = pvq_num;
+    pvq_msg = pvqs_msg->pvq_msg;
+    memcpy(pvq_msg, vpnet->pvq_msg, payload_size);
+
+    vpnet_send_crq_msg(vpnet, msg);
+    g_free(msg);
+}
+
 static void vpnet_set_status(struct VirtIODevice *vdev, uint8_t status)
 {
+    VhostPCINet *vpnet = VHOST_PCI_NET(vdev);
+
+    if (status & VIRTIO_CONFIG_S_DRIVER_OK) {
+        vpnet_send_peer_mem_msg(vpnet);
+        vpnet_send_peer_vq_msg(vpnet);
+    }
 }
 
 static uint64_t vpnet_get_features(VirtIODevice *vdev, uint64_t features, Error **errp)
include/standard-headers/linux/vhost_pci_net.h +17 -0
index e525569..770171e 100644
@@ -65,4 +65,21 @@ struct peer_vqs_msg {
 	struct peer_vq_msg pvq_msg[];
 };
 
+#define VHOST_PCI_CTRL_PEER_MEM_MSG    0
+#define VHOST_PCI_CTRL_PEER_VQ_MSG     1
+struct vpnet_controlq_msg {
+	uint8_t class;
+	uint8_t cmd;
+	uint16_t size;
+        union {
+		struct peer_mem_msg pmem_msg;
+		struct peer_vqs_msg pvqs_msg;
+	} payload;
+} __attribute__((packed));
+
+static struct vpnet_controlq_msg vpnet_msg __attribute__ ((unused));
+#define VPNET_CQ_MSG_HDR_SIZE (sizeof(vpnet_msg.class) \
+			      + sizeof(vpnet_msg.cmd)  \
+			      + sizeof(vpnet_msg.size))
+
 #endif
Signature · 1 line
2.7.4
author
#29 lore raw

PATCH 29/37 vhost-pci-slave/msg: VHOST_USER_SET_VHOST_PCI (start)

In reply to Wei Wang

The VHOST_USER_SET_VHOST_PCI msg is used to request the start or stop of the vhost-pci device.

This patch handles the start commandin the slave. When receiving the SET_VHOST_PCI request with the start command, the slave creates a vhost-pci device based on the previously received virtio_id.

---
 hw/virtio/vhost-pci-slave.c    | 51 ++++++++++++++++++++++++++++++++++++++++++
 include/hw/virtio/vhost-user.h |  5 +++++
 2 files changed, 56 insertions(+)
hw/virtio/vhost-pci-slave.c +51 -0
index cdeb710..73d3f71 100644
@@ -13,6 +13,7 @@
 #include <qemu/osdep.h>
 #include <qemu/sockets.h>
 
+#include "monitor/qdev.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "hw/virtio/virtio-pci.h"
@@ -260,6 +261,51 @@ static void vp_slave_set_vring_enable(VhostUserMsg *msg)
     }
 }
 
+static int vp_slave_device_create(uint16_t virtio_id)
+{
+    Error *local_err = NULL;
+    QemuOpts *opts;
+    DeviceState *dev;
+    char params[50];
+
+    switch (virtio_id) {
+    case VIRTIO_ID_NET:
+        strcpy(params, "driver=vhost-pci-net-pci,id=vhost-pci-0");
+        break;
+    default:
+        error_report("vhost-pci device create: device type %d not supported",
+                     virtio_id);
+    }
+
+    opts = qemu_opts_parse_noisily(qemu_find_opts("device"), params, true);
+    dev = qdev_device_add(opts, &local_err);
+    if (!dev) {
+        qemu_opts_del(opts);
+        return -1;
+    }
+    object_unref(OBJECT(dev));
+    return 0;
+}
+
+static int vp_slave_set_vhost_pci(CharBackend *chr_be, VhostUserMsg *msg)
+{
+    int ret;
+    uint8_t cmd = (uint8_t)msg->payload.u64;
+
+    switch (cmd) {
+    case VHOST_USER_SET_VHOST_PCI_start:
+        ret = vp_slave_device_create(vp_slave->dev_type);
+        if (ret < 0)
+            return ret;
+        break;
+    default:
+        error_report("slave pconnection: cmd %d not supported yet", cmd);
+        return -1;
+    }
+
+    return ret;
+}
+
 static int vp_slave_can_read(void *opaque)
 {
     return VHOST_USER_HDR_SIZE;
@@ -370,6 +416,11 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
         break;
     case VHOST_USER_SEND_RARP:
         break;
+    case VHOST_USER_SET_VHOST_PCI:
+        ret = vp_slave_set_vhost_pci(chr_be, &msg);
+        if (ret < 0)
+            goto err_handling;
+        break;
     default:
         error_report("vhost-pci-slave does not support msg request = %d",
                      msg.request);
include/hw/virtio/vhost-user.h +5 -0
index 45f11be..12e4dc9 100644
@@ -25,6 +25,10 @@ enum VhostUserProtocolFeature {
                                       (1ULL << VHOST_USER_PROTOCOL_F_VHOST_PCI) | \
                                       (1ULL << VHOST_USER_PROTOCOL_F_SET_DEVICE_ID)
 
+/* control/status of the vhost-pci device */
+#define VHOST_USER_SET_VHOST_PCI_start    0
+#define VHOST_USER_SET_VHOST_PCI_stop     1
+
 typedef enum VhostUserRequest {
     VHOST_USER_NONE = 0,
     VHOST_USER_GET_FEATURES = 1,
@@ -47,6 +51,7 @@ typedef enum VhostUserRequest {
     VHOST_USER_SET_VRING_ENABLE = 18,
     VHOST_USER_SEND_RARP = 19,
     VHOST_USER_SET_DEVICE_ID = 20,
+    VHOST_USER_SET_VHOST_PCI = 21,
     VHOST_USER_MAX
 } VhostUserRequest;
 
Signature · 1 line
2.7.4
author
#30 lore raw

PATCH 30/37 vhost-pci-slave/msg: VHOST_USER_SET_VHOST_PCI (stop)

In reply to Wei Wang

The slave removes the slave device when receiving the request with the stop command.

In the case that the master side guest crashes, the crashed guest, typically, will be killed by the admin. This event will be captured via the close of the socket connection, so we can remove the vhost-pci device and free the related resources there.

---
 hw/net/vhost-pci-net.c              |  1 +
 hw/virtio/vhost-pci-slave.c         | 40 +++++++++++++++++++++++++++++++++++++
 include/hw/virtio/vhost-pci-slave.h |  2 ++
 3 files changed, 43 insertions(+)
hw/net/vhost-pci-net.c +1 -0
index d8b13c8..0198686 100644
@@ -170,6 +170,7 @@ static void vpnet_device_realize(DeviceState *dev, Error **errp)
                                          vpnet_handle_rq);
     }
     vpnet->status = 0;
+    vp_slave->vdev = vdev;
 }
 
 static void vpnet_device_unrealize(DeviceState *dev, Error **errp)
hw/virtio/vhost-pci-slave.c +40 -0
index 73d3f71..427d618 100644
@@ -34,6 +34,9 @@ static void vp_slave_cleanup(void)
     uint32_t i, nregions;
     PeerVqNode *pvq_node;
 
+    if (!vp_slave->vdev)
+        return;
+
     nregions = vp_slave->pmem_msg.nregions;
     for (i = 0; i < nregions; i++) {
         ret = munmap(vp_slave->mr_map_base[i], vp_slave->mr_map_size[i]);
@@ -48,6 +51,7 @@ static void vp_slave_cleanup(void)
     }
     QLIST_INIT(&vp_slave->pvq_list);
     vp_slave->pvq_num = 0;
+    vp_slave->vdev = NULL;
 }
 
 static int vp_slave_write(CharBackend *chr_be, VhostUserMsg *msg)
@@ -81,12 +85,44 @@ static void vp_slave_set_features(VhostUserMsg *msg)
                              & ~(1 << VHOST_USER_F_PROTOCOL_FEATURES);
 }
 
+static DeviceState *virtio_to_pci_dev(VirtIODevice *vdev, uint16_t virtio_id)
+{
+    DeviceState *qdev;
+    VhostPCINet *vpnet;
+    VhostPCINetPCI *netpci;
+
+    switch (virtio_id) {
+    case VIRTIO_ID_NET:
+        vpnet = VHOST_PCI_NET(vdev);
+        netpci = container_of(vpnet, VhostPCINetPCI, vdev);
+        qdev = &netpci->parent_obj.pci_dev.qdev;
+        break;
+    default:
+        error_report("virtio_to_pci_dev: device type %d not supported",
+                     virtio_id);
+    }
+
+    return qdev;
+}
+
+static void vp_slave_device_del(VirtIODevice *vdev)
+{
+    Error *errp = NULL;
+    DeviceState *qdev = virtio_to_pci_dev(vdev, vp_slave->dev_type);
+
+    if (vdev != NULL) {
+        qdev_unplug(qdev, &errp);
+        vp_slave_cleanup();
+    }
+}
+
 static void vp_slave_event(void *opaque, int event)
 {
     switch (event) {
     case CHR_EVENT_OPENED:
         break;
     case CHR_EVENT_CLOSED:
+        vp_slave_device_del(vp_slave->vdev);
         break;
     }
 }
@@ -298,6 +334,10 @@ static int vp_slave_set_vhost_pci(CharBackend *chr_be, VhostUserMsg *msg)
         if (ret < 0)
             return ret;
         break;
+    case VHOST_USER_SET_VHOST_PCI_stop:
+        vp_slave_device_del(vp_slave->vdev);
+        ret = 0;
+        break;
     default:
         error_report("slave pconnection: cmd %d not supported yet", cmd);
         return -1;
include/hw/virtio/vhost-pci-slave.h +2 -0
index 3e0f4c7..79e1ffd 100644
@@ -19,6 +19,8 @@ typedef struct PeerVqNode {
 
 typedef struct VhostPCISlave {
     CharBackend chr_be;
+    /* Ponnter to the slave device */
+    VirtIODevice *vdev;
     uint16_t dev_type;
     uint64_t feature_bits;
     /* hotplugged memory should be mapped following the offset */
Signature · 1 line
2.7.4
author
#31 lore raw

PATCH 31/37 vhost-user/msg: send VHOST_USER_SET_VHOST_PCI (start/stop)

In reply to Wei Wang

The master requests the slave to create or destroy a vhost-pci device.

---
 hw/net/vhost_net.c                | 34 ++++++++++++++++++++++++++++++++++
 hw/virtio/vhost-user.c            | 17 +++++++++++++++++
 include/hw/virtio/vhost-backend.h |  2 ++
 include/net/vhost_net.h           |  2 ++
 4 files changed, 55 insertions(+)
hw/net/vhost_net.c +34 -0
index 6524503..7f64be3 100644
@@ -18,6 +18,7 @@
 #include "net/tap.h"
 #include "net/vhost-user.h"
 
+#include "hw/virtio/vhost-user.h"
 #include "hw/virtio/virtio-net.h"
 #include "net/vhost_net.h"
 #include "qemu/error-report.h"
@@ -293,6 +294,7 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs,
     BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(dev)));
     VirtioBusState *vbus = VIRTIO_BUS(qbus);
     VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);
+    struct vhost_net *last_net;
     int r, e, i;
 
     if (!k->set_guest_notifiers) {
@@ -338,6 +340,14 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs,
         }
     }
 
+    last_net = get_vhost_net(ncs[total_queues-1].peer);
+    if (vhost_pci_enabled(&last_net->dev)) {
+        r = vhost_set_vhost_pci(ncs[total_queues-1].peer,
+                              VHOST_USER_SET_VHOST_PCI_start);
+        if (r < 0)
+            goto err_start;
+    }
+
     return 0;
 
 err_start:
@@ -359,8 +369,14 @@ void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs,
     BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(dev)));
     VirtioBusState *vbus = VIRTIO_BUS(qbus);
     VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);
+    struct vhost_net *last_net;
     int i, r;
 
+    last_net = get_vhost_net(ncs[total_queues-1].peer);
+    if (vhost_pci_enabled(&last_net->dev))
+        vhost_set_vhost_pci(ncs[total_queues-1].peer,
+                              VHOST_USER_SET_VHOST_PCI_stop);
+
     for (i = 0; i < total_queues; i++) {
         vhost_net_stop_one(get_vhost_net(ncs[i].peer), dev);
     }
@@ -436,6 +452,18 @@ int vhost_set_vring_enable(NetClientState *nc, int enable)
     return 0;
 }
 
+int vhost_set_vhost_pci(NetClientState *nc, uint8_t cmd)
+{
+    VHostNetState *net = get_vhost_net(nc);
+    const VhostOps *vhost_ops = net->dev.vhost_ops;
+
+    if (vhost_ops && vhost_ops->vhost_set_vhost_pci) {
+        return vhost_ops->vhost_set_vhost_pci(&net->dev, cmd);
+    }
+
+    return 0;
+}
+
 #else
 uint64_t vhost_net_get_max_queues(VHostNetState *net)
 {
@@ -502,4 +530,10 @@ int vhost_set_vring_enable(NetClientState *nc, int enable)
 {
     return 0;
 }
+
+int vhost_set_vhost_pci(NetClientState *nc, uint8_t cmd)
+{
+    return 0;
+}
+
 #endif
hw/virtio/vhost-user.c +17 -0
index 8b5ac0b..ce92140 100644
@@ -312,6 +312,22 @@ static int vhost_user_set_vring_enable(struct vhost_dev *dev, int enable)
     return 0;
 }
 
+static int vhost_user_set_vhost_pci(struct vhost_dev *dev, uint8_t cmd)
+{
+    VhostUserMsg msg = {
+        .request = VHOST_USER_SET_VHOST_PCI,
+        .flags = VHOST_USER_VERSION,
+        .payload.u64 = (uint64_t)cmd,
+        .size = sizeof(msg.payload.u64),
+    };
+
+    if (vhost_user_write(dev, &msg, NULL, 0) < 0) {
+        return -1;
+    }
+
+    return 0;
+}
+
 static int vhost_user_get_vring_base(struct vhost_dev *dev,
                                      struct vhost_vring_state *ring)
 {
@@ -639,6 +655,7 @@ const VhostOps user_ops = {
         .vhost_reset_device = vhost_user_reset_device,
         .vhost_get_vq_index = vhost_user_get_vq_index,
         .vhost_set_vring_enable = vhost_user_set_vring_enable,
+        .vhost_set_vhost_pci = vhost_user_set_vhost_pci,
         .vhost_requires_shm_log = vhost_user_requires_shm_log,
         .vhost_migration_done = vhost_user_migration_done,
         .vhost_backend_can_merge = vhost_user_can_merge,
include/hw/virtio/vhost-backend.h +2 -0
index 6e90703..60c0833 100644
@@ -67,6 +67,7 @@ typedef int (*vhost_reset_device_op)(struct vhost_dev *dev);
 typedef int (*vhost_get_vq_index_op)(struct vhost_dev *dev, int idx);
 typedef int (*vhost_set_vring_enable_op)(struct vhost_dev *dev,
                                          int enable);
+typedef int (*vhost_set_vhost_pci_op)(struct vhost_dev *dev, uint8_t cmd);
 typedef bool (*vhost_requires_shm_log_op)(struct vhost_dev *dev);
 typedef int (*vhost_migration_done_op)(struct vhost_dev *dev,
                                        char *mac_addr);
@@ -102,6 +103,7 @@ typedef struct VhostOps {
     vhost_reset_device_op vhost_reset_device;
     vhost_get_vq_index_op vhost_get_vq_index;
     vhost_set_vring_enable_op vhost_set_vring_enable;
+    vhost_set_vhost_pci_op vhost_set_vhost_pci;
     vhost_requires_shm_log_op vhost_requires_shm_log;
     vhost_migration_done_op vhost_migration_done;
     vhost_backend_can_merge_op vhost_backend_can_merge;
include/net/vhost_net.h +2 -0
index 5a08eff..82d5987 100644
@@ -35,4 +35,6 @@ int vhost_set_vring_enable(NetClientState * nc, int enable);
 
 uint64_t vhost_net_get_acked_features(VHostNetState *net);
 
+int vhost_set_vhost_pci(NetClientState *nc, uint8_t cmd);
+
 #endif
Signature · 1 line
2.7.4
author
#32 lore raw

PATCH 32/37 vhost-user: add asynchronous read for the vhost-user master

In reply to Wei Wang

Enable the vhost-user master to asynchronously receive messages from the slave.

---
 hw/virtio/vhost-user.c         | 42 +++++++++++++++++++++++++++++++++++++++++-
 include/hw/virtio/vhost-user.h |  4 ++++
 include/net/vhost-user.h       |  4 ++++
 net/vhost-user.c               | 20 ++++++++++++++++++--
 4 files changed, 67 insertions(+), 3 deletions(-)
hw/virtio/vhost-user.c +41 -1
index ce92140..800b8ed 100644
@@ -14,7 +14,7 @@
 #include "hw/virtio/vhost-backend.h"
 #include "hw/virtio/vhost-user.h"
 #include "hw/virtio/virtio-net.h"
-#include "sysemu/char.h"
+#include "net/vhost-user.h"
 #include "sysemu/kvm.h"
 #include "qemu/error-report.h"
 #include "qemu/sockets.h"
@@ -75,6 +75,46 @@ fail:
     return -1;
 }
 
+int vhost_user_can_read(void *opaque)
+{
+    return VHOST_USER_HDR_SIZE;
+}
+
+void vhost_user_asyn_read(void *opaque, const uint8_t *buf, int size)
+{
+    const char *name = opaque;
+    VhostUserMsg msg;
+    uint8_t *p = (uint8_t *) &msg;
+    CharBackend *chr_be = net_name_to_chr_be(name);
+
+    if (size != VHOST_USER_HDR_SIZE) {
+        error_report("Wrong message size received %d\n", size);
+        return;
+    }
+
+    memcpy(p, buf, VHOST_USER_HDR_SIZE);
+
+    if (msg.size) {
+        p += VHOST_USER_HDR_SIZE;
+        size = qemu_chr_fe_read_all(chr_be, p, msg.size);
+        if (size != msg.size) {
+            error_report("Wrong message size received %d != %d\n",
+                           size, msg.size);
+            return;
+        }
+    }
+
+    if (msg.request > VHOST_USER_MAX)
+        error_report("vhost-user master read incorrect msg \n");
+
+    switch(msg.request) {
+    default:
+        error_report("vhost-user master does not support msg request = %d\n",
+                     msg.request);
+        break;
+    }
+}
+
 static int process_message_reply(struct vhost_dev *dev,
                                  VhostUserRequest request)
 {
include/hw/virtio/vhost-user.h +4 -0
index 12e4dc9..142ea52 100644
@@ -102,4 +102,8 @@ static VhostUserMsg m __attribute__ ((unused));
 /* The version of the protocol we support */
 #define VHOST_USER_VERSION    (0x1)
 
+int vhost_user_can_read(void *opaque);
+
+void vhost_user_asyn_read(void *opaque, const uint8_t *buf, int size);
+
 #endif
include/net/vhost-user.h +4 -0
index d9e328d..1bb5f1a 100644
@@ -11,8 +11,12 @@
 #ifndef NET_VHOST_USER_H
 #define NET_VHOST_USER_H
 
+#include "sysemu/char.h"
+
 struct vhost_net;
 struct vhost_net *vhost_user_get_vhost_net(NetClientState *nc);
 uint64_t vhost_user_get_acked_features(NetClientState *nc);
 
+CharBackend *net_name_to_chr_be(const char *name);
+
 #endif /* VHOST_USER_H */
net/vhost-user.c +18 -2
index 7aff77e..58eee6a 100644
@@ -12,7 +12,7 @@
 #include "clients.h"
 #include "net/vhost_net.h"
 #include "net/vhost-user.h"
-#include "sysemu/char.h"
+#include "hw/virtio/vhost-user.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 #include "qmp-commands.h"
@@ -190,6 +190,22 @@ static gboolean net_vhost_user_watch(GIOChannel *chan, GIOCondition cond,
     return FALSE;
 }
 
+CharBackend *net_name_to_chr_be(const char *name)
+{
+    NetClientState *ncs[MAX_QUEUE_NUM];
+    VhostUserState *s;
+    int queues;
+
+    queues = qemu_find_net_clients_except(name, ncs,
+                                          NET_CLIENT_DRIVER_NIC,
+                                          MAX_QUEUE_NUM);
+    assert(queues < MAX_QUEUE_NUM);
+
+    s = DO_UPCAST(VhostUserState, nc, ncs[0]);
+
+    return &s->chr;
+}
+
 static void net_vhost_user_event(void *opaque, int event)
 {
     const char *name = opaque;
@@ -265,7 +281,7 @@ static int net_vhost_user_init(NetClientState *peer, const char *device,
             error_report_err(err);
             return -1;
         }
-        qemu_chr_fe_set_handlers(&s->chr, NULL, NULL,
+        qemu_chr_fe_set_handlers(&s->chr, vhost_user_can_read, vhost_user_asyn_read,
                                  net_vhost_user_event, nc0->name, NULL, true);
     } while (!s->started);
 
Signature · 1 line
2.7.4
author
#33 lore raw

PATCH 33/37 vhost-pci-net: send the negotiated feature bits to the master

In reply to Wei Wang

The slave actively sends the negotiated feature bits to the master. "need_send" is used to detect if the 64-bit feature bits are ready to be sent.

---
 hw/net/vhost-pci-net.c              | 12 ++++++++++++
 hw/virtio/vhost-pci-slave.c         | 21 +++++++++++++++++++++
 include/hw/virtio/vhost-pci-slave.h |  2 ++
 3 files changed, 35 insertions(+)
hw/net/vhost-pci-net.c +12 -0
index 0198686..567fb86 100644
@@ -15,6 +15,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/iov.h"
+#include "qemu/error-report.h"
 #include "hw/virtio/virtio-access.h"
 #include "hw/virtio/vhost-pci-net.h"
 
@@ -136,6 +137,17 @@ static uint64_t vpnet_get_features(VirtIODevice *vdev, uint64_t features, Error
 
 static void vpnet_set_features(VirtIODevice *vdev, uint64_t features)
 {
+    static bool need_send;
+    int ret;
+
+    if (need_send) {
+        need_send = 0;
+        ret = vp_slave_send_feature_bits(features);
+        if (ret < 0)
+            error_report("failed to send feature bits to the master");
+    } else {
+        need_send = 1;
+    }
 }
 
 static void vpnet_get_config(VirtIODevice *vdev, uint8_t *config)
hw/virtio/vhost-pci-slave.c +21 -0
index 427d618..d3c3443 100644
@@ -85,6 +85,27 @@ static void vp_slave_set_features(VhostUserMsg *msg)
                              & ~(1 << VHOST_USER_F_PROTOCOL_FEATURES);
 }
 
+static int vp_slave_send_u64(int request, uint64_t u64)
+{
+    VhostUserMsg msg = {
+        .request = request,
+        .flags = VHOST_USER_VERSION,
+        .payload.u64 = u64,
+        .size = sizeof(msg.payload.u64),
+    };
+
+    if (vp_slave_write(&vp_slave->chr_be, &msg) < 0) {
+        return -1;
+    }
+
+    return 0;
+}
+
+int vp_slave_send_feature_bits(uint64_t features)
+{
+    return vp_slave_send_u64(VHOST_USER_SET_FEATURES, features);
+}
+
 static DeviceState *virtio_to_pci_dev(VirtIODevice *vdev, uint16_t virtio_id)
 {
     DeviceState *qdev;
include/hw/virtio/vhost-pci-slave.h +2 -0
index 79e1ffd..e60580a 100644
@@ -40,4 +40,6 @@ extern int vhost_pci_slave_init(QemuOpts *opts);
 
 extern int vhost_pci_slave_cleanup(void);
 
+extern int vp_slave_send_feature_bits(uint64_t features);
+
 #endif
Signature · 1 line
2.7.4
author
#34 lore raw

PATCH 34/37 vhost-pci-slave: add "peer_reset"

In reply to Wei Wang

Setting "peer_reset" flags that the peer device is about to be reset. This happens when the slave side device driver only accepts a subset of the feature bits offered by the peer device.

The peer device is expected to have a second run of the vhost-user protocol for the re-setup.

---
 hw/net/vhost-pci-net.c              |  4 ++++
 hw/virtio/vhost-pci-slave.c         | 17 +++++++++++++++--
 include/hw/virtio/vhost-pci-slave.h |  1 +
 3 files changed, 20 insertions(+), 2 deletions(-)
hw/net/vhost-pci-net.c +4 -0
index 567fb86..6d4db6c 100644
@@ -141,6 +141,10 @@ static void vpnet_set_features(VirtIODevice *vdev, uint64_t features)
     int ret;
 
     if (need_send) {
+        if (vp_slave->feature_bits != features) {
+            vp_slave->feature_bits = features;
+            vp_slave->peer_reset = 1;
+        }
         need_send = 0;
         ret = vp_slave_send_feature_bits(features);
         if (ret < 0)
hw/virtio/vhost-pci-slave.c +15 -2
index d3c3443..5cfa335 100644
@@ -37,6 +37,14 @@ static void vp_slave_cleanup(void)
     if (!vp_slave->vdev)
         return;
 
+    /*
+     * if this cleanup is not invoked due to peer reset, re-initialize
+     * the feature bits, so that the slave can work with a new master
+     */
+    if (!vp_slave->peer_reset)
+        vp_slave->feature_bits =
+                1ULL << VHOST_USER_F_PROTOCOL_FEATURES;
+
     nregions = vp_slave->pmem_msg.nregions;
     for (i = 0; i < nregions; i++) {
         ret = munmap(vp_slave->mr_map_base[i], vp_slave->mr_map_size[i]);
@@ -163,8 +171,10 @@ static void vp_slave_set_device_type(VhostUserMsg *msg)
 
     switch (vp_slave->dev_type) {
     case VIRTIO_ID_NET:
-        vp_slave->feature_bits |= (VHOST_PCI_FEATURE_BITS
-                                   | VHOST_PCI_NET_FEATURE_BITS);
+        /* Don't initialize the feature bits if they have been negotiated */
+        if (!vp_slave->peer_reset)
+            vp_slave->feature_bits |= (VHOST_PCI_FEATURE_BITS
+                                       | VHOST_PCI_NET_FEATURE_BITS);
         break;
     default:
         error_report("device type %d is not supported", vp_slave->dev_type);
@@ -351,6 +361,8 @@ static int vp_slave_set_vhost_pci(CharBackend *chr_be, VhostUserMsg *msg)
 
     switch (cmd) {
     case VHOST_USER_SET_VHOST_PCI_start:
+        if (vp_slave->peer_reset)
+            vp_slave->peer_reset = 0;
         ret = vp_slave_device_create(vp_slave->dev_type);
         if (ret < 0)
             return ret;
@@ -519,6 +531,7 @@ int vhost_pci_slave_init(QemuOpts *opts)
     vp_slave->sub_mr = NULL;
     QLIST_INIT(&vp_slave->pvq_list);
     vp_slave->pvq_num = 0;
+    vp_slave->peer_reset = 0;
     qemu_chr_fe_init(&vp_slave->chr_be, chr, &error_abort);
     qemu_chr_fe_set_handlers(&vp_slave->chr_be, vp_slave_can_read,
                              vp_slave_read, vp_slave_event,
include/hw/virtio/vhost-pci-slave.h +1 -0
index e60580a..dd78ed4 100644
@@ -21,6 +21,7 @@ typedef struct VhostPCISlave {
     CharBackend chr_be;
     /* Ponnter to the slave device */
     VirtIODevice *vdev;
+    bool peer_reset;
     uint16_t dev_type;
     uint64_t feature_bits;
     /* hotplugged memory should be mapped following the offset */
Signature · 1 line
2.7.4
author
#35 lore raw

PATCH 35/37 vhost-pci-net: start the vhost-pci-net device

In reply to Wei Wang

If the peer device on the other side doesn't need to be reset, then start the device when DRIVER_OK is received.

---
 hw/net/vhost-pci-net.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
hw/net/vhost-pci-net.c +15 -0
index 6d4db6c..75ee72c 100644
@@ -22,6 +22,16 @@
 #define VPNET_CQ_SIZE 32
 #define VPNET_RQ_SIZE 256
 
+static void vpnet_set_link_up(VhostPCINet *vpnet)
+{
+    VirtIODevice *vdev = VIRTIO_DEVICE(vpnet);
+    uint16_t old_status = vpnet->status;
+
+    vpnet->status |= VPNET_S_LINK_UP;
+    if (vpnet->status != old_status)
+        virtio_notify_config(vdev);
+}
+
 void vpnet_set_peer_vq_num(VhostPCINet *vpnet, uint16_t num)
 {
     vpnet->peer_vq_num = num;
@@ -125,6 +135,11 @@ static void vpnet_set_status(struct VirtIODevice *vdev, uint8_t status)
     if (status & VIRTIO_CONFIG_S_DRIVER_OK) {
         vpnet_send_peer_mem_msg(vpnet);
         vpnet_send_peer_vq_msg(vpnet);
+        /* If the peer device is not reset, start the device now */
+        if (!vp_slave->peer_reset) {
+            vdev->status = status;
+            vpnet_set_link_up(vpnet);
+        }
     }
 }
 
Signature · 1 line
2.7.4
author
#36 lore raw

PATCH 36/37 vhost-user/msg: handling VHOST_USER_SET_FEATURES

In reply to Wei Wang

If the featuer bits sent by the slave are not equal to the ones that were sent by the master, perform a reset of the master device.

---
 hw/net/vhost_net.c       |  2 ++
 hw/virtio/vhost-user.c   | 19 +++++++++++++++++++
 hw/virtio/virtio-pci.c   | 20 ++++++++++++++++++++
 hw/virtio/virtio-pci.h   |  2 ++
 include/net/vhost-user.h | 14 ++++++++++++++
 net/vhost-user.c         | 14 +++++---------
 6 files changed, 62 insertions(+), 9 deletions(-)
hw/net/vhost_net.c +2 -0
index 7f64be3..b8dbc61 100644
@@ -348,6 +348,8 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs,
             goto err_start;
     }
 
+    vhost_user_set_master_dev(ncs[0].peer, dev);
+
     return 0;
 
 err_start:
hw/virtio/vhost-user.c +19 -0
index 800b8ed..08d5e86 100644
@@ -12,6 +12,7 @@
 #include "qapi/error.h"
 #include "hw/virtio/vhost.h"
 #include "hw/virtio/vhost-backend.h"
+#include "hw/virtio/virtio-pci.h"
 #include "hw/virtio/vhost-user.h"
 #include "hw/virtio/virtio-net.h"
 #include "net/vhost-user.h"
@@ -75,6 +76,21 @@ fail:
     return -1;
 }
 
+static void handle_slave_acked_features(const char *name, VhostUserMsg *msg)
+{
+    CharBackend *chr_be = net_name_to_chr_be(name);
+    VhostUserState *s = container_of(chr_be, VhostUserState, chr);
+    VirtIODevice *vdev = s->vdev;
+    uint64_t master_features, slave_features;
+
+    master_features = vhost_net_get_acked_features(s->vhost_net)
+                      & ~(1 << VHOST_USER_F_PROTOCOL_FEATURES);
+    slave_features = msg->payload.u64;
+
+    if (master_features != slave_features)
+        master_reset_virtio_net(vdev);
+}
+
 int vhost_user_can_read(void *opaque)
 {
     return VHOST_USER_HDR_SIZE;
@@ -108,6 +124,9 @@ void vhost_user_asyn_read(void *opaque, const uint8_t *buf, int size)
         error_report("vhost-user master read incorrect msg \n");
 
     switch(msg.request) {
+    case VHOST_USER_SET_FEATURES:
+        handle_slave_acked_features(name, &msg);
+        break;
     default:
         error_report("vhost-user master does not support msg request = %d\n",
                      msg.request);
hw/virtio/virtio-pci.c +20 -0
index 20cbefc..82b2920 100644
@@ -38,6 +38,7 @@
 #include "qemu/range.h"
 #include "hw/virtio/virtio-bus.h"
 #include "qapi/visitor.h"
+#include "monitor/qdev.h"
 
 #define VIRTIO_PCI_REGION_SIZE(dev)     VIRTIO_PCI_CONFIG_OFF(msix_present(dev))
 
@@ -2257,6 +2258,25 @@ static const TypeInfo virtio_serial_pci_info = {
 
 /* virtio-net-pci */
 
+void master_reset_virtio_net(VirtIODevice *vdev)
+{
+    VirtIONet *net = VIRTIO_NET(vdev);
+    VirtIONetPCI *net_pci = container_of(net, VirtIONetPCI, vdev);
+    VirtIOPCIProxy *proxy = &net_pci->parent_obj;
+    DeviceState *qdev = DEVICE(proxy);
+    DeviceState *qdev_new;
+    Error *err = NULL;
+
+    virtio_pci_reset(qdev);
+    qdev_unplug(qdev, &err);
+    qdev->realized = false;
+    qdev_new = qdev_device_add(qdev->opts, &err);
+    if (!qdev_new) {
+        qemu_opts_del(qdev->opts);
+    }
+    object_unref(OBJECT(qdev));
+}
+
 static Property virtio_net_properties[] = {
     DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags,
                     VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, false),
hw/virtio/virtio-pci.h +2 -0
index 0b4b04f..c41c621 100644
@@ -383,4 +383,6 @@ struct VirtIOCryptoPCI {
 /* Virtio ABI version, if we increment this, we break the guest driver. */
 #define VIRTIO_PCI_ABI_VERSION          0
 
+void master_reset_virtio_net(VirtIODevice *vdev);
+
 #endif
include/net/vhost-user.h +14 -0
index 1bb5f1a..4cd14c9 100644
@@ -12,6 +12,18 @@
 #define NET_VHOST_USER_H
 
 #include "sysemu/char.h"
+#include "net/vhost_net.h"
+
+typedef struct VhostUserState {
+    NetClientState nc;
+    CharBackend chr; /* only queue index 0 */
+    VHostNetState *vhost_net;
+    guint watch;
+    uint64_t acked_features;
+    bool started;
+    /* Pointer to the master device */
+    VirtIODevice *vdev;
+} VhostUserState;
 
 struct vhost_net;
 struct vhost_net *vhost_user_get_vhost_net(NetClientState *nc);
@@ -19,4 +31,6 @@ uint64_t vhost_user_get_acked_features(NetClientState *nc);
 
 CharBackend *net_name_to_chr_be(const char *name);
 
+void vhost_user_set_master_dev(NetClientState *nc, VirtIODevice *vdev);
+
 #endif /* VHOST_USER_H */
net/vhost-user.c +5 -9
index 58eee6a..5f4b568 100644
@@ -10,7 +10,6 @@
 
 #include "qemu/osdep.h"
 #include "clients.h"
-#include "net/vhost_net.h"
 #include "net/vhost-user.h"
 #include "hw/virtio/vhost-user.h"
 #include "qemu/config-file.h"
@@ -18,14 +17,11 @@
 #include "qmp-commands.h"
 #include "trace.h"
 
-typedef struct VhostUserState {
-    NetClientState nc;
-    CharBackend chr; /* only queue index 0 */
-    VHostNetState *vhost_net;
-    guint watch;
-    uint64_t acked_features;
-    bool started;
-} VhostUserState;
+void vhost_user_set_master_dev(NetClientState *nc, VirtIODevice *vdev)
+{
+    VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc);
+    s->vdev = vdev;
+}
 
 VHostNetState *vhost_user_get_vhost_net(NetClientState *nc)
 {
Signature · 1 line
2.7.4
author
#37 lore raw

PATCH 37/37 vl: enable vhost-pci-slave

In reply to Wei Wang

Enable vhost-pci-slave in vl.c

---
 vl.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
vl.c +20 -0
index 10d7f89..6959dba 100644
@@ -123,6 +123,7 @@ int main(int argc, char **argv)
 #include "sysemu/replay.h"
 #include "qapi/qmp/qerror.h"
 #include "sysemu/iothread.h"
+#include "hw/virtio/vhost-pci-slave.h"
 
 #define MAX_VIRTIO_CONSOLES 1
 #define MAX_SCLP_CONSOLES 1
@@ -180,6 +181,7 @@ bool boot_strict;
 uint8_t *boot_splash_filedata;
 size_t boot_splash_filedata_size;
 uint8_t qemu_extra_params_fw[2];
+bool vhost_pci_slave_enabled;
 
 int icount_align_option;
 
@@ -4064,6 +4066,7 @@ int main(int argc, char **argv, char **envp)
                 if (!opts) {
                     exit(1);
                 }
+                vhost_pci_slave_enabled = true;
                 break;
             default:
                 os_parse_cmd_args(popt->index, optarg);
@@ -4581,6 +4584,16 @@ int main(int argc, char **argv, char **envp)
         exit(1);
     }
 
+    /* check if the vhost-pci-server is enabled */
+    if (vhost_pci_slave_enabled) {
+        int ret;
+        ret = vhost_pci_slave_init(qemu_opts_find(
+                                    qemu_find_opts("vhost-pci-slave"),
+                                    NULL));
+        if (ret < 0)
+            exit(1);
+    }
+
     /* init USB devices */
     if (machine_usb(current_machine)) {
         if (foreach_device_config(DEV_USB, usb_parse) < 0)
@@ -4710,6 +4723,13 @@ int main(int argc, char **argv, char **envp)
     pause_all_vcpus();
     res_free();
 
+    if (vhost_pci_slave_enabled) {
+        int ret;
+        ret = vhost_pci_slave_cleanup();
+        if (ret < 0)
+            exit(1);
+    }
+
     /* vhost-user must be cleaned up before chardevs.  */
     net_cleanup();
     audio_cleanup();
Signature · 1 line
2.7.4
#38 lore raw
In reply to Wei Wang
Your series seems to have some coding style problems. See output below for more information:

Hi,

Your series seems to have some coding style problems. See output below for more information:

Type: series
Subject: [Qemu-devel] [PATCH v1 00/37] Implementation of vhost-pci for inter-vm commucation
Message-id: [email protected]

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do

    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))

done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
b0804ed vl: enable vhost-pci-slave
6817843 vhost-user/msg: handling VHOST_USER_SET_FEATURES
5625ffb vhost-pci-net: start the vhost-pci-net device
a234ebe vhost-pci-slave: add "peer_reset"
2de6ab3 vhost-pci-net: send the negotiated feature bits to the master 4d698f6 vhost-user: add asynchronous read for the vhost-user master 25162f6 vhost-user/msg: send VHOST_USER_SET_VHOST_PCI (start/stop) bafef20 vhost-pci-slave/msg: VHOST_USER_SET_VHOST_PCI (stop) 7d9fcd4 vhost-pci-slave/msg: VHOST_USER_SET_VHOST_PCI (start) e037343 vhost-pci-net: pass the mem and vring info to the driver 9518b5d vhost-pci-net: pass the info collected by vp_slave to the device 99b1f40 vhost-pci-slave/msg: VHOST_USER_GET_VRING_BASE
976ac97 vhost-pci-slave/msg: VHOST_USER_SEND_RARP
683f514 vhost-pci-slave/msg: VHOST_USER_SET_LOG_FD
ec7ff39 vhost-pci-slave/msg: VHOST_USER_SET_LOG_BASE
597e3d1 vhost-pci-slave/msg: VHOST_USER_SET_VRING_ENABLE
96d8ed7 vhost-pci-slave/msg: VHOST_USER_SET_VRING_CALL
7bea32f vhost-pci-slave/msg: VHOST_USER_SET_VRING_KICK
78e4d19 vhost-pci-slave/msg: VHOST_USER_SET_VRING_ADDR
cad137a vhost-user: send guest physical address of virtqueues to the slave 06ca090 vhost-pci-slave/msg: VHOST_USER_SET_VRING_BASE
450f521 vhost-pci-slave/msg: VHOST_USER_SET_VRING_NUM
396bda9 vhost-pci-slave/msg: VHOST_USER_SET_MEM_TABLE
9b22d68 vhost-pci-slave/msg: VHOST_USER_SET_OWNER
c8f6463 vhost-pci-slave/msg: VHOST_USER_GET_QUEUE_NUM
2971089 vhost-pci-slave/msg: VHOST_USER_SET_DEVICE_ID
ad3e6ee vhost-user/msg: VHOST_USER_PROTOCOL_F_SET_DEVICE_ID c1cd46a vhost-pci-slave/msg: VHOST_USER_SET_PROTOCOL_FEATURES ec6ae04 vhost-pci-slave/msg: VHOST_USER_GET_PROTOCOL_FEATURES 35242dd vhost-pci-slave/msg: VHOST_USER_SET_FEATURES
ddda2fb vhost-pci-slave/msg: VHOST_USER_GET_FEATURES
b168748 vhost-pci-slave: set up the fundamental handlers for the server socket 9eaf436 vhost-pci-slave: start the implementation of vhost-pci-slave 798c50f vl: add the vhost-pci-slave command line option
2b7ed80 vhost-user: share the vhost-user protocol related structures 6b83939 vhost-pci-net: the fundamental implementation of vhost-pci-net-pci 94d5a87 vhost-pci-net: the fundamental vhost-pci-net device emulation

=== OUTPUT BEGIN ===
Checking PATCH 1/37: vhost-pci-net: the fundamental vhost-pci-net device emulation...
WARNING: line over 80 characters
#64: FILE: hw/net/vhost-pci-net.c:35:
+static uint64_t vpnet_get_features(VirtIODevice *vdev, uint64_t features, Error **errp)

ERROR: space required after that ',' (ctx:VxV)
#103: FILE: hw/net/vhost-pci-net.c:74:
+ vpnet->rqs[i] = virtio_add_queue(vdev,VPNET_RQ_SIZE,

                                              ^

ERROR: braces {} are necessary even for single statement blocks #115: FILE: hw/net/vhost-pci-net.c:86:
+ for (i = 0; i < rq_num + 2; i++)
+ virtio_del_queue(vdev, i);

total: 2 errors, 1 warnings, 256 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 2/37: vhost-pci-net: the fundamental implementation of vhost-pci-net-pci... Checking PATCH 3/37: vhost-user: share the vhost-user protocol related structures...
ERROR: spaces required around that '<<' (ctx:VxV)
#189: FILE: include/hw/virtio/vhost-user.h:66:
+#define VHOST_USER_REPLY_MASK (0x1<<2)

                                         ^

ERROR: spaces required around that '<<' (ctx:VxV)
#195: FILE: include/hw/virtio/vhost-user.h:72:
+#define VHOST_USER_VRING_NOFD_MASK (0x1<<8)

                                         ^

total: 2 errors, 0 warnings, 200 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 4/37: vl: add the vhost-pci-slave command line option...
ERROR: line over 90 characters
#67: FILE: vl.c:4063:
+ opts = qemu_opts_parse_noisily(qemu_find_opts("vhost-pci-slave"), optarg, false);

total: 1 errors, 0 warnings, 49 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 5/37: vhost-pci-slave: start the implementation of vhost-pci-slave... Argument "m" isn't numeric in numeric eq (==) at ./scripts/checkpatch.pl line 2459. Argument "m" isn't numeric in numeric eq (==) at ./scripts/checkpatch.pl line 2459. Use of uninitialized value $1 in concatenation (.) or string at ./scripts/checkpatch.pl line 2460.
ERROR: unnecessary cast may hide bugs, use g_new instead
#66: FILE: hw/virtio/vhost-pci-slave.c:37:
+ vp_slave = (VhostPCISlave *)g_malloc(sizeof(VhostPCISlave));

total: 1 errors, 0 warnings, 76 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 6/37: vhost-pci-slave: set up the fundamental handlers for the server socket...
ERROR: braces {} are necessary for all arms of this statement
#60: FILE: hw/virtio/vhost-pci-slave.c:60:
+ if (msg.request > VHOST_USER_MAX)
[...]

ERROR: space required before the open parenthesis '(' #63: FILE: hw/virtio/vhost-pci-slave.c:63:
+ switch(msg.request) {

total: 2 errors, 0 warnings, 68 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 7/37: vhost-pci-slave/msg: VHOST_USER_GET_FEATURES...
ERROR: Macros with complex values should be enclosed in parenthesis #26: FILE: hw/virtio/vhost-pci-slave.c:23:
+#define VHOST_PCI_NET_FEATURE_BITS (1ULL << VIRTIO_NET_F_MRG_RXBUF) | \
+ (1ULL << VIRTIO_NET_F_CTRL_VQ) | \
+ (1ULL << VIRTIO_NET_F_MQ)

ERROR: braces {} are necessary for all arms of this statement #36: FILE: hw/virtio/vhost-pci-slave.c:33:
+ if (!msg)
[...]

ERROR: braces {} are necessary for all arms of this statement #73: FILE: hw/virtio/vhost-pci-slave.c:98:
+ if (ret < 0)
[...]

total: 3 errors, 0 warnings, 83 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 8/37: vhost-pci-slave/msg: VHOST_USER_SET_FEATURES... Checking PATCH 9/37: vhost-pci-slave/msg: VHOST_USER_GET_PROTOCOL_FEATURES...
WARNING: line over 80 characters
#21: FILE: hw/virtio/vhost-pci-slave.c:70:
+static int vp_slave_get_protocol_features(CharBackend *chr_be, VhostUserMsg *msg)

ERROR: braces {} are necessary for all arms of this statement #39: FILE: hw/virtio/vhost-pci-slave.c:122:
+ if (ret < 0)
[...]

ERROR: spaces required around that '=' (ctx:WxV)
#53: FILE: include/hw/virtio/vhost-user.h:14:
+ VHOST_USER_PROTOCOL_F_VHOST_PCI =4,

                                     ^

ERROR: Macros with complex values should be enclosed in parenthesis #60: FILE: include/hw/virtio/vhost-user.h:21:
+#define VHOST_USER_PROTOCOL_FEATURES ((1ULL << VHOST_USER_PROTOCOL_F_MQ) | \

+                                      (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) | \
+                                      (1ULL << VHOST_USER_PROTOCOL_F_RARP)) | \
+                                      (1ULL << VHOST_USER_PROTOCOL_F_VHOST_PCI)

WARNING: line over 80 characters
#61: FILE: include/hw/virtio/vhost-user.h:22:
+ (1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD) | \

total: 3 errors, 2 warnings, 44 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 10/37: vhost-pci-slave/msg: VHOST_USER_SET_PROTOCOL_FEATURES... Checking PATCH 11/37: vhost-user/msg: VHOST_USER_PROTOCOL_F_SET_DEVICE_ID...
WARNING: line over 80 characters
#54: FILE: hw/virtio/vhost-user.c:524:
+ if (dev->protocol_features & (1ULL << VHOST_USER_PROTOCOL_F_SET_DEVICE_ID)) {

WARNING: line over 80 characters
#81: FILE: include/hw/virtio/vhost-user.h:25:
+ (1ULL << VHOST_USER_PROTOCOL_F_VHOST_PCI) | \

WARNING: line over 80 characters
#82: FILE: include/hw/virtio/vhost-user.h:26:
+ (1ULL << VHOST_USER_PROTOCOL_F_SET_DEVICE_ID)

total: 0 errors, 3 warnings, 68 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Checking PATCH 12/37: vhost-pci-slave/msg: VHOST_USER_SET_DEVICE_ID... Checking PATCH 13/37: vhost-pci-slave/msg: VHOST_USER_GET_QUEUE_NUM...
ERROR: braces {} are necessary for all arms of this statement #46: FILE: hw/virtio/vhost-pci-slave.c:163:
+ if (ret < 0)
[...]

total: 1 errors, 0 warnings, 34 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 14/37: vhost-pci-slave/msg: VHOST_USER_SET_OWNER... Checking PATCH 15/37: vhost-pci-slave/msg: VHOST_USER_SET_MEM_TABLE...
ERROR: braces {} are necessary for all arms of this statement #35: FILE: hw/virtio/vhost-pci-slave.c:37:
+ if (ret < 0)
[...]

ERROR: spaces required around that '+' (ctx:VxV)
#37: FILE: hw/virtio/vhost-pci-slave.c:39:

+        memory_region_del_subregion(vp_slave->bar_mr, vp_slave->sub_mr+i);
                                                                       ^

ERROR: braces {} are necessary for all arms of this statement #74: FILE: hw/virtio/vhost-pci-slave.c:150:
+ if (fd_num != nregions)
[...]

ERROR: braces {} are necessary for all arms of this statement #77: FILE: hw/virtio/vhost-pci-slave.c:153:
+ if (vp_slave->bar_mr == NULL)
[...]

ERROR: braces {} are necessary for all arms of this statement #79: FILE: hw/virtio/vhost-pci-slave.c:155:
+ if (vp_slave->sub_mr == NULL)
[...]

total: 5 errors, 0 warnings, 165 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 16/37: vhost-pci-slave/msg: VHOST_USER_SET_VRING_NUM... Checking PATCH 17/37: vhost-pci-slave/msg: VHOST_USER_SET_VRING_BASE... Checking PATCH 18/37: vhost-user: send guest physical address of virtqueues to the slave...
WARNING: line over 80 characters
#103: FILE: hw/virtio/vhost.c:1028:
+ cpu_physical_memory_unmap(vq->used, virtio_queue_get_used_size(vdev, idx),

WARNING: line over 80 characters
#105: FILE: hw/virtio/vhost.c:1030:
+ cpu_physical_memory_unmap(vq->avail, virtio_queue_get_avail_size(vdev, idx),

WARNING: line over 80 characters
#107: FILE: hw/virtio/vhost.c:1032:
+ cpu_physical_memory_unmap(vq->desc, virtio_queue_get_desc_size(vdev, idx),

total: 0 errors, 3 warnings, 98 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Checking PATCH 19/37: vhost-pci-slave/msg: VHOST_USER_SET_VRING_ADDR... Checking PATCH 20/37: vhost-pci-slave/msg: VHOST_USER_SET_VRING_KICK... Checking PATCH 21/37: vhost-pci-slave/msg: VHOST_USER_SET_VRING_CALL... Checking PATCH 22/37: vhost-pci-slave/msg: VHOST_USER_SET_VRING_ENABLE... Checking PATCH 23/37: vhost-pci-slave/msg: VHOST_USER_SET_LOG_BASE... Checking PATCH 24/37: vhost-pci-slave/msg: VHOST_USER_SET_LOG_FD... Checking PATCH 25/37: vhost-pci-slave/msg: VHOST_USER_SEND_RARP... Checking PATCH 26/37: vhost-pci-slave/msg: VHOST_USER_GET_VRING_BASE...
ERROR: braces {} are necessary for all arms of this statement #36: FILE: hw/virtio/vhost-pci-slave.c:334:
+ if (ret < 0)
[...]

total: 1 errors, 0 warnings, 27 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 27/37: vhost-pci-net: pass the info collected by vp_slave to the device...
ERROR: braces {} are necessary for all arms of this statement
#37: FILE: hw/net/vhost-pci-net.c:38:
+ if (vpnet->pvq_msg == NULL)
[...]

WARNING: line over 80 characters
#38: FILE: hw/net/vhost-pci-net.c:39:
+ vpnet->pvq_msg = g_malloc0(sizeof(struct peer_vq_msg) * (vring_num + 1));

total: 1 errors, 1 warnings, 93 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 28/37: vhost-pci-net: pass the mem and vring info to the driver... Checking PATCH 29/37: vhost-pci-slave/msg: VHOST_USER_SET_VHOST_PCI (start)...
ERROR: braces {} are necessary for all arms of this statement
#66: FILE: hw/virtio/vhost-pci-slave.c:298:
+ if (ret < 0)
[...]

ERROR: braces {} are necessary for all arms of this statement #86: FILE: hw/virtio/vhost-pci-slave.c:421:
+ if (ret < 0)
[...]

total: 2 errors, 0 warnings, 86 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 30/37: vhost-pci-slave/msg: VHOST_USER_SET_VHOST_PCI (stop)...
ERROR: braces {} are necessary for all arms of this statement #37: FILE: hw/virtio/vhost-pci-slave.c:37:
+ if (!vp_slave->vdev)
[...]

total: 1 errors, 0 warnings, 85 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 31/37: vhost-user/msg: send VHOST_USER_SET_VHOST_PCI (start/stop)...
ERROR: spaces required around that '-' (ctx:VxV)
#35: FILE: hw/net/vhost_net.c:343:

+    last_net = get_vhost_net(ncs[total_queues-1].peer);
                                              ^

ERROR: spaces required around that '-' (ctx:VxV)
#37: FILE: hw/net/vhost_net.c:345:
+ r = vhost_set_vhost_pci(ncs[total_queues-1].peer,

                                                 ^

ERROR: braces {} are necessary for all arms of this statement #39: FILE: hw/net/vhost_net.c:347:
+ if (r < 0)
[...]

ERROR: spaces required around that '-' (ctx:VxV)
#53: FILE: hw/net/vhost_net.c:375:

+    last_net = get_vhost_net(ncs[total_queues-1].peer);
                                              ^

ERROR: braces {} are necessary for all arms of this statement #54: FILE: hw/net/vhost_net.c:376:
+ if (vhost_pci_enabled(&last_net->dev))
[...]

ERROR: spaces required around that '-' (ctx:VxV)
#55: FILE: hw/net/vhost_net.c:377:
+ vhost_set_vhost_pci(ncs[total_queues-1].peer,

                                             ^

total: 6 errors, 0 warnings, 119 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 32/37: vhost-user: add asynchronous read for the vhost-user master...
ERROR: Error messages should not contain newlines
#42: FILE: hw/virtio/vhost-user.c:91:
+ error_report("Wrong message size received %d\n", size);

ERROR: Error messages should not contain newlines
#52: FILE: hw/virtio/vhost-user.c:101:
+ error_report("Wrong message size received %d != %d\n",

ERROR: braces {} are necessary for all arms of this statement #58: FILE: hw/virtio/vhost-user.c:107:
+ if (msg.request > VHOST_USER_MAX)
[...]

ERROR: unnecessary whitespace before a quoted newline #59: FILE: hw/virtio/vhost-user.c:108:
+ error_report("vhost-user master read incorrect msg \n");

ERROR: Error messages should not contain newlines
#59: FILE: hw/virtio/vhost-user.c:108:
+ error_report("vhost-user master read incorrect msg \n");

ERROR: space required before the open parenthesis '(' #61: FILE: hw/virtio/vhost-user.c:110:
+ switch(msg.request) {

ERROR: Error messages should not contain newlines
#63: FILE: hw/virtio/vhost-user.c:112:
+ error_report("vhost-user master does not support msg request = %d\n",

WARNING: line over 80 characters
#143: FILE: net/vhost-user.c:284:
+ qemu_chr_fe_set_handlers(&s->chr, vhost_user_can_read, vhost_user_asyn_read,

total: 7 errors, 1 warnings, 112 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 33/37: vhost-pci-net: send the negotiated feature bits to the master...
ERROR: braces {} are necessary for all arms of this statement
#35: FILE: hw/net/vhost-pci-net.c:146:
+ if (ret < 0)
[...]

total: 1 errors, 0 warnings, 57 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 34/37: vhost-pci-slave: add "peer_reset"...
ERROR: braces {} are necessary for all arms of this statement #43: FILE: hw/virtio/vhost-pci-slave.c:44:
+ if (!vp_slave->peer_reset)
[...]

ERROR: braces {} are necessary for all arms of this statement #57: FILE: hw/virtio/vhost-pci-slave.c:175:
+ if (!vp_slave->peer_reset)
[...]

ERROR: braces {} are necessary for all arms of this statement #67: FILE: hw/virtio/vhost-pci-slave.c:364:
+ if (vp_slave->peer_reset)
[...]

total: 3 errors, 0 warnings, 58 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 35/37: vhost-pci-net: start the vhost-pci-net device... Checking PATCH 36/37: vhost-user/msg: handling VHOST_USER_SET_FEATURES...
ERROR: unnecessary whitespace before a quoted newline
#60: FILE: hw/virtio/vhost-user.c:124:

         error_report("vhost-user master read incorrect msg \n");

total: 1 errors, 0 warnings, 133 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 37/37: vl: enable vhost-pci-slave...
ERROR: braces {} are necessary for all arms of this statement #63: FILE: vl.c:4729:
+ if (ret < 0)
[...]

total: 1 errors, 0 warnings, 50 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1

---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]

#39 lore raw
In reply to Wei Wang
Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally.

Hi,

Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally.

Type: series
Subject: [Qemu-devel] [PATCH v1 00/37] Implementation of vhost-pci for inter-vm commucation
Message-id: [email protected]

=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
# Let docker tests dump environment info
export SHOW_ENV=1
export J=16
make docker-test-quick@centos6
make docker-test-mingw@fedora
make docker-test-build@min-glib
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
b0804ed vl: enable vhost-pci-slave
6817843 vhost-user/msg: handling VHOST_USER_SET_FEATURES
5625ffb vhost-pci-net: start the vhost-pci-net device
a234ebe vhost-pci-slave: add "peer_reset"
2de6ab3 vhost-pci-net: send the negotiated feature bits to the master 4d698f6 vhost-user: add asynchronous read for the vhost-user master 25162f6 vhost-user/msg: send VHOST_USER_SET_VHOST_PCI (start/stop) bafef20 vhost-pci-slave/msg: VHOST_USER_SET_VHOST_PCI (stop) 7d9fcd4 vhost-pci-slave/msg: VHOST_USER_SET_VHOST_PCI (start) e037343 vhost-pci-net: pass the mem and vring info to the driver 9518b5d vhost-pci-net: pass the info collected by vp_slave to the device 99b1f40 vhost-pci-slave/msg: VHOST_USER_GET_VRING_BASE
976ac97 vhost-pci-slave/msg: VHOST_USER_SEND_RARP
683f514 vhost-pci-slave/msg: VHOST_USER_SET_LOG_FD
ec7ff39 vhost-pci-slave/msg: VHOST_USER_SET_LOG_BASE
597e3d1 vhost-pci-slave/msg: VHOST_USER_SET_VRING_ENABLE
96d8ed7 vhost-pci-slave/msg: VHOST_USER_SET_VRING_CALL
7bea32f vhost-pci-slave/msg: VHOST_USER_SET_VRING_KICK
78e4d19 vhost-pci-slave/msg: VHOST_USER_SET_VRING_ADDR
cad137a vhost-user: send guest physical address of virtqueues to the slave 06ca090 vhost-pci-slave/msg: VHOST_USER_SET_VRING_BASE
450f521 vhost-pci-slave/msg: VHOST_USER_SET_VRING_NUM
396bda9 vhost-pci-slave/msg: VHOST_USER_SET_MEM_TABLE
9b22d68 vhost-pci-slave/msg: VHOST_USER_SET_OWNER
c8f6463 vhost-pci-slave/msg: VHOST_USER_GET_QUEUE_NUM
2971089 vhost-pci-slave/msg: VHOST_USER_SET_DEVICE_ID
ad3e6ee vhost-user/msg: VHOST_USER_PROTOCOL_F_SET_DEVICE_ID c1cd46a vhost-pci-slave/msg: VHOST_USER_SET_PROTOCOL_FEATURES ec6ae04 vhost-pci-slave/msg: VHOST_USER_GET_PROTOCOL_FEATURES 35242dd vhost-pci-slave/msg: VHOST_USER_SET_FEATURES
ddda2fb vhost-pci-slave/msg: VHOST_USER_GET_FEATURES
b168748 vhost-pci-slave: set up the fundamental handlers for the server socket 9eaf436 vhost-pci-slave: start the implementation of vhost-pci-slave 798c50f vl: add the vhost-pci-slave command line option
2b7ed80 vhost-user: share the vhost-user protocol related structures 6b83939 vhost-pci-net: the fundamental implementation of vhost-pci-net-pci 94d5a87 vhost-pci-net: the fundamental vhost-pci-net device emulation

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc' Cloning into 'dtc'...
Submodule path 'dtc': checked out '65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf'
BUILD centos6
make[1]: Entering directory `/var/tmp/patchew-tester-tmp-ff527md2/src'
ARCHIVE qemu.tgz
ARCHIVE dtc.tgz
COPY RUNNER
RUN test-quick in qemu:centos6
Packages installed:
SDL-devel-1.2.14-7.el6_7.1.x86_64
ccache-3.1.6-2.el6.x86_64
epel-release-6-8.noarch
gcc-4.4.7-17.el6.x86_64
git-1.7.1-4.el6_7.1.x86_64
glib2-devel-2.28.8-5.el6.x86_64
libfdt-devel-1.4.0-1.el6.x86_64
make-3.81-23.el6.x86_64
package g++ is not installed
pixman-devel-0.32.8-1.el6.x86_64
tar-1.23-15.el6_8.x86_64
zlib-devel-1.2.3-29.el6.x86_64

Environment variables:
PACKAGES=libfdt-devel ccache tar git make gcc g++ zlib-devel glib2-devel SDL-devel pixman-devel epel-release
HOSTNAME=583fb81d8e2e
TERM=xterm
MAKEFLAGS= -j16
HISTSIZE=1000
J=16
USER=root
CCACHE_DIR=/var/tmp/ccache
EXTRA_CONFIGURE_OPTS=
V=
SHOW_ENV=1
MAIL=/var/spool/mail/root PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PWD=/
LANG=en_US.UTF-8
TARGET_LIST=
HISTCONTROL=ignoredups
SHLVL=1
HOME=/root
TEST_DIR=/tmp/qemu-test
LOGNAME=root
LESSOPEN=||/usr/bin/lesspipe.sh %s
FEATURES= dtc
DEBUG=
G_BROKEN_FILENAMES=1
CCACHE_HASHDIR=
_=/usr/bin/env

Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/var/tmp/qemu-build/install No C++ compiler available; disabling C++ specific optional code

Install prefix    /var/tmp/qemu-build/install
BIOS directory    /var/tmp/qemu-build/install/share/qemu
binary directory  /var/tmp/qemu-build/install/bin

library directory /var/tmp/qemu-build/install/lib module directory /var/tmp/qemu-build/install/lib/qemu libexec directory /var/tmp/qemu-build/install/libexec include directory /var/tmp/qemu-build/install/include config directory /var/tmp/qemu-build/install/etc
local state directory /var/tmp/qemu-build/install/var
Manual directory /var/tmp/qemu-build/install/share/man ELF interp prefix /usr/gnemul/qemu-%M

Source path       /tmp/qemu-test/src
C compiler        cc
Host C compiler   cc
C++ compiler      
Objective-C compiler cc
ARFLAGS           rv
CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS       -I/usr/include/pixman-1    -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all
LDFLAGS           -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g 
make              make
install           install
python            python -B
smbd              /usr/sbin/smbd
module support    no
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu aarch64-softmmu
tcg debug enabled no
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
pixman            system
SDL support       yes (1.2.14)
GTK support       no 
GTK GL support    no
VTE support       no 
TLS priority      NORMAL
GNUTLS support    no
GNUTLS rnd        no
libgcrypt         no
libgcrypt kdf     no
nettle            no 
nettle kdf        no
libtasn1          no
curses support    no
virgl support     no
curl support      no
mingw32 support   no
Audio drivers     oss
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    no
VNC support       yes
VNC SASL support  no
VNC JPEG support  no
VNC PNG support   no
xen support       no
brlapi support    no
bluez  support    no
Documentation     no
PIE               yes
vde support       no
netmap support    no
Linux AIO support no
ATTR/XATTR support yes
Install blobs     yes
KVM support       yes
COLO support      yes
RDMA support      no
TCG interpreter   no
fdt support       yes
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes

libcap-ng support no
vhost-net support yes
vhost-scsi support yes
vhost-vsock support yes

Trace backends    log
spice support     no 
rbd support       no
xfsctl support    no
smartcard support no
libusb            no
usb net redir     no
OpenGL support    no
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no

build guest agent yes
QGA VSS support no
QGA w32 disk info no
QGA MSI support no
seccomp support no
coroutine backend ucontext
coroutine pool yes
debug stack usage no
GlusterFS support no
Archipelago support no

gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   no
TPM passthrough   yes
QOM debugging     yes
lzo support       no
snappy support    no
bzip2 support     no

NUMA host support no
tcmalloc support no
jemalloc support no
avx2 optimization no
replication support yes

  GEN     x86_64-softmmu/config-devices.mak.tmp
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     config-host.h
  GEN     qemu-options.def
  GEN     qmp-commands.h
  GEN     qapi-types.h
  GEN     qapi-visit.h
  GEN     qapi-event.h
  GEN     qmp-introspect.h
  GEN     x86_64-softmmu/config-devices.mak
  GEN     aarch64-softmmu/config-devices.mak
  GEN     module_block.h
  GEN     tests/test-qapi-types.h
  GEN     tests/test-qapi-visit.h
  GEN     tests/test-qmp-commands.h
  GEN     tests/test-qapi-event.h
  GEN     tests/test-qmp-introspect.h
  GEN     config-all-devices.mak
  GEN     trace/generated-tracers.h
  GEN     trace/generated-tcg-tracers.h
  GEN     trace/generated-helpers-wrappers.h
  GEN     trace/generated-helpers.h
  CC      tests/qemu-iotests/socket_scm_helper.o
  GEN     qga/qapi-generated/qga-qmp-commands.h
  GEN     qga/qapi-generated/qga-qapi-types.h
  GEN     qga/qapi-generated/qga-qapi-visit.h
  GEN     qga/qapi-generated/qga-qapi-types.c
  GEN     qga/qapi-generated/qga-qapi-visit.c
  GEN     qga/qapi-generated/qga-qmp-marshal.c
  GEN     qmp-introspect.c
  GEN     qapi-types.c
  GEN     qapi-visit.c
  GEN     qapi-event.c
  CC      qapi/qapi-visit-core.o
  CC      qapi/qapi-dealloc-visitor.o
  CC      qapi/qobject-input-visitor.o
  CC      qapi/qobject-output-visitor.o
  CC      qapi/qmp-registry.o
  CC      qapi/qmp-dispatch.o
  CC      qapi/string-input-visitor.o
  CC      qapi/string-output-visitor.o
  CC      qapi/opts-visitor.o
  CC      qapi/qapi-clone-visitor.o
  CC      qapi/qmp-event.o
  CC      qapi/qapi-util.o
  CC      qobject/qnull.o
  CC      qobject/qint.o
  CC      qobject/qstring.o
  CC      qobject/qdict.o
  CC      qobject/qlist.o
  CC      qobject/qfloat.o
  CC      qobject/qbool.o
  CC      qobject/qjson.o
  CC      qobject/qobject.o
  CC      qobject/json-lexer.o
  CC      qobject/json-streamer.o
  CC      qobject/json-parser.o
  GEN     trace/generated-tracers.c
  CC      trace/control.o
  CC      trace/qmp.o
  CC      util/osdep.o
  CC      util/cutils.o
  CC      util/unicode.o
  CC      util/qemu-timer-common.o
  CC      util/bufferiszero.o
  CC      util/compatfd.o
  CC      util/event_notifier-posix.o
  CC      util/mmap-alloc.o
  CC      util/oslib-posix.o
  CC      util/qemu-openpty.o
  CC      util/qemu-thread-posix.o
  CC      util/memfd.o
  CC      util/envlist.o
  CC      util/path.o
  CC      util/module.o
  CC      util/bitmap.o
  CC      util/bitops.o
  CC      util/hbitmap.o
  CC      util/fifo8.o
  CC      util/acl.o
  CC      util/error.o
  CC      util/qemu-error.o
  CC      util/id.o
  CC      util/iov.o
  CC      util/qemu-config.o
  CC      util/qemu-sockets.o
  CC      util/uri.o
  CC      util/notify.o
  CC      util/qemu-option.o
  CC      util/qemu-progress.o
  CC      util/hexdump.o
  CC      util/crc32c.o
  CC      util/uuid.o
  CC      util/throttle.o
  CC      util/getauxval.o
  CC      util/readline.o
  CC      util/rcu.o
  CC      util/qemu-coroutine.o
  CC      util/qemu-coroutine-lock.o
  CC      util/qemu-coroutine-io.o
  CC      util/qemu-coroutine-sleep.o
  CC      util/coroutine-ucontext.o
  CC      util/buffer.o
  CC      util/timed-average.o
  CC      util/base64.o
  CC      util/log.o
  CC      util/qdist.o
  CC      util/qht.o
  CC      util/range.o
  CC      crypto/pbkdf-stub.o
  CC      stubs/arch-query-cpu-def.o
  CC      stubs/arch-query-cpu-model-expansion.o
  CC      stubs/arch-query-cpu-model-comparison.o
  CC      stubs/arch-query-cpu-model-baseline.o
  CC      stubs/bdrv-next-monitor-owned.o
  CC      stubs/blk-commit-all.o
  CC      stubs/blockdev-close-all-bdrv-states.o
  CC      stubs/clock-warp.o
  CC      stubs/cpu-get-clock.o
  CC      stubs/cpu-get-icount.o
  CC      stubs/dump.o
  CC      stubs/error-printf.o
  CC      stubs/fdset-add-fd.o
  CC      stubs/fdset-find-fd.o
  CC      stubs/fdset-get-fd.o
  CC      stubs/fdset-remove-fd.o
  CC      stubs/gdbstub.o
  CC      stubs/get-fd.o
  CC      stubs/get-next-serial.o
  CC      stubs/get-vm-name.o
  CC      stubs/iothread.o
  CC      stubs/iothread-lock.o
  CC      stubs/is-daemonized.o
  CC      stubs/machine-init-done.o
  CC      stubs/migr-blocker.o
  CC      stubs/mon-is-qmp.o
  CC      stubs/monitor-init.o
  CC      stubs/notify-event.o
  CC      stubs/qtest.o
  CC      stubs/replay.o
  CC      stubs/replay-user.o
  CC      stubs/reset.o
  CC      stubs/runstate-check.o
  CC      stubs/set-fd-handler.o
  CC      stubs/slirp.o
  CC      stubs/sysbus.o
  CC      stubs/trace-control.o
  CC      stubs/uuid.o
  CC      stubs/vm-stop.o
  CC      stubs/vmstate.o
  CC      stubs/cpus.o
  CC      stubs/kvm.o
  CC      stubs/qmp_pc_dimm_device_list.o
  CC      stubs/target-monitor-defs.o
  CC      stubs/target-get-monitor-def.o
  CC      stubs/vhost.o
  CC      stubs/iohandler.o
  CC      stubs/smbios_type_38.o
  CC      stubs/ipmi.o
  CC      stubs/pc_madt_cpu_entry.o
  CC      stubs/migration-colo.o
  CC      contrib/ivshmem-client/ivshmem-client.o
  CC      contrib/ivshmem-client/main.o
  CC      contrib/ivshmem-server/ivshmem-server.o
  CC      contrib/ivshmem-server/main.o
  CC      qemu-nbd.o
  CC      async.o
  CC      thread-pool.o
  CC      block.o
  CC      blockjob.o
  CC      main-loop.o
  CC      iohandler.o
  CC      qemu-timer.o
  CC      aio-posix.o
  CC      qemu-io-cmds.o
  CC      replication.o
  CC      block/raw_bsd.o
  CC      block/qcow.o
  CC      block/vdi.o
  CC      block/vmdk.o
  CC      block/cloop.o
  CC      block/bochs.o
  CC      block/vpc.o
  CC      block/dmg.o
  CC      block/vvfat.o
  CC      block/qcow2.o
  CC      block/qcow2-refcount.o
  CC      block/qcow2-cluster.o
  CC      block/qcow2-snapshot.o
  CC      block/qed.o
  CC      block/qcow2-cache.o
  CC      block/qed-gencb.o
  CC      block/qed-l2-cache.o
  CC      block/qed-table.o
  CC      block/qed-cluster.o
  CC      block/qed-check.o
  CC      block/vhdx.o
  CC      block/vhdx-endian.o
  CC      block/vhdx-log.o
  CC      block/quorum.o
  CC      block/parallels.o
  CC      block/blkdebug.o
  CC      block/blkverify.o
  CC      block/blkreplay.o
  CC      block/block-backend.o
  CC      block/snapshot.o
  CC      block/qapi.o
  CC      block/raw-posix.o
  CC      block/null.o
  CC      block/mirror.o
  CC      block/commit.o
  CC      block/io.o
  CC      block/throttle-groups.o
  CC      block/nbd.o
  CC      block/nbd-client.o
  CC      block/sheepdog.o
  CC      block/accounting.o
  CC      block/dirty-bitmap.o
  CC      block/write-threshold.o
  CC      block/backup.o
  CC      block/replication.o
  CC      block/crypto.o
  CC      nbd/server.o
  CC      nbd/client.o
  CC      crypto/init.o
  CC      nbd/common.o
  CC      crypto/hash.o
  CC      crypto/hash-glib.o
  CC      crypto/aes.o
  CC      crypto/desrfb.o
  CC      crypto/cipher.o
  CC      crypto/tlscreds.o
  CC      crypto/tlscredsanon.o
  CC      crypto/tlscredsx509.o
  CC      crypto/tlssession.o
  CC      crypto/secret.o
  CC      crypto/random-platform.o
  CC      crypto/pbkdf.o
  CC      crypto/ivgen-essiv.o
  CC      crypto/ivgen.o
  CC      crypto/ivgen-plain.o
  CC      crypto/ivgen-plain64.o
  CC      crypto/xts.o
  CC      crypto/afsplit.o
  CC      crypto/block.o
  CC      crypto/block-luks.o
  CC      crypto/block-qcow.o
  CC      io/channel.o
  CC      io/channel-buffer.o
  CC      io/channel-command.o
  CC      io/channel-file.o
  CC      io/channel-socket.o
  CC      io/channel-tls.o
  CC      io/channel-watch.o
  CC      io/channel-websock.o
  CC      io/channel-util.o
  CC      io/task.o
  CC      qom/object.o
  CC      qom/container.o
  CC      qom/object_interfaces.o
  CC      qom/qom-qobject.o
  GEN     qemu-img-cmds.h
  CC      qemu-io.o
  CC      qemu-bridge-helper.o
  CC      blockdev.o
  CC      blockdev-nbd.o
  CC      iothread.o
  CC      qdev-monitor.o
  CC      device-hotplug.o
  CC      os-posix.o
  CC      qemu-char.o
  CC      page_cache.o
  CC      accel.o
  CC      bt-host.o
  CC      bt-vhci.o
  CC      dma-helpers.o
  CC      vl.o
  CC      tpm.o
  CC      device_tree.o
  GEN     qmp-marshal.c
  CC      qmp.o
  CC      hmp.o
  CC      audio/audio.o
  CC      cpus-common.o
  CC      audio/noaudio.o
  CC      audio/wavaudio.o
  CC      audio/mixeng.o
  CC      audio/sdlaudio.o
  CC      audio/ossaudio.o
  CC      audio/wavcapture.o
  CC      backends/rng.o
  CC      backends/rng-egd.o
  CC      backends/testdev.o
  CC      backends/rng-random.o
  CC      backends/msmouse.o
  CC      backends/hostmem.o
  CC      backends/tpm.o
  CC      backends/hostmem-ram.o
  CC      backends/hostmem-file.o
  CC      backends/cryptodev.o
  CC      backends/cryptodev-builtin.o
  CC      block/stream.o
  CC      disas/arm.o
  CC      disas/i386.o
  CC      fsdev/qemu-fsdev-dummy.o
  CC      fsdev/qemu-fsdev-opts.o
  CC      hw/acpi/core.o
  CC      hw/acpi/piix4.o
  CC      hw/acpi/pcihp.o
  CC      hw/acpi/tco.o
  CC      hw/acpi/ich9.o
  CC      hw/acpi/cpu_hotplug.o
  CC      hw/acpi/memory_hotplug.o
  CC      hw/acpi/memory_hotplug_acpi_table.o
  CC      hw/acpi/cpu.o
  CC      hw/acpi/nvdimm.o
  CC      hw/acpi/acpi_interface.o
  CC      hw/acpi/bios-linker-loader.o
  CC      hw/acpi/aml-build.o
  CC      hw/acpi/ipmi.o
  CC      hw/audio/sb16.o
  CC      hw/audio/es1370.o
  CC      hw/audio/ac97.o
  CC      hw/audio/fmopl.o
  CC      hw/audio/adlib.o
  CC      hw/audio/gus.o
  CC      hw/audio/gusemu_hal.o
  CC      hw/audio/gusemu_mixer.o
  CC      hw/audio/cs4231a.o
  CC      hw/audio/intel-hda.o
  CC      hw/audio/hda-codec.o
  CC      hw/audio/pcspk.o
  CC      hw/audio/wm8750.o
  CC      hw/audio/pl041.o
  CC      hw/audio/lm4549.o
  CC      hw/audio/marvell_88w8618.o
  CC      hw/block/block.o
  CC      hw/block/cdrom.o
  CC      hw/block/hd-geometry.o
  CC      hw/block/fdc.o
  CC      hw/block/m25p80.o
  CC      hw/block/nand.o
  CC      hw/block/pflash_cfi01.o
  CC      hw/block/pflash_cfi02.o
  CC      hw/block/ecc.o
  CC      hw/block/onenand.o
  CC      hw/block/nvme.o
  CC      hw/bt/core.o
  CC      hw/bt/l2cap.o
  CC      hw/bt/sdp.o
  CC      hw/bt/hci.o
  CC      hw/bt/hid.o
  CC      hw/bt/hci-csr.o
  CC      hw/char/ipoctal232.o
  CC      hw/char/parallel.o
  CC      hw/char/pl011.o
  CC      hw/char/serial.o
  CC      hw/char/serial-isa.o
  CC      hw/char/serial-pci.o
  CC      hw/char/virtio-console.o
  CC      hw/char/cadence_uart.o
  CC      hw/char/debugcon.o
  CC      hw/char/imx_serial.o
  CC      hw/core/qdev.o
  CC      hw/core/qdev-properties.o
  CC      hw/core/bus.o
  CC      hw/core/fw-path-provider.o
  CC      hw/core/irq.o
  CC      hw/core/hotplug.o
  CC      hw/core/ptimer.o
  CC      hw/core/sysbus.o
  CC      hw/core/machine.o
  CC      hw/core/null-machine.o
  CC      hw/core/loader.o
  CC      hw/core/qdev-properties-system.o
  CC      hw/core/register.o
  CC      hw/core/or-irq.o
  CC      hw/core/platform-bus.o
  CC      hw/display/ads7846.o
  CC      hw/display/cirrus_vga.o
  CC      hw/display/pl110.o
  CC      hw/display/ssd0303.o
  CC      hw/display/ssd0323.o
  CC      hw/display/vga-pci.o
  CC      hw/display/vga-isa.o
  CC      hw/display/vmware_vga.o
  CC      hw/display/blizzard.o
  CC      hw/display/exynos4210_fimd.o
  CC      hw/display/framebuffer.o
  CC      hw/display/tc6393xb.o
  CC      hw/dma/pl080.o
  CC      hw/dma/pl330.o
  CC      hw/dma/i8257.o
  CC      hw/dma/xlnx-zynq-devcfg.o
  CC      hw/gpio/max7310.o
  CC      hw/gpio/pl061.o
  CC      hw/gpio/zaurus.o
  CC      hw/gpio/gpio_key.o
  CC      hw/i2c/core.o
  CC      hw/i2c/smbus.o
  CC      hw/i2c/smbus_eeprom.o
  CC      hw/i2c/i2c-ddc.o
  CC      hw/i2c/versatile_i2c.o
  CC      hw/i2c/smbus_ich9.o
  CC      hw/i2c/pm_smbus.o
  CC      hw/i2c/bitbang_i2c.o
  CC      hw/i2c/exynos4210_i2c.o
  CC      hw/i2c/imx_i2c.o
  CC      hw/i2c/aspeed_i2c.o
  CC      hw/ide/core.o
  CC      hw/ide/atapi.o
  CC      hw/ide/qdev.o
  CC      hw/ide/pci.o
  CC      hw/ide/isa.o
  CC      hw/ide/piix.o
  CC      hw/ide/microdrive.o
  CC      hw/ide/ahci.o
  CC      hw/ide/ich.o
  CC      hw/input/hid.o
  CC      hw/input/lm832x.o
  CC      hw/input/pckbd.o
  CC      hw/input/pl050.o
  CC      hw/input/ps2.o
  CC      hw/input/stellaris_input.o
  CC      hw/input/tsc2005.o
  CC      hw/input/vmmouse.o
  CC      hw/input/virtio-input.o
  CC      hw/input/virtio-input-hid.o
  CC      hw/input/virtio-input-host.o
  CC      hw/intc/i8259_common.o
  CC      hw/intc/i8259.o
  CC      hw/intc/pl190.o
  CC      hw/intc/imx_avic.o
  CC      hw/intc/realview_gic.o
  CC      hw/intc/ioapic_common.o
  CC      hw/intc/arm_gic_common.o
  CC      hw/intc/arm_gic.o
  CC      hw/intc/arm_gicv2m.o
  CC      hw/intc/arm_gicv3_common.o
  CC      hw/intc/arm_gicv3.o
  CC      hw/intc/arm_gicv3_dist.o
  CC      hw/intc/arm_gicv3_redist.o
  CC      hw/intc/intc.o
  CC      hw/intc/arm_gicv3_its_common.o
  CC      hw/ipack/ipack.o
  CC      hw/ipack/tpci200.o
  CC      hw/ipmi/ipmi.o
  CC      hw/ipmi/ipmi_bmc_sim.o
  CC      hw/ipmi/ipmi_bmc_extern.o
  CC      hw/ipmi/isa_ipmi_kcs.o
  CC      hw/ipmi/isa_ipmi_bt.o
  CC      hw/isa/isa-bus.o
  CC      hw/isa/apm.o
  CC      hw/mem/pc-dimm.o
  CC      hw/mem/nvdimm.o
  CC      hw/misc/applesmc.o
  CC      hw/misc/max111x.o
  CC      hw/misc/tmp105.o
  CC      hw/misc/debugexit.o
  CC      hw/misc/sga.o
  CC      hw/misc/pc-testdev.o
  CC      hw/misc/pci-testdev.o
  CC      hw/misc/arm_l2x0.o
  CC      hw/misc/arm_integrator_debug.o
  CC      hw/misc/a9scu.o
  CC      hw/misc/arm11scu.o
  CC      hw/net/ne2000.o
  CC      hw/net/eepro100.o
  CC      hw/net/pcnet-pci.o
  CC      hw/net/pcnet.o
  CC      hw/net/e1000.o
  CC      hw/net/e1000x_common.o
  CC      hw/net/net_rx_pkt.o
  CC      hw/net/net_tx_pkt.o
  CC      hw/net/e1000e.o
  CC      hw/net/e1000e_core.o
  CC      hw/net/rtl8139.o
  CC      hw/net/vmxnet3.o
  CC      hw/net/smc91c111.o
  CC      hw/net/lan9118.o
  CC      hw/net/ne2000-isa.o
  CC      hw/net/xgmac.o
  CC      hw/net/allwinner_emac.o
  CC      hw/net/imx_fec.o
  CC      hw/net/cadence_gem.o
  CC      hw/net/stellaris_enet.o
  CC      hw/net/rocker/rocker.o
  CC      hw/net/rocker/rocker_fp.o
  CC      hw/net/rocker/rocker_desc.o
  CC      hw/net/rocker/rocker_world.o
  CC      hw/net/rocker/rocker_of_dpa.o
  CC      hw/nvram/eeprom93xx.o
  CC      hw/nvram/fw_cfg.o
/tmp/qemu-test/src/hw/nvram/fw_cfg.c: In function ‘fw_cfg_dma_transfer’:
/tmp/qemu-test/src/hw/nvram/fw_cfg.c:329: warning: ‘read’ may be used uninitialized in this function
  CC      hw/nvram/chrp_nvram.o
  CC      hw/pci-bridge/pci_bridge_dev.o
  CC      hw/pci-bridge/pci_expander_bridge.o
  CC      hw/pci-bridge/xio3130_upstream.o
  CC      hw/pci-bridge/xio3130_downstream.o
  CC      hw/pci-bridge/ioh3420.o
  CC      hw/pci-bridge/i82801b11.o
  CC      hw/pci-host/pam.o
  CC      hw/pci-host/versatile.o
  CC      hw/pci-host/piix.o
  CC      hw/pci-host/q35.o
  CC      hw/pci-host/gpex.o
  CC      hw/pci/pci.o
  CC      hw/pci/pci_bridge.o
  CC      hw/pci/msix.o
  CC      hw/pci/msi.o
  CC      hw/pci/shpc.o
  CC      hw/pci/slotid_cap.o
  CC      hw/pci/pci_host.o
  CC      hw/pci/pcie_host.o
  CC      hw/pci/pcie.o
  CC      hw/pci/pcie_aer.o
  CC      hw/pci/pcie_port.o
  CC      hw/pci/pci-stub.o
  CC      hw/pcmcia/pcmcia.o
  CC      hw/scsi/scsi-generic.o
  CC      hw/scsi/scsi-disk.o
  CC      hw/scsi/scsi-bus.o
  CC      hw/scsi/lsi53c895a.o
  CC      hw/scsi/mptsas.o
  CC      hw/scsi/mptconfig.o
  CC      hw/scsi/mptendian.o
  CC      hw/scsi/megasas.o
  CC      hw/scsi/vmw_pvscsi.o
  CC      hw/scsi/esp.o
  CC      hw/scsi/esp-pci.o
  CC      hw/sd/pl181.o
  CC      hw/sd/ssi-sd.o
  CC      hw/sd/sd.o
  CC      hw/sd/core.o
  CC      hw/sd/sdhci.o
  CC      hw/smbios/smbios.o
  CC      hw/smbios/smbios_type_38.o
  CC      hw/ssi/pl022.o
  CC      hw/ssi/ssi.o
  CC      hw/ssi/xilinx_spips.o
  CC      hw/ssi/aspeed_smc.o
  CC      hw/ssi/stm32f2xx_spi.o
  CC      hw/timer/arm_timer.o
  CC      hw/timer/arm_mptimer.o
  CC      hw/timer/a9gtimer.o
  CC      hw/timer/cadence_ttc.o
  CC      hw/timer/ds1338.o
  CC      hw/timer/hpet.o
  CC      hw/timer/i8254_common.o
  CC      hw/timer/i8254.o
  CC      hw/timer/pl031.o
  CC      hw/timer/twl92230.o
  CC      hw/timer/imx_epit.o
  CC      hw/timer/imx_gpt.o
  CC      hw/timer/stm32f2xx_timer.o
  CC      hw/timer/aspeed_timer.o
  CC      hw/tpm/tpm_tis.o
  CC      hw/tpm/tpm_passthrough.o
  CC      hw/tpm/tpm_util.o
  CC      hw/usb/core.o
  CC      hw/usb/combined-packet.o
  CC      hw/usb/bus.o
  CC      hw/usb/libhw.o
  CC      hw/usb/desc.o
  CC      hw/usb/desc-msos.o
  CC      hw/usb/hcd-uhci.o
  CC      hw/usb/hcd-ohci.o
  CC      hw/usb/hcd-ehci.o
  CC      hw/usb/hcd-ehci-pci.o
  CC      hw/usb/hcd-ehci-sysbus.o
  CC      hw/usb/hcd-xhci.o
  CC      hw/usb/hcd-musb.o
  CC      hw/usb/dev-hub.o
  CC      hw/usb/dev-hid.o
  CC      hw/usb/dev-wacom.o
  CC      hw/usb/dev-storage.o
  CC      hw/usb/dev-uas.o
  CC      hw/usb/dev-audio.o
  CC      hw/usb/dev-serial.o
  CC      hw/usb/dev-network.o
  CC      hw/usb/dev-bluetooth.o
  CC      hw/usb/dev-smartcard-reader.o
  CC      hw/usb/dev-mtp.o
  CC      hw/usb/host-stub.o
  CC      hw/virtio/virtio-rng.o
  CC      hw/virtio/virtio-pci.o
  CC      hw/virtio/virtio-bus.o
  CC      hw/virtio/virtio-mmio.o
  CC      hw/virtio/vhost-pci-slave.o
  CC      hw/watchdog/watchdog.o
  CC      hw/watchdog/wdt_i6300esb.o
  CC      hw/watchdog/wdt_ib700.o
  CC      migration/migration.o
  CC      migration/socket.o
  CC      migration/fd.o
  CC      migration/exec.o
  CC      migration/tls.o
  CC      migration/colo-comm.o
  CC      migration/colo.o
  CC      migration/colo-failover.o
  CC      migration/vmstate.o
  CC      migration/qemu-file.o
  CC      migration/qemu-file-channel.o
  CC      migration/xbzrle.o
  CC      migration/postcopy-ram.o
  CC      migration/qjson.o
  CC      migration/block.o
  CC      net/net.o
  CC      net/queue.o
  CC      net/checksum.o
  CC      net/util.o
  CC      net/hub.o
  CC      net/socket.o
  CC      net/dump.o
  CC      net/eth.o
  CC      net/l2tpv3.o
  CC      net/tap.o
  CC      net/vhost-user.o
  CC      net/tap-linux.o
  CC      net/slirp.o
  CC      net/filter.o
  CC      net/filter-buffer.o
  CC      net/filter-mirror.o
/tmp/qemu-test/src/hw/virtio/vhost-pci-slave.c: In function ‘vp_slave_device_del’:
/tmp/qemu-test/src/hw/virtio/vhost-pci-slave.c:119: warning: ‘qdev’ may be used uninitialized in this function
/tmp/qemu-test/src/hw/virtio/vhost-pci-slave.c:119: note: ‘qdev’ was declared here
  CC      net/colo-compare.o
  CC      net/colo.o
  CC      net/filter-rewriter.o
  CC      qom/cpu.o
  CC      replay/replay.o
  CC      replay/replay-internal.o
  CC      replay/replay-time.o
  CC      replay/replay-events.o
/tmp/qemu-test/src/replay/replay-internal.c: In function ‘replay_put_array’:
/tmp/qemu-test/src/replay/replay-internal.c:65: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
  CC      replay/replay-input.o
  CC      replay/replay-char.o
  CC      replay/replay-snapshot.o
  CC      slirp/cksum.o
  CC      slirp/if.o
  CC      slirp/ip_icmp.o
  CC      slirp/ip6_icmp.o
  CC      slirp/ip6_input.o
  CC      slirp/ip6_output.o
  CC      slirp/ip_input.o
  CC      slirp/ip_output.o
  CC      slirp/dnssearch.o
  CC      slirp/dhcpv6.o
  CC      slirp/slirp.o
  CC      slirp/mbuf.o
  CC      slirp/misc.o
  CC      slirp/sbuf.o
  CC      slirp/socket.o
  CC      slirp/tcp_input.o
  CC      slirp/tcp_output.o
  CC      slirp/tcp_subr.o
  CC      slirp/tcp_timer.o
  CC      slirp/udp.o
  CC      slirp/tftp.o
  CC      slirp/udp6.o
  CC      slirp/bootp.o
  CC      slirp/arp_table.o

/tmp/qemu-test/src/slirp/tcp_input.c: In function ‘tcp_input’:
/tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_p’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_len’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_tos’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_id’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_off’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_ttl’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_sum’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_src.s_addr’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:219: warning: ‘save_ip.ip_dst.s_addr’ may be used uninitialized in this function /tmp/qemu-test/src/slirp/tcp_input.c:220: warning: ‘save_ip6.ip_nh’ may be used uninitialized in this function

  CC      slirp/ndp_table.o
  CC      ui/keymaps.o
  CC      ui/console.o
  CC      ui/cursor.o
  CC      ui/qemu-pixman.o
  CC      ui/input.o
  CC      ui/input-keymap.o
  CC      ui/input-legacy.o
  CC      ui/input-linux.o
  CC      ui/sdl.o
  CC      ui/sdl_zoom.o
  CC      ui/x_keymap.o
  CC      ui/vnc.o
  CC      ui/vnc-enc-zlib.o
  CC      ui/vnc-enc-hextile.o
  CC      ui/vnc-palette.o
  CC      ui/vnc-enc-tight.o
  CC      ui/vnc-auth-vencrypt.o
  CC      ui/vnc-enc-zrle.o
  CC      ui/vnc-ws.o
  CC      ui/vnc-jobs.o
  LINK    tests/qemu-iotests/socket_scm_helper
  CC      qga/commands.o
  CC      qga/guest-agent-command-state.o
  CC      qga/main.o
  CC      qga/commands-posix.o
  CC      qga/channel-posix.o
  CC      qga/qapi-generated/qga-qapi-types.o
  CC      qga/qapi-generated/qga-qapi-visit.o
  CC      qga/qapi-generated/qga-qmp-marshal.o
  CC      qmp-introspect.o
  CC      qapi-types.o
  CC      qapi-visit.o
  CC      qapi-event.o
  CC      qemu-img.o
  AR      libqemustub.a
  CC      qmp-marshal.o
  CC      trace/generated-tracers.o
  AR      libqemuutil.a
  AS      optionrom/linuxboot.o
  AS      optionrom/multiboot.o
  CC      optionrom/linuxboot_dma.o
  AS      optionrom/kvmvapic.o
cc unrecognized option '-no-integrated-as'
cc unrecognized option '-no-integrated-as'
  BUILD   optionrom/linuxboot_dma.img
  BUILD   optionrom/linuxboot_dma.raw
  BUILD   optionrom/linuxboot.img
  SIGN    optionrom/linuxboot_dma.bin
  BUILD   optionrom/multiboot.img
  BUILD   optionrom/kvmvapic.img
  BUILD   optionrom/linuxboot.raw
  BUILD   optionrom/multiboot.raw
  BUILD   optionrom/kvmvapic.raw
  SIGN    optionrom/linuxboot.bin
  SIGN    optionrom/multiboot.bin
  SIGN    optionrom/kvmvapic.bin
  LINK    qemu-ga
  LINK    ivshmem-client
  LINK    ivshmem-server
  LINK    qemu-nbd
  LINK    qemu-img
  LINK    qemu-io
  LINK    qemu-bridge-helper
  GEN     x86_64-softmmu/hmp-commands.h
  GEN     x86_64-softmmu/hmp-commands-info.h
  GEN     x86_64-softmmu/config-target.h
  GEN     aarch64-softmmu/config-target.h
  GEN     aarch64-softmmu/hmp-commands.h
  GEN     aarch64-softmmu/hmp-commands-info.h
  CC      x86_64-softmmu/translate-all.o
  CC      x86_64-softmmu/exec.o
  CC      x86_64-softmmu/cpu-exec.o
  CC      x86_64-softmmu/translate-common.o
  CC      x86_64-softmmu/cpu-exec-common.o
  CC      x86_64-softmmu/tcg/tcg.o
  CC      x86_64-softmmu/tcg/tcg-op.o
  CC      x86_64-softmmu/tcg/optimize.o
  CC      x86_64-softmmu/tcg/tcg-common.o
  CC      x86_64-softmmu/fpu/softfloat.o
  CC      x86_64-softmmu/disas.o
  CC      x86_64-softmmu/tcg-runtime.o
  CC      x86_64-softmmu/arch_init.o
  CC      x86_64-softmmu/cpus.o
  CC      x86_64-softmmu/monitor.o
  CC      x86_64-softmmu/gdbstub.o
  CC      x86_64-softmmu/balloon.o
  CC      x86_64-softmmu/ioport.o
  CC      x86_64-softmmu/numa.o
  CC      x86_64-softmmu/qtest.o
  CC      x86_64-softmmu/bootdevice.o
  CC      x86_64-softmmu/kvm-all.o
  CC      x86_64-softmmu/memory.o
  CC      x86_64-softmmu/cputlb.o
  CC      x86_64-softmmu/memory_mapping.o
  CC      x86_64-softmmu/dump.o
  CC      x86_64-softmmu/migration/ram.o
  CC      x86_64-softmmu/migration/savevm.o
  CC      x86_64-softmmu/xen-common-stub.o
  CC      x86_64-softmmu/xen-hvm-stub.o
  CC      x86_64-softmmu/hw/block/virtio-blk.o
  CC      x86_64-softmmu/hw/block/dataplane/virtio-blk.o
  CC      x86_64-softmmu/hw/char/virtio-serial-bus.o
  CC      x86_64-softmmu/hw/core/nmi.o
  CC      x86_64-softmmu/hw/core/generic-loader.o
  CC      x86_64-softmmu/hw/cpu/core.o
  CC      x86_64-softmmu/hw/display/vga.o
  CC      x86_64-softmmu/hw/display/virtio-gpu.o
  CC      aarch64-softmmu/exec.o
  CC      aarch64-softmmu/translate-all.o
  CC      x86_64-softmmu/hw/display/virtio-gpu-3d.o
  CC      aarch64-softmmu/cpu-exec.o
  CC      aarch64-softmmu/translate-common.o
  CC      x86_64-softmmu/hw/display/virtio-gpu-pci.o
  CC      aarch64-softmmu/cpu-exec-common.o
  CC      aarch64-softmmu/tcg/tcg.o
  CC      x86_64-softmmu/hw/display/virtio-vga.o
  CC      x86_64-softmmu/hw/intc/apic.o
  CC      x86_64-softmmu/hw/intc/apic_common.o
  CC      x86_64-softmmu/hw/intc/ioapic.o
  CC      x86_64-softmmu/hw/isa/lpc_ich9.o
  CC      aarch64-softmmu/tcg/tcg-op.o
  CC      x86_64-softmmu/hw/misc/vmport.o
  CC      aarch64-softmmu/tcg/optimize.o
  CC      aarch64-softmmu/tcg/tcg-common.o
  CC      x86_64-softmmu/hw/misc/ivshmem.o
  CC      aarch64-softmmu/fpu/softfloat.o
  CC      aarch64-softmmu/disas.o
  CC      x86_64-softmmu/hw/misc/pvpanic.o
  CC      aarch64-softmmu/tcg-runtime.o
  CC      x86_64-softmmu/hw/misc/edu.o
  GEN     aarch64-softmmu/gdbstub-xml.c
  CC      x86_64-softmmu/hw/misc/hyperv_testdev.o
  CC      x86_64-softmmu/hw/net/virtio-net.o
  CC      aarch64-softmmu/kvm-stub.o
  CC      aarch64-softmmu/arch_init.o
  CC      aarch64-softmmu/cpus.o
  CC      aarch64-softmmu/monitor.o
  CC      x86_64-softmmu/hw/net/vhost-pci-net.o
  CC      aarch64-softmmu/gdbstub.o
  CC      x86_64-softmmu/hw/net/vhost_net.o
  CC      aarch64-softmmu/balloon.o
  CC      aarch64-softmmu/ioport.o
  CC      x86_64-softmmu/hw/scsi/virtio-scsi.o
  CC      aarch64-softmmu/numa.o
  CC      aarch64-softmmu/qtest.o
  CC      aarch64-softmmu/bootdevice.o
  CC      x86_64-softmmu/hw/scsi/virtio-scsi-dataplane.o
  CC      x86_64-softmmu/hw/scsi/vhost-scsi.o
  CC      x86_64-softmmu/hw/timer/mc146818rtc.o
  CC      aarch64-softmmu/memory.o
  CC      x86_64-softmmu/hw/vfio/common.o
  CC      x86_64-softmmu/hw/vfio/pci.o
  CC      x86_64-softmmu/hw/vfio/pci-quirks.o
  CC      x86_64-softmmu/hw/vfio/platform.o
  CC      x86_64-softmmu/hw/vfio/calxeda-xgmac.o
  CC      aarch64-softmmu/cputlb.o
  CC      aarch64-softmmu/memory_mapping.o
  CC      aarch64-softmmu/dump.o
  CC      aarch64-softmmu/migration/ram.o
  CC      aarch64-softmmu/migration/savevm.o
  CC      aarch64-softmmu/xen-common-stub.o
  CC      x86_64-softmmu/hw/vfio/amd-xgbe.o
  CC      aarch64-softmmu/xen-hvm-stub.o
  CC      aarch64-softmmu/hw/adc/stm32f2xx_adc.o
  CC      x86_64-softmmu/hw/vfio/spapr.o
  CC      x86_64-softmmu/hw/virtio/virtio.o
  CC      aarch64-softmmu/hw/block/virtio-blk.o
  CC      aarch64-softmmu/hw/block/dataplane/virtio-blk.o
  CC      aarch64-softmmu/hw/char/exynos4210_uart.o
  CC      aarch64-softmmu/hw/char/omap_uart.o
  CC      aarch64-softmmu/hw/char/digic-uart.o
  CC      aarch64-softmmu/hw/char/stm32f2xx_usart.o
  CC      x86_64-softmmu/hw/virtio/virtio-balloon.o
  CC      x86_64-softmmu/hw/virtio/vhost.o
  CC      x86_64-softmmu/hw/virtio/vhost-backend.o
  CC      x86_64-softmmu/hw/virtio/vhost-user.o
  CC      aarch64-softmmu/hw/char/bcm2835_aux.o
  CC      x86_64-softmmu/hw/virtio/vhost-vsock.o
  CC      x86_64-softmmu/hw/virtio/virtio-crypto.o
  CC      x86_64-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      x86_64-softmmu/hw/i386/multiboot.o
  CC      aarch64-softmmu/hw/char/virtio-serial-bus.o
  CC      aarch64-softmmu/hw/core/nmi.o
  CC      aarch64-softmmu/hw/core/generic-loader.o
  CC      x86_64-softmmu/hw/i386/pc.o
  CC      x86_64-softmmu/hw/i386/pc_piix.o
  CC      x86_64-softmmu/hw/i386/pc_q35.o
  CC      x86_64-softmmu/hw/i386/pc_sysfw.o
  CC      aarch64-softmmu/hw/cpu/arm11mpcore.o
  CC      aarch64-softmmu/hw/cpu/realview_mpcore.o
  CC      aarch64-softmmu/hw/cpu/a9mpcore.o
  CC      x86_64-softmmu/hw/i386/x86-iommu.o
  CC      aarch64-softmmu/hw/cpu/a15mpcore.o
  CC      x86_64-softmmu/hw/i386/intel_iommu.o
  CC      x86_64-softmmu/hw/i386/amd_iommu.o
  CC      aarch64-softmmu/hw/cpu/core.o
  CC      aarch64-softmmu/hw/display/omap_dss.o
  CC      x86_64-softmmu/hw/i386/kvmvapic.o
  CC      x86_64-softmmu/hw/i386/acpi-build.o
  CC      x86_64-softmmu/hw/i386/pci-assign-load-rom.o
  CC      x86_64-softmmu/hw/i386/kvm/clock.o
  CC      x86_64-softmmu/hw/i386/kvm/apic.o
  CC      x86_64-softmmu/hw/i386/kvm/i8259.o
  CC      x86_64-softmmu/hw/i386/kvm/ioapic.o
  CC      x86_64-softmmu/hw/i386/kvm/i8254.o
  CC      x86_64-softmmu/hw/i386/kvm/pci-assign.o
  CC      x86_64-softmmu/target-i386/translate.o
  CC      aarch64-softmmu/hw/display/omap_lcdc.o
/tmp/qemu-test/src/hw/i386/pc_piix.c: In function ‘igd_passthrough_isa_bridge_create’:
/tmp/qemu-test/src/hw/i386/pc_piix.c:1046: warning: ‘pch_rev_id’ may be used uninitialized in this function
  CC      aarch64-softmmu/hw/display/pxa2xx_lcd.o
  CC      aarch64-softmmu/hw/display/bcm2835_fb.o
  CC      aarch64-softmmu/hw/display/vga.o
  CC      x86_64-softmmu/target-i386/helper.o
  CC      aarch64-softmmu/hw/display/virtio-gpu.o
  CC      aarch64-softmmu/hw/display/virtio-gpu-3d.o
  CC      aarch64-softmmu/hw/display/virtio-gpu-pci.o
  CC      aarch64-softmmu/hw/display/dpcd.o
  CC      aarch64-softmmu/hw/display/xlnx_dp.o
  CC      aarch64-softmmu/hw/dma/xlnx_dpdma.o
  CC      aarch64-softmmu/hw/dma/omap_dma.o
  CC      aarch64-softmmu/hw/dma/soc_dma.o
  CC      aarch64-softmmu/hw/dma/pxa2xx_dma.o
  CC      x86_64-softmmu/target-i386/cpu.o
  CC      aarch64-softmmu/hw/dma/bcm2835_dma.o
  CC      aarch64-softmmu/hw/gpio/omap_gpio.o
  CC      x86_64-softmmu/target-i386/bpt_helper.o
  CC      aarch64-softmmu/hw/gpio/imx_gpio.o
  CC      aarch64-softmmu/hw/i2c/omap_i2c.o
  CC      aarch64-softmmu/hw/input/pxa2xx_keypad.o
  CC      x86_64-softmmu/target-i386/excp_helper.o
  CC      aarch64-softmmu/hw/input/tsc210x.o
  CC      aarch64-softmmu/hw/intc/armv7m_nvic.o
  CC      aarch64-softmmu/hw/intc/exynos4210_gic.o
  CC      x86_64-softmmu/target-i386/fpu_helper.o
  CC      aarch64-softmmu/hw/intc/exynos4210_combiner.o
  CC      x86_64-softmmu/target-i386/cc_helper.o
  CC      aarch64-softmmu/hw/intc/omap_intc.o
  CC      aarch64-softmmu/hw/intc/bcm2835_ic.o
  CC      x86_64-softmmu/target-i386/int_helper.o
  CC      x86_64-softmmu/target-i386/svm_helper.o
  CC      x86_64-softmmu/target-i386/smm_helper.o
  CC      x86_64-softmmu/target-i386/misc_helper.o
  CC      aarch64-softmmu/hw/intc/bcm2836_control.o
  CC      aarch64-softmmu/hw/intc/allwinner-a10-pic.o
  CC      x86_64-softmmu/target-i386/mem_helper.o
  CC      aarch64-softmmu/hw/intc/aspeed_vic.o
  CC      aarch64-softmmu/hw/intc/arm_gicv3_cpuif.o
  CC      aarch64-softmmu/hw/misc/ivshmem.o
  CC      x86_64-softmmu/target-i386/seg_helper.o
  CC      aarch64-softmmu/hw/misc/arm_sysctl.o
  CC      aarch64-softmmu/hw/misc/cbus.o
  CC      aarch64-softmmu/hw/misc/exynos4210_pmu.o
  CC      x86_64-softmmu/target-i386/mpx_helper.o
  CC      x86_64-softmmu/target-i386/gdbstub.o
  CC      x86_64-softmmu/target-i386/machine.o
  CC      x86_64-softmmu/target-i386/arch_memory_mapping.o
  CC      x86_64-softmmu/target-i386/arch_dump.o
  CC      x86_64-softmmu/target-i386/monitor.o
  CC      aarch64-softmmu/hw/misc/imx_ccm.o
  CC      x86_64-softmmu/target-i386/kvm.o
  CC      aarch64-softmmu/hw/misc/imx31_ccm.o
  CC      x86_64-softmmu/target-i386/hyperv.o
  CC      aarch64-softmmu/hw/misc/imx25_ccm.o
  CC      aarch64-softmmu/hw/misc/imx6_ccm.o
  GEN     trace/generated-helpers.c
  CC      x86_64-softmmu/trace/control-target.o
  CC      aarch64-softmmu/hw/misc/imx6_src.o
  CC      aarch64-softmmu/hw/misc/mst_fpga.o
  CC      aarch64-softmmu/hw/misc/omap_clk.o
  CC      aarch64-softmmu/hw/misc/omap_l4.o
  CC      aarch64-softmmu/hw/misc/omap_gpmc.o
  CC      aarch64-softmmu/hw/misc/omap_sdrc.o
  CC      aarch64-softmmu/hw/misc/omap_tap.o
  CC      aarch64-softmmu/hw/misc/bcm2835_mbox.o
  CC      aarch64-softmmu/hw/misc/bcm2835_property.o
  CC      aarch64-softmmu/hw/misc/zynq_slcr.o
  CC      aarch64-softmmu/hw/misc/stm32f2xx_syscfg.o
  CC      aarch64-softmmu/hw/misc/zynq-xadc.o
  CC      aarch64-softmmu/hw/misc/edu.o
  CC      aarch64-softmmu/hw/misc/auxbus.o
  CC      aarch64-softmmu/hw/misc/aspeed_scu.o
  CC      aarch64-softmmu/hw/misc/aspeed_sdmc.o
  CC      aarch64-softmmu/hw/net/virtio-net.o
  CC      aarch64-softmmu/hw/net/vhost-pci-net.o
  CC      aarch64-softmmu/hw/net/vhost_net.o
  CC      aarch64-softmmu/hw/pcmcia/pxa2xx.o
  CC      aarch64-softmmu/hw/scsi/virtio-scsi.o
  CC      aarch64-softmmu/hw/scsi/virtio-scsi-dataplane.o
/tmp/qemu-test/src/hw/i386/acpi-build.c: In function ‘build_append_pci_bus_devices’:
/tmp/qemu-test/src/hw/i386/acpi-build.c:501: warning: ‘notify_method’ may be used uninitialized in this function
  CC      aarch64-softmmu/hw/scsi/vhost-scsi.o
  CC      aarch64-softmmu/hw/sd/omap_mmc.o
  CC      aarch64-softmmu/hw/sd/pxa2xx_mmci.o
  CC      aarch64-softmmu/hw/ssi/omap_spi.o
  CC      aarch64-softmmu/hw/ssi/imx_spi.o
  CC      x86_64-softmmu/trace/generated-helpers.o
  CC      aarch64-softmmu/hw/timer/exynos4210_mct.o
  CC      aarch64-softmmu/hw/timer/exynos4210_rtc.o
  CC      aarch64-softmmu/hw/timer/exynos4210_pwm.o
  CC      aarch64-softmmu/hw/timer/omap_gptimer.o
  CC      aarch64-softmmu/hw/timer/pxa2xx_timer.o
  CC      aarch64-softmmu/hw/timer/omap_synctimer.o
  CC      aarch64-softmmu/hw/timer/digic-timer.o
  CC      aarch64-softmmu/hw/timer/allwinner-a10-pit.o
  CC      aarch64-softmmu/hw/usb/tusb6010.o
  CC      aarch64-softmmu/hw/vfio/common.o
  CC      aarch64-softmmu/hw/vfio/pci-quirks.o
  CC      aarch64-softmmu/hw/vfio/pci.o
  CC      aarch64-softmmu/hw/vfio/platform.o
  CC      aarch64-softmmu/hw/vfio/calxeda-xgmac.o
  CC      aarch64-softmmu/hw/vfio/amd-xgbe.o
  CC      aarch64-softmmu/hw/vfio/spapr.o
  CC      aarch64-softmmu/hw/virtio/virtio.o
  CC      aarch64-softmmu/hw/virtio/virtio-balloon.o
  CC      aarch64-softmmu/hw/virtio/vhost.o
  CC      aarch64-softmmu/hw/virtio/vhost-backend.o
  CC      aarch64-softmmu/hw/virtio/vhost-user.o
  CC      aarch64-softmmu/hw/virtio/vhost-vsock.o
  CC      aarch64-softmmu/hw/virtio/virtio-crypto.o
  CC      aarch64-softmmu/hw/virtio/virtio-crypto-pci.o
  CC      aarch64-softmmu/hw/arm/boot.o
  CC      aarch64-softmmu/hw/arm/collie.o
  CC      aarch64-softmmu/hw/arm/exynos4_boards.o
  CC      aarch64-softmmu/hw/arm/gumstix.o
  CC      aarch64-softmmu/hw/arm/highbank.o
  CC      aarch64-softmmu/hw/arm/digic_boards.o
  CC      aarch64-softmmu/hw/arm/integratorcp.o
  CC      aarch64-softmmu/hw/arm/mainstone.o
  CC      aarch64-softmmu/hw/arm/musicpal.o
  CC      aarch64-softmmu/hw/arm/nseries.o
  CC      aarch64-softmmu/hw/arm/omap_sx1.o
  CC      aarch64-softmmu/hw/arm/palm.o
  CC      aarch64-softmmu/hw/arm/realview.o
  CC      aarch64-softmmu/hw/arm/spitz.o
  CC      aarch64-softmmu/hw/arm/stellaris.o
  CC      aarch64-softmmu/hw/arm/tosa.o
  CC      aarch64-softmmu/hw/arm/versatilepb.o
  CC      aarch64-softmmu/hw/arm/vexpress.o
  CC      aarch64-softmmu/hw/arm/virt.o
  CC      aarch64-softmmu/hw/arm/xilinx_zynq.o
  CC      aarch64-softmmu/hw/arm/z2.o
  CC      aarch64-softmmu/hw/arm/virt-acpi-build.o
  CC      aarch64-softmmu/hw/arm/netduino2.o
  CC      aarch64-softmmu/hw/arm/armv7m.o
  CC      aarch64-softmmu/hw/arm/sysbus-fdt.o
  CC      aarch64-softmmu/hw/arm/exynos4210.o
  CC      aarch64-softmmu/hw/arm/pxa2xx.o
  CC      aarch64-softmmu/hw/arm/pxa2xx_gpio.o
  CC      aarch64-softmmu/hw/arm/pxa2xx_pic.o
  CC      aarch64-softmmu/hw/arm/digic.o
  CC      aarch64-softmmu/hw/arm/omap1.o
  CC      aarch64-softmmu/hw/arm/omap2.o
  CC      aarch64-softmmu/hw/arm/strongarm.o
  CC      aarch64-softmmu/hw/arm/allwinner-a10.o
  CC      aarch64-softmmu/hw/arm/cubieboard.o
  CC      aarch64-softmmu/hw/arm/bcm2835_peripherals.o
  CC      aarch64-softmmu/hw/arm/bcm2836.o
  CC      aarch64-softmmu/hw/arm/raspi.o
  CC      aarch64-softmmu/hw/arm/stm32f205_soc.o
  CC      aarch64-softmmu/hw/arm/xlnx-zynqmp.o
  CC      aarch64-softmmu/hw/arm/xlnx-ep108.o
  CC      aarch64-softmmu/hw/arm/fsl-imx25.o
  CC      aarch64-softmmu/hw/arm/imx25_pdk.o
  CC      aarch64-softmmu/hw/arm/fsl-imx31.o
  CC      aarch64-softmmu/hw/arm/kzm.o
  CC      aarch64-softmmu/hw/arm/fsl-imx6.o
  CC      aarch64-softmmu/hw/arm/sabrelite.o
  CC      aarch64-softmmu/hw/arm/aspeed_soc.o
  CC      aarch64-softmmu/hw/arm/aspeed.o
  CC      aarch64-softmmu/target-arm/arm-semi.o
  CC      aarch64-softmmu/target-arm/machine.o
  CC      aarch64-softmmu/target-arm/psci.o
  CC      aarch64-softmmu/target-arm/arch_dump.o
  CC      aarch64-softmmu/target-arm/monitor.o
  CC      aarch64-softmmu/target-arm/kvm-stub.o
  CC      aarch64-softmmu/target-arm/translate.o
  CC      aarch64-softmmu/target-arm/op_helper.o
  CC      aarch64-softmmu/target-arm/helper.o
  CC      aarch64-softmmu/target-arm/cpu.o
  LINK    x86_64-softmmu/qemu-system-x86_64
  CC      aarch64-softmmu/target-arm/iwmmxt_helper.o
  CC      aarch64-softmmu/target-arm/neon_helper.o
  CC      aarch64-softmmu/target-arm/gdbstub.o
  CC      aarch64-softmmu/target-arm/cpu64.o
  CC      aarch64-softmmu/target-arm/translate-a64.o
  CC      aarch64-softmmu/target-arm/helper-a64.o
  CC      aarch64-softmmu/target-arm/gdbstub64.o
  CC      aarch64-softmmu/target-arm/crypto_helper.o
  CC      aarch64-softmmu/target-arm/arm-powerctl.o
  GEN     trace/generated-helpers.c
  CC      aarch64-softmmu/trace/control-target.o

/tmp/qemu-test/src/target-arm/translate-a64.c: In function ‘handle_shri_with_rndacc’:
/tmp/qemu-test/src/target-arm/translate-a64.c:6391: warning: ‘tcg_src_hi’ may be used uninitialized in this function /tmp/qemu-test/src/target-arm/translate-a64.c: In function ‘disas_simd_scalar_two_reg_misc’:
/tmp/qemu-test/src/target-arm/translate-a64.c:8118: warning: ‘rmode’ may be used uninitialized in this function

  CC      aarch64-softmmu/gdbstub-xml.o
  CC      aarch64-softmmu/trace/generated-helpers.o
  LINK    aarch64-softmmu/qemu-system-aarch64
  TEST    tests/qapi-schema/alternate-any.out
  TEST    tests/qapi-schema/alternate-array.out
  TEST    tests/qapi-schema/alternate-base.out
  TEST    tests/qapi-schema/alternate-clash.out
  TEST    tests/qapi-schema/alternate-conflict-dict.out
  TEST    tests/qapi-schema/alternate-empty.out
  TEST    tests/qapi-schema/alternate-conflict-string.out
  TEST    tests/qapi-schema/alternate-nested.out
  TEST    tests/qapi-schema/alternate-unknown.out
  TEST    tests/qapi-schema/args-alternate.out
  TEST    tests/qapi-schema/args-any.out
  TEST    tests/qapi-schema/args-array-empty.out
  TEST    tests/qapi-schema/args-array-unknown.out
  TEST    tests/qapi-schema/args-bad-boxed.out
  TEST    tests/qapi-schema/args-boxed-anon.out
  TEST    tests/qapi-schema/args-boxed-empty.out
  TEST    tests/qapi-schema/args-boxed-string.out
  TEST    tests/qapi-schema/args-int.out
  TEST    tests/qapi-schema/args-invalid.out
  TEST    tests/qapi-schema/args-member-array-bad.out
  TEST    tests/qapi-schema/args-member-case.out
  TEST    tests/qapi-schema/args-member-unknown.out
  TEST    tests/qapi-schema/args-name-clash.out
  TEST    tests/qapi-schema/args-union.out
  TEST    tests/qapi-schema/args-unknown.out
  TEST    tests/qapi-schema/bad-base.out
  TEST    tests/qapi-schema/bad-data.out
  TEST    tests/qapi-schema/bad-ident.out
  TEST    tests/qapi-schema/bad-type-bool.out
  TEST    tests/qapi-schema/bad-type-dict.out
  TEST    tests/qapi-schema/bad-type-int.out
  TEST    tests/qapi-schema/base-cycle-direct.out
  TEST    tests/qapi-schema/base-cycle-indirect.out
  TEST    tests/qapi-schema/command-int.out
  TEST    tests/qapi-schema/comments.out
  TEST    tests/qapi-schema/double-data.out
  TEST    tests/qapi-schema/double-type.out
  TEST    tests/qapi-schema/duplicate-key.out
  TEST    tests/qapi-schema/empty.out
  TEST    tests/qapi-schema/enum-bad-name.out
  TEST    tests/qapi-schema/enum-bad-prefix.out
  TEST    tests/qapi-schema/enum-clash-member.out
  TEST    tests/qapi-schema/enum-dict-member.out
  TEST    tests/qapi-schema/enum-int-member.out
  TEST    tests/qapi-schema/enum-member-case.out
  TEST    tests/qapi-schema/enum-missing-data.out
  TEST    tests/qapi-schema/enum-wrong-data.out
  TEST    tests/qapi-schema/escape-outside-string.out
  TEST    tests/qapi-schema/escape-too-big.out
  TEST    tests/qapi-schema/escape-too-short.out
  TEST    tests/qapi-schema/event-boxed-empty.out
  TEST    tests/qapi-schema/event-case.out
  TEST    tests/qapi-schema/event-nest-struct.out
  TEST    tests/qapi-schema/flat-union-array-branch.out
  TEST    tests/qapi-schema/flat-union-bad-base.out
  TEST    tests/qapi-schema/flat-union-bad-discriminator.out
  TEST    tests/qapi-schema/flat-union-base-any.out
  TEST    tests/qapi-schema/flat-union-base-union.out
  TEST    tests/qapi-schema/flat-union-clash-member.out
  TEST    tests/qapi-schema/flat-union-empty.out
  TEST    tests/qapi-schema/flat-union-incomplete-branch.out
  TEST    tests/qapi-schema/flat-union-inline.out
  TEST    tests/qapi-schema/flat-union-int-branch.out
  TEST    tests/qapi-schema/flat-union-invalid-branch-key.out
  TEST    tests/qapi-schema/flat-union-invalid-discriminator.out
  TEST    tests/qapi-schema/flat-union-no-base.out
  TEST    tests/qapi-schema/flat-union-optional-discriminator.out
  TEST    tests/qapi-schema/flat-union-string-discriminator.out
  TEST    tests/qapi-schema/funny-char.out
  TEST    tests/qapi-schema/ident-with-escape.out
  TEST    tests/qapi-schema/include-before-err.out
  TEST    tests/qapi-schema/include-cycle.out
  TEST    tests/qapi-schema/include-format-err.out
  TEST    tests/qapi-schema/include-nested-err.out
  TEST    tests/qapi-schema/include-no-file.out
  TEST    tests/qapi-schema/include-non-file.out
  TEST    tests/qapi-schema/include-relpath.out
  TEST    tests/qapi-schema/include-repetition.out
  TEST    tests/qapi-schema/include-self-cycle.out
  TEST    tests/qapi-schema/include-simple.out
  TEST    tests/qapi-schema/indented-expr.out
  TEST    tests/qapi-schema/leading-comma-list.out
  TEST    tests/qapi-schema/leading-comma-object.out
  TEST    tests/qapi-schema/missing-comma-list.out
  TEST    tests/qapi-schema/missing-colon.out
  TEST    tests/qapi-schema/missing-comma-object.out
  TEST    tests/qapi-schema/missing-type.out
  TEST    tests/qapi-schema/nested-struct-data.out
  TEST    tests/qapi-schema/non-objects.out
  TEST    tests/qapi-schema/qapi-schema-test.out
  TEST    tests/qapi-schema/redefined-builtin.out
  TEST    tests/qapi-schema/quoted-structural-chars.out
  TEST    tests/qapi-schema/redefined-command.out
  TEST    tests/qapi-schema/redefined-event.out
  TEST    tests/qapi-schema/reserved-command-q.out
  TEST    tests/qapi-schema/redefined-type.out
  TEST    tests/qapi-schema/reserved-enum-q.out
  TEST    tests/qapi-schema/reserved-member-has.out
  TEST    tests/qapi-schema/reserved-member-q.out
  TEST    tests/qapi-schema/reserved-member-u.out
  TEST    tests/qapi-schema/reserved-member-underscore.out
  TEST    tests/qapi-schema/reserved-type-kind.out
  TEST    tests/qapi-schema/reserved-type-list.out
  TEST    tests/qapi-schema/returns-alternate.out
  TEST    tests/qapi-schema/returns-dict.out
  TEST    tests/qapi-schema/returns-array-bad.out
  TEST    tests/qapi-schema/returns-unknown.out
  TEST    tests/qapi-schema/returns-whitelist.out
  TEST    tests/qapi-schema/struct-base-clash-deep.out
  TEST    tests/qapi-schema/struct-base-clash.out
  TEST    tests/qapi-schema/struct-data-invalid.out
  TEST    tests/qapi-schema/struct-member-invalid.out
  TEST    tests/qapi-schema/trailing-comma-list.out
  TEST    tests/qapi-schema/trailing-comma-object.out
  TEST    tests/qapi-schema/type-bypass-bad-gen.out
  TEST    tests/qapi-schema/unclosed-list.out
  TEST    tests/qapi-schema/unclosed-object.out
  TEST    tests/qapi-schema/unclosed-string.out
  TEST    tests/qapi-schema/unicode-str.out
  TEST    tests/qapi-schema/union-base-no-discriminator.out
  TEST    tests/qapi-schema/union-branch-case.out
  TEST    tests/qapi-schema/union-empty.out
  TEST    tests/qapi-schema/union-clash-branches.out
  TEST    tests/qapi-schema/union-invalid-base.out
  TEST    tests/qapi-schema/union-optional-branch.out
  TEST    tests/qapi-schema/union-unknown.out
  TEST    tests/qapi-schema/unknown-escape.out
  TEST    tests/qapi-schema/unknown-expr-key.out
  CC      tests/check-qdict.o
  CC      tests/test-char.o
  CC      tests/check-qfloat.o
  CC      tests/check-qint.o
  CC      tests/check-qstring.o
  CC      tests/check-qnull.o
  CC      tests/check-qlist.o
  CC      tests/test-qobject-output-visitor.o
  CC      tests/check-qjson.o
  GEN     tests/test-qapi-visit.c
  GEN     tests/test-qapi-types.c
  GEN     tests/test-qapi-event.c
  GEN     tests/test-qmp-introspect.c
  CC      tests/test-clone-visitor.o
  CC      tests/test-qobject-input-visitor.o
  CC      tests/test-qobject-input-strict.o
  CC      tests/test-qmp-commands.o
  GEN     tests/test-qmp-marshal.c
  CC      tests/test-string-input-visitor.o
  CC      tests/test-string-output-visitor.o
  CC      tests/test-qmp-event.o
  CC      tests/test-opts-visitor.o
  CC      tests/test-coroutine.o
  CC      tests/test-visitor-serialization.o
  CC      tests/test-aio.o
  CC      tests/test-iov.o
  CC      tests/test-throttle.o
  CC      tests/test-thread-pool.o
  CC      tests/test-hbitmap.o
  CC      tests/test-blockjob.o
  CC      tests/test-blockjob-txn.o
  CC      tests/test-x86-cpuid.o
  CC      tests/test-xbzrle.o
  CC      tests/test-vmstate.o
  CC      tests/test-mul64.o
  CC      tests/test-cutils.o
  CC      tests/test-int128.o
  CC      tests/rcutorture.o
  CC      tests/test-rcu-list.o
  CC      tests/test-qdist.o
  CC      tests/test-qht.o
  CC      tests/qht-bench.o
  CC      tests/test-qht-par.o
  CC      tests/test-bitops.o
  CC      tests/check-qom-proplist.o
  CC      tests/check-qom-interface.o
/tmp/qemu-test/src/tests/test-int128.c:180: warning: ‘__noclone__’ attribute directive ignored
  CC      tests/test-qemu-opts.o
  CC      tests/test-write-threshold.o
  CC      tests/test-crypto-hash.o
  CC      tests/test-crypto-cipher.o
  CC      tests/test-crypto-secret.o
  CC      tests/test-qga.o
  CC      tests/libqtest.o
  CC      tests/test-io-task.o
  CC      tests/test-timed-average.o
  CC      tests/io-channel-helpers.o
  CC      tests/test-io-channel-socket.o
  CC      tests/test-io-channel-file.o
  CC      tests/test-io-channel-buffer.o
  CC      tests/test-io-channel-command.o
  CC      tests/test-base64.o
  CC      tests/test-crypto-ivgen.o
  CC      tests/test-crypto-afsplit.o
  CC      tests/test-crypto-xts.o
  CC      tests/test-crypto-block.o
  CC      tests/test-logging.o
  CC      tests/test-replication.o
  CC      tests/test-uuid.o
  CC      tests/ptimer-test.o
  CC      tests/test-bufferiszero.o
  CC      tests/ptimer-test-stubs.o
  CC      tests/vhost-user-test.o
  CC      tests/libqos/pci.o
  CC      tests/libqos/fw_cfg.o
  CC      tests/libqos/i2c.o
  CC      tests/libqos/malloc.o
  CC      tests/libqos/libqos.o
  CC      tests/libqos/malloc-spapr.o
  CC      tests/libqos/libqos-spapr.o
  CC      tests/libqos/rtas.o
  CC      tests/libqos/pci-spapr.o
  CC      tests/libqos/pci-pc.o
  CC      tests/libqos/malloc-pc.o
  CC      tests/libqos/ahci.o
  CC      tests/libqos/libqos-pc.o
  CC      tests/libqos/virtio.o
  CC      tests/libqos/virtio-pci.o
  CC      tests/libqos/virtio-mmio.o
  CC      tests/libqos/malloc-generic.o
  CC      tests/endianness-test.o
  CC      tests/ide-test.o
  CC      tests/fdc-test.o
  CC      tests/ahci-test.o
  CC      tests/hd-geo-test.o
  CC      tests/boot-order-test.o
  CC      tests/bios-tables-test.o
  CC      tests/boot-sector.o
  CC      tests/boot-serial-test.o
  CC      tests/rtc-test.o
  CC      tests/pxe-test.o
  CC      tests/ipmi-kcs-test.o
  CC      tests/ipmi-bt-test.o

/tmp/qemu-test/src/tests/ide-test.c: In function ‘cdrom_pio_impl’:
/tmp/qemu-test/src/tests/ide-test.c:791: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result /tmp/qemu-test/src/tests/ide-test.c: In function ‘test_cdrom_dma’:
/tmp/qemu-test/src/tests/ide-test.c:886: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result

  CC      tests/i440fx-test.o
  CC      tests/drive_del-test.o
  CC      tests/fw_cfg-test.o
  CC      tests/wdt_ib700-test.o
  CC      tests/tco-test.o
  CC      tests/e1000-test.o
  CC      tests/rtl8139-test.o
  CC      tests/e1000e-test.o
  CC      tests/pcnet-test.o
  CC      tests/eepro100-test.o
  CC      tests/ne2000-test.o
  CC      tests/nvme-test.o
  CC      tests/ac97-test.o
  CC      tests/es1370-test.o
  CC      tests/virtio-net-test.o
  CC      tests/virtio-balloon-test.o
  CC      tests/virtio-blk-test.o
  CC      tests/virtio-scsi-test.o
  CC      tests/virtio-rng-test.o
  CC      tests/virtio-serial-test.o
  CC      tests/virtio-console-test.o
  CC      tests/tpci200-test.o
  CC      tests/ipoctal232-test.o
  CC      tests/display-vga-test.o
  CC      tests/intel-hda-test.o
  CC      tests/ivshmem-test.o
  CC      tests/vmxnet3-test.o
  CC      tests/pvpanic-test.o
  CC      tests/i82801b11-test.o
  CC      tests/ioh3420-test.o
  CC      tests/usb-hcd-ohci-test.o
  CC      tests/libqos/usb.o
  CC      tests/usb-hcd-uhci-test.o
  CC      tests/usb-hcd-ehci-test.o
  CC      tests/usb-hcd-xhci-test.o
  CC      tests/pc-cpu-test.o
  CC      tests/q35-test.o
  CC      tests/test-netfilter.o
  CC      tests/test-filter-mirror.o
  CC      tests/test-filter-redirector.o
  CC      tests/postcopy-test.o
  CC      tests/test-x86-cpuid-compat.o
  CC      tests/device-introspect-test.o
  CC      tests/qom-test.o
  LINK    tests/check-qdict
  LINK    tests/test-char
  LINK    tests/check-qfloat
  LINK    tests/check-qint
  LINK    tests/check-qstring
  LINK    tests/check-qlist
  LINK    tests/check-qnull
  LINK    tests/check-qjson
  CC      tests/test-qapi-visit.o
  CC      tests/test-qapi-types.o
  CC      tests/test-qapi-event.o
  CC      tests/test-qmp-introspect.o
  CC      tests/test-qmp-marshal.o
  LINK    tests/test-coroutine
  LINK    tests/test-visitor-serialization
  LINK    tests/test-iov
  LINK    tests/test-aio
  LINK    tests/test-throttle
  LINK    tests/test-thread-pool
  LINK    tests/test-hbitmap
  LINK    tests/test-blockjob
  LINK    tests/test-blockjob-txn
  LINK    tests/test-x86-cpuid
  LINK    tests/test-xbzrle
  LINK    tests/test-vmstate
  LINK    tests/test-cutils
  LINK    tests/test-mul64
  LINK    tests/test-int128
  LINK    tests/rcutorture
  LINK    tests/test-rcu-list
  LINK    tests/test-qdist
  LINK    tests/test-qht
  LINK    tests/qht-bench
  LINK    tests/test-bitops
  LINK    tests/check-qom-interface
  LINK    tests/check-qom-proplist
  LINK    tests/test-qemu-opts
  LINK    tests/test-write-threshold
  LINK    tests/test-crypto-hash
  LINK    tests/test-crypto-cipher
  LINK    tests/test-crypto-secret
  LINK    tests/test-qga
  LINK    tests/test-timed-average
  LINK    tests/test-io-task
  LINK    tests/test-io-channel-socket
  LINK    tests/test-io-channel-file
  LINK    tests/test-io-channel-command
  LINK    tests/test-io-channel-buffer
  LINK    tests/test-base64
  LINK    tests/test-crypto-ivgen
  LINK    tests/test-crypto-afsplit
  LINK    tests/test-crypto-xts
  LINK    tests/test-crypto-block
  LINK    tests/test-logging
  LINK    tests/test-replication
  LINK    tests/test-bufferiszero
  LINK    tests/test-uuid
  LINK    tests/ptimer-test
  LINK    tests/vhost-user-test
  LINK    tests/endianness-test
  LINK    tests/fdc-test
  LINK    tests/ide-test
  LINK    tests/ahci-test
  LINK    tests/hd-geo-test
  LINK    tests/boot-order-test
  LINK    tests/bios-tables-test
  LINK    tests/boot-serial-test
  LINK    tests/pxe-test
  LINK    tests/rtc-test
  LINK    tests/ipmi-kcs-test
  LINK    tests/ipmi-bt-test
  LINK    tests/i440fx-test
  LINK    tests/fw_cfg-test
  LINK    tests/drive_del-test
  LINK    tests/wdt_ib700-test
  LINK    tests/tco-test
  LINK    tests/e1000-test
  LINK    tests/e1000e-test
  LINK    tests/rtl8139-test
  LINK    tests/pcnet-test
  LINK    tests/eepro100-test
  LINK    tests/ne2000-test
  LINK    tests/nvme-test
  LINK    tests/ac97-test
  LINK    tests/es1370-test
  LINK    tests/virtio-net-test
  LINK    tests/virtio-balloon-test
  LINK    tests/virtio-blk-test
  LINK    tests/virtio-rng-test
  LINK    tests/virtio-scsi-test
  LINK    tests/virtio-serial-test
  LINK    tests/virtio-console-test
  LINK    tests/tpci200-test
  LINK    tests/ipoctal232-test
  LINK    tests/display-vga-test
  LINK    tests/intel-hda-test
  LINK    tests/ivshmem-test
  LINK    tests/vmxnet3-test
  LINK    tests/pvpanic-test
  LINK    tests/i82801b11-test
  LINK    tests/ioh3420-test
  LINK    tests/usb-hcd-ohci-test
  LINK    tests/usb-hcd-uhci-test
  LINK    tests/usb-hcd-ehci-test
  LINK    tests/usb-hcd-xhci-test
  LINK    tests/pc-cpu-test
  LINK    tests/q35-test
  LINK    tests/test-netfilter
  LINK    tests/test-filter-mirror
  LINK    tests/test-filter-redirector
  LINK    tests/postcopy-test
  LINK    tests/test-x86-cpuid-compat
  LINK    tests/device-introspect-test
  LINK    tests/qom-test
  GTESTER tests/check-qdict
  GTESTER tests/test-char
  GTESTER tests/check-qfloat
  GTESTER tests/check-qint
  GTESTER tests/check-qstring
  GTESTER tests/check-qlist
  GTESTER tests/check-qnull
  GTESTER tests/check-qjson
  LINK    tests/test-qobject-output-visitor
  LINK    tests/test-clone-visitor
  LINK    tests/test-qobject-input-visitor
  LINK    tests/test-qobject-input-strict
  LINK    tests/test-qmp-commands
  LINK    tests/test-string-input-visitor
  LINK    tests/test-string-output-visitor
  LINK    tests/test-qmp-event

GTESTER tests/test-coroutine
LINK tests/test-opts-visitor
GTESTER tests/test-visitor-serialization
GTESTER tests/test-iov
GTESTER tests/test-aio
GTESTER tests/test-throttle
GTESTER tests/test-thread-pool
GTESTER tests/test-blockjob
GTESTER tests/test-hbitmap
GTESTER tests/test-blockjob-txn
GTESTER tests/test-x86-cpuid
GTESTER tests/test-xbzrle
GTESTER tests/test-vmstate
GTESTER tests/test-cutils
GTESTER tests/test-mul64
GTESTER tests/test-int128
Failed to load simple/primitive:b_1
Failed to load simple/primitive:i64_2
Failed to load simple/primitive:i32_1
Failed to load simple/primitive:i32_1
GTESTER tests/rcutorture
GTESTER tests/test-rcu-list
GTESTER tests/test-qdist
GTESTER tests/test-qht
LINK tests/test-qht-par
GTESTER tests/test-bitops
GTESTER tests/check-qom-interface
GTESTER tests/check-qom-proplist
GTESTER tests/test-qemu-opts
GTESTER tests/test-write-threshold
GTESTER tests/test-crypto-hash
GTESTER tests/test-crypto-cipher
GTESTER tests/test-crypto-secret
GTESTER tests/test-qga
GTESTER tests/test-timed-average
GTESTER tests/test-io-task
GTESTER tests/test-io-channel-socket
GTESTER tests/test-io-channel-file
GTESTER tests/test-io-channel-command
GTESTER tests/test-io-channel-buffer
GTESTER tests/test-base64
GTESTER tests/test-crypto-ivgen
GTESTER tests/test-crypto-afsplit
GTESTER tests/test-crypto-xts
GTESTER tests/test-crypto-block
GTESTER tests/test-replication
GTESTER tests/test-logging
GTESTER tests/test-bufferiszero
GTESTER tests/test-uuid
GTESTER tests/ptimer-test
GTESTER check-qtest-x86_64
GTESTER check-qtest-aarch64
GTESTER tests/test-qobject-output-visitor
GTESTER tests/test-clone-visitor
GTESTER tests/test-qobject-input-visitor
GTESTER tests/test-qobject-input-strict
GTESTER tests/test-qmp-commands
GTESTER tests/test-string-input-visitor
GTESTER tests/test-string-output-visitor
GTESTER tests/test-qmp-event
GTESTER tests/test-opts-visitor
GTESTER tests/test-qht-par
ftruncate: Permission denied
ftruncate: Permission denied
ftruncate: Permission denied
**
ERROR:/tmp/qemu-test/src/tests/vhost-user-test.c:668:test_migrate: assertion failed: (qdict_haskey(rsp, "return"))
GTester: last random seed: R02Saffe25c306a2e574b3056c0c3e029ee6
ftruncate: Permission denied
ftruncate: Permission denied
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-ff527md2/src'
BUILD fedora
make[1]: Entering directory `/var/tmp/patchew-tester-tmp-ff527md2/src'
ARCHIVE qemu.tgz
ARCHIVE dtc.tgz
COPY RUNNER
RUN test-mingw in qemu:fedora
Packages installed:
PyYAML-3.11-12.fc24.x86_64
SDL-devel-1.2.15-21.fc24.x86_64
bc-1.06.95-16.fc24.x86_64
bison-3.0.4-4.fc24.x86_64
ccache-3.3.2-1.fc24.x86_64
clang-3.8.0-2.fc24.x86_64
findutils-4.6.0-7.fc24.x86_64
flex-2.6.0-2.fc24.x86_64
gcc-6.2.1-2.fc24.x86_64
gcc-c++-6.2.1-2.fc24.x86_64
git-2.7.4-3.fc24.x86_64
glib2-devel-2.48.2-1.fc24.x86_64
libfdt-devel-1.4.2-1.fc24.x86_64
make-4.1-5.fc24.x86_64
mingw32-SDL-1.2.15-7.fc24.noarch
mingw32-bzip2-1.0.6-7.fc24.noarch
mingw32-curl-7.47.0-1.fc24.noarch
mingw32-glib2-2.48.2-1.fc24.noarch
mingw32-gmp-6.1.0-1.fc24.noarch
mingw32-gnutls-3.4.14-1.fc24.noarch
mingw32-gtk2-2.24.31-1.fc24.noarch
mingw32-gtk3-3.20.9-1.fc24.noarch
mingw32-libjpeg-turbo-1.5.0-1.fc24.noarch
mingw32-libpng-1.6.23-1.fc24.noarch
mingw32-libssh2-1.4.3-5.fc24.noarch
mingw32-libtasn1-4.5-2.fc24.noarch
mingw32-nettle-3.2-1.fc24.noarch
mingw32-pixman-0.34.0-1.fc24.noarch
mingw32-pkg-config-0.28-6.fc24.x86_64
mingw64-SDL-1.2.15-7.fc24.noarch
mingw64-bzip2-1.0.6-7.fc24.noarch
mingw64-curl-7.47.0-1.fc24.noarch
mingw64-glib2-2.48.2-1.fc24.noarch
mingw64-gmp-6.1.0-1.fc24.noarch
mingw64-gnutls-3.4.14-1.fc24.noarch
mingw64-gtk2-2.24.31-1.fc24.noarch
mingw64-gtk3-3.20.9-1.fc24.noarch
mingw64-libjpeg-turbo-1.5.0-1.fc24.noarch
mingw64-libpng-1.6.23-1.fc24.noarch
mingw64-libssh2-1.4.3-5.fc24.noarch
mingw64-libtasn1-4.5-2.fc24.noarch
mingw64-nettle-3.2-1.fc24.noarch
mingw64-pixman-0.34.0-1.fc24.noarch
mingw64-pkg-config-0.28-6.fc24.x86_64
perl-5.22.2-362.fc24.x86_64
pixman-devel-0.34.0-2.fc24.x86_64
sparse-0.5.0-7.fc24.x86_64
tar-1.28-7.fc24.x86_64
which-2.20-13.fc24.x86_64
zlib-devel-1.2.8-10.fc24.x86_64

Environment variables:
PACKAGES=ccache git tar PyYAML sparse flex bison glib2-devel pixman-devel zlib-devel SDL-devel libfdt-devel gcc gcc-c++ clang make perl which bc findutils mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL mingw32-pkg-config mingw32-gtk2 mingw32-gtk3 mingw32-gnutls mingw32-nettle mingw32-libtasn1 mingw32-libjpeg-turbo mingw32-libpng mingw32-curl mingw32-libssh2 mingw32-bzip2 mingw64-pixman mingw64-glib2 mingw64-gmp mingw64-SDL mingw64-pkg-config mingw64-gtk2 mingw64-gtk3 mingw64-gnutls mingw64-nettle mingw64-libtasn1 mingw64-libjpeg-turbo mingw64-libpng mingw64-curl mingw64-libssh2 mingw64-bzip2
HOSTNAME=
TERM=xterm
MAKEFLAGS= -j16
HISTSIZE=1000
J=16
USER=root
CCACHE_DIR=/var/tmp/ccache
EXTRA_CONFIGURE_OPTS=
V=
SHOW_ENV=1
MAIL=/var/spool/mail/root PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PWD=/
TARGET_LIST=
HISTCONTROL=ignoredups
SHLVL=1
HOME=/root
TEST_DIR=/tmp/qemu-test
LOGNAME=root
LESSOPEN=||/usr/bin/lesspipe.sh %s
FEATURES=mingw clang pyyaml dtc
DEBUG=
_=/usr/bin/env

Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/var/tmp/qemu-build/install --cross-prefix=x86_64-w64-mingw32- --enable-trace-backends=simple --enable-debug --enable-gnutls --enable-nettle --enable-curl --enable-vnc --enable-bzip2 --enable-guest-agent --with-sdlabi=1.2 --with-gtkabi=2.0

Install prefix    /var/tmp/qemu-build/install
BIOS directory    /var/tmp/qemu-build/install
binary directory  /var/tmp/qemu-build/install

library directory /var/tmp/qemu-build/install/lib module directory /var/tmp/qemu-build/install/lib libexec directory /var/tmp/qemu-build/install/libexec include directory /var/tmp/qemu-build/install/include config directory /var/tmp/qemu-build/install
local state directory queried at runtime

Windows SDK       no
Source path       /tmp/qemu-test/src
C compiler        x86_64-w64-mingw32-gcc
Host C compiler   cc
C++ compiler      x86_64-w64-mingw32-g++
Objective-C compiler clang
ARFLAGS           rv
CFLAGS            -g 
QEMU_CFLAGS       -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/pixman-1  -I$(SRC_PATH)/dtc/libfdt -Werror -mms-bitfields -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/glib-2.0 -I/usr/x86_64-w64-mingw32/sys-root/mingw/lib/glib-2.0/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include  -m64 -mcx16 -mthreads -D__USE_MINGW_ANSI_STDIO=1 -DWIN32_LEAN_AND_MEAN -DWINVER=0x501 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wendif-labels -Wno-shift-negative-value -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/p11-kit-1 -I/usr/x86_64-w64-mingw32/sys-root/mingw/include  -I/usr/x86_64-w64-mingw32/sys-root/mingw/include   -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/libpng16 
LDFLAGS           -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase -Wl,--warn-common -m64 -g 
make              make
install           install
python            python -B
smbd              /usr/sbin/smbd
module support    no
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu aarch64-softmmu
tcg debug enabled yes
gprof enabled     no
sparse enabled    no
strip binaries    no
profiler          no
static build      no
pixman            system
SDL support       yes (1.2.15)
GTK support       yes (2.24.31)
GTK GL support    no
VTE support       no 
TLS priority      NORMAL
GNUTLS support    yes
GNUTLS rnd        yes
libgcrypt         no
libgcrypt kdf     no
nettle            yes (3.2)
nettle kdf        yes
libtasn1          yes
curses support    no
virgl support     no
curl support      yes
mingw32 support   yes
Audio drivers     dsound
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS support    no
VNC support       yes
VNC SASL support  no
VNC JPEG support  yes
VNC PNG support   yes
xen support       no
brlapi support    no
bluez  support    no
Documentation     no
PIE               no
vde support       no
netmap support    no
Linux AIO support no
ATTR/XATTR support no
Install blobs     yes
KVM support       no
COLO support      yes
RDMA support      no
TCG interpreter   no
fdt support       yes
preadv support    no
fdatasync         no
madvise           no
posix_madvise     no

libcap-ng support no
vhost-net support no
vhost-scsi support no
vhost-vsock support no
Trace backends simple
Trace output file trace-<pid>

spice support     no 
rbd support       no
xfsctl support    no
smartcard support no
libusb            no
usb net redir     no
OpenGL support    no
OpenGL dmabufs    no
libiscsi support  no
libnfs support    no

build guest agent yes
QGA VSS support no
QGA w32 disk info yes
QGA MSI support no
seccomp support no
coroutine backend win32
coroutine pool yes
debug stack usage no
GlusterFS support no
Archipelago support no

gcov              gcov
gcov enabled      no
TPM support       yes
libssh2 support   yes
TPM passthrough   no
QOM debugging     yes
lzo support       no
snappy support    no
bzip2 support     yes

NUMA host support no
tcmalloc support no
jemalloc support no
avx2 optimization yes
replication support yes
mkdir -p dtc/libfdt
GEN x86_64-softmmu/config-devices.mak.tmp
mkdir -p dtc/tests

  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     config-host.h
  GEN     qemu-options.def
  GEN     qmp-commands.h
  GEN     qapi-types.h
  GEN     qapi-visit.h
  GEN     qapi-event.h
  GEN     qmp-introspect.h
  GEN     module_block.h
  GEN     tests/test-qapi-types.h
  GEN     tests/test-qapi-visit.h
  GEN     tests/test-qmp-commands.h
  GEN     tests/test-qapi-event.h
  GEN     tests/test-qmp-introspect.h
  GEN     x86_64-softmmu/config-devices.mak
  GEN     aarch64-softmmu/config-devices.mak
  GEN     trace/generated-tracers.h
  GEN     trace/generated-tcg-tracers.h

DEP /tmp/qemu-test/src/dtc/tests/dumptrees.c
DEP /tmp/qemu-test/src/dtc/tests/trees.S
DEP /tmp/qemu-test/src/dtc/tests/testutils.c
DEP /tmp/qemu-test/src/dtc/tests/value-labels.c DEP /tmp/qemu-test/src/dtc/tests/asm_tree_dump.c DEP /tmp/qemu-test/src/dtc/tests/truncated_property.c DEP /tmp/qemu-test/src/dtc/tests/subnode_iterate.c
GEN trace/generated-helpers-wrappers.h
DEP /tmp/qemu-test/src/dtc/tests/integer-expressions.c
GEN trace/generated-helpers.h
DEP /tmp/qemu-test/src/dtc/tests/utilfdt_test.c
GEN config-all-devices.mak
DEP /tmp/qemu-test/src/dtc/tests/path_offset_aliases.c DEP /tmp/qemu-test/src/dtc/tests/add_subnode_with_nops.c DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_unordered.c DEP /tmp/qemu-test/src/dtc/tests/dtb_reverse.c DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_ordered.c DEP /tmp/qemu-test/src/dtc/tests/extra-terminating-null.c DEP /tmp/qemu-test/src/dtc/tests/incbin.c
DEP /tmp/qemu-test/src/dtc/tests/boot-cpuid.c
DEP /tmp/qemu-test/src/dtc/tests/phandle_format.c DEP /tmp/qemu-test/src/dtc/tests/path-references.c DEP /tmp/qemu-test/src/dtc/tests/references.c
DEP /tmp/qemu-test/src/dtc/tests/string_escapes.c DEP /tmp/qemu-test/src/dtc/tests/propname_escapes.c DEP /tmp/qemu-test/src/dtc/tests/appendprop1.c DEP /tmp/qemu-test/src/dtc/tests/appendprop2.c DEP /tmp/qemu-test/src/dtc/tests/del_node.c
DEP /tmp/qemu-test/src/dtc/tests/del_property.c DEP /tmp/qemu-test/src/dtc/tests/setprop.c
DEP /tmp/qemu-test/src/dtc/tests/set_name.c
DEP /tmp/qemu-test/src/dtc/tests/rw_tree1.c
DEP /tmp/qemu-test/src/dtc/tests/open_pack.c
DEP /tmp/qemu-test/src/dtc/tests/mangle-layout.c DEP /tmp/qemu-test/src/dtc/tests/nopulate.c
DEP /tmp/qemu-test/src/dtc/tests/move_and_save.c DEP /tmp/qemu-test/src/dtc/tests/sw_tree1.c
DEP /tmp/qemu-test/src/dtc/tests/nop_node.c
DEP /tmp/qemu-test/src/dtc/tests/nop_property.c DEP /tmp/qemu-test/src/dtc/tests/setprop_inplace.c DEP /tmp/qemu-test/src/dtc/tests/notfound.c
DEP /tmp/qemu-test/src/dtc/tests/sized_cells.c DEP /tmp/qemu-test/src/dtc/tests/char_literal.c DEP /tmp/qemu-test/src/dtc/tests/get_alias.c
DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_compatible.c DEP /tmp/qemu-test/src/dtc/tests/node_check_compatible.c DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_phandle.c DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_prop_value.c DEP /tmp/qemu-test/src/dtc/tests/parent_offset.c DEP /tmp/qemu-test/src/dtc/tests/supernode_atdepth_offset.c DEP /tmp/qemu-test/src/dtc/tests/get_path.c
DEP /tmp/qemu-test/src/dtc/tests/get_phandle.c DEP /tmp/qemu-test/src/dtc/tests/getprop.c
DEP /tmp/qemu-test/src/dtc/tests/get_name.c
DEP /tmp/qemu-test/src/dtc/tests/path_offset.c DEP /tmp/qemu-test/src/dtc/tests/subnode_offset.c DEP /tmp/qemu-test/src/dtc/tests/find_property.c DEP /tmp/qemu-test/src/dtc/tests/root_node.c
DEP /tmp/qemu-test/src/dtc/tests/get_mem_rsv.c DEP /tmp/qemu-test/src/dtc/libfdt/fdt_strerror.c DEP /tmp/qemu-test/src/dtc/libfdt/fdt_empty_tree.c DEP /tmp/qemu-test/src/dtc/libfdt/fdt_rw.c
DEP /tmp/qemu-test/src/dtc/libfdt/fdt_sw.c
DEP /tmp/qemu-test/src/dtc/libfdt/fdt_wip.c
DEP /tmp/qemu-test/src/dtc/libfdt/fdt_ro.c
DEP /tmp/qemu-test/src/dtc/libfdt/fdt.c
DEP /tmp/qemu-test/src/dtc/util.c
DEP /tmp/qemu-test/src/dtc/fdtput.c
DEP /tmp/qemu-test/src/dtc/fdtget.c
DEP /tmp/qemu-test/src/dtc/fdtdump.c
LEX convert-dtsv0-lexer.lex.c
DEP /tmp/qemu-test/src/dtc/srcpos.c
BISON dtc-parser.tab.c
LEX dtc-lexer.lex.c
DEP /tmp/qemu-test/src/dtc/livetree.c
DEP /tmp/qemu-test/src/dtc/treesource.c
DEP /tmp/qemu-test/src/dtc/fstree.c
DEP /tmp/qemu-test/src/dtc/flattree.c
DEP /tmp/qemu-test/src/dtc/dtc.c
DEP /tmp/qemu-test/src/dtc/data.c
DEP /tmp/qemu-test/src/dtc/checks.c
DEP convert-dtsv0-lexer.lex.c
DEP dtc-parser.tab.c
DEP dtc-lexer.lex.c
CHK version_gen.h
UPD version_gen.h
DEP /tmp/qemu-test/src/dtc/util.c
CC libfdt/fdt.o
CC libfdt/fdt_ro.o
CC libfdt/fdt_wip.o
CC libfdt/fdt_sw.o
CC libfdt/fdt_rw.o
CC libfdt/fdt_strerror.o
CC libfdt/fdt_empty_tree.o
AR libfdt/libfdt.a
x86_64-w64-mingw32-ar: creating libfdt/libfdt.a
a - libfdt/fdt.o
a - libfdt/fdt_ro.o
a - libfdt/fdt_wip.o
a - libfdt/fdt_sw.o
a - libfdt/fdt_rw.o
a - libfdt/fdt_strerror.o
a - libfdt/fdt_empty_tree.o

  RC      version.lo
  RC      version.o
  GEN     qga/qapi-generated/qga-qapi-types.h
  GEN     qga/qapi-generated/qga-qapi-visit.h
  GEN     qga/qapi-generated/qga-qmp-commands.h
  GEN     qga/qapi-generated/qga-qapi-types.c
  GEN     qga/qapi-generated/qga-qapi-visit.c
  GEN     qga/qapi-generated/qga-qmp-marshal.c
  GEN     qmp-introspect.c
  GEN     qapi-types.c
  GEN     qapi-visit.c
  GEN     qapi-event.c
  CC      qapi/qapi-visit-core.o
  CC      qapi/qapi-dealloc-visitor.o
  CC      qapi/qobject-input-visitor.o
  CC      qapi/qobject-output-visitor.o
  CC      qapi/qmp-registry.o
  CC      qapi/qmp-dispatch.o
  CC      qapi/string-input-visitor.o
  CC      qapi/string-output-visitor.o
  CC      qapi/opts-visitor.o
  CC      qapi/qapi-clone-visitor.o
  CC      qapi/qmp-event.o
  CC      qapi/qapi-util.o
  CC      qobject/qnull.o
  CC      qobject/qint.o
  CC      qobject/qstring.o
  CC      qobject/qdict.o
  CC      qobject/qlist.o
  CC      qobject/qfloat.o
  CC      qobject/qbool.o
  CC      qobject/qjson.o
  CC      qobject/qobject.o
  CC      qobject/json-lexer.o
  CC      qobject/json-streamer.o
  CC      qobject/json-parser.o
  GEN     trace/generated-tracers.c
  CC      trace/simple.o
  CC      trace/control.o
  CC      trace/qmp.o
  CC      util/osdep.o
  CC      util/cutils.o
  CC      util/unicode.o
  CC      util/qemu-timer-common.o
  CC      util/bufferiszero.o
  CC      util/event_notifier-win32.o
  CC      util/oslib-win32.o
  CC      util/qemu-thread-win32.o
  CC      util/envlist.o
  CC      util/path.o
  CC      util/module.o
  CC      util/bitmap.o
  CC      util/bitops.o
  CC      util/hbitmap.o
  CC      util/fifo8.o
  CC      util/acl.o
  CC      util/error.o
  CC      util/qemu-error.o
  CC      util/id.o
  CC      util/iov.o
  CC      util/qemu-config.o
  CC      util/qemu-sockets.o
  CC      util/uri.o
  CC      util/notify.o
  CC      util/qemu-option.o
  CC      util/qemu-progress.o
  CC      util/hexdump.o
  CC      util/crc32c.o
  CC      util/uuid.o
  CC      util/throttle.o
  CC      util/getauxval.o
  CC      util/readline.o
  CC      util/rcu.o
  CC      util/qemu-coroutine.o
  CC      util/qemu-coroutine-lock.o
  CC      util/qemu-coroutine-sleep.o
  CC      util/qemu-coroutine-io.o
  CC      util/coroutine-win32.o
  CC      util/buffer.o
  CC      util/timed-average.o
  CC      util/base64.o
  CC      util/log.o
  CC      util/qdist.o
  CC      util/qht.o
  CC      util/range.o
  CC      crypto/pbkdf-stub.o
  CC      stubs/arch-query-cpu-def.o
  CC      stubs/arch-query-cpu-model-expansion.o
  CC      stubs/arch-query-cpu-model-comparison.o
  CC      stubs/arch-query-cpu-model-baseline.o
  CC      stubs/bdrv-next-monitor-owned.o
  CC      stubs/blk-commit-all.o
  CC      stubs/blockdev-close-all-bdrv-states.o
  CC      stubs/clock-warp.o
  CC      stubs/cpu-get-clock.o
  CC      stubs/cpu-get-icount.o
  CC      stubs/dump.o
  CC      stubs/error-printf.o
  CC      stubs/fdset-add-fd.o
  CC      stubs/fdset-find-fd.o
  CC      stubs/fdset-get-fd.o
  CC      stubs/fdset-remove-fd.o
  CC      stubs/gdbstub.o
  CC      stubs/get-fd.o
  CC      stubs/get-next-serial.o
  CC      stubs/get-vm-name.o
  CC      stubs/iothread.o
  CC      stubs/iothread-lock.o
  CC      stubs/is-daemonized.o
  CC      stubs/machine-init-done.o
  CC      stubs/migr-blocker.o
  CC      stubs/mon-is-qmp.o
  CC      stubs/monitor-init.o
  CC      stubs/notify-event.o
  CC      stubs/qtest.o
  CC      stubs/replay.o
  CC      stubs/replay-user.o
  CC      stubs/reset.o
  CC      stubs/runstate-check.o
  CC      stubs/set-fd-handler.o
  CC      stubs/slirp.o
  CC      stubs/sysbus.o
  CC      stubs/trace-control.o
  CC      stubs/uuid.o
  CC      stubs/vm-stop.o
  CC      stubs/vmstate.o
  CC      stubs/fd-register.o
  CC      stubs/cpus.o
  CC      stubs/kvm.o
  CC      stubs/qmp_pc_dimm_device_list.o
  CC      stubs/target-monitor-defs.o
  CC      stubs/target-get-monitor-def.o
  CC      stubs/vhost.o
  CC      stubs/iohandler.o
  CC      stubs/smbios_type_38.o
  CC      stubs/ipmi.o
  CC      stubs/pc_madt_cpu_entry.o
  CC      stubs/migration-colo.o
  GEN     qemu-img-cmds.h
  CC      async.o
  CC      thread-pool.o
  CC      block.o
  CC      blockjob.o
  CC      main-loop.o
  CC      iohandler.o
  CC      qemu-timer.o
  CC      aio-win32.o
  CC      qemu-io-cmds.o
  CC      replication.o
  CC      block/raw_bsd.o
  CC      block/qcow.o
  CC      block/vdi.o
  CC      block/vmdk.o
  CC      block/cloop.o
  CC      block/bochs.o
  CC      block/vpc.o
  CC      block/vvfat.o
  CC      block/dmg.o
  CC      block/qcow2.o
  CC      block/qcow2-refcount.o
  CC      block/qcow2-cluster.o
  CC      block/qcow2-snapshot.o
  CC      block/qcow2-cache.o
  CC      block/qed.o
  CC      block/qed-gencb.o
  CC      block/qed-l2-cache.o
  CC      block/qed-table.o
  CC      block/qed-cluster.o
  CC      block/qed-check.o
  CC      block/vhdx.o
  CC      block/vhdx-endian.o
  CC      block/vhdx-log.o
  CC      block/quorum.o
  CC      block/parallels.o
  CC      block/blkdebug.o
  CC      block/blkverify.o
  CC      block/blkreplay.o
  CC      block/block-backend.o
  CC      block/snapshot.o
  CC      block/qapi.o
  CC      block/raw-win32.o
  CC      block/win32-aio.o
  CC      block/null.o
  CC      block/mirror.o
  CC      block/commit.o
  CC      block/io.o
  CC      block/throttle-groups.o
  CC      block/nbd.o
  CC      block/nbd-client.o
  CC      block/sheepdog.o
  CC      block/accounting.o
  CC      block/dirty-bitmap.o
  CC      block/write-threshold.o
  CC      block/backup.o
  CC      block/replication.o
  CC      block/crypto.o
  CC      nbd/server.o
  CC      nbd/client.o
  CC      nbd/common.o
  CC      block/curl.o
  CC      block/dmg-bz2.o
  CC      block/ssh.o
  CC      crypto/init.o
  CC      crypto/hash.o
  CC      crypto/hash-nettle.o
  CC      crypto/desrfb.o
  CC      crypto/aes.o
  CC      crypto/cipher.o
  CC      crypto/tlscreds.o
  CC      crypto/tlscredsanon.o
  CC      crypto/tlscredsx509.o
  CC      crypto/tlssession.o
  CC      crypto/secret.o
  CC      crypto/random-gnutls.o
  CC      crypto/pbkdf.o
  CC      crypto/pbkdf-nettle.o
  CC      crypto/ivgen.o
  CC      crypto/ivgen-essiv.o
  CC      crypto/ivgen-plain.o
  CC      crypto/afsplit.o
  CC      crypto/ivgen-plain64.o
  CC      crypto/xts.o
  CC      crypto/block.o
  CC      crypto/block-qcow.o
  CC      crypto/block-luks.o
  CC      io/channel-buffer.o
  CC      io/channel.o
  CC      io/channel-command.o
  CC      io/channel-file.o
  CC      io/channel-socket.o
  CC      io/channel-tls.o
  CC      io/channel-watch.o
  CC      io/channel-websock.o
  CC      io/channel-util.o
  CC      io/task.o
  CC      qom/object.o
  CC      qom/qom-qobject.o
  CC      qom/container.o
  CC      qom/object_interfaces.o
  CC      qemu-io.o
  CC      blockdev.o
  CC      blockdev-nbd.o
  CC      iothread.o
  CC      qdev-monitor.o
  CC      device-hotplug.o
  CC      os-win32.o
  CC      qemu-char.o
  CC      page_cache.o
  CC      accel.o
  CC      bt-host.o
  CC      bt-vhci.o
  CC      dma-helpers.o
  CC      vl.o
  CC      tpm.o
  CC      device_tree.o
  GEN     qmp-marshal.c
  CC      qmp.o
  CC      hmp.o
  CC      cpus-common.o
  CC      audio/audio.o
  CC      audio/noaudio.o
  CC      audio/wavaudio.o
  CC      audio/mixeng.o
  CC      audio/sdlaudio.o
  CC      audio/dsoundaudio.o
  CC      audio/audio_win_int.o
  CC      audio/wavcapture.o
  CC      backends/rng.o
  CC      backends/rng-egd.o
  CC      backends/msmouse.o
  CC      backends/testdev.o
  CC      backends/tpm.o
  CC      backends/hostmem-ram.o
  CC      backends/hostmem.o
  CC      backends/cryptodev.o
  CC      backends/cryptodev-builtin.o
  CC      block/stream.o
  CC      disas/arm.o
  CXX     disas/arm-a64.o
  CC      disas/i386.o
  CXX     disas/libvixl/vixl/utils.o
  CXX     disas/libvixl/vixl/compiler-intrinsics.o
  CXX     disas/libvixl/vixl/a64/instructions-a64.o
  CXX     disas/libvixl/vixl/a64/decoder-a64.o
  CXX     disas/libvixl/vixl/a64/disasm-a64.o
  CC      hw/acpi/core.o
  CC      hw/acpi/piix4.o
  CC      hw/acpi/pcihp.o
  CC      hw/acpi/tco.o
  CC      hw/acpi/ich9.o
  CC      hw/acpi/cpu_hotplug.o
  CC      hw/acpi/memory_hotplug.o
  CC      hw/acpi/memory_hotplug_acpi_table.o
  CC      hw/acpi/cpu.o
  CC      hw/acpi/nvdimm.o
  CC      hw/acpi/acpi_interface.o
  CC      hw/acpi/bios-linker-loader.o
  CC      hw/acpi/aml-build.o
  CC      hw/acpi/ipmi.o
  CC      hw/audio/sb16.o
  CC      hw/audio/es1370.o
  CC      hw/audio/ac97.o
  CC      hw/audio/fmopl.o
  CC      hw/audio/adlib.o
  CC      hw/audio/gus.o
  CC      hw/audio/gusemu_hal.o
  CC      hw/audio/gusemu_mixer.o
  CC      hw/audio/cs4231a.o
  CC      hw/audio/intel-hda.o
  CC      hw/audio/hda-codec.o
  CC      hw/audio/pcspk.o
  CC      hw/audio/wm8750.o
  CC      hw/audio/pl041.o
  CC      hw/audio/lm4549.o
  CC      hw/audio/marvell_88w8618.o
  CC      hw/block/block.o
  CC      hw/block/cdrom.o
  CC      hw/block/fdc.o
  CC      hw/block/hd-geometry.o
  CC      hw/block/m25p80.o
  CC      hw/block/nand.o
  CC      hw/block/pflash_cfi01.o
  CC      hw/block/pflash_cfi02.o
  CC      hw/block/ecc.o
  CC      hw/block/onenand.o
  CC      hw/block/nvme.o
  CC      hw/bt/core.o
  CC      hw/bt/l2cap.o
  CC      hw/bt/sdp.o
  CC      hw/bt/hci.o
  CC      hw/bt/hid.o
  CC      hw/bt/hci-csr.o
  CC      hw/char/ipoctal232.o
  CC      hw/char/parallel.o
  CC      hw/char/pl011.o
  CC      hw/char/serial.o
  CC      hw/char/serial-isa.o
  CC      hw/char/serial-pci.o
  CC      hw/char/virtio-console.o
In file included from /tmp/qemu-test/src/vl.c:126:0:
/tmp/qemu-test/src/include/hw/virtio/vhost-pci-slave.h:4:25: fatal error: linux/vhost.h: No such file or directory
 #include <linux/vhost.h>
                         ^

compilation terminated.
/tmp/qemu-test/src/rules.mak:60: recipe for target 'vl.o' failed
make: *** [vl.o] Error 1
make: *** Waiting for unfinished jobs....
make[1]: *** [docker-run] Error 2
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-ff527md2/src'
make: *** [docker-run-test-mingw@fedora] Error 2
=== OUTPUT END ===

Test command exited with code: 2

---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]