mirror of https://gitlab.com/qemu-project/qemu
virtio-serial: fix ANY_LAYOUT
Don't assume a specific layout for control messages. Required by virtio 1. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
5f456073aa
commit
7882080388
|
@ -195,7 +195,8 @@ static size_t send_control_msg(VirtIOSerial *vser, void *buf, size_t len)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(elem.in_sg[0].iov_base, buf, len);
|
/* TODO: detect a buffer that's too short, set NEEDS_RESET */
|
||||||
|
iov_from_buf(elem.in_sg, elem.in_num, 0, buf, len);
|
||||||
|
|
||||||
virtqueue_push(vq, &elem, len);
|
virtqueue_push(vq, &elem, len);
|
||||||
virtio_notify(VIRTIO_DEVICE(vser), vq);
|
virtio_notify(VIRTIO_DEVICE(vser), vq);
|
||||||
|
|
Loading…
Reference in New Issue