From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THXLJ-00071v-JT for qemu-devel@nongnu.org; Fri, 28 Sep 2012 05:58:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THXLF-0000Yw-Cb for qemu-devel@nongnu.org; Fri, 28 Sep 2012 05:58:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THXLF-0000Ya-4r for qemu-devel@nongnu.org; Fri, 28 Sep 2012 05:58:41 -0400 Date: Fri, 28 Sep 2012 12:00:12 +0200 From: "Michael S. Tsirkin" Message-ID: <20120928100012.GA7294@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH RESEND 0/3] Introduce virtqueue_get_avail_bytes() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu list , Anthony Liguori On Tue, Sep 25, 2012 at 12:05:13AM +0530, Amit Shah wrote: > This is a rebased version of the patchset sent earlier. > > The current virtqueue_avail_bytes() is a weird API: it's oddly-named: > doesn't tell us what the API is going to do, and also suits just one > use-case (that in virtio-net.c). > > Introduce virtqueue_get_avail_bytes(), which returns the number of > bytes in the vq available for input as well as output. > virtqueue_avail_bytes() is made a wrapper around this new function for > now. It should be deprecated soon, though. > > Doing this will also help with the virtio-rng patch where a > VirtQueueElement is popped only to find out what its size is. With > this series applied, the popping (and the subsequent save/load of > state for migration) isn't necessary. > > The virtio-serial-bus code becomes better too, that's patch 3 here. > > Please apply, Applied, thanks. > Amit Shah (3): > virtio: use unsigned int for counting bytes in vq > virtio: Introduce virtqueue_get_avail_bytes() > virtio-serial-bus: let chardev know the exact number of bytes > requested > > hw/virtio-serial-bus.c | 11 +++-------- > hw/virtio.c | 30 ++++++++++++++++++++++-------- > hw/virtio.h | 5 ++++- > 3 files changed, 29 insertions(+), 17 deletions(-) > > -- > 1.7.7.6