From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJd16-0003SL-7b for qemu-devel@nongnu.org; Mon, 27 Jul 2015 03:40:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJd14-0004b9-4n for qemu-devel@nongnu.org; Mon, 27 Jul 2015 03:40:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJd14-0004aa-0Z for qemu-devel@nongnu.org; Mon, 27 Jul 2015 03:40:06 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id A060F8EB37 for ; Mon, 27 Jul 2015 07:40:05 +0000 (UTC) Date: Mon, 27 Jul 2015 10:40:03 +0300 From: "Michael S. Tsirkin" Message-ID: <20150727103913-mutt-send-email-mst@redhat.com> References: <1437979063-25159-1-git-send-email-mst@redhat.com> <20150727064136.GD12267@grmbl.mre> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150727064136.GD12267@grmbl.mre> Subject: Re: [Qemu-devel] [PATCH] virtio-serial: fix ANY_LAYOUT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu-devel@nongnu.org On Mon, Jul 27, 2015 at 12:11:36PM +0530, Amit Shah wrote: > 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 Definitely not for 2.4. It's a guest bug, we need a consistent strategy for handling these. -- MST