summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEugenio Pérez2022-09-06 17:07:17 +0200
committerJason Wang2022-09-27 09:14:37 +0200
commit275ba561cd3f7b17675046792ecbdea184e948f8 (patch)
treef29b76b86549326917953eb2519b79c2f4ea52ec /net
parentvdpa: Add vhost_vdpa_net_load_mq (diff)
downloadqemu-275ba561cd3f7b17675046792ecbdea184e948f8.tar.gz
qemu-275ba561cd3f7b17675046792ecbdea184e948f8.tar.xz
qemu-275ba561cd3f7b17675046792ecbdea184e948f8.zip
vdpa: validate MQ CVQ commands
So we are sure we can update the device model properly before sending to the device. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/vhost-vdpa.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 3950e4f25d..c6cbe2fb5c 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -486,6 +486,15 @@ static bool vhost_vdpa_net_cvq_validate_cmd(const void *out_buf, size_t len)
__func__, ctrl.cmd);
};
break;
+ case VIRTIO_NET_CTRL_MQ:
+ switch (ctrl.cmd) {
+ case VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET:
+ return true;
+ default:
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid mq cmd %u\n",
+ __func__, ctrl.cmd);
+ };
+ break;
default:
qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid control class %u\n",
__func__, ctrl.class);