@@ -61,6 +61,7 @@ typedef enum VhostUserRequest {
VHOST_USER_SET_VRING_ENABLE = 18,
VHOST_USER_SEND_RARP = 19,
VHOST_USER_INPUT_GET_CONFIG = 20,
+ VHOST_USER_GPU_SET_SOCKET = 21,
VHOST_USER_MAX
} VhostUserRequest;
@@ -59,6 +59,7 @@ typedef enum VhostUserRequest {
VHOST_USER_SET_VRING_ENABLE = 18,
VHOST_USER_SEND_RARP = 19,
VHOST_USER_INPUT_GET_CONFIG = 20,
+ VHOST_USER_GPU_SET_SOCKET = 21,
VHOST_USER_MAX
} VhostUserRequest;
@@ -263,6 +264,16 @@ err:
return -1;
}
+int vhost_user_gpu_set_socket(struct vhost_dev *dev, int fd)
+{
+ VhostUserMsg msg = {
+ .request = VHOST_USER_GPU_SET_SOCKET,
+ .flags = VHOST_USER_VERSION,
+ };
+
+ return vhost_user_write(dev, &msg, &fd, 1);
+}
+
static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,
struct vhost_log *log)
{
@@ -110,5 +110,6 @@ int vhost_set_backend_type(struct vhost_dev *dev,
int vhost_user_input_get_config(struct vhost_dev *dev,
struct virtio_input_config **config);
+int vhost_user_gpu_set_socket(struct vhost_dev *dev, int fd);
#endif /* VHOST_BACKEND_H_ */