qemu/hw/virtio
Hanna Czenczek 00adced5c3 virtio: Allow .get_vhost() without vhost_started
Historically, .get_vhost() was probably only called when
vdev->vhost_started is true.  However, we now decidedly want to call it
also when vhost_started is false, specifically so we can issue a reset
to the vhost back-end while device operation is stopped.

Some .get_vhost() implementations dereference some pointers (or return
offsets from them) that are probably guaranteed to be non-NULL when
vhost_started is true, but not necessarily otherwise.  This patch makes
all such implementations check all such pointers, returning NULL if any
is NULL.

Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
Message-Id: <20240723163941.48775-2-hreitz@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2024-09-10 14:27:56 -04:00
..
Kconfig hw/virtio: add vhost-user-snd and vhost-user-snd-pci devices 2024-02-14 06:09:03 -05:00
meson.build hw/virtio: move stubs out of stubs/ 2024-04-18 11:17:27 +02:00
trace-events virtio-iommu: Add trace point on virtio_iommu_detach_endpoint_from_domain 2024-07-22 20:15:42 -04:00
trace.h
vdpa-dev-pci.c
vdpa-dev.c vdpa-dev: Fix the issue of device status not updating when configuration interruption is triggered 2024-04-09 02:31:27 -04:00
vhost-backend.c vhost: Add worker backend callouts 2023-12-25 11:34:55 -05:00
vhost-iova-tree.c
vhost-iova-tree.h
vhost-scsi-pci.c
vhost-shadow-virtqueue.c vhost: Expose vhost_svq_available_slots() 2023-10-18 10:41:50 -04:00
vhost-shadow-virtqueue.h vhost: Expose vhost_svq_available_slots() 2023-10-18 10:41:50 -04:00
vhost-stub.c vhost: Add vhost_get_max_memslots() 2023-10-12 14:15:22 +02:00
vhost-user-base.c hw/virtio: Free vqs after vhost_dev_cleanup() 2024-07-01 17:16:05 -04:00
vhost-user-blk-pci.c
vhost-user-device-pci.c virtio: split into vhost-user-base and vhost-user-device 2024-02-14 06:01:39 -05:00
vhost-user-device.c virtio: split into vhost-user-base and vhost-user-device 2024-02-14 06:01:39 -05:00
vhost-user-fs-pci.c
vhost-user-fs.c vhost,vhost-user: Add VIRTIO_F_IN_ORDER to vhost feature bits 2024-07-21 14:45:56 -04:00
vhost-user-gpio-pci.c
vhost-user-gpio.c hw/virtio: derive vhost-user-gpio from vhost-user-base 2024-02-14 06:01:44 -05:00
vhost-user-i2c-pci.c
vhost-user-i2c.c hw/virtio: derive vhost-user-i2c from vhost-user-base 2024-02-14 06:01:49 -05:00
vhost-user-input-pci.c hw/virtio: derive vhost-user-input from vhost-user-base 2024-02-14 06:09:32 -05:00
vhost-user-input.c hw/virtio: derive vhost-user-input from vhost-user-base 2024-02-14 06:09:32 -05:00
vhost-user-rng-pci.c
vhost-user-rng.c hw/virtio: derive vhost-user-rng from vhost-user-base 2024-02-14 06:01:42 -05:00
vhost-user-scmi-pci.c hw/virtio: Add vhost-user-scmi-pci boilerplate 2023-07-10 16:17:08 -04:00
vhost-user-scmi.c bulk: Access existing variables initialized to &S->F when available 2024-03-12 11:46:16 +01:00
vhost-user-scsi-pci.c
vhost-user-snd-pci.c hw/virtio: add vhost-user-snd and vhost-user-snd-pci devices 2024-02-14 06:09:03 -05:00
vhost-user-snd.c hw/virtio: add vhost-user-snd and vhost-user-snd-pci devices 2024-02-14 06:09:03 -05:00
vhost-user-vsock-pci.c
vhost-user-vsock.c vhost,vhost-user: Add VIRTIO_F_IN_ORDER to vhost feature bits 2024-07-21 14:45:56 -04:00
vhost-user.c vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests 2024-07-01 17:16:05 -04:00
vhost-vdpa.c util/hexdump: Add unit_len and block_len to qemu_hexdump_line 2024-06-05 12:14:18 -07:00
vhost-vsock-common.c vhost-vsock: add VIRTIO_F_RING_PACKED to feature_bits 2024-07-01 14:56:23 -04:00
vhost-vsock-pci.c
vhost-vsock.c hw/virtio/vhost-vsock: Fix missing ERRP_GUARD() for error_prepend() 2024-03-12 11:45:45 +01:00
vhost.c vhost: Perform memory section dirty scans once per iteration 2024-07-01 14:56:23 -04:00
virtio-9p-pci.c
virtio-acpi.c acpi: Clean up includes 2024-01-30 21:20:20 +03:00
virtio-balloon-pci.c
virtio-balloon.c migration: remove migration.h references 2024-03-11 16:28:59 -04:00
virtio-blk-pci.c
virtio-bus.c
virtio-config-io.c
virtio-crypto-pci.c
virtio-crypto.c virtio: Allow .get_vhost() without vhost_started 2024-09-10 14:27:56 -04:00
virtio-hmp-cmds.c virtio: Move HMP commands from monitor/ to hw/virtio/ 2023-02-04 07:56:54 +01:00
virtio-input-host-pci.c
virtio-input-pci.c virtio-input-pci: add virtio-multitouch-pci 2023-05-28 13:08:25 +04:00
virtio-iommu-pci.c hw/virtio: Free VirtIOIOMMUPCI::vdev.reserved_regions[] on finalize() 2023-11-27 15:27:41 +00:00
virtio-iommu.c virtio-iommu: Add trace point on virtio_iommu_detach_endpoint_from_domain 2024-07-22 20:15:42 -04:00
virtio-md-pci.c hw/mem/memory-device: Remove legacy_align from memory_device_pre_plug() 2024-06-19 12:40:49 +02:00
virtio-md-stubs.c hw/virtio: move stubs out of stubs/ 2024-04-18 11:17:27 +02:00
virtio-mem-pci.c virtio-mem: Expose device memory dynamically via multiple memslots if enabled 2023-10-12 14:15:22 +02:00
virtio-mem-pci.h virtio-md-pci: New parent type for virtio-mem-pci and virtio-pmem-pci 2023-07-12 09:27:25 +02:00
virtio-mem.c virtio-mem: improve error message when unplug of device fails due to plugged memory 2024-07-10 18:06:24 +02:00
virtio-mmio.c virtio-mmio: Handle extra notification data 2024-07-01 14:56:23 -04:00
virtio-net-pci.c Revert "virtio-net: Implement SR-IOV VF" 2024-08-01 04:32:00 -04:00
virtio-pci.c virtio-pci: Fix the use of an uninitialized irqfd 2024-08-20 06:57:47 -04:00
virtio-pmem-pci.c virtio-md-pci: New parent type for virtio-mem-pci and virtio-pmem-pci 2023-07-12 09:27:25 +02:00
virtio-pmem-pci.h virtio-md-pci: New parent type for virtio-mem-pci and virtio-pmem-pci 2023-07-12 09:27:25 +02:00
virtio-pmem.c Revert "hw/virtio/virtio-pmem: Replace impossible check by assertion" 2023-11-06 13:53:59 +01:00
virtio-qmp.c vhost-user: move VhostUserProtocolFeature definition to header file 2023-10-04 04:54:28 -04:00
virtio-qmp.h qmp: remove virtio_list, search QOM tree instead 2023-10-04 04:54:24 -04:00
virtio-rng-pci.c
virtio-rng.c virtio-rng: block max-bytes=0 2024-08-01 04:32:00 -04:00
virtio-scsi-pci.c
virtio-serial-pci.c
virtio-stub.c
virtio.c virtio-net: Fix network stall at the host side waiting for kick 2024-08-02 11:09:52 +08:00