From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLMpo-0005FD-6w for qemu-devel@nongnu.org; Fri, 31 Jul 2015 22:47:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLMpl-00059i-1D for qemu-devel@nongnu.org; Fri, 31 Jul 2015 22:47:40 -0400 Received: from mail-yk0-f178.google.com ([209.85.160.178]:35595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLMpk-00059O-UI for qemu-devel@nongnu.org; Fri, 31 Jul 2015 22:47:36 -0400 Received: by ykdu72 with SMTP id u72so73486223ykd.2 for ; Fri, 31 Jul 2015 19:47:36 -0700 (PDT) From: l@dorileo.org In-Reply-To: <1438105003-29501-7-git-send-email-marcandre.lureau@redhat.com> References: <1438105003-29501-1-git-send-email-marcandre.lureau@redhat.com> <1438105003-29501-7-git-send-email-marcandre.lureau@redhat.com> Date: Fri, 31 Jul 2015 23:47:31 -0300 Message-ID: <87pp37g1x8.fsf@dorileo.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 6/9] vhost: use variable arguments for vhost_call() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , qemu-devel@nongnu.org Cc: haifeng.lin@huawei.com, mst@redhat.com, thibaut.collet@6wind.com, jasowang@redhat.com, pbonzini@redhat.com Marc-Andr=C3=A9 Lureau writes: Hi Andr=C3=A9, > It is useful to pass extra arguments to the funtions, for > various backend needs. > > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > hw/virtio/vhost-backend.c | 4 ++-- > hw/virtio/vhost-user.c | 4 ++-- > include/hw/virtio/vhost-backend.h | 6 ++++-- > 3 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c > index 4d68a27..7255089 100644 > --- a/hw/virtio/vhost-backend.c > +++ b/hw/virtio/vhost-backend.c > @@ -14,8 +14,8 @@ >=20=20 > #include >=20=20 > -static int vhost_kernel_call(struct vhost_dev *dev, unsigned long int re= quest, > - void *arg) > +static int vhost_kernel_call(struct vhost_dev *dev, > + unsigned long int request, void *arg, ...) I Couldn't see in your set where you change vhost_kernel_call() implementat= ion or make any use of this change. Regards... --=20 Leandro Dorileo > { > int fd =3D (uintptr_t) dev->opaque; >=20=20 > diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c > index 4993b63..8b6d7e7 100644 > --- a/hw/virtio/vhost-user.c > +++ b/hw/virtio/vhost-user.c > @@ -190,8 +190,8 @@ static int vhost_user_write(struct vhost_dev *dev, Vh= ostUserMsg *msg, > 0 : -1; > } >=20=20 > -static int vhost_user_call(struct vhost_dev *dev, unsigned long int requ= est, > - void *arg) > +static int vhost_user_call(struct vhost_dev *dev, > + unsigned long int request, void *arg, ...) > { > VhostUserMsg msg; > VhostUserRequest msg_request; > diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-= backend.h > index e472f29..36fa0f7 100644 > --- a/include/hw/virtio/vhost-backend.h > +++ b/include/hw/virtio/vhost-backend.h > @@ -11,6 +11,8 @@ > #ifndef VHOST_BACKEND_H_ > #define VHOST_BACKEND_H_ >=20=20 > +#include > + > typedef enum VhostBackendType { > VHOST_BACKEND_TYPE_NONE =3D 0, > VHOST_BACKEND_TYPE_KERNEL =3D 1, > @@ -20,8 +22,8 @@ typedef enum VhostBackendType { >=20=20 > struct vhost_dev; >=20=20 > -typedef int (*vhost_call)(struct vhost_dev *dev, unsigned long int reque= st, > - void *arg); > +typedef int (*vhost_call)(struct vhost_dev *dev, > + unsigned long int request, void *arg, ...); > typedef int (*vhost_backend_init)(struct vhost_dev *dev, void *opaque); > typedef int (*vhost_backend_cleanup)(struct vhost_dev *dev); >=20=20 > --=20 > 2.4.3 > >