From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nu6xC-0006lb-0R for qemu-devel@nongnu.org; Tue, 23 Mar 2010 12:27:42 -0400 Received: from [199.232.76.173] (port=52571 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nu6xB-0006kY-9f for qemu-devel@nongnu.org; Tue, 23 Mar 2010 12:27:41 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nu6x9-0007l1-SK for qemu-devel@nongnu.org; Tue, 23 Mar 2010 12:27:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45376) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nu6x9-0007ko-GU for qemu-devel@nongnu.org; Tue, 23 Mar 2010 12:27:39 -0400 Date: Tue, 23 Mar 2010 18:23:46 +0200 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] Re: [PATCH 4/9] virtio-serial: Handle scatter-gather buffers for control messages Message-ID: <20100323162346.GA25837@redhat.com> References: <1268999926-29560-1-git-send-email-amit.shah@redhat.com> <1268999926-29560-2-git-send-email-amit.shah@redhat.com> <1268999926-29560-3-git-send-email-amit.shah@redhat.com> <1268999926-29560-4-git-send-email-amit.shah@redhat.com> <1268999926-29560-5-git-send-email-amit.shah@redhat.com> <4BA47C02.3000105@redhat.com> <20100322051802.GE24577@amit-x200.redhat.com> <20100323155126.GA25772@redhat.com> <20100323161508.GF3080@amit-x200.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100323161508.GF3080@amit-x200.redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org, kraxel@redhat.com, Avi Kivity , quintela@redhat.com On Tue, Mar 23, 2010 at 09:45:08PM +0530, Amit Shah wrote: > On (Tue) Mar 23 2010 [17:51:26], Michael S. Tsirkin wrote: > > On Mon, Mar 22, 2010 at 10:48:02AM +0530, Amit Shah wrote: > > > On (Sat) Mar 20 2010 [09:40:50], Avi Kivity wrote: > > > > On 03/19/2010 01:58 PM, Amit Shah wrote: > > > >> + > > > >> + offset = 0; > > > >> + for (i = 0; i< elem.out_num; i++) { > > > >> + memcpy(buf + offset, elem.out_sg[i].iov_base, > > > >> + elem.out_sg[i].iov_len); > > > >> + offset += elem.out_sg[i].iov_len; > > > >> + } > > > >> + len = cur_len; > > > >> + > > > >> + handle_control_message(vser, buf, len); > > > >> + virtqueue_push(vq,&elem, len); > > > >> + } > > > >> + if (len) { > > > >> + qemu_free(buf); > > > >> } > > > >> virtio_notify(vdev, vq); > > > >> } > > > > > > > > Isn't there some virtio function to linearize requests? > > > > > > I don't see one. > > > > virtio-net has iov_fill. Reuse it? > > Hm, yeah. Any ideas on how to share it? Put it in some common file? > > Just copying it seems good for now.. > > Amit Add iov.c -- MST