From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKWvq-00014d-MI for qemu-devel@nongnu.org; Tue, 26 Mar 2013 12:41:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKWvl-0005yR-HE for qemu-devel@nongnu.org; Tue, 26 Mar 2013 12:41:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKWvl-0005y0-9L for qemu-devel@nongnu.org; Tue, 26 Mar 2013 12:41:01 -0400 Message-ID: <5151CF4E.6010905@redhat.com> Date: Tue, 26 Mar 2013 10:39:42 -0600 From: Eric Blake MIME-Version: 1.0 References: <1364314072-2474-1-git-send-email-stefanha@redhat.com> <1364314072-2474-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1364314072-2474-4-git-send-email-stefanha@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2PFQQJRUQHDWTKDBCFBEE" Subject: Re: [Qemu-devel] [PATCH 3/4] oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Anthony Liguori , david.pravec@nethost.cz, Juan Quintela , mprivozn@redhat.com, Corey Bryant , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2PFQQJRUQHDWTKDBCFBEE Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/26/2013 10:07 AM, Stefan Hajnoczi wrote: > The fcntl(fd, F_SETFL, O_NONBLOCK) flag is not specific to sockets. > Rename to qemu_set_nonblock() just like qemu_set_cloexec(). >=20 > Signed-off-by: Stefan Hajnoczi > --- Reviewed-by: Eric Blake > +++ b/util/oslib-posix.c > @@ -134,14 +134,14 @@ void qemu_vfree(void *ptr) > free(ptr); > } > =20 > -void socket_set_block(int fd) > +void qemu_set_block(int fd) > { > int f; > f =3D fcntl(fd, F_GETFL); > fcntl(fd, F_SETFL, f & ~O_NONBLOCK); Odd that we aren't checking for errors here, but that's an independent consideration not for this patch. > +++ b/util/oslib-win32.c > @@ -100,14 +100,14 @@ struct tm *localtime_r(const time_t *timep, struc= t tm *result) > return p; > } > =20 > -void socket_set_block(int fd) > +void qemu_set_block(int fd) > { > unsigned long opt =3D 0; > WSAEventSelect(fd, NULL, 0); > ioctlsocket(fd, FIONBIO, &opt); ioctlsocket() doesn't work on non-sockets, does it? On the other hand, do we ever call qemu_set_block() on a non-socket in the mingw build, since we lack SCM_RIGHTS on that platform? Also, this is another case of not checking for errors - I guess inability to set blocking on a non-socket is not fatal, so not checking for errors kind of makes sense. Again, doesn't impact this patch from being a mechanical rename. See my comment in 1/4 about possibly rebasing this to be first (in which case it is slightly smaller). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2PFQQJRUQHDWTKDBCFBEE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRUc9OAAoJEKeha0olJ0NqLbgH/iC2N52KykdH4bnsaTele+8v TkOwGq6VYUI2ePFIJ6NCxABiFlS0X8ZpoABSN6x4tKm8rhpym28NYdOAmgnjnWD0 OK9d482fgoISihK12sXZOStK2DTStpdkU3ES3Qk20QPsKrxWWo9VA+f0/G+g6GHj slCUjh2VoFSp7GEPly8XvruRsitoMq+ZZuYIMJsbOelG+ZOmM1eZtUlrN+ABFxHf Lre2PvvIEH/nykh1PKHAVDVl1HaknUUqOEQYVY2vHz36t3Uzi/JZkFYW2hshOEt5 zYhxH24EcewsBI8y5V4UitJPYdYRnSGcgm382okBUsMODnfR8P9HzCSt6B5OQm8= =CrAF -----END PGP SIGNATURE----- ------enig2PFQQJRUQHDWTKDBCFBEE--