diff options
author | Eugenio Pérez <eperezma@redhat.com> | 2022-09-06 17:07:17 +0200 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2022-09-27 15:14:37 +0800 |
commit | 275ba561cd3f7b17675046792ecbdea184e948f8 (patch) | |
tree | f29b76b86549326917953eb2519b79c2f4ea52ec /net | |
parent | f64c7cda6973b0ea7477d999b11139306b3d04d5 (diff) |
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.c | 9 |
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); |