From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDWlR-0001yH-6U for qemu-devel@nongnu.org; Tue, 20 Jan 2015 06:14:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDWlN-0007nc-2f for qemu-devel@nongnu.org; Tue, 20 Jan 2015 06:14:29 -0500 Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]:62188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDWlM-0007nU-SG for qemu-devel@nongnu.org; Tue, 20 Jan 2015 06:14:25 -0500 Received: by mail-we0-f175.google.com with SMTP id k11so36438424wes.6 for ; Tue, 20 Jan 2015 03:14:24 -0800 (PST) Date: Tue, 20 Jan 2015 11:14:21 +0000 From: Stefan Hajnoczi Message-ID: <20150120111421.GK17631@stefanha-thinkpad.redhat.com> References: <1418304322-7546-1-git-send-email-cornelia.huck@de.ibm.com> <1418304322-7546-13-git-send-email-cornelia.huck@de.ibm.com> <20141212115538.2aa96fd2@oc7435384737.ibm.com> <20141212121825.6c09af4d.cornelia.huck@de.ibm.com> <20141212122547.511baafd@oc7435384737.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Cy+5HEalSgyXkpVS" Content-Disposition: inline In-Reply-To: <20141212122547.511baafd@oc7435384737.ibm.com> Subject: Re: [Qemu-devel] [PATCH RFC v6 12/20] virtio: disallow late feature changes for virtio-1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: Cornelia Huck , virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org, mst@redhat.com --Cy+5HEalSgyXkpVS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 12, 2014 at 12:25:47PM +0100, Thomas Huth wrote: > On Fri, 12 Dec 2014 12:18:25 +0100 > Cornelia Huck wrote: >=20 > > On Fri, 12 Dec 2014 11:55:38 +0100 > > Thomas Huth wrote: > >=20 > > > On Thu, 11 Dec 2014 14:25:14 +0100 > > > Cornelia Huck wrote: > > >=20 > > > > For virtio-1 devices, the driver must not attempt to set feature bi= ts > > > > after it set FEATURES_OK in the device status. Simply reject it in > > > > that case. > > > >=20 > > > > Signed-off-by: Cornelia Huck > > > > --- > > > > hw/virtio/virtio.c | 16 ++++++++++++++-- > > > > include/hw/virtio/virtio.h | 2 ++ > > > > 2 files changed, 16 insertions(+), 2 deletions(-) > > > >=20 > > > > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > > > > index 57190ba..a3dd67b 100644 > > > > --- a/hw/virtio/virtio.c > > > > +++ b/hw/virtio/virtio.c > > > > @@ -978,7 +978,7 @@ void virtio_save(VirtIODevice *vdev, QEMUFile *= f) > > > > vmstate_save_state(f, &vmstate_virtio, vdev); > > > > } > > > >=20 > > > > -int virtio_set_features(VirtIODevice *vdev, uint64_t val) > > > > +static int __virtio_set_features(VirtIODevice *vdev, uint64_t val) > > >=20 > > > Maybe avoid the double underscores here? But unfortunately, I also fa= il > > > to come up with a better suggestion for a name here ... > >=20 > > virtio_set_features_nocheck()? >=20 > Sounds ok to me. >=20 > > This function is only called within virtio.c anyway... >=20 > Right, so the double underscores should be ok here, too. (I still do > not like them very much, but that's just my personal taste in this case) C99 "7.1.3 Reserved identifiers" says: All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use [by the standard library] You can use a trailing underscore or useless word like "do", e.g. virtio_do_set_features(), for internal functions. --Cy+5HEalSgyXkpVS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUvjiNAAoJEJykq7OBq3PIs3YH/3B0hKswuZVJqEhHDmRegdQs R/JXgdhlqxLma5BMdW25Y0CP3EDUPIicS8twn8xG6XpCpOr8bk9lIExNV4R4VVtR bZh2XXxMCUwgbjWusXTHfMciMLXAKPexn/oDHt5QIPfx75QnI3RLCoNfwlYJy2VA 6lsG3wrVy+skZgCXrX4sKKLoexlIPqyGSOCOENG3B75wEJjxym31EcaYZeprsrMY oXXwjCXy0QyHfVRX6C0FtziEJnwgcEi1oHpbjGbr4mhrZq5l0l187XSeMNGt59Ki bE4BVVSVir+XpJkKij9K0YLsyske5KTFOXBug85rXsHwNE8NozECamYdCTgCGws= =sL9I -----END PGP SIGNATURE----- --Cy+5HEalSgyXkpVS--