From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zdwtu-0005yP-WA for qemu-devel@nongnu.org; Mon, 21 Sep 2015 04:56:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zdwtq-0007Vl-0X for qemu-devel@nongnu.org; Mon, 21 Sep 2015 04:56:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zdwtp-0007UE-Rh for qemu-devel@nongnu.org; Mon, 21 Sep 2015 04:56:37 -0400 Date: Mon, 21 Sep 2015 11:56:33 +0300 From: "Michael S. Tsirkin" Message-ID: <20150921115543-mutt-send-email-mst@redhat.com> References: <1442657533-13030-1-git-send-email-marcandre.lureau@redhat.com> <1442657533-13030-10-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v4 09/22] vhost: use a function for each call List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thibaut Collet Cc: Linhaifeng , marcandre.lureau@redhat.com, Jason Wang , qemu-devel , Paolo Bonzini On Mon, Sep 21, 2015 at 09:33:04AM +0200, Thibaut Collet wrote: > > +static int vhost_reset_owner(struct vhost_dev *dev) > > +{ > > + VhostUserMsg msg = { > > + .request = VHOST_USER_RESET_OWNER, > > + .flags = VHOST_USER_VERSION, > > + }; > > + > > + vhost_user_write(dev, &msg, NULL, 0); > > + > > return 0; > > } > > > > If you define a specific function for each messages it can be > interesting to add function for messages to get/set protocol features > (VHOST_USER_GET_PROTOCOL_FEATURES and > VHOST_USER_SET_PROTOCOL_FEATURES) and modify the vhost_user_init > function to call these specific functions (this function can be > already modified to use the specific function for > VHOST_USER_GET_FEATURES message to avoid code duplication) I'm not sure what this would buy us ... can be a patch on top. -- MST