aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2024-12-19 12:13:53 +0100
committerStefano Brivio <sbrivio@redhat.com>2025-01-20 19:51:24 +0100
commit6016e04a3aae90cdd49fec391088b83a6d2170a6 (patch)
tree61e94c85e091c5fcf0c6cbb5be9ef188158f0b99
parenta8f4fc481ce3afbf48522a0af44d222d665b515e (diff)
downloadpasst-6016e04a3aae90cdd49fec391088b83a6d2170a6.tar
passt-6016e04a3aae90cdd49fec391088b83a6d2170a6.tar.gz
passt-6016e04a3aae90cdd49fec391088b83a6d2170a6.tar.bz2
passt-6016e04a3aae90cdd49fec391088b83a6d2170a6.tar.lz
passt-6016e04a3aae90cdd49fec391088b83a6d2170a6.tar.xz
passt-6016e04a3aae90cdd49fec391088b83a6d2170a6.tar.zst
passt-6016e04a3aae90cdd49fec391088b83a6d2170a6.zip
vhost-user: update protocol features and commands list
vhost-user protocol specification has been updated with feature flags and commands we will need to implement migration. Signed-off-by: Laurent Vivier <lvivier@redhat.com> [sbrivio: Fix comment to union vhost_user_payload] Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--vhost_user.c5
-rw-r--r--vhost_user.h40
2 files changed, 44 insertions, 1 deletions
diff --git a/vhost_user.c b/vhost_user.c
index 4b8558f..48226a8 100644
--- a/vhost_user.c
+++ b/vhost_user.c
@@ -110,6 +110,11 @@ static const char *vu_request_to_string(unsigned int req)
REQ(VHOST_USER_GET_MAX_MEM_SLOTS),
REQ(VHOST_USER_ADD_MEM_REG),
REQ(VHOST_USER_REM_MEM_REG),
+ REQ(VHOST_USER_SET_STATUS),
+ REQ(VHOST_USER_GET_STATUS),
+ REQ(VHOST_USER_GET_SHARED_OBJECT),
+ REQ(VHOST_USER_SET_DEVICE_STATE_FD),
+ REQ(VHOST_USER_CHECK_DEVICE_STATE),
};
#undef REQ
return vu_request_str[req];
diff --git a/vhost_user.h b/vhost_user.h
index 464ba21..c880893 100644
--- a/vhost_user.h
+++ b/vhost_user.h
@@ -37,6 +37,10 @@ enum vhost_user_protocol_feature {
VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD = 12,
VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS = 14,
VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS = 15,
+ VHOST_USER_PROTOCOL_F_STATUS = 16,
+ /* Feature 17 reserved for VHOST_USER_PROTOCOL_F_XEN_MMAP. */
+ VHOST_USER_PROTOCOL_F_SHARED_OBJECT = 18,
+ VHOST_USER_PROTOCOL_F_DEVICE_STATE = 19,
VHOST_USER_PROTOCOL_F_MAX
};
@@ -83,6 +87,11 @@ enum vhost_user_request {
VHOST_USER_GET_MAX_MEM_SLOTS = 36,
VHOST_USER_ADD_MEM_REG = 37,
VHOST_USER_REM_MEM_REG = 38,
+ VHOST_USER_SET_STATUS = 39,
+ VHOST_USER_GET_STATUS = 40,
+ VHOST_USER_GET_SHARED_OBJECT = 41,
+ VHOST_USER_SET_DEVICE_STATE_FD = 42,
+ VHOST_USER_CHECK_DEVICE_STATE = 43,
VHOST_USER_MAX
};
@@ -129,11 +138,38 @@ struct vhost_user_memory {
};
/**
+ * struct vhost_user_log - Address and size of the shared memory region used
+ * to log page update
+ * @mmap_size: Size of the shared memory region
+ * @mmap_offset: Offset of the shared memory region
+ */
+struct vhost_user_log {
+ uint64_t mmap_size;
+ uint64_t mmap_offset;
+};
+
+/**
+ * struct vhost_user_transfer_device_state - Set the direction and phase
+ * of the backend device state fd
+ * @direction: Device state transfer direction (save or load)
+ * @phase: Migration phase (only stopped is supported)
+ */
+struct vhost_user_transfer_device_state {
+ uint32_t direction;
+#define VHOST_USER_TRANSFER_STATE_DIRECTION_SAVE 0
+#define VHOST_USER_TRANSFER_STATE_DIRECTION_LOAD 1
+ uint32_t phase;
+#define VHOST_USER_TRANSFER_STATE_PHASE_STOPPED 0
+};
+
+/**
* union vhost_user_payload - vhost-user message payload
* @u64: 64-bit payload
* @state: vring state payload
* @addr: vring addresses payload
- * vhost_user_memory: Memory regions information payload
+ * @memory: Memory regions information payload
+ * @log: Memory logging payload
+ * @transfer_state: Device state payload
*/
union vhost_user_payload {
#define VHOST_USER_VRING_IDX_MASK 0xff
@@ -142,6 +178,8 @@ union vhost_user_payload {
struct vhost_vring_state state;
struct vhost_vring_addr addr;
struct vhost_user_memory memory;
+ struct vhost_user_log log;
+ struct vhost_user_transfer_device_state transfer_state;
};
/**