On (Mon) 27 Jul 2015 [09:37:47], Michael S. Tsirkin wrote: > Don't assume a specific layout for control messages. > Required by virtio 1. > > Signed-off-by: Michael S. Tsirkin <m...@redhat.com>
Reviewed-by: Amit Shah <amit.s...@redhat.com> > --- > hw/char/virtio-serial-bus.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c > index 78c73e5..16de50f 100644 > --- 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, buf, len); Not sure why NEEDS_RESET -- anyhow, you planning on doing this? Amit