From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Uty-0001bH-8k for qemu-devel@nongnu.org; Mon, 15 Jun 2015 09:58:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4Utu-0000OU-5d for qemu-devel@nongnu.org; Mon, 15 Jun 2015 09:58:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32956) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Utu-0000OH-0E for qemu-devel@nongnu.org; Mon, 15 Jun 2015 09:58:10 -0400 Date: Mon, 15 Jun 2015 14:58:07 +0100 From: Stefan Hajnoczi Message-ID: <20150615135807.GD9410@stefanha-thinkpad.redhat.com> References: <1432538908-26298-5-git-send-email-mukawa@igel.co.jp> <1432874550-10921-1-git-send-email-mukawa@igel.co.jp> <1432874550-10921-5-git-send-email-mukawa@igel.co.jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ylS2wUBXLOxYXZFQ" Content-Disposition: inline In-Reply-To: <1432874550-10921-5-git-send-email-mukawa@igel.co.jp> Subject: Re: [Qemu-devel] [PATCH v1 4/4] vhost-user: Add new option to specify vhost-user backend features List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tetsuya Mukawa Cc: jasowang@redhat.com, qemu-devel@nongnu.org, n.nikolaev@virtualopensystems.com --ylS2wUBXLOxYXZFQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 29, 2015 at 01:42:30PM +0900, Tetsuya Mukawa wrote: > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c > index 3af6faf..7fbb306 100644 > --- a/hw/net/virtio-net.c > +++ b/hw/net/virtio-net.c > @@ -366,6 +366,17 @@ static int peer_has_ufo(VirtIONet *n) > return n->has_ufo; > } > =20 > +static uint64_t peer_backend_features(VirtIONet *n) > +{ > + if (!peer_has_vnet_hdr(n)) > + return 0; QEMU coding style always uses {} even for single statement if bodies: if (!peer_has_vnet_hdr(n)) { return 0; } > diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c > index 4d7e3ba..d847ea5 100644 > --- a/hw/virtio/vhost-user.c > +++ b/hw/virtio/vhost-user.c > @@ -307,6 +307,13 @@ static int vhost_user_call(struct vhost_dev *dev, un= signed long int request, > error_report("Received bad msg size."); > goto close; > } > + if (dev->backend_features !=3D (dev->backend_features & msg.= u64)) { > + error_report("Lack of backend features. " > + "Expected 0x%llx, but receives 0x%lx", Please use PRIx64 for msg.u64 to avoid compiler errors on 32-bit hosts. > + dev->backend_features, msg.u64); > + goto close; QEMU uses 4-space indentation. --ylS2wUBXLOxYXZFQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVftnvAAoJEJykq7OBq3PIdEkH/jKFzNIn8X7ZL2P9csmok113 ULdFLecvR2ylXgGVQJJNoqTzfsMeZGW3uhcqLAG+h8YhaJentQK8+fn9NQ2f1wxu sMR8si2YB/Z42Jnt4/GbB/Lu89maxjzPYmgiDScRDv+hLzGnvNir7BnaYdfmjfFT 8q2eLxs2TCFQmxP++tZLkuAXa//32m7bwxVkKNAlBKxopgEo9smBCS2KDkq+TQ0b mzncTtd4mI6CQDeH87ywoicoAjNmgzoah237XUx1kAx78hTKbI2qp3+IAWK8UKF7 GFGmLpgVRdgC3j6IYjEuokJnQ5IcWTmMbdHbPyARDrtasMEU6UZip0TdBIj0i2Q= =NnD0 -----END PGP SIGNATURE----- --ylS2wUBXLOxYXZFQ--