aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-11-05 15:16:43 +0000
committerPeter Maydell <peter.maydell@linaro.org>2020-11-05 15:16:43 +0000
commit85c3ed44171d757e399bcbb3db3608c1848c0984 (patch)
tree777c2c5df9154caa0f0787b15b76deda2f2c2399 /contrib
parent747c6b3811ef5f06278ab364261e3723bcbb4031 (diff)
parent9f6df01d0e128c2df179789b37140d6aeddfcb92 (diff)
downloadqemu-85c3ed44171d757e399bcbb3db3608c1848c0984.zip
qemu-85c3ed44171d757e399bcbb3db3608c1848c0984.tar.gz
qemu-85c3ed44171d757e399bcbb3db3608c1848c0984.tar.bz2
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
pc,pci,vhost,virtio: fixes Lots of fixes all over the place. virtio-mem and virtio-iommu patches are kind of fixes but it seems better to just make them behave sanely than try to educate users about the limitations ... Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Wed 04 Nov 2020 18:40:03 GMT # gpg: using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469 # gpg: issuer "mst@redhat.com" # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full] # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" [full] # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: (31 commits) contrib/vhost-user-blk: fix get_config() information leak block/export: fix vhost-user-blk get_config() information leak block/export: make vhost-user-blk config space little-endian configure: introduce --enable-vhost-user-blk-server libvhost-user: follow QEMU comment style vhost-blk: set features before setting inflight feature Revert "vhost-blk: set features before setting inflight feature" net: Add vhost-vdpa in show_netdevs() vhost-vdpa: Add qemu_close in vhost_vdpa_cleanup vfio: Don't issue full 2^64 unmap virtio-iommu: Set supported page size mask vfio: Set IOMMU page size as per host supported page size memory: Add interface to set iommu page size mask virtio-iommu: Add notify_flag_changed() memory region callback virtio-iommu: Add replay() memory region callback virtio-iommu: Call memory notifiers in attach/detach virtio-iommu: Add memory notifiers for map/unmap virtio-iommu: Store memory region in endpoint struct virtio-iommu: Fix virtio_iommu_mr() hw/smbios: Fix leaked fd in save_opt_one() error path ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/libvhost-user/libvhost-user.h15
-rw-r--r--contrib/vhost-user-blk/vhost-user-blk.c2
2 files changed, 12 insertions, 5 deletions
diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-user/libvhost-user.h
index 3bbeae8..a1539db 100644
--- a/contrib/libvhost-user/libvhost-user.h
+++ b/contrib/libvhost-user/libvhost-user.h
@@ -392,7 +392,8 @@ struct VuDev {
bool broken;
uint16_t max_queues;
- /* @read_msg: custom method to read vhost-user message
+ /*
+ * @read_msg: custom method to read vhost-user message
*
* Read data from vhost_user socket fd and fill up
* the passed VhostUserMsg *vmsg struct.
@@ -409,15 +410,19 @@ struct VuDev {
*
*/
vu_read_msg_cb read_msg;
- /* @set_watch: add or update the given fd to the watch set,
- * call cb when condition is met */
+
+ /*
+ * @set_watch: add or update the given fd to the watch set,
+ * call cb when condition is met.
+ */
vu_set_watch_cb set_watch;
/* @remove_watch: remove the given fd from the watch set */
vu_remove_watch_cb remove_watch;
- /* @panic: encountered an unrecoverable error, you may try to
- * re-initialize */
+ /*
+ * @panic: encountered an unrecoverable error, you may try to re-initialize
+ */
vu_panic_cb panic;
const VuDevIface *iface;
diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
index 25eccd0..caad886 100644
--- a/contrib/vhost-user-blk/vhost-user-blk.c
+++ b/contrib/vhost-user-blk/vhost-user-blk.c
@@ -404,6 +404,8 @@ vub_get_config(VuDev *vu_dev, uint8_t *config, uint32_t len)
VugDev *gdev;
VubDev *vdev_blk;
+ g_return_val_if_fail(len <= sizeof(struct virtio_blk_config), -1);
+
gdev = container_of(vu_dev, VugDev, parent);
vdev_blk = container_of(gdev, VubDev, parent);
memcpy(config, &vdev_blk->blkcfg, len);