projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f45607
)
virtio-serial: fix ANY_LAYOUT
author
Michael S. Tsirkin
<mst@redhat.com>
Thu, 23 Jul 2015 14:52:02 +0000
(17:52 +0300)
committer
Michael S. Tsirkin
<mst@redhat.com>
Mon, 27 Jul 2015 08:24:48 +0000
(11:24 +0300)
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>
hw/char/virtio-serial-bus.c
patch
|
blob
|
history
diff --git
a/hw/char/virtio-serial-bus.c
b/hw/char/virtio-serial-bus.c
index 78c73e5abe01d06efdef5a713a5f9e23717019ac..929e49c67165d5f8175adb142470938b3a9c3c0b 100644
(file)
--- a/
hw/char/virtio-serial-bus.c
+++ b/
hw/char/virtio-serial-bus.c
@@
-195,7
+195,8
@@
static size_t send_control_msg(VirtIOSerial *vser, void *buf, size_t len)
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);
virtio_notify(VIRTIO_DEVICE(vser), vq);