OSDN Git Service

vhost-user: Skip unnecessary duplicated VHOST_USER_ADD/REM_MEM_REG requests
authorMinghao Yuan <yuanmh12@chinatelecom.cn>
Mon, 23 Jan 2023 12:21:19 +0000 (20:21 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Sat, 28 Jan 2023 11:21:30 +0000 (06:21 -0500)
The VHOST_USER_ADD/REM_MEM_REG requests should be categorized into
non-vring specific messages, and should be sent only once.

Signed-off-by: Minghao Yuan <yuanmh12@chinatelecom.cn>
Message-Id: <20230123122119.194347-1-yuanmh12@chinatelecom.cn>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/vhost-user.c

index 6c79da9..eca9e10 100644 (file)
@@ -459,6 +459,8 @@ static bool vhost_user_one_time_request(VhostUserRequest request)
     case VHOST_USER_SET_MEM_TABLE:
     case VHOST_USER_GET_QUEUE_NUM:
     case VHOST_USER_NET_SET_MTU:
+    case VHOST_USER_ADD_MEM_REG:
+    case VHOST_USER_REM_MEM_REG:
         return true;
     default:
         return false;