vduse: Add suspend

Implement suspend operation for vduse devices, so vhost-vdpa will offer
that backend feature and userspace can effectively suspend the device.

This is a must before get virtqueue indexes (base) for live migration,
since the device could modify them after userland gets them.

This patch does not implement resume, so VMM resets the whole device
to recover from a live migration failure.  Resume optimization can be
implemented on top of these patches, as other vDPA devices have done in
the past.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260707123344.244575-3-eperezma@redhat.com>
This commit is contained in:
Eugenio Pérez
2026-07-07 14:33:44 +02:00
committed by Michael S. Tsirkin
parent 675087c762
commit b282418bc3
2 changed files with 92 additions and 7 deletions

View File

@@ -17,6 +17,9 @@
/* The VDUSE instance expects a request for vq ready */
#define VDUSE_F_QUEUE_READY 0
/* The VDUSE instance expects a request for suspend */
#define VDUSE_F_SUSPEND 1
/*
* Get the version of VDUSE API that kernel supported (VDUSE_API_VERSION).
* This is used for future extension.
@@ -335,6 +338,7 @@ enum vduse_req_type {
VDUSE_UPDATE_IOTLB,
VDUSE_SET_VQ_GROUP_ASID,
VDUSE_SET_VQ_READY,
VDUSE_SUSPEND,
};
/**