From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJc6h-00043t-Ns for qemu-devel@nongnu.org; Mon, 27 Jul 2015 02:41:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJc6d-0003h8-Kw for qemu-devel@nongnu.org; Mon, 27 Jul 2015 02:41:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJc6d-0003h2-FM for qemu-devel@nongnu.org; Mon, 27 Jul 2015 02:41:47 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 065CD342267 for ; Mon, 27 Jul 2015 06:41:46 +0000 (UTC) Date: Mon, 27 Jul 2015 12:11:36 +0530 From: Amit Shah Message-ID: <20150727064136.GD12267@grmbl.mre> References: <1437979063-25159-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437979063-25159-1-git-send-email-mst@redhat.com> Subject: Re: [Qemu-devel] [PATCH] virtio-serial: fix ANY_LAYOUT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org 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 Reviewed-by: Amit Shah > --- > 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