acpi, vhost, misc: fixes, features
Subsystems (6)
The following changes since commit 63b88968f139b6a77f2f81e6f1eedf70c0170a85:
intel-iommu: rework the page walk logic (2018-05-23 17:34:05 +0300)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to 25b1d45a1975fd8624c37b5bf42e8502ccf53460:
vhost-blk: turn on pre-defined RO feature bit (2018-06-01 19:20:38 +0300)
----------------------------------------------------------------
acpi, vhost, misc: fixes, features
vDPA support, fix to vhost blk RO bit handling, some include path cleanups, NFIT ACPI table.
----------------------------------------------------------------
Changpeng Liu (1):
vhost-blk: turn on pre-defined RO feature bit
Michael S. Tsirkin (21):
osdep: add wait.h compat macros
libqtest: fail if child coredumps
block: use local path for local headers
crypto: use local path for local headers
hppa: use local path for local headers
migration: drop an unused include
trace: use local path for local headers
display: use local path for local headers
ide: use local path for local headers
ioapic: fix up includes
e1000e: use local path for local headers
rocker: drop an unused include
ppc: use local path for local headers
vhost-scsi: drop an unused include
sd: fix up include
usb: use local path for local headers
migration: use local path for local headers
colo: use local path for local headers
qga: use local path for local headers
ui: use local path for local headers
arch_init: sort architectures
Ross Zwisler (3):
tests/.gitignore: add entry for generated file nvdimm, acpi: support NFIT platform capabilities ACPI testing: test NFIT platform capabilities
Tiwei Bie (6):
vhost: allow backends to filter memory sections
vhost-user: allow slave to send fds via slave channel
vhost-user: introduce shared vhost-user state
vhost-user: support registering external host notifiers
libvhost-user: support host notifier
vhost-user-bridge: support host notifier
docs/interop/vhost-user.txt | 38 +++++++ docs/nvdimm.txt | 27 +++++ contrib/libvhost-user/libvhost-user.h | 32 ++++++ crypto/block-luks.h | 2 +- crypto/block-qcow.h | 2 +- crypto/ivgen-essiv.h | 2 +- crypto/ivgen-plain.h | 2 +- crypto/ivgen-plain64.h | 2 +- hw/hppa/hppa_sys.h | 2 +- include/hw/i386/pc.h | 1 + include/hw/mem/nvdimm.h | 5 + include/hw/virtio/vhost-backend.h | 4 + include/hw/virtio/vhost-user-blk.h | 3 +- include/hw/virtio/vhost-user-scsi.h | 2 + include/hw/virtio/vhost-user.h | 28 +++++ include/migration/vmstate.h | 2 +- include/qemu/osdep.h | 10 ++ trace/control.h | 2 +- arch_init.c | 16 +-- backends/cryptodev-vhost-user.c | 20 +++- block/crypto.c | 2 +- block/nbd.c | 2 +- block/qcow.c | 2 +- block/qcow2-bitmap.c | 2 +- block/qcow2-cluster.c | 2 +- block/qcow2-refcount.c | 2 +- block/qcow2-snapshot.c | 2 +- block/qcow2.c | 4 +- block/vhdx-endian.c | 2 +- block/vhdx-log.c | 2 +- block/vhdx.c | 2 +- contrib/libvhost-user/libvhost-user.c | 81 ++++++++++++-- contrib/vhost-user-blk/vhost-user-blk.c | 48 ++++++--- crypto/block-luks.c | 2 +- crypto/block-qcow.c | 2 +- crypto/block.c | 6 +- crypto/cipher.c | 6 +- crypto/ivgen-essiv.c | 2 +- crypto/ivgen-plain.c | 2 +- crypto/ivgen-plain64.c | 2 +- crypto/ivgen.c | 8 +- crypto/tlscreds.c | 2 +- crypto/tlscredsanon.c | 2 +- crypto/tlscredsx509.c | 2 +- hw/acpi/nvdimm.c | 45 +++++++- hw/block/vhost-user-blk.c | 27 ++++- hw/display/bcm2835_fb.c | 2 +- hw/hppa/machine.c | 2 +- hw/i386/pc.c | 31 ++++++ hw/ide/ahci-allwinner.c | 2 +- hw/ide/ahci.c | 2 +- hw/ide/ich.c | 2 +- hw/intc/ioapic.c | 3 +- hw/net/e1000e.c | 2 +- hw/net/rocker/rocker_fp.c | 1 - hw/ppc/ppc440_uc.c | 2 +- hw/ppc/sam460ex.c | 4 +- hw/scsi/vhost-scsi-common.c | 1 - hw/scsi/vhost-user-scsi.c | 20 +++- hw/sd/milkymist-memcard.c | 2 +- hw/usb/desc-msos.c | 2 +- hw/usb/desc.c | 2 +- hw/usb/dev-audio.c | 2 +- hw/usb/dev-bluetooth.c | 2 +- hw/usb/dev-hid.c | 2 +- hw/usb/dev-hub.c | 2 +- hw/usb/dev-mtp.c | 2 +- hw/usb/dev-network.c | 2 +- hw/usb/dev-serial.c | 2 +- hw/usb/dev-smartcard-reader.c | 2 +- hw/usb/dev-storage.c | 2 +- hw/usb/dev-uas.c | 2 +- hw/usb/dev-wacom.c | 2 +- hw/virtio/vhost-stub.c | 10 ++ hw/virtio/vhost-user.c | 182 ++++++++++++++++++++++++++++---- hw/virtio/vhost.c | 9 +- migration/block-dirty-bitmap.c | 2 +- migration/page_cache.c | 2 +- migration/ram.c | 4 +- migration/savevm.c | 1 + migration/vmstate.c | 2 +- net/colo-compare.c | 2 +- net/colo.c | 2 +- net/filter-rewriter.c | 2 +- net/vhost-user.c | 44 ++++++-- qga/channel-posix.c | 2 +- qga/channel-win32.c | 4 +- qga/commands-posix.c | 2 +- qga/commands-win32.c | 4 +- qga/commands.c | 2 +- qga/guest-agent-command-state.c | 2 +- qga/main.c | 4 +- qga/vss-win32.c | 6 +- tests/bios-tables-test.c | 2 +- tests/libqtest.c | 9 +- tests/vhost-user-bridge.c | 98 ++++++++++++++++- trace/qmp.c | 2 +- ui/gtk.c | 2 +- ui/input-keymap.c | 2 +- ui/input-legacy.c | 2 +- ui/spice-input.c | 2 +- hw/virtio/Makefile.objs | 2 +- tests/.gitignore | 1 + tests/acpi-test-data/pc/NFIT.dimmpxm | Bin 224 -> 240 bytes tests/acpi-test-data/q35/NFIT.dimmpxm | Bin 224 -> 240 bytes 105 files changed, 808 insertions(+), 167 deletions(-) create mode 100644 include/hw/virtio/vhost-user.h
[Qemu-devel] [PULL 01/31] vhost: allow backends to filter memory sections
From: Tiwei Bie <[email protected]>
This patch introduces a vhost op for vhost backends to allow them to filter the memory sections that they can handle.
--- include/hw/virtio/vhost-backend.h | 4 ++++ hw/virtio/vhost-user.c | 11 +++++++++++ hw/virtio/vhost.c | 9 +++++++-- 3 files changed, 22 insertions(+), 2 deletions(-)
include/hw/virtio/vhost-backend.h +4 -0
@@ -101,6 +101,9 @@ typedef int (*vhost_crypto_create_session_op)(struct vhost_dev *dev,typedef int (*vhost_crypto_close_session_op )(struct vhost_dev *dev,uint64_t session_id); +typedef bool (*vhost_backend_mem_section_filter_op )(struct vhost_dev *dev, +MemoryRegionSection *section); + typedef struct VhostOps { VhostBackendType backend_type; vhost_backend_init vhost_backend_init;
@@ -138,6 +141,7 @@ typedef struct VhostOps {vhost_set_config_op vhost_set_config;vhost_crypto_create_session_op vhost_crypto_create_session;vhost_crypto_close_session_op vhost_crypto_close_session; +vhost_backend_mem_section_filter_op vhost_backend_mem_section_filter; } VhostOps;extern const VhostOps user_ops;
hw/virtio/vhost-user.c +11 -0
@@ -1620,6 +1620,16 @@ vhost_user_crypto_close_session(struct vhost_dev *dev, uint64_t session_id)return 0 ; } +static bool vhost_user_mem_section_filter (struct vhost_dev *dev, +MemoryRegionSection *section) +{ +bool result; + + result =memory_region_get_fd (section->mr) >=0 ; + +return result; +} +const VhostOps user_ops = { .backend_type =VHOST_BACKEND_TYPE_USER , .vhost_backend_init = vhost_user_init,
@@ -1650,4 +1660,5 @@ const VhostOps user_ops = { .vhost_set_config = vhost_user_set_config, .vhost_crypto_create_session = vhost_user_crypto_create_session, .vhost_crypto_close_session = vhost_user_crypto_close_session, + .vhost_backend_mem_section_filter = vhost_user_mem_section_filter, };
hw/virtio/vhost.c +7 -2
@@ -386,7 +386,7 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev,return r; } -static bool vhost_section (MemoryRegionSection *section) +static bool vhost_section (struct vhost_dev *dev,MemoryRegionSection *section) {bool result; bool log_dirty = memory_region_get_dirty_log_mask(section->mr) &
@@ -399,6 +399,11 @@ static bool vhost_section(MemoryRegionSection *section)*/ result &= !log_dirty; +if (result && dev->vhost_ops->vhost_backend_mem_section_filter) { + result &= + dev->vhost_ops->vhost_backend_mem_section_filter (dev, section); + } +trace_vhost_section (section->mr->name, result);return result; }
@@ -632,7 +637,7 @@ static void vhost_region_addnop(MemoryListener *listener, struct vhost_dev *dev = container_of(listener, struct vhost_dev, memory_listener); -if (!vhost_section (section)) { +if (!vhost_section (dev, section)) {return ; }vhost_region_add_section (dev, section);
Signature · 1 line
MST
[Qemu-devel] [PULL 02/31] vhost-user: allow slave to send fds via slave channel
In reply to Michael S. TsirkinFrom: Tiwei Bie <[email protected]>
Introduce VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD protocol feature to allow slave to send at most 8 descriptors in each message to master via ancillary data using the slave channel.
--- docs/interop/vhost-user.txt | 5 +++++ hw/virtio/vhost-user.c | 27 +++++++++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-)
docs/interop/vhost-user.txt +5 -0
@@ -367,6 +367,10 @@ The fd is provided via VHOST_USER_SET_SLAVE_REQ_FD ancillary data. A slave may then send VHOST_USER_SLAVE_* messages to the master using this fd communication channel. +If VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD protocol feature is negotiated, +slave can send file descriptors (at most 8 descriptors in each message) +to master via ancillary data using this fd communication channel. + Protocol features -----------------
@@ -380,6 +384,7 @@ Protocol features #define VHOST_USER_PROTOCOL_F_CRYPTO_SESSION 7 #define VHOST_USER_PROTOCOL_F_PAGEFAULT 8 #define VHOST_USER_PROTOCOL_F_CONFIG 9 +#define VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD 10 Master message types --------------------
hw/virtio/vhost-user.c +17 -10
@@ -30,6 +30,7 @@#define VHOST_MEMORY_MAX_NREGIONS 8#define VHOST_USER_F_PROTOCOL_FEATURES 30 +#define VHOST_USER_SLAVE_MAX_FDS 8/* * Maximum size of virtio device config space
@@ -47,6 +48,7 @@ enum VhostUserProtocolFeature {VHOST_USER_PROTOCOL_F_CRYPTO_SESSION =7 ,VHOST_USER_PROTOCOL_F_PAGEFAULT =8 ,VHOST_USER_PROTOCOL_F_CONFIG =9 , +VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD =10 , VHOST_USER_PROTOCOL_F_MAX };
@@ -854,10 +856,10 @@ static void slave_read(void *opaque)int size, ret =0 ;struct iovec iov;struct msghdr msgh; -int fd =-1 ; +int fd[VHOST_USER_SLAVE_MAX_FDS ];char control[CMSG_SPACE (sizeof (fd))];struct cmsghdr *cmsg; -size_t fdsize; +int i, fdsize =0 ;memset (&msgh,0 ,sizeof (msgh)); msgh.msg_iov = &iov;
@@ -865,6 +867,8 @@ static void slave_read(void *opaque) msgh.msg_control = control; msgh.msg_controllen =sizeof (control); +memset (fd,-1 ,sizeof (fd)); +/* Read header */ iov.iov_base = &hdr; iov.iov_len =VHOST_USER_HDR_SIZE ;
@@ -885,7 +889,7 @@ static void slave_read(void *opaque)if (cmsg->cmsg_level ==SOL_SOCKET && cmsg->cmsg_type ==SCM_RIGHTS ) { fdsize = cmsg->cmsg_len -CMSG_LEN (0 ); -memcpy (&fd,CMSG_DATA (cmsg), fdsize); +memcpy (fd,CMSG_DATA (cmsg), fdsize);break ; } }
@@ -913,14 +917,15 @@ static void slave_read(void *opaque)break ;default :error_report ("Received unexpected msg type." ); -if (fd !=-1 ) { -close (fd); - } ret = -EINVAL ; } -/* Message handlers need to make sure that fd will be consumed. */ - fd =-1 ; +/* Close the remaining file descriptors. */ +for (i =0 ; i < fdsize; i++) { +if (fd[i] !=-1 ) { +close (fd[i]); + } + }/* * REPLY_ACK feature handling. Other reply types has to be managed
@@ -954,8 +959,10 @@ err:qemu_set_fd_handler (u->slave_fd,NULL ,NULL ,NULL );close (u->slave_fd); u->slave_fd =-1 ; -if (fd !=-1 ) { -close (fd); +for (i =0 ; i < fdsize; i++) { +if (fd[i] !=-1 ) { +close (fd[i]); + } }return ; }
Signature · 1 line
MST
[Qemu-devel] [PULL 04/31] vhost-user: support registering external host notifiers
In reply to Michael S. TsirkinFrom: Tiwei Bie <[email protected]>
This patch introduces VHOST_USER_PROTOCOL_F_HOST_NOTIFIER. With this feature negotiated, vhost-user backend can register memory region based host notifiers. And it will allow the guest driver in the VM to notify the hardware accelerator at the vhost-user backend directly.
--- docs/interop/vhost-user.txt | 33 ++++++++++ include/hw/virtio/vhost-user.h | 8 +++ hw/virtio/vhost-user.c | 113 +++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+)
docs/interop/vhost-user.txt +33 -0
@@ -132,6 +132,16 @@ Depending on the request type, payload can be: Payload: Size bytes array holding the contents of the virtio device's configuration space + * Vring area description + ----------------------- + | u64 | size | offset | + ----------------------- + + u64: a 64-bit integer contains vring index and flags + Size: a 64-bit size of this area + Offset: a 64-bit offset of this area from the start of the + supplied file descriptor + In QEMU the vhost-user message is implemented with the following struct: typedef struct VhostUserMsg {
@@ -146,6 +156,7 @@ typedef struct VhostUserMsg { VhostUserLog log; struct vhost_iotlb_msg iotlb; VhostUserConfig config; + VhostUserVringArea area; }; } QEMU_PACKED VhostUserMsg;
@@ -385,6 +396,7 @@ Protocol features #define VHOST_USER_PROTOCOL_F_PAGEFAULT 8 #define VHOST_USER_PROTOCOL_F_CONFIG 9 #define VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD 10 +#define VHOST_USER_PROTOCOL_F_HOST_NOTIFIER 11 Master message types --------------------
@@ -782,6 +794,27 @@ Slave message types the VHOST_USER_NEED_REPLY flag, master must respond with zero when operation is successfully completed, or non-zero otherwise. + * VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG + + Id: 3 + Equivalent ioctl: N/A + Slave payload: vring area description + Master payload: N/A + + Sets host notifier for a specified queue. The queue index is contained + in the u64 field of the vring area description. The host notifier is + described by the file descriptor (typically it's a VFIO device fd) which + is passed as ancillary data and the size (which is mmap size and should + be the same as host page size) and offset (which is mmap offset) carried + in the vring area description. QEMU can mmap the file descriptor based + on the size and offset to get a memory range. Registering a host notifier + means mapping this memory range to the VM as the specified queue's notify + MMIO region. Slave sends this request to tell QEMU to de-register the + existing notifier if any and register the new notifier if the request is + sent with a file descriptor. + This request should be sent only when VHOST_USER_PROTOCOL_F_HOST_NOTIFIER + protocol feature has been successfully negotiated. + VHOST_USER_PROTOCOL_F_REPLY_ACK: ------------------------------- The original vhost-user specification only demands replies for certain
include/hw/virtio/vhost-user.h +8 -0
@@ -9,9 +9,17 @@#define HW_VIRTIO_VHOST_USER_H #include "chardev/char-fe.h" +#include "hw/virtio/virtio.h" + +typedef struct VhostUserHostNotifier { +MemoryRegion mr; +void *addr; +bool set; +}VhostUserHostNotifier ;typedef struct VhostUserState {CharBackend *chr; +VhostUserHostNotifier notifier[VIRTIO_QUEUE_MAX ]; }VhostUserState ;VhostUserState *vhost_user_init (void );
hw/virtio/vhost-user.c +113 -0
176 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 03/31] vhost-user: introduce shared vhost-user state
In reply to Michael S. TsirkinFrom: Tiwei Bie <[email protected]>
When multi queue is enabled e.g. for a virtio-net device, each queue pair will have a vhost_dev, and the only thing shared between vhost devs currently is the chardev. This patch introduces a vhost-user state structure which will be shared by all vhost devs of the same virtio device.
--- include/hw/virtio/vhost-user-blk.h | 2 ++ include/hw/virtio/vhost-user-scsi.h | 2 ++ include/hw/virtio/vhost-user.h | 20 +++++++++++++ backends/cryptodev-vhost-user.c | 20 ++++++++++++- hw/block/vhost-user-blk.c | 22 ++++++++++++++- hw/scsi/vhost-user-scsi.c | 20 ++++++++++++- hw/virtio/vhost-stub.c | 10 +++++++ hw/virtio/vhost-user.c | 31 ++++++++++++++------ net/vhost-user.c | 44 +++++++++++++++++++++++------ hw/virtio/Makefile.objs | 2 +- 10 files changed, 152 insertions(+), 21 deletions(-) create mode 100644 include/hw/virtio/vhost-user.h
include/hw/virtio/vhost-user-blk.h +2 -0
@@ -21,6 +21,7 @@#include "hw/block/block.h" #include "chardev/char-fe.h" #include "hw/virtio/vhost.h" +#include "hw/virtio/vhost-user.h" #define TYPE_VHOST_USER_BLK "vhost-user-blk"#define VHOST_USER_BLK (obj) \
@@ -36,6 +37,7 @@ typedef struct VHostUserBlk {uint32_t config_wce;uint32_t config_ro;struct vhost_dev dev; + VhostUserState *vhost_user; } VHostUserBlk;#endif
include/hw/virtio/vhost-user-scsi.h +2 -0
@@ -21,6 +21,7 @@#include "hw/qdev.h" #include "hw/virtio/virtio-scsi.h" #include "hw/virtio/vhost.h" +#include "hw/virtio/vhost-user.h" #include "hw/virtio/vhost-scsi-common.h" #define TYPE_VHOST_USER_SCSI "vhost-user-scsi"
@@ -30,6 +31,7 @@typedef struct VHostUserSCSI {VHostSCSICommon parent_obj;uint64_t host_features; +VhostUserState *vhost_user; }VHostUserSCSI ;#endif /* VHOST_USER_SCSI_H */
include/hw/virtio/vhost-user.h new file +20 -0
@@ -0,0 +1,20 @@ +/* +* Copyright (c) 2017-2018 Intel Corporation +* +* This work is licensed under the terms of the GNU GPL, version 2. +* See the COPYING file in the top-level directory. +*/ + +#ifndef HW_VIRTIO_VHOST_USER_H +#define HW_VIRTIO_VHOST_USER_H + +#include "chardev/char-fe.h" + +typedef struct VhostUserState { +CharBackend *chr; +}VhostUserState ; + +VhostUserState *vhost_user_init (void ); +void vhost_user_cleanup (VhostUserState *user); + +#endif
backends/cryptodev-vhost-user.c +19 -1
@@ -26,6 +26,7 @@#include "qapi/error.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" +#include "hw/virtio/vhost-user.h" #include "standard-headers/linux/virtio_crypto.h" #include "sysemu/cryptodev-vhost.h" #include "chardev/char-fe.h"
@@ -46,6 +47,7 @@ typedef struct CryptoDevBackendVhostUser { CryptoDevBackend parent_obj; + VhostUserState *vhost_user; CharBackend chr; char *chr_name; bool opened;
@@ -102,7 +104,7 @@ cryptodev_vhost_user_start(int queues,continue ; } - options.opaque = &s->chr; + options.opaque = s->vhost_user; options.backend_type =VHOST_BACKEND_TYPE_USER ; options.cc = b->conf.peers.ccs[i]; s->vhost_crypto[i] =cryptodev_vhost_init (&options);
@@ -185,6 +187,7 @@ static void cryptodev_vhost_user_init(size_t i;Error *local_err =NULL ;Chardev *chr; +VhostUserState *user;CryptoDevBackendClient *cc;CryptoDevBackendVhostUser *s =CRYPTODEV_BACKEND_VHOST_USER (backend);
@@ -215,6 +218,15 @@ static void cryptodev_vhost_user_init( } } + user =vhost_user_init (); +if (!user) { +error_setg (errp,"Failed to init vhost_user" ); +return ; + } + + user->chr = &s->chr; + s->vhost_user = user; +qemu_chr_fe_set_handlers (&s->chr,NULL ,NULL , cryptodev_vhost_user_event,NULL , s,NULL , true);
@@ -299,6 +311,12 @@ static void cryptodev_vhost_user_cleanup( backend->conf.peers.ccs[i] =NULL ; } } + +if (s->vhost_user) { +vhost_user_cleanup (s->vhost_user); +g_free (s->vhost_user); + s->vhost_user =NULL ; + } } static void cryptodev_vhost_user_set_chardev(Object *obj,
hw/block/vhost-user-blk.c +21 -1
@@ -226,6 +226,7 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp) {VirtIODevice *vdev =VIRTIO_DEVICE (dev);VHostUserBlk *s =VHOST_USER_BLK (vdev); +VhostUserState *user;int i, ret;if (!s->chardev.chr) {
@@ -243,6 +244,15 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp)return ; } + user =vhost_user_init (); +if (!user) { +error_setg (errp,"vhost-user-blk: failed to init vhost_user" ); +return ; + } + + user->chr = &s->chardev; + s->vhost_user = user; +virtio_init (vdev,"virtio-blk" ,VIRTIO_ID_BLOCK ,sizeof (struct virtio_blk_config ));
@@ -258,7 +268,7 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp)vhost_dev_set_config_notifier (&s->dev, &blk_ops); - ret =vhost_dev_init (&s->dev, &s->chardev,VHOST_BACKEND_TYPE_USER ,0 ); + ret =vhost_dev_init (&s->dev, s->vhost_user,VHOST_BACKEND_TYPE_USER ,0 );if (ret <0 ) {error_setg (errp,"vhost-user-blk: vhost initialization failed: %s" ,strerror (-ret));
@@ -283,6 +293,10 @@ vhost_err: virtio_err:g_free (s->dev.vqs);virtio_cleanup (vdev); + +vhost_user_cleanup (user); +g_free (user); + s->vhost_user =NULL ; }static void vhost_user_blk_device_unrealize (DeviceState *dev,Error **errp)
@@ -294,6 +308,12 @@ static void vhost_user_blk_device_unrealize(DeviceState *dev, Error **errp)vhost_dev_cleanup (&s->dev);g_free (s->dev.vqs);virtio_cleanup (vdev); + +if (s->vhost_user) { +vhost_user_cleanup (s->vhost_user); +g_free (s->vhost_user); + s->vhost_user =NULL ; + } }static void vhost_user_blk_instance_init (Object *obj)
hw/scsi/vhost-user-scsi.c +19 -1
@@ -69,6 +69,7 @@ static void vhost_user_scsi_realize(DeviceState *dev, Error **errp)VirtIOSCSICommon *vs =VIRTIO_SCSI_COMMON (dev);VHostUserSCSI *s =VHOST_USER_SCSI (dev);VHostSCSICommon *vsc =VHOST_SCSI_COMMON (s); +VhostUserState *user;Error *err =NULL ;int ret;
@@ -85,19 +86,30 @@ static void vhost_user_scsi_realize(DeviceState *dev, Error **errp)return ; } + user =vhost_user_init (); +if (!user) { +error_setg (errp,"vhost-user-scsi: failed to init vhost_user" ); +return ; + } + user->chr = &vs->conf.chardev; + vsc->dev.nvqs =2 + vs->conf.num_queues; vsc->dev.vqs = g_new(struct vhost_virtqueue, vsc->dev.nvqs); vsc->dev.vq_index =0 ; vsc->dev.backend_features =0 ; - ret =vhost_dev_init (&vsc->dev, (void *)&vs->conf.chardev, + ret =vhost_dev_init (&vsc->dev, user,VHOST_BACKEND_TYPE_USER ,0 );if (ret <0 ) {error_setg (errp,"vhost-user-scsi: vhost initialization failed: %s" ,strerror (-ret)); +vhost_user_cleanup (user); +g_free (user);return ; } + s->vhost_user = user; +/* Channel and lun both are 0 for bootable vhost-user-scsi disk */ vsc->channel =0 ; vsc->lun =0 ;
@@ -117,6 +129,12 @@ static void vhost_user_scsi_unrealize(DeviceState *dev, Error **errp)g_free (vsc->dev.vqs);virtio_scsi_common_unrealize (dev, errp); + +if (s->vhost_user) { +vhost_user_cleanup (s->vhost_user); +g_free (s->vhost_user); + s->vhost_user =NULL ; + } } static uint64_t vhost_user_scsi_get_features(VirtIODevice *vdev,
hw/virtio/vhost-stub.c +10 -0
@@ -1,7 +1,17 @@#include "qemu/osdep.h" #include "hw/virtio/vhost.h" +#include "hw/virtio/vhost-user.h" bool vhost_has_free_slot (void ) {return true; } + +VhostUserState *vhost_user_init (void ) +{ +return NULL ; +} + +void vhost_user_cleanup (VhostUserState *user) +{ +}
hw/virtio/vhost-user.c +22 -9
@@ -11,6 +11,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "hw/virtio/vhost.h" +#include "hw/virtio/vhost-user.h" #include "hw/virtio/vhost-backend.h" #include "hw/virtio/virtio-net.h" #include "chardev/char-fe.h"
@@ -175,7 +176,8 @@ static VhostUserMsg m __attribute__ ((unused));struct vhost_user {struct vhost_dev *dev; -CharBackend *chr; +/* Shared between vhost devs of the same virtio device */ +VhostUserState *user;int slave_fd;NotifierWithReturn postcopy_notifier;struct PostCopyFD postcopy_fd;
@@ -201,7 +203,7 @@ static bool ioeventfd_enabled(void)static int vhost_user_read (struct vhost_dev *dev,VhostUserMsg *msg) {struct vhost_user *u = dev->opaque; -CharBackend *chr = u->chr; +CharBackend *chr = u->user->chr;uint8_t *p = (uint8_t *) msg;int r, size =VHOST_USER_HDR_SIZE ;
@@ -287,7 +289,7 @@ static int vhost_user_write(struct vhost_dev *dev, VhostUserMsg *msg, int *fds, int fd_num) {struct vhost_user *u = dev->opaque; -CharBackend *chr = u->chr; +CharBackend *chr = u->user->chr;int ret, size =VHOST_USER_HDR_SIZE + msg->hdr.size;/*
@@ -1090,7 +1092,7 @@ static int vhost_user_postcopy_waker(struct PostCopyFD *pcfd, RAMBlock *rb,static int vhost_user_postcopy_advise (struct vhost_dev *dev,Error **errp) {struct vhost_user *u = dev->opaque; -CharBackend *chr = u->chr; +CharBackend *chr = u->user->chr;int ufd;VhostUserMsg msg = { .hdr.request =VHOST_USER_POSTCOPY_ADVISE ,
@@ -1228,7 +1230,7 @@ static int vhost_user_postcopy_notifier(NotifierWithReturn *notifier,return 0 ; } -static int vhost_user_init (struct vhost_dev *dev,void *opaque) +static int vhost_user_backend_init (struct vhost_dev *dev,void *opaque) {uint64_t features, protocol_features;struct vhost_user *u;
@@ -1237,7 +1239,7 @@ static int vhost_user_init(struct vhost_dev *dev, void *opaque)assert (dev->vhost_ops->backend_type ==VHOST_BACKEND_TYPE_USER ); u = g_new0(struct vhost_user, 1); - u->chr = opaque; + u->user = opaque; u->slave_fd =-1 ; u->dev = dev; dev->opaque = u;
@@ -1313,7 +1315,7 @@ static int vhost_user_init(struct vhost_dev *dev, void *opaque)return 0 ; } -static int vhost_user_cleanup (struct vhost_dev *dev) +static int vhost_user_backend_cleanup (struct vhost_dev *dev) {struct vhost_user *u;
@@ -1637,10 +1639,21 @@ static bool vhost_user_mem_section_filter(struct vhost_dev *dev,return result; } +VhostUserState *vhost_user_init (void ) +{ + VhostUserState *user = g_new0(struct VhostUserState, 1); + +return user; +} + +void vhost_user_cleanup (VhostUserState *user) +{ +} +const VhostOps user_ops = { .backend_type =VHOST_BACKEND_TYPE_USER , - .vhost_backend_init = vhost_user_init, - .vhost_backend_cleanup = vhost_user_cleanup, + .vhost_backend_init = vhost_user_backend_init, + .vhost_backend_cleanup = vhost_user_backend_cleanup, .vhost_backend_memslots_limit = vhost_user_memslots_limit, .vhost_set_log_base = vhost_user_set_log_base, .vhost_set_mem_table = vhost_user_set_mem_table,
net/vhost-user.c +36 -8
117 lines not on this page · raw message
hw/virtio/Makefile.objs +1 -1
@@ -11,5 +11,5 @@ obj-y += virtio-crypto.o obj-$(CONFIG_VIRTIO_PCI) += virtio-crypto-pci.o endif -common-obj-$(call lnot,$(CONFIG_LINUX)) += vhost-stub.o +common-obj-$(call lnot,$(call land,$(CONFIG_VIRTIO),$(CONFIG_LINUX))) += vhost-stub.o common-obj-$(CONFIG_ALL) += vhost-stub.o
Signature · 1 line
MST
[Qemu-devel] [PULL 05/31] libvhost-user: support host notifier
In reply to Michael S. TsirkinFrom: Tiwei Bie <[email protected]>
This patch introduces the host notifier support in libvhost-user. A new API is added to support setting host notifier for each queue.
--- contrib/libvhost-user/libvhost-user.h | 32 +++++++++++ contrib/libvhost-user/libvhost-user.c | 81 ++++++++++++++++++++++++--- 2 files changed, 105 insertions(+), 8 deletions(-)
contrib/libvhost-user/libvhost-user.h +32 -0
@@ -51,6 +51,8 @@ enum VhostUserProtocolFeature {VHOST_USER_PROTOCOL_F_CRYPTO_SESSION =7 ,VHOST_USER_PROTOCOL_F_PAGEFAULT =8 ,VHOST_USER_PROTOCOL_F_CONFIG =9 , +VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD =10 , +VHOST_USER_PROTOCOL_F_HOST_NOTIFIER =11 , VHOST_USER_PROTOCOL_F_MAX };
@@ -92,6 +94,14 @@ typedef enum VhostUserRequest {VHOST_USER_MAX } VhostUserRequest; +typedef enum VhostUserSlaveRequest { +VHOST_USER_SLAVE_NONE =0 , +VHOST_USER_SLAVE_IOTLB_MSG =1 , +VHOST_USER_SLAVE_CONFIG_CHANGE_MSG =2 , +VHOST_USER_SLAVE_VRING_HOST_NOTIFIER_MSG =3 , +VHOST_USER_SLAVE_MAX +}VhostUserSlaveRequest ; + typedef struct VhostUserMemoryRegion { uint64_t guest_phys_addr; uint64_t memory_size;
@@ -122,6 +132,12 @@ static VhostUserConfig c __attribute__ ((unused)); + sizeof(c.size) \ + sizeof(c.flags)) +typedef struct VhostUserVringArea { +uint64_t u64; +uint64_t size; +uint64_t offset; +}VhostUserVringArea ; +#if defined(_WIN32)# define VU_PACKED __attribute__((gcc_struct, packed))#else
@@ -133,6 +149,7 @@ typedef struct VhostUserMsg {#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 */
@@ -145,6 +162,7 @@ typedef struct VhostUserMsg {VhostUserMemory memory;VhostUserLog log;VhostUserConfig config; +VhostUserVringArea area; } payload;int fds[VHOST_MEMORY_MAX_NREGIONS ];
@@ -368,6 +386,20 @@ VuVirtq *vu_get_queue(VuDev *dev, int qidx);void vu_set_queue_handler (VuDev *dev,VuVirtq *vq,vu_queue_handler_cb handler); +/** +* vu_set_queue_host_notifier: +* @dev: a VuDev context +* @vq: a VuVirtq queue +* @fd: a file descriptor +* @size: host page size +* @offset: notifier offset in @fd file +* +* Set queue's host notifier. This function may be called several +* times for the same queue. If called with -1 @fd, the notifier +* is removed. +*/ +bool vu_set_queue_host_notifier (VuDev *dev,VuVirtq *vq,int fd, +int size,int offset);/** * vu_queue_set_notification:
contrib/libvhost-user/libvhost-user.c +73 -8
117 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 06/31] vhost-user-bridge: support host notifier
In reply to Michael S. TsirkinFrom: Tiwei Bie <[email protected]>
This patch introduces the host notifier support in vhost-user-bridge. A new option (-H) is added to use the host notifier. This is mainly used to test the host notifier implementation in vhost user.
--- tests/vhost-user-bridge.c | 98 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 95 insertions(+), 3 deletions(-)
tests/vhost-user-bridge.c +95 -3
@@ -29,6 +29,7 @@#define _FILE_OFFSET_BITS 64 +#include "qemu/atomic.h" #include "qemu/osdep.h" #include "qemu/iov.h" #include "standard-headers/linux/virtio_net.h"
@@ -65,6 +66,11 @@ typedef struct VubrDev {int sock;int ready;int quit; +struct { +int fd; +void *addr; +pthread_t thread; + } notifier; } VubrDev; static void
@@ -445,14 +451,22 @@ static uint64_t vubr_get_features(VuDev *dev) {return 1ULL <<VIRTIO_NET_F_GUEST_ANNOUNCE | -1ULL <<VIRTIO_NET_F_MRG_RXBUF ; +1ULL <<VIRTIO_NET_F_MRG_RXBUF | +1ULL <<VIRTIO_F_VERSION_1 ; }static void vubr_queue_set_started (VuDev *dev,int qidx,bool started) { +VubrDev *vubr =container_of (dev, VubrDev, vudev);VuVirtq *vq =vu_get_queue (dev, qidx); +if (started && vubr->notifier.fd >=0 ) { +vu_set_queue_host_notifier (dev, vq, vubr->notifier.fd, +getpagesize (), + qidx *getpagesize ()); + } +if (qidx %2 ==1 ) {vu_set_queue_handler (dev, vq, started ? vubr_handle_tx :NULL ); }
@@ -522,6 +536,8 @@ vubr_new(const char *path, bool client)vubr_die ("socket" ); } + dev->notifier.fd =-1 ; + un.sun_family =AF_UNIX ;strcpy (un.sun_path, path); len =sizeof (un.sun_family) +strlen (path);
@@ -559,6 +575,73 @@ vubr_new(const char *path, bool client)return dev; } +static void *notifier_thread (void *arg) +{ +VuDev *dev = (VuDev *)arg; +VubrDev *vubr =container_of (dev, VubrDev, vudev); +int pagesize =getpagesize (); +int qidx; + +while (true) { +for (qidx =0 ; qidx <VHOST_MAX_NR_VIRTQUEUE ; qidx++) { +uint16_t *n = vubr->notifier.addr + pagesize * qidx; + +if (*n == qidx) { + *n =0xffff ; +/* We won't miss notifications if we reset +* the memory first. */ +smp_mb (); + +DPRINT ("Got a notification for queue%d via host notifier.\n" , + qidx); + +if (qidx %2 ==1 ) { +vubr_handle_tx (dev, qidx); + } + } +usleep (1000 ); + } + } + +return NULL ; +} + +static void +vubr_host_notifier_setup (VubrDev *dev) +{ +char template[] ="/tmp/vubr-XXXXXX" ; +pthread_t thread; +size_t length; +void *addr; +int fd; + + length =getpagesize () *VHOST_MAX_NR_VIRTQUEUE ; + + fd =mkstemp (template); +if (fd <0 ) { +vubr_die ("mkstemp()" ); + } + +if (posix_fallocate (fd,0 , length) !=0 ) { +vubr_die ("posix_fallocate()" ); + } + + addr =mmap (NULL , length,PROT_READ |PROT_WRITE ,MAP_SHARED , fd,0 ); +if (addr ==MAP_FAILED ) { +vubr_die ("mmap()" ); + } + +memset (addr,0xff , length); + +if (pthread_create (&thread,NULL , notifier_thread, &dev->vudev) !=0 ) { +vubr_die ("pthread_create()" ); + } + + dev->notifier.fd = fd; + dev->notifier.addr = addr; + dev->notifier.thread = thread; +} +static void vubr_set_host (struct sockaddr_in *saddr,const char *host) {
@@ -673,8 +756,9 @@ main(int argc, char *argv[])VubrDev *dev;int opt;bool client = false; +bool host_notifier = false; -while ((opt =getopt (argc, argv,"l:r:u:c" )) !=-1 ) { +while ((opt =getopt (argc, argv,"l:r:u:cH" )) !=-1 ) {switch (opt) {case 'l' :
@@ -693,6 +777,9 @@ main(int argc, char *argv[])case 'c' : client = true;break ; +case 'H' : + host_notifier = true; +break ;default : goto out; }
@@ -708,6 +795,10 @@ main(int argc, char *argv[])return 1 ; } +if (host_notifier) { +vubr_host_notifier_setup (dev); + } +vubr_backend_udp_setup (dev, lhost, lport, rhost, rport);vubr_run (dev);
@@ -717,7 +808,7 @@ main(int argc, char *argv[]) out:fprintf (stderr,"Usage: %s " , argv[0 ]); -fprintf (stderr,"[-c] [-u ud_socket_path] [-l lhost:lport] [-r rhost:rport]\n" ); +fprintf (stderr,"[-c] [-H] [-u ud_socket_path] [-l lhost:lport] [-r rhost:rport]\n" );fprintf (stderr,"\t-u path to unix doman socket. default: %s\n" ,DEFAULT_UD_SOCKET ); fprintf(stderr, "\t-l local host and port. default: %s:%s\n",
@@ -725,6 +816,7 @@ out:fprintf (stderr,"\t-r remote host and port. default: %s:%s\n" ,DEFAULT_RHOST ,DEFAULT_RPORT );fprintf (stderr,"\t-c client mode\n" ); +fprintf (stderr,"\t-H use host notifier\n" );return 1 ; }
Signature · 1 line
MST
[Qemu-devel] [PULL 07/31] osdep: add wait.h compat macros
In reply to Michael S. TsirkinMan page for WCOREDUMP says:
WCOREDUMP(wstatus) returns true if the child produced a core dump. This macro should be employed only if WIFSIGNALED returned true.
This macro is not specified in POSIX.1-2001 and is not available on some UNIX implementations (e.g., AIX, SunOS). Therefore, enclose its use inside #ifdef WCOREDUMP ... #endif.
Let's do exactly this.
--- include/qemu/osdep.h | 10 ++++++++++ 1 file changed, 10 insertions(+)
include/qemu/osdep.h +10 -0
@@ -107,6 +107,16 @@ extern int daemon(int, int);#include "glib-compat.h" #include "qemu/typedefs.h" +/* +* According to waitpid man page: +* WCOREDUMP +* This macro is not specified in POSIX.1-2001 and is not +* available on some UNIX implementations (e.g., AIX, SunOS). +* Therefore, enclose its use inside #ifdef WCOREDUMP ... #endif. +*/ +#ifndef WCOREDUMP +#define WCOREDUMP (status) 0 +#endif /* * We have a lot of unaudited code that may fail in strange ways, or * even be a security risk during migration, if you disable assertions
Signature · 1 line
MST
[Qemu-devel] [PULL 08/31] libqtest: fail if child coredumps
In reply to Michael S. TsirkinRight now tests report OK status if QEMU crashes during cleanup. Let's catch that case and fail the test.
--- tests/libqtest.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
tests/libqtest.c +8 -1
@@ -103,8 +103,15 @@ static int socket_accept(int sock)static void kill_qemu (QTestState *s) {if (s->qemu_pid !=-1 ) { +int wstatus =0 ; +pid_t pid; +kill (s->qemu_pid,SIGTERM ); -waitpid (s->qemu_pid,NULL ,0 ); + pid =waitpid (s->qemu_pid, &wstatus,0 ); + +if (pid == s->qemu_pid &&WIFSIGNALED (wstatus)) { +assert (!WCOREDUMP (wstatus)); + } } }
Signature · 1 line
MST
[Qemu-devel] [PULL 11/31] hppa: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- hw/hppa/hppa_sys.h | 2 +- hw/hppa/machine.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
hw/hppa/hppa_sys.h +1 -1
@@ -10,7 +10,7 @@#include "hw/i386/pc.h" #include "hw/irq.h" -#include "hw/hppa/hppa_hardware.h" +#include "hppa_hardware.h" PCIBus *dino_init (MemoryRegion *,qemu_irq *,qemu_irq *);
hw/hppa/machine.c +1 -1
@@ -16,7 +16,7 @@#include "hw/ide.h" #include "hw/timer/i8254.h" #include "hw/char/serial.h" -#include "hw/hppa/hppa_sys.h" +#include "hppa_sys.h" #include "qemu/cutils.h" #include "qapi/error.h" #include "qemu/log.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 10/31] crypto: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- crypto/block-luks.h | 2 +- crypto/block-qcow.h | 2 +- crypto/ivgen-essiv.h | 2 +- crypto/ivgen-plain.h | 2 +- crypto/ivgen-plain64.h | 2 +- crypto/block-luks.c | 2 +- crypto/block-qcow.c | 2 +- crypto/block.c | 6 +++--- crypto/cipher.c | 6 +++--- crypto/ivgen-essiv.c | 2 +- crypto/ivgen-plain.c | 2 +- crypto/ivgen-plain64.c | 2 +- crypto/ivgen.c | 8 ++++---- crypto/tlscreds.c | 2 +- crypto/tlscredsanon.c | 2 +- crypto/tlscredsx509.c | 2 +- 16 files changed, 23 insertions(+), 23 deletions(-)
crypto/block-luks.h +1 -1
@@ -21,7 +21,7 @@#ifndef QCRYPTO_BLOCK_LUKS_H #define QCRYPTO_BLOCK_LUKS_H -#include "crypto/blockpriv.h" +#include "blockpriv.h" extern const QCryptoBlockDriver qcrypto_block_driver_luks;
crypto/block-qcow.h +1 -1
@@ -21,7 +21,7 @@#ifndef QCRYPTO_BLOCK_QCOW_H #define QCRYPTO_BLOCK_QCOW_H -#include "crypto/blockpriv.h" +#include "blockpriv.h" extern const QCryptoBlockDriver qcrypto_block_driver_qcow;
crypto/ivgen-essiv.h +1 -1
@@ -18,7 +18,7 @@* */ -#include "crypto/ivgenpriv.h" +#include "ivgenpriv.h" #ifndef QCRYPTO_IVGEN_ESSIV_H__ #define QCRYPTO_IVGEN_ESSIV_H__
crypto/ivgen-plain.h +1 -1
@@ -18,7 +18,7 @@* */ -#include "crypto/ivgenpriv.h" +#include "ivgenpriv.h" #ifndef QCRYPTO_IVGEN_PLAIN_H__ #define QCRYPTO_IVGEN_PLAIN_H__
crypto/ivgen-plain64.h +1 -1
@@ -18,7 +18,7 @@* */ -#include "crypto/ivgenpriv.h" +#include "ivgenpriv.h" #ifndef QCRYPTO_IVGEN_PLAIN64_H__ #define QCRYPTO_IVGEN_PLAIN64_H__
crypto/block-luks.c +1 -1
@@ -22,7 +22,7 @@#include "qapi/error.h" #include "qemu/bswap.h" -#include "crypto/block-luks.h" +#include "block-luks.h" #include "crypto/hash.h" #include "crypto/afsplit.h"
crypto/block-qcow.c +1 -1
@@ -27,7 +27,7 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "crypto/block-qcow.h" +#include "block-qcow.h" #include "crypto/secret.h" #define QCRYPTO_BLOCK_QCOW_SECTOR_SIZE 512
crypto/block.c +3 -3
@@ -20,9 +20,9 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "crypto/blockpriv.h" -#include "crypto/block-qcow.h" -#include "crypto/block-luks.h" +#include "blockpriv.h" +#include "block-qcow.h" +#include "block-luks.h" static const QCryptoBlockDriver *qcrypto_block_drivers[] = { [Q_CRYPTO_BLOCK_FORMAT_QCOW ] = &qcrypto_block_driver_qcow,
crypto/cipher.c +3 -3
@@ -150,11 +150,11 @@ qcrypto_cipher_munge_des_rfb_key(const uint8_t *key,#endif /* CONFIG_GCRYPT || CONFIG_NETTLE */ #ifdef CONFIG_GCRYPT -#include "crypto/cipher-gcrypt.c" +#include "cipher-gcrypt.c" #elif definedCONFIG_NETTLE -#include "crypto/cipher-nettle.c" +#include "cipher-nettle.c" #else -#include "crypto/cipher-builtin.c" +#include "cipher-builtin.c" #endif QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg,
crypto/ivgen-essiv.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu/bswap.h" -#include "crypto/ivgen-essiv.h" +#include "ivgen-essiv.h" typedef struct QCryptoIVGenESSIV QCryptoIVGenESSIV ;struct QCryptoIVGenESSIV {
crypto/ivgen-plain.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu/bswap.h" -#include "crypto/ivgen-plain.h" +#include "ivgen-plain.h" static int qcrypto_ivgen_plain_init(QCryptoIVGen *ivgen, const uint8_t *key, size_t nkey,
crypto/ivgen-plain64.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu/bswap.h" -#include "crypto/ivgen-plain.h" +#include "ivgen-plain.h" static int qcrypto_ivgen_plain_init(QCryptoIVGen *ivgen, const uint8_t *key, size_t nkey,
crypto/ivgen.c +4 -4
@@ -21,10 +21,10 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "crypto/ivgenpriv.h" -#include "crypto/ivgen-plain.h" -#include "crypto/ivgen-plain64.h" -#include "crypto/ivgen-essiv.h" +#include "ivgenpriv.h" +#include "ivgen-plain.h" +#include "ivgen-plain64.h" +#include "ivgen-essiv.h" QCryptoIVGen *qcrypto_ivgen_new(QCryptoIVGenAlgorithm alg,
crypto/tlscreds.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" -#include "crypto/tlscredspriv.h" +#include "tlscredspriv.h" #include "trace.h" #define DH_BITS 2048
crypto/tlscredsanon.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "crypto/tlscredsanon.h" -#include "crypto/tlscredspriv.h" +#include "tlscredspriv.h" #include "qapi/error.h" #include "qom/object_interfaces.h" #include "trace.h"
crypto/tlscredsx509.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "crypto/tlscredsx509.h" -#include "crypto/tlscredspriv.h" +#include "tlscredspriv.h" #include "crypto/secret.h" #include "qapi/error.h" #include "qom/object_interfaces.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 12/31] migration: drop an unused include
In reply to Michael S. TsirkinIn the vmstate.h file, we just need a struct name. Use a forward declaration instead of an include, then adjust the one affected .c file to include the file that is no longer implicit from the header.
--- include/migration/vmstate.h | 2 +- migration/savevm.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
include/migration/vmstate.h +1 -1
@@ -27,7 +27,7 @@#ifndef QEMU_VMSTATE_H #define QEMU_VMSTATE_H -#include "migration/qjson.h" +typedef struct QJSON QJSON ;typedef struct VMStateInfo VMStateInfo ;typedef struct VMStateDescription VMStateDescription ;
migration/savevm.c +1 -0
@@ -55,6 +55,7 @@#include "io/channel-buffer.h" #include "io/channel-file.h" #include "sysemu/replay.h" +#include "qjson.h" #ifndef ETH_P_RARP #define ETH_P_RARP 0x8035
Signature · 1 line
MST
[Qemu-devel] [PULL 09/31] block: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- block/crypto.c | 2 +- block/nbd.c | 2 +- block/qcow.c | 2 +- block/qcow2-bitmap.c | 2 +- block/qcow2-cluster.c | 2 +- block/qcow2-refcount.c | 2 +- block/qcow2-snapshot.c | 2 +- block/qcow2.c | 4 ++-- block/vhdx-endian.c | 2 +- block/vhdx-log.c | 2 +- block/vhdx.c | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-)
block/crypto.c +1 -1
@@ -29,7 +29,7 @@#include "qapi/qobject-input-visitor.h" #include "qapi/error.h" #include "qemu/option.h" -#include "block/crypto.h" +#include "crypto.h" typedef struct BlockCrypto BlockCrypto ;
block/nbd.c +1 -1
@@ -27,7 +27,7 @@*/ #include "qemu/osdep.h" -#include "block/nbd-client.h" +#include "nbd-client.h" #include "qapi/error.h" #include "qemu/uri.h" #include "block/block_int.h"
block/qcow.c +1 -1
@@ -37,7 +37,7 @@#include "qapi/qapi-visit-block-core.h" #include "crypto/block.h" #include "migration/blocker.h" -#include "block/crypto.h" +#include "crypto.h" /**************************************************************/ /* QEMU COW block driver with compression and encryption support */
block/qcow2-bitmap.c +1 -1
@@ -30,7 +30,7 @@#include "qemu/cutils.h" #include "block/block_int.h" -#include "block/qcow2.h" +#include "qcow2.h" /* NOTICE: BME here means Bitmaps Extension and used as a namespace for * _internal_ constants. Please do not use this _internal_ abbreviation for
block/qcow2-cluster.c +1 -1
@@ -28,7 +28,7 @@#include "qapi/error.h" #include "qemu-common.h" #include "block/block_int.h" -#include "block/qcow2.h" +#include "qcow2.h" #include "qemu/bswap.h" #include "trace.h"
block/qcow2-refcount.c +1 -1
@@ -26,7 +26,7 @@#include "qapi/error.h" #include "qemu-common.h" #include "block/block_int.h" -#include "block/qcow2.h" +#include "qcow2.h" #include "qemu/range.h" #include "qemu/bswap.h" #include "qemu/cutils.h"
block/qcow2-snapshot.c +1 -1
@@ -25,7 +25,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "block/block_int.h" -#include "block/qcow2.h" +#include "qcow2.h" #include "qemu/bswap.h" #include "qemu/error-report.h" #include "qemu/cutils.h"
block/qcow2.c +2 -2
@@ -27,7 +27,7 @@#include "sysemu/block-backend.h" #include "qemu/module.h" #include <zlib.h> -#include "block/qcow2.h" +#include "qcow2.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/qapi-events-block-core.h"
@@ -39,7 +39,7 @@#include "qemu/bswap.h" #include "qapi/qobject-input-visitor.h" #include "qapi/qapi-visit-block-core.h" -#include "block/crypto.h" +#include "crypto.h" /* Differences with QCOW:
block/vhdx-endian.c +1 -1
@@ -19,7 +19,7 @@#include "qemu-common.h" #include "block/block_int.h" #include "qemu/bswap.h" -#include "block/vhdx.h" +#include "vhdx.h" /* * All the VHDX formats on disk are little endian - the following
block/vhdx-log.c +1 -1
@@ -24,7 +24,7 @@#include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/bswap.h" -#include "block/vhdx.h" +#include "vhdx.h" typedef struct VHDXLogSequence {
block/vhdx.c +1 -1
@@ -23,7 +23,7 @@#include "qemu/option.h" #include "qemu/crc32c.h" #include "qemu/bswap.h" -#include "block/vhdx.h" +#include "vhdx.h" #include "migration/blocker.h" #include "qemu/uuid.h" #include "qapi/qmp/qdict.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 13/31] trace: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- trace/control.h | 2 +- trace/qmp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
trace/control.h +1 -1
@@ -267,6 +267,6 @@ char *trace_opt_parse(const char *optarg);uint32_t trace_get_vcpu_event_count (void ); -#include "trace/control-internal.h" +#include "control-internal.h" #endif /* TRACE__CONTROL_H */
trace/qmp.c +1 -1
@@ -10,7 +10,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qapi/qapi-commands-trace.h" -#include "trace/control.h" +#include "control.h" static CPUState *get_cpu (bool has_vcpu,int vcpu,Error **errp)
Signature · 1 line
MST
[Qemu-devel] [PULL 14/31] display: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- hw/display/bcm2835_fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/bcm2835_fb.c +1 -1
@@ -26,7 +26,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "hw/display/bcm2835_fb.h" -#include "hw/display/framebuffer.h" +#include "framebuffer.h" #include "ui/pixel_ops.h" #include "hw/misc/bcm2835_mbox_defs.h" #include "qemu/log.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 16/31] ioapic: fix up includes
In reply to Michael S. Tsirkininclude files shouldn't have the "include/" part, that is implied.
Also, drop an unused include.
--- hw/intc/ioapic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
hw/intc/ioapic.c +1 -2
@@ -28,9 +28,8 @@#include "hw/i386/apic.h" #include "hw/i386/ioapic.h" #include "hw/i386/ioapic_internal.h" -#include "include/hw/pci/msi.h" +#include "hw/pci/msi.h" #include "sysemu/kvm.h" -#include "target/i386/cpu.h" #include "hw/i386/apic-msidef.h" #include "hw/i386/x86-iommu.h" #include "trace.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 17/31] e1000e: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- hw/net/e1000e.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/net/e1000e.c +1 -1
@@ -41,7 +41,7 @@#include "hw/pci/msi.h" #include "hw/pci/msix.h" -#include "hw/net/e1000_regs.h" +#include "e1000_regs.h" #include "e1000x_common.h" #include "e1000e_core.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 18/31] rocker: drop an unused include
In reply to Michael S. TsirkinWe don't use net/clients.h, drop that include.
--- hw/net/rocker/rocker_fp.c | 1 - 1 file changed, 1 deletion(-)
hw/net/rocker/rocker_fp.c +0 -1
@@ -15,7 +15,6 @@*/ #include "qemu/osdep.h" -#include "net/clients.h" #include "qapi/qapi-types-rocker.h" #include "rocker.h" #include "rocker_hw.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 19/31] ppc: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- hw/ppc/ppc440_uc.c | 2 +- hw/ppc/sam460ex.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
hw/ppc/ppc440_uc.c +1 -1
@@ -20,7 +20,7 @@#include "hw/ppc/ppc.h" #include "hw/pci/pci.h" #include "sysemu/block-backend.h" -#include "hw/ppc/ppc440.h" +#include "ppc440.h" /*****************************************************************************/ /* L2 Cache as SRAM */
hw/ppc/sam460ex.c +2 -2
@@ -27,8 +27,8 @@#include "elf.h" #include "exec/address-spaces.h" #include "exec/memory.h" -#include "hw/ppc/ppc440.h" -#include "hw/ppc/ppc405.h" +#include "ppc440.h" +#include "ppc405.h" #include "hw/block/flash.h" #include "sysemu/sysemu.h" #include "sysemu/qtest.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 20/31] vhost-scsi: drop an unused include
In reply to Michael S. TsirkinNo reason for vhost-scsi to pull in migration headers directly.
--- hw/scsi/vhost-scsi-common.c | 1 - 1 file changed, 1 deletion(-)
hw/scsi/vhost-scsi-common.c +0 -1
@@ -17,7 +17,6 @@#include "qemu/osdep.h" #include "qemu/error-report.h" -#include "migration/migration.h" #include "hw/virtio/vhost.h" #include "hw/virtio/vhost-scsi-common.h" #include "hw/virtio/virtio-scsi.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 15/31] ide: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- hw/ide/ahci-allwinner.c | 2 +- hw/ide/ahci.c | 2 +- hw/ide/ich.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
hw/ide/ahci-allwinner.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/error-report.h" #include "sysemu/dma.h" #include "hw/ide/internal.h" -#include "hw/ide/ahci_internal.h" +#include "ahci_internal.h" #include "trace.h"
hw/ide/ahci.c +1 -1
@@ -31,7 +31,7 @@#include "sysemu/dma.h" #include "hw/ide/internal.h" #include "hw/ide/pci.h" -#include "hw/ide/ahci_internal.h" +#include "ahci_internal.h" #include "trace.h"
hw/ide/ich.c +1 -1
@@ -67,7 +67,7 @@#include "hw/isa/isa.h" #include "sysemu/dma.h" #include "hw/ide/pci.h" -#include "hw/ide/ahci_internal.h" +#include "ahci_internal.h" #define ICH9_MSI_CAP_OFFSET 0x80#define ICH9_SATA_CAP_OFFSET 0xA8
Signature · 1 line
MST
[Qemu-devel] [PULL 21/31] sd: fix up include
In reply to Michael S. Tsirkininclude files shouldn't have the "include/" part, that is implied.
--- hw/sd/milkymist-memcard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/sd/milkymist-memcard.c +1 -1
@@ -27,7 +27,7 @@#include "hw/sysbus.h" #include "sysemu/sysemu.h" #include "trace.h" -#include "include/qapi/error.h" +#include "qapi/error.h" #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "hw/sd/sd.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 22/31] usb: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- hw/usb/desc-msos.c | 2 +- hw/usb/desc.c | 2 +- hw/usb/dev-audio.c | 2 +- hw/usb/dev-bluetooth.c | 2 +- hw/usb/dev-hid.c | 2 +- hw/usb/dev-hub.c | 2 +- hw/usb/dev-mtp.c | 2 +- hw/usb/dev-network.c | 2 +- hw/usb/dev-serial.c | 2 +- hw/usb/dev-smartcard-reader.c | 2 +- hw/usb/dev-storage.c | 2 +- hw/usb/dev-uas.c | 2 +- hw/usb/dev-wacom.c | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-)
hw/usb/desc-msos.c +1 -1
@@ -1,6 +1,6 @@#include "qemu/osdep.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" /* * Microsoft OS Descriptors
hw/usb/desc.c +1 -1
@@ -1,7 +1,7 @@#include "qemu/osdep.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" #include "trace.h" /* ------------------------------------------------------------------ */
hw/usb/dev-audio.c +1 -1
@@ -32,7 +32,7 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" #include "hw/hw.h" #include "audio/audio.h"
hw/usb/dev-bluetooth.c +1 -1
@@ -22,7 +22,7 @@#include "qemu-common.h" #include "qemu/error-report.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" #include "sysemu/bt.h" #include "hw/bt.h"
hw/usb/dev-hid.c +1 -1
@@ -26,7 +26,7 @@#include "hw/hw.h" #include "ui/console.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" #include "qapi/error.h" #include "qemu/timer.h" #include "hw/input/hid.h"
hw/usb/dev-hub.c +1 -1
@@ -26,7 +26,7 @@#include "qemu-common.h" #include "trace.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" #include "qemu/error-report.h" #define NUM_PORTS 8
hw/usb/dev-mtp.c +1 -1
@@ -24,7 +24,7 @@#include "qemu/iov.h" #include "trace.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" /* ----------------------------------------------------------------------- */
hw/usb/dev-network.c +1 -1
@@ -27,7 +27,7 @@#include "qapi/error.h" #include "qemu-common.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" #include "net/net.h" #include "qemu/error-report.h" #include "qemu/queue.h"
hw/usb/dev-serial.c +1 -1
@@ -14,7 +14,7 @@#include "qemu/cutils.h" #include "qemu/error-report.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" #include "chardev/char-serial.h" #include "chardev/char-fe.h"
hw/usb/dev-smartcard-reader.c +1 -1
@@ -39,7 +39,7 @@#include "qemu-common.h" #include "qemu/error-report.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" #include "ccid.h"
hw/usb/dev-storage.c +1 -1
@@ -14,7 +14,7 @@#include "qemu/option.h" #include "qemu/config-file.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" #include "hw/scsi/scsi.h" #include "ui/console.h" #include "monitor/monitor.h"
hw/usb/dev-uas.c +1 -1
@@ -17,7 +17,7 @@#include "qemu/error-report.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" #include "hw/scsi/scsi.h" #include "scsi/constants.h"
hw/usb/dev-wacom.c +1 -1
@@ -29,7 +29,7 @@#include "hw/hw.h" #include "ui/console.h" #include "hw/usb.h" -#include "hw/usb/desc.h" +#include "desc.h" /* Interface requests */ #define WACOM_GET_REPORT 0x2101
Signature · 1 line
MST
[Qemu-devel] [PULL 24/31] colo: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- net/colo-compare.c | 2 +- net/colo.c | 2 +- net/filter-rewriter.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
net/colo-compare.c +1 -1
@@ -25,7 +25,7 @@#include "net/queue.h" #include "chardev/char-fe.h" #include "qemu/sockets.h" -#include "net/colo.h" +#include "colo.h" #include "sysemu/iothread.h" #define TYPE_COLO_COMPARE "colo-compare"
net/colo.c +1 -1
@@ -14,7 +14,7 @@#include "qemu/osdep.h" #include "trace.h" -#include "net/colo.h" +#include "colo.h" uint32_t connection_key_hash (const void *opaque) {
net/filter-rewriter.c +1 -1
@@ -11,7 +11,7 @@#include "qemu/osdep.h" #include "trace.h" -#include "net/colo.h" +#include "colo.h" #include "net/filter.h" #include "net/net.h" #include "qemu-common.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 25/31] qga: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- qga/channel-posix.c | 2 +- qga/channel-win32.c | 4 ++-- qga/commands-posix.c | 2 +- qga/commands-win32.c | 4 ++-- qga/commands.c | 2 +- qga/guest-agent-command-state.c | 2 +- qga/main.c | 4 ++-- qga/vss-win32.c | 6 +++--- 8 files changed, 13 insertions(+), 13 deletions(-)
qga/channel-posix.c +1 -1
@@ -2,7 +2,7 @@#include <termios.h> #include "qapi/error.h" #include "qemu/sockets.h" -#include "qga/channel.h" +#include "channel.h" #ifdef CONFIG_SOLARIS #include <stropts.h>
qga/channel-win32.c +2 -2
@@ -1,8 +1,8 @@#include "qemu/osdep.h" #include <windows.h> #include <io.h> -#include "qga/guest-agent-core.h" -#include "qga/channel.h" +#include "guest-agent-core.h" +#include "channel.h" typedef struct GAChannelReadState { guint thread_id;
qga/commands-posix.c +1 -1
@@ -16,7 +16,7 @@#include <sys/utsname.h> #include <sys/wait.h> #include <dirent.h> -#include "qga/guest-agent-core.h" +#include "guest-agent-core.h" #include "qga-qapi-commands.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h"
qga/commands-win32.c +2 -2
@@ -32,8 +32,8 @@#include <wtsapi32.h> #include <wininet.h> -#include "qga/guest-agent-core.h" -#include "qga/vss-win32.h" +#include "guest-agent-core.h" +#include "vss-win32.h" #include "qga-qapi-commands.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h"
qga/commands.c +1 -1
@@ -11,7 +11,7 @@*/ #include "qemu/osdep.h" -#include "qga/guest-agent-core.h" +#include "guest-agent-core.h" #include "qga-qapi-commands.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h"
qga/guest-agent-command-state.c +1 -1
@@ -10,7 +10,7 @@* See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" -#include "qga/guest-agent-core.h" +#include "guest-agent-core.h" struct GACommandState {GSList *groups;
qga/main.c +2 -2
@@ -23,12 +23,12 @@#include "qapi/qmp/qdict.h" #include "qapi/qmp/qjson.h" #include "qapi/qmp/qstring.h" -#include "qga/guest-agent-core.h" +#include "guest-agent-core.h" #include "qemu/module.h" #include "qga-qapi-commands.h" #include "qapi/qmp/qerror.h" #include "qapi/error.h" -#include "qga/channel.h" +#include "channel.h" #include "qemu/bswap.h" #include "qemu/help_option.h" #include "qemu/sockets.h"
qga/vss-win32.c +3 -3
@@ -14,9 +14,9 @@#include <windows.h> #include "qapi/error.h" #include "qemu/error-report.h" -#include "qga/guest-agent-core.h" -#include "qga/vss-win32.h" -#include "qga/vss-win32/requester.h" +#include "guest-agent-core.h" +#include "vss-win32.h" +#include "vss-win32/requester.h" #define QGA_VSS_DLL "qga-vss.dll"
Signature · 1 line
MST
[Qemu-devel] [PULL 26/31] ui: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- ui/gtk.c | 2 +- ui/input-keymap.c | 2 +- ui/input-legacy.c | 2 +- ui/spice-input.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
ui/gtk.c +1 -1
@@ -66,7 +66,7 @@#define VC_SCALE_STEP 0.25#ifdef GDK_WINDOWING_X11 -#include "ui/x_keymap.h" +#include "x_keymap.h" /* Gtk2 compat */ #ifndef GDK_IS_X11_DISPLAY
ui/input-keymap.c +1 -1
@@ -1,6 +1,6 @@#include "qemu/osdep.h" #include "sysemu/sysemu.h" -#include "ui/keymaps.h" +#include "keymaps.h" #include "ui/input.h" #include "standard-headers/linux/input.h"
ui/input-legacy.c +1 -1
@@ -26,7 +26,7 @@#include "qapi/qapi-commands-ui.h" #include "sysemu/sysemu.h" #include "ui/console.h" -#include "ui/keymaps.h" +#include "keymaps.h" #include "ui/input.h" struct QEMUPutMouseEntry {
ui/spice-input.c +1 -1
@@ -23,7 +23,7 @@#include "qemu-common.h" #include "ui/qemu-spice.h" #include "ui/console.h" -#include "ui/keymaps.h" +#include "keymaps.h" #include "ui/input.h" /* keyboard bits */
Signature · 1 line
MST
[Qemu-devel] [PULL 27/31] arch_init: sort architectures
In reply to Michael S. TsirkinSort alphabetically. Will help us see if anything is missing (e.g. tile is not there now).
--- arch_init.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch_init.c +8 -8
@@ -52,14 +52,14 @@ int graphic_depth = 32;#define QEMU_ARCH QEMU_ARCH_ARM#elif defined(TARGET_CRIS )#define QEMU_ARCH QEMU_ARCH_CRIS -#elif defined(TARGET_I386 ) -#define QEMU_ARCH QEMU_ARCH_I386#elif defined(TARGET_HPPA )#define QEMU_ARCH QEMU_ARCH_HPPA -#elif defined(TARGET_M68K ) -#define QEMU_ARCH QEMU_ARCH_M68K +#elif defined(TARGET_I386 ) +#define QEMU_ARCH QEMU_ARCH_I386#elif defined(TARGET_LM32 )#define QEMU_ARCH QEMU_ARCH_LM32 +#elif defined(TARGET_M68K ) +#define QEMU_ARCH QEMU_ARCH_M68K#elif defined(TARGET_MICROBLAZE )#define QEMU_ARCH QEMU_ARCH_MICROBLAZE#elif defined(TARGET_MIPS )
@@ -80,12 +80,12 @@ int graphic_depth = 32;#define QEMU_ARCH QEMU_ARCH_SH4#elif defined(TARGET_SPARC )#define QEMU_ARCH QEMU_ARCH_SPARC -#elif defined(TARGET_XTENSA ) -#define QEMU_ARCH QEMU_ARCH_XTENSA -#elif defined(TARGET_UNICORE32 ) -#define QEMU_ARCH QEMU_ARCH_UNICORE32#elif defined(TARGET_TRICORE )#define QEMU_ARCH QEMU_ARCH_TRICORE +#elif defined(TARGET_UNICORE32 ) +#define QEMU_ARCH QEMU_ARCH_UNICORE32 +#elif defined(TARGET_XTENSA ) +#define QEMU_ARCH QEMU_ARCH_XTENSA#endif const uint32_t arch_type =QEMU_ARCH ;
Signature · 1 line
MST
[Qemu-devel] [PULL 28/31] tests/.gitignore: add entry for generated file
In reply to Michael S. TsirkinFrom: Ross Zwisler <[email protected]>
After a "make check" we end up with the following:
$ git status On branch master Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
tests/test-block-backend
nothing added to commit but untracked files present (use "git add" to track)
--- tests/.gitignore | 1 + 1 file changed, 1 insertion(+)
tests/.gitignore +1 -0
@@ -21,6 +21,7 @@ test-base64 test-bdrv-drain test-bitops test-bitcnt +test-block-backend test-blockjob test-blockjob-txn test-bufferiszero
Signature · 1 line
MST
[Qemu-devel] [PULL 29/31] nvdimm, acpi: support NFIT platform capabilities
In reply to Michael S. TsirkinFrom: Ross Zwisler <[email protected]>
Add a machine command line option to allow the user to control the Platform Capabilities Structure in the virtualized NFIT. This Platform Capabilities Structure was added in ACPI 6.2 Errata A.
--- docs/nvdimm.txt | 27 +++++++++++++++++++++++++ include/hw/i386/pc.h | 1 + include/hw/mem/nvdimm.h | 5 +++++ hw/acpi/nvdimm.c | 45 +++++++++++++++++++++++++++++++++++++---- hw/i386/pc.c | 31 ++++++++++++++++++++++++++++ 5 files changed, 105 insertions(+), 4 deletions(-)
docs/nvdimm.txt +27 -0
@@ -153,3 +153,30 @@ guest NVDIMM region mapping structure. This unarmed flag indicates guest software that this vNVDIMM device contains a region that cannot accept persistent writes. In result, for example, the guest Linux NVDIMM driver, marks such vNVDIMM device as read-only. + +Platform Capabilities +--------------------- + +ACPI 6.2 Errata A added support for a new Platform Capabilities Structure +which allows the platform to communicate what features it supports related to +NVDIMM data durability. Users can provide a capabilities value to a guest via +the optional "nvdimm-cap" machine command line option: + + -machine pc,accel=kvm,nvdimm,nvdimm-cap=2 + +This "nvdimm-cap" field is an integer, and is the combined value of the +various capability bits defined in table 5-137 of the ACPI 6.2 Errata A spec. + +Here is a quick summary of the three bits that are defined as of that spec: + +Bit[0] - CPU Cache Flush to NVDIMM Durability on Power Loss Capable. +Bit[1] - Memory Controller Flush to NVDIMM Durability on Power Loss Capable. + Note: If bit 0 is set to 1 then this bit shall be set to 1 as well. +Bit[2] - Byte Addressable Persistent Memory Hardware Mirroring Capable. + +So, a "nvdimm-cap" value of 2 would mean that the platform supports Memory +Controller Flush on Power Loss, a value of 3 would mean that the platform +supports CPU Cache Flush and Memory Controller Flush on Power Loss, etc. + +For a complete list of the flags available and for more detailed descriptions, +please consult the ACPI spec.
include/hw/i386/pc.h +1 -0
@@ -76,6 +76,7 @@ struct PCMachineState {#define PC_MACHINE_VMPORT "vmport"#define PC_MACHINE_SMM "smm"#define PC_MACHINE_NVDIMM "nvdimm" +#define PC_MACHINE_NVDIMM_CAP "nvdimm-cap"#define PC_MACHINE_SMBUS "smbus"#define PC_MACHINE_SATA "sata"#define PC_MACHINE_PIT "pit"
include/hw/mem/nvdimm.h +5 -0
@@ -134,6 +134,11 @@ struct AcpiNVDIMMState {/* the IO region used by OSPM to transfer control to QEMU. */ MemoryRegion io_mr; + +/* +* Platform capabilities, section 5.2.25.9 of ACPI 6.2 Errata A +*/ +int32_t capabilities; };typedef struct AcpiNVDIMMState AcpiNVDIMMState ;
hw/acpi/nvdimm.c +41 -4
76 lines not on this page · raw message
hw/i386/pc.c +31 -0
@@ -2182,6 +2182,33 @@ static void pc_machine_set_nvdimm(Object *obj, bool value, Error **errp) pcms->acpi_nvdimm_state.is_enabled = value; } +static void pc_machine_get_nvdimm_capabilities (Object *obj,Visitor *v, +const char *name,void *opaque, +Error **errp) +{ +PCMachineState *pcms =PC_MACHINE (obj); +uint32_t value = pcms->acpi_nvdimm_state.capabilities; + +visit_type_uint32 (v, name, &value, errp); +} + +static void pc_machine_set_nvdimm_capabilities (Object *obj,Visitor *v, +const char *name,void *opaque, +Error **errp) +{ +PCMachineState *pcms =PC_MACHINE (obj); +Error *error =NULL ; +uint32_t value; + +visit_type_uint32 (v, name, &value, &error); +if (error) { +error_propagate (errp, error); +return ; + } + + pcms->acpi_nvdimm_state.capabilities = value; +} +static bool pc_machine_get_smbus (Object *obj,Error **errp) {PCMachineState *pcms =PC_MACHINE (obj);
@@ -2395,6 +2422,10 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)object_class_property_add_bool (oc,PC_MACHINE_NVDIMM , pc_machine_get_nvdimm, pc_machine_set_nvdimm, &error_abort); +object_class_property_add (oc,PC_MACHINE_NVDIMM_CAP ,"uint32" , + pc_machine_get_nvdimm_capabilities, + pc_machine_set_nvdimm_capabilities,NULL ,NULL , &error_abort); +object_class_property_add_bool (oc,PC_MACHINE_SMBUS , pc_machine_get_smbus, pc_machine_set_smbus, &error_abort);
Signature · 1 line
MST
[Qemu-devel] [PULL 23/31] migration: use local path for local headers
In reply to Michael S. TsirkinWhen pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory.
--- migration/block-dirty-bitmap.c | 2 +- migration/page_cache.c | 2 +- migration/ram.c | 4 ++-- migration/vmstate.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
migration/block-dirty-bitmap.c +1 -1
@@ -66,7 +66,7 @@#include "qemu/error-report.h" #include "migration/misc.h" #include "migration/migration.h" -#include "migration/qemu-file.h" +#include "qemu-file.h" #include "migration/vmstate.h" #include "migration/register.h" #include "qemu/hbitmap.h"
migration/page_cache.c +1 -1
@@ -18,7 +18,7 @@#include "qapi/error.h" #include "qemu-common.h" #include "qemu/host-utils.h" -#include "migration/page_cache.h" +#include "page_cache.h" #ifdef DEBUG_CACHE #define DPRINTF (fmt, ...) \
migration/ram.c +2 -2
@@ -41,7 +41,7 @@#include "migration/misc.h" #include "qemu-file.h" #include "postcopy-ram.h" -#include "migration/page_cache.h" +#include "page_cache.h" #include "qemu/error-report.h" #include "qapi/error.h" #include "qapi/qapi-events-migration.h"
@@ -51,7 +51,7 @@#include "exec/target_page.h" #include "qemu/rcu_queue.h" #include "migration/colo.h" -#include "migration/block.h" +#include "block.h" #include "sysemu/sysemu.h" #include "qemu/uuid.h" #include "savevm.h"
migration/vmstate.c +1 -1
@@ -14,7 +14,7 @@#include "qemu-common.h" #include "migration.h" #include "migration/vmstate.h" -#include "migration/savevm.h" +#include "savevm.h" #include "qemu-file.h" #include "qemu/bitops.h" #include "qemu/error-report.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 30/31] ACPI testing: test NFIT platform capabilities
In reply to Michael S. TsirkinFrom: Ross Zwisler <[email protected]>
Add testing for the newly added NFIT Platform Capabilities Structure.
--- tests/bios-tables-test.c | 2 +- tests/acpi-test-data/pc/NFIT.dimmpxm | Bin 224 -> 240 bytes tests/acpi-test-data/q35/NFIT.dimmpxm | Bin 224 -> 240 bytes 3 files changed, 1 insertion(+), 1 deletion(-)
tests/bios-tables-test.c +1 -1
@@ -830,7 +830,7 @@ static void test_acpi_tcg_dimm_pxm(const char *machine)memset (&data,0 ,sizeof (data)); data.machine = machine; data.variant =".dimmpxm" ; -test_acpi_one (" -machine nvdimm=on" +test_acpi_one (" -machine nvdimm=on,nvdimm-cap=3" " -smp 4,sockets=4" " -m 128M,slots=3,maxmem=1G" " -numa node,mem=32M,nodeid=0"
tests/acpi-test-data/pc/NFIT.dimmpxm binary +0 -0
tests/acpi-test-data/q35/NFIT.dimmpxm binary +0 -0
Signature · 1 line
MST
[Qemu-devel] [PULL 31/31] vhost-blk: turn on pre-defined RO feature bit
In reply to Michael S. TsirkinFrom: Changpeng Liu <[email protected]>
Read only feature shouldn't be negotiable, because if the backend device reported Read only feature supported, QEMU host driver shouldn't change backend's RO attribute. While here, also enable the vhost-user-blk test utility to test RO feature.
--- include/hw/virtio/vhost-user-blk.h | 1 - contrib/vhost-user-blk/vhost-user-blk.c | 48 ++++++++++++++++++------- hw/block/vhost-user-blk.c | 5 +-- 3 files changed, 36 insertions(+), 18 deletions(-)
include/hw/virtio/vhost-user-blk.h +0 -1
@@ -35,7 +35,6 @@ typedef struct VHostUserBlk {uint16_t num_queues;uint32_t queue_size;uint32_t config_wce; -uint32_t config_ro;struct vhost_dev dev;VhostUserState *vhost_user; } VHostUserBlk;
contrib/vhost-user-blk/vhost-user-blk.c +35 -13
94 lines not on this page · raw message
hw/block/vhost-user-blk.c +1 -4
@@ -203,13 +203,11 @@ static uint64_t vhost_user_blk_get_features(VirtIODevice *vdev,virtio_add_feature (&features,VIRTIO_BLK_F_TOPOLOGY );virtio_add_feature (&features,VIRTIO_BLK_F_BLK_SIZE );virtio_add_feature (&features,VIRTIO_BLK_F_FLUSH ); +virtio_add_feature (&features,VIRTIO_BLK_F_RO );if (s->config_wce) {virtio_add_feature (&features,VIRTIO_BLK_F_CONFIG_WCE ); } -if (s->config_ro) { -virtio_add_feature (&features,VIRTIO_BLK_F_RO ); - }if (s->num_queues >1 ) {virtio_add_feature (&features,VIRTIO_BLK_F_MQ ); }
@@ -339,7 +337,6 @@ static Property vhost_user_blk_properties[] = {DEFINE_PROP_UINT16 ("num-queues" , VHostUserBlk, num_queues,1 ),DEFINE_PROP_UINT32 ("queue-size" , VHostUserBlk, queue_size,128 ),DEFINE_PROP_BIT ("config-wce" , VHostUserBlk, config_wce,0 , true), -DEFINE_PROP_BIT ("config-ro" , VHostUserBlk, config_ro,0 , false), DEFINE_PROP_END_OF_LIST(), };
Signature · 1 line
MST
Peter Maydell
AppliedQuoted 15 lines · Michael S. Tsirkin
The following changes since commit
63b88968f139b6a77f2f81e6f1eedf70c0170a85:intel-iommu: rework the page walk logic (2018-05-23 17:34:05 +0300)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gittags/for_upstreamfor you to fetch changes up to
25b1d45a1975fd8624c37b5bf42e8502ccf53460:vhost-blk: turn on pre-defined RO feature bit (2018-06-01 19:20:38 +0300)
----------------------------------------------------------------
acpi, vhost, misc: fixes, features
Quoted 6 lines
vDPA support, fix to vhost blk RO bit handling, some include path cleanups, NFIT ACPI table.
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Applied, thanks.
-- PMM
Quoted 10 lines · Michael S. Tsirkin
The following changes since commit
63b88968f139b6a77f2f81e6f1eedf70c0170a85:intel-iommu: rework the page walk logic (2018-05-23 17:34:05 +0300)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gittags/for_upstreamfor you to fetch changes up to
25b1d45a1975fd8624c37b5bf42e8502ccf53460:
Quoted 7 lines
vhost-blk: turn on pre-defined RO feature bit (2018-06-01 19:20:38 +0300)
----------------------------------------------------------------
acpi, vhost, misc: fixes, featuresvDPA support, fix to vhost blk RO bit handling, some include path cleanups, NFIT ACPI table.
I'm getting a warning during "make check" now:
acpi-test: Warning! SSDT mismatch. Actual [asl:/tmp/asl-SPL1JZ.dsl, aml:/tmp/aml-L3C3JZ], Expected [asl:/tmp/asl-ME01JZ.dsl, aml:tests/acpi-test-data/q35/SSDT.dimmpxm].
Do the test tables maybe need an update?
Thomas
Quoted 16 lines · Peter Maydell
Quoted 15 lines · Michael S. Tsirkin
The following changes since commit
63b88968f139b6a77f2f81e6f1eedf70c0170a85:intel-iommu: rework the page walk logic (2018-05-23 17:34:05 +0300)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gittags/for_upstreamfor you to fetch changes up to
25b1d45a1975fd8624c37b5bf42e8502ccf53460:vhost-blk: turn on pre-defined RO feature bit (2018-06-01 19:20:38 +0300)
----------------------------------------------------------------
acpi, vhost, misc: fixes, features
Quoted 8 lines
Quoted 6 lines
vDPA support, fix to vhost blk RO bit handling, some include path cleanups, NFIT ACPI table.
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Applied, thanks.
Not sure this is a problem, but something experienced after rebasing:
#1
/source/qemu/qemu-nbd.c: In function ‘version’:
/source/qemu/qemu-nbd.c:133:6: error: expected ‘)’ before ‘QEMU_FULL_VERSION’
"%s " QEMU_FULL_VERSION "\n"
^~~~~~~~~~~~~~~~~~
)/source/qemu/qemu-nbd.c:133:3: error: format ‘%s’ expects a matching ‘char *’ argument [-Werror=format=]
"%s " QEMU_FULL_VERSION "\n"
~^
cc1: all warnings being treated as errors
It took me a while to figure this out, probably because today is Friday.
$ git status --ignored show me I had a "qemu-version.h" generated long time ago in the source directory.
- I only do out-of-tree builds.
- sometimes I run "make help/docker/vm-test" and friends in the source directory, and my 'make' is aliased as 'make -jN'.
I doubt those make calls generate this file, as ./configure generates it, so I probably messed with a ./configure in source dir.
Now, building out-of-tree dirs was finding the old /qemu-version.h before the generated one in current dir.
I was not noticing it due to the /qemu-version.h entry in /.gitignore .
#2
CC vl.o
/source/qemu/vl.c: In function ‘main’:
/source/qemu/vl.c:3052:18: error: ‘QEMU_OPTION_blockdev’ undeclared (first use in this function); did you mean ‘QEMU_OPTION_clock’?
case QEMU_OPTION_blockdev:
^~~~~~~~~~~~~~~~~~~~
QEMU_OPTION_clock/source/qemu/vl.c:3052:18: note: each undeclared identifier is reported only once for each function it appears in /source/qemu/vl.c:3171:18: error: ‘QEMU_OPTION_nic’ undeclared (first use in this function); did you mean ‘QEMU_OPTION_rtc’?
case QEMU_OPTION_nic:
^~~~~~~~~~~~~~~
QEMU_OPTION_rtc
/source/qemu/vl.c:3574:18: error: ‘QEMU_OPTION_preconfig’ undeclared
(first use in this function); did you mean ‘QEMU_OPTION_writeconfig’?
case QEMU_OPTION_preconfig:
^~~~~~~~~~~~~~~~~~~~~
QEMU_OPTION_writeconfigThis is the same story, but with /qemu-options.def (also in .gitignore).
So 'rm ${srcdir}/qemu-version.h ${srcdir}/qemu-options.def' fixed my problems.
Should we add a check for this kind of mistakes when running out-of-tree builds? I'll try something.
Regards,
Phil.
Quoted 83 lines · Philippe Mathieu-Daudé
Quoted 16 lines · Peter Maydell
Quoted 15 lines · Michael S. Tsirkin
The following changes since commit
63b88968f139b6a77f2f81e6f1eedf70c0170a85:intel-iommu: rework the page walk logic (2018-05-23 17:34:05 +0300)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gittags/for_upstreamfor you to fetch changes up to
25b1d45a1975fd8624c37b5bf42e8502ccf53460:vhost-blk: turn on pre-defined RO feature bit (2018-06-01 19:20:38 +0300)
----------------------------------------------------------------
acpi, vhost, misc: fixes, featuresQuoted 8 lines
Quoted 6 lines
vDPA support, fix to vhost blk RO bit handling, some include path cleanups, NFIT ACPI table.
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Applied, thanks.
Not sure this is a problem, but something experienced after rebasing:
#1
/source/qemu/qemu-nbd.c: In function ‘version’:
/source/qemu/qemu-nbd.c:133:6: error: expected ‘)’ before ‘QEMU_FULL_VERSION’
"%s "QEMU_FULL_VERSION"\n"^~~~~~~~~~~~~~~~~~ )/source/qemu/qemu-nbd.c:133:3: error: format ‘%s’ expects a matching ‘char *’ argument [-Werror=format=]
"%s "QEMU_FULL_VERSION"\n"
~^
cc1: all warnings being treated as errorsIt took me a while to figure this out, probably because today is Friday.
$ git status --ignored show me I had a "qemu-version.h" generated long time ago in the source directory.- I only do out-of-tree builds.
- sometimes I run "make help/docker/vm-test" and friends in the source directory, and my 'make' is aliased as 'make -jN'.
I doubt those make calls generate this file, as ./configure generates it, so I probably messed with a ./configure in source dir.Now, building out-of-tree dirs was finding the old /qemu-version.h before the generated one in current dir.
I was not noticing it due to the /qemu-version.h entry in /.gitignore .
#2
CC vl.o
/source/qemu/vl.c: In function ‘main’:
/source/qemu/vl.c:3052:18: error: ‘QEMU_OPTION_blockdev’ undeclared (first use in this function); did you mean ‘QEMU_OPTION_clock’?case QEMU_OPTION_blockdev: ^~~~~~~~~~~~~~~~~~~~ QEMU_OPTION_clock/source/qemu/vl.c:3052:18: note: each undeclared identifier is reported only once for each function it appears in /source/qemu/vl.c:3171:18: error: ‘QEMU_OPTION_nic’ undeclared (first use in this function); did you mean ‘QEMU_OPTION_rtc’?
case QEMU_OPTION_nic: ^~~~~~~~~~~~~~~ QEMU_OPTION_rtc /source/qemu/vl.c:3574:18: error: ‘QEMU_OPTION_preconfig’ undeclared (first use in this function); did you mean ‘QEMU_OPTION_writeconfig’? case QEMU_OPTION_preconfig: ^~~~~~~~~~~~~~~~~~~~~ QEMU_OPTION_writeconfig
Quoted 8 lines
This is the same story, but with /qemu-options.def (also in .gitignore).
So 'rm
${srcdir}/qemu-version.h${srcdir}/qemu-options.def' fixed my problems.Should we add a check for this kind of mistakes when running out-of-tree builds? I'll try something.
Oops, doesn't seem related to this merge...
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Philippe Mathieu-Daudé
So 'rm
${srcdir}/qemu-version.h${srcdir}/qemu-options.def' fixed my problems.Should we add a check for this kind of mistakes when running out-of-tree builds? I'll try something.
We do have a rune in the makefile that checks for whether you have a stale in-tree build and you do an out-of-tree build, and we also should refuse to do an in-tree build without generating any extra files. Unfortunately we didn't always have the rules for the latter correct, so in the past it was possible to generate stray generated files, which then lurk around until they cause a problem months later.
thanks
-- PMM