From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHToz-0000dV-C3 for qemu-devel@nongnu.org; Fri, 08 Jan 2016 04:59:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHTow-0005EB-HS for qemu-devel@nongnu.org; Fri, 08 Jan 2016 04:59:01 -0500 Received: from e28smtp03.in.ibm.com ([125.16.236.3]:36679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHTov-0005Dh-R9 for qemu-devel@nongnu.org; Fri, 08 Jan 2016 04:58:58 -0500 Received: from localhost by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 8 Jan 2016 15:28:53 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 398D41258066 for ; Fri, 8 Jan 2016 15:29:34 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay05.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u089vpft43516086 for ; Fri, 8 Jan 2016 15:27:51 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u089vobr021686 for ; Fri, 8 Jan 2016 15:27:50 +0530 From: "Aneesh Kumar K.V" In-Reply-To: <1452196584-17259-22-git-send-email-wei.liu2@citrix.com> References: <1452196584-17259-1-git-send-email-wei.liu2@citrix.com> <1452196584-17259-22-git-send-email-wei.liu2@citrix.com> Date: Fri, 08 Jan 2016 15:27:49 +0530 Message-ID: <871t9sv1eq.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 21/27] 9pfs: factor out virtio_9p_push_and_notify List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wei Liu , qemu-devel@nongnu.org Cc: Greg Kurz , "Michael S. Tsirkin" Wei Liu writes: > The new function resides in virtio specific file. > > Signed-off-by: Wei Liu > --- > v2: new, part of original "9pfs: break out generic code from > virtio-9p.{c,h}" > --- > hw/9pfs/virtio-9p-device.c | 11 +++++++++++ > hw/9pfs/virtio-9p.c | 8 +------- > hw/9pfs/virtio-9p.h | 2 ++ > 3 files changed, 14 insertions(+), 7 deletions(-) > > diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c > index 5cad654..cfad13a 100644 > --- a/hw/9pfs/virtio-9p-device.c > +++ b/hw/9pfs/virtio-9p-device.c > @@ -20,6 +20,17 @@ > #include "coth.h" > #include "hw/virtio/virtio-access.h" > > +void virtio_9p_push_and_notify(V9fsPDU *pdu) > +{ > + V9fsState *s = pdu->s; > + > + /* push onto queue and notify */ > + virtqueue_push(s->vq, &pdu->elem, pdu->size); > + > + /* FIXME: we should batch these completions */ > + virtio_notify(VIRTIO_DEVICE(s), s->vq); > +} > + > static uint64_t virtio_9p_get_features(VirtIODevice *vdev, uint64_t features, > Error **errp) > { > diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c > index 3c39247..0ba2312 100644 > --- a/hw/9pfs/virtio-9p.c > +++ b/hw/9pfs/virtio-9p.c > @@ -65,13 +65,7 @@ ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...) > > static void pdu_push_and_notify(V9fsPDU *pdu) > { > - V9fsState *s = pdu->s; > - > - /* push onto queue and notify */ > - virtqueue_push(s->vq, &pdu->elem, pdu->size); > - > - /* FIXME: we should batch these completions */ > - virtio_notify(VIRTIO_DEVICE(s), s->vq); > + virtio_9p_push_and_notify(pdu); > } > > static int omode_to_uflags(int8_t mode) > diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h > index b4d344a..a1ac398 100644 > --- a/hw/9pfs/virtio-9p.h > +++ b/hw/9pfs/virtio-9p.h > @@ -6,6 +6,8 @@ > #include "9p.h" > > extern void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq); > +extern void virtio_9p_push_and_notify(V9fsPDU *pdu); > + > ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset, > const char *fmt, va_list ap); > ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset, > -- > 2.1.4 How is this different from pdu_push_notify added by [PATCH 18/27] -aneesh