From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yx0bN-0006Q4-66 for qemu-devel@nongnu.org; Mon, 25 May 2015 18:12:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yx0bK-000891-0F for qemu-devel@nongnu.org; Mon, 25 May 2015 18:12:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yx0bJ-00088s-Om for qemu-devel@nongnu.org; Mon, 25 May 2015 18:12:01 -0400 Message-ID: <55639E2E.9040604@redhat.com> Date: Mon, 25 May 2015 16:11:58 -0600 From: Eric Blake MIME-Version: 1.0 References: <1432538908-26298-1-git-send-email-mukawa@igel.co.jp> <1432538908-26298-5-git-send-email-mukawa@igel.co.jp> In-Reply-To: <1432538908-26298-5-git-send-email-mukawa@igel.co.jp> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="g2tuvhFIwPJFVKAT1DjVJi9sF5bk04S9M" Subject: Re: [Qemu-devel] [RFC PATCH 4/4] vhost-user: Add new option to specify vhost-user backend supports List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tetsuya Mukawa , qemu-devel@nongnu.org Cc: jasowang@redhat.com, n.nikolaev@virtualopensystems.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --g2tuvhFIwPJFVKAT1DjVJi9sF5bk04S9M Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/25/2015 01:28 AM, Tetsuya Mukawa wrote: > This patch adds 'backend_features' option for vhost-user backends. > If this option is specified, QEMU assumes vhost-user backends support > the features specified by user, and QEMU can start without vhost-user > backend. >=20 > Here are examples. > * QEMU is configured as vhost-user client. > -chardev socket,id=3Dchr0,path=3D/tmp/sock,reconnect=3D3 \ > -netdev vhost-user,id=3Dnet0,chardev=3Dchr0,vhostforce,backend_feature= s=3D0x68000 \ > -device virtio-net-pci,netdev=3Dnet0 \ >=20 > * QEMU is configured as vhost-user server. > -chardev socket,id=3Dchr0,path=3D/tmp/sock,server,nowait \ > -netdev vhost-user,id=3Dnet0,chardev=3Dchr0,vhostforce,backend_feature= s=3D0x68000 \ > -device virtio-net-pci,netdev=3Dnet0 \ >=20 > To know vhost-user backend features that the backend expects, please > specify 0xffffffff as backend_features, then invoke QEMU and check erro= r log > like below. >=20 > Lack of backend features. Expected 0xffffffff, but receives 0x68000 >=20 > Above log indicates the backend features QEMU should be passed. >=20 > Signed-off-by: Tetsuya Mukawa > --- > +++ b/qapi-schema.json > @@ -2243,6 +2243,8 @@ > # > # @queues: #optional number of queues to be created for multiqueue cap= able tap > # > +# @backend_features: #optional feature flag to support vhost user back= end Missing a (since 2.4) designation. New interfaces should prefer - over _, but I see that you are consistent with vnet_hder already in this struct so it is okay. > +# > # Since 1.2 > ## > { 'struct': 'NetdevTapOptions', > @@ -2259,7 +2261,8 @@ > '*vhostfd': 'str', > '*vhostfds': 'str', > '*vhostforce': 'bool', > - '*queues': 'uint32'} } > + '*queues': 'uint32', > + '*backend_features':'uint64'} } Ewww. Making users figure out what integers to pass is NOT user friendly. Better would be an enum type, and make the parameter an optional array of enum values. > =20 > ## > # @NetdevSocketOptions > @@ -2444,12 +2447,15 @@ > # > # @vhostforce: #optional vhost on for non-MSIX virtio guests (default:= false). > # > +# @backend_features: #optional feature flag to support vhost user back= end (default: 0). > +# Long line. Please wrap to fit within 80 columns. Missing (since 2.4) deisgnation. Again, I don't like making users know a raw integer; an enum type would be better. > # Since 2.1 > ## > { 'struct': 'NetdevVhostUserOptions', > 'data': { > 'chardev': 'str', > - '*vhostforce': 'bool' } } > + '*vhostforce': 'bool', > + '*backend_features': 'uint64' } } This struct has no pre-existing _, so the name 'backend-features' is nice= r. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --g2tuvhFIwPJFVKAT1DjVJi9sF5bk04S9M Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVY54uAAoJEKeha0olJ0NqczMH/jOo+Z4iK2Idy0l9R2Itk2fp JwYwwrTsLv4a49n34pDMp/Al+sZvFI3Eg+Y7xbQ89zH7qUxirtnXo+tzvaTIy8nq xNlGbURpdRBkyAsflIDndGtmt3ycevH92JsYyivdlEQzR0Her5puP33ke32VZQxo wqeqDEurAtWjb0140aVugv3XziG5WXtSa4+Oftk/2kRbuZx6qzTtXC4RJ1tQLnaI NaOiSYYRtGnoioxNagCmEtw/68bj0eCsrBwnrNFMTpXeoHTFG7jnj7J4SjajcvNZ IhW6HIN6VIB65wD5/N0iVVhi0LnsxbhByHuLvUT6dsjhaW8LEJrOhnkUopLea/w= =28s+ -----END PGP SIGNATURE----- --g2tuvhFIwPJFVKAT1DjVJi9sF5bk04S9M--