[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 47/48] vhost: Add stubs for the migration state transfer interface
From: |
Michael S. Tsirkin |
Subject: |
[PULL 47/48] vhost: Add stubs for the migration state transfer interface |
Date: |
Wed, 15 Jan 2025 13:10:58 -0500 |
From: Laurent Vivier <lvivier@redhat.com>
Migration state transfer interface is only used by vhost-user-fs,
so the interface needs to be defined only when vhost is built.
But I need to use this interface with virtio-net and vhost is not always
enabled, and to avoid undefined reference error during build, define stub
functions for vhost_supports_device_state(), vhost_save_backend_state() and
vhost_load_backend_state().
Cc: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20250115135044.799698-2-lvivier@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/hw/virtio/vhost.h | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h
index 461c168c37..a9469d50bc 100644
--- a/include/hw/virtio/vhost.h
+++ b/include/hw/virtio/vhost.h
@@ -365,7 +365,14 @@ static inline int vhost_reset_device(struct vhost_dev
*hdev)
* Returns true if the device supports these commands, and false if it
* does not.
*/
+#ifdef CONFIG_VHOST
bool vhost_supports_device_state(struct vhost_dev *dev);
+#else
+static inline bool vhost_supports_device_state(struct vhost_dev *dev)
+{
+ return false;
+}
+#endif
/**
* vhost_set_device_state_fd(): Begin transfer of internal state from/to
@@ -448,7 +455,15 @@ int vhost_check_device_state(struct vhost_dev *dev, Error
**errp);
*
* Returns 0 on success, and -errno otherwise.
*/
+#ifdef CONFIG_VHOST
int vhost_save_backend_state(struct vhost_dev *dev, QEMUFile *f, Error **errp);
+#else
+static inline int vhost_save_backend_state(struct vhost_dev *dev, QEMUFile *f,
+ Error **errp)
+{
+ return -ENOSYS;
+}
+#endif
/**
* vhost_load_backend_state(): High-level function to load a vhost
@@ -465,6 +480,14 @@ int vhost_save_backend_state(struct vhost_dev *dev,
QEMUFile *f, Error **errp);
*
* Returns 0 on success, and -errno otherwise.
*/
+#ifdef CONFIG_VHOST
int vhost_load_backend_state(struct vhost_dev *dev, QEMUFile *f, Error **errp);
+#else
+static inline int vhost_load_backend_state(struct vhost_dev *dev, QEMUFile *f,
+ Error **errp)
+{
+ return -ENOSYS;
+}
+#endif
#endif
--
MST
- [PULL 25/48] tests/qtest: Add intel-iommu test, (continued)
- [PULL 25/48] tests/qtest: Add intel-iommu test, Michael S. Tsirkin, 2025/01/15
- [PULL 37/48] acpi/ghes: don't crash QEMU if ghes GED is not found, Michael S. Tsirkin, 2025/01/15
- [PULL 30/48] acpi/ghes: better handle source_id and notification, Michael S. Tsirkin, 2025/01/15
- [PULL 44/48] pci: acpi: Windows 'PCI Label Id' bug workaround, Michael S. Tsirkin, 2025/01/15
- [PULL 48/48] virtio-net: vhost-user: Implement internal migration, Michael S. Tsirkin, 2025/01/15
- [PULL 36/48] acpi/ghes: better name GHES memory error function, Michael S. Tsirkin, 2025/01/15
- [PULL 35/48] acpi/ghes: make the GHES record generation more generic, Michael S. Tsirkin, 2025/01/15
- [PULL 39/48] acpi/ghes: better name the offset of the hardware error firmware, Michael S. Tsirkin, 2025/01/15
- [PULL 38/48] acpi/ghes: rename etc/hardware_error file macros, Michael S. Tsirkin, 2025/01/15
- [PULL 42/48] docs: acpi_hest_ghes: fix documentation for CPER size, Michael S. Tsirkin, 2025/01/15
- [PULL 47/48] vhost: Add stubs for the migration state transfer interface,
Michael S. Tsirkin <=
- [PULL 43/48] tests: acpi: whitelist expected blobs, Michael S. Tsirkin, 2025/01/15
- [PULL 45/48] tests: acpi: update expected blobs, Michael S. Tsirkin, 2025/01/15
- Re: [PULL 00/48] virtio,pc,pci: features, fixes, cleanups, David Woodhouse, 2025/01/15
- Re: [PULL 00/48] virtio,pc,pci: features, fixes, cleanups, Michael S. Tsirkin, 2025/01/15
- Re: [PULL 00/48] virtio,pc,pci: features, fixes, cleanups, David Woodhouse, 2025/01/15
- Re: [PULL 00/48] virtio,pc,pci: features, fixes, cleanups, Michael S. Tsirkin, 2025/01/16
- Re: [PULL 00/48] virtio,pc,pci: features, fixes, cleanups, David Woodhouse, 2025/01/16
- Re: [PULL 00/48] virtio,pc,pci: features, fixes, cleanups, Michael S. Tsirkin, 2025/01/16
- Re: [PULL 00/48] virtio,pc,pci: features, fixes, cleanups, Stefan Hajnoczi, 2025/01/16