From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su7AE-00027X-GR for qemu-devel@nongnu.org; Wed, 25 Jul 2012 15:22:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Su7AD-0003pc-5r for qemu-devel@nongnu.org; Wed, 25 Jul 2012 15:22:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su7AC-0003pU-Tf for qemu-devel@nongnu.org; Wed, 25 Jul 2012 15:22:29 -0400 Message-ID: <5010476C.9050405@redhat.com> Date: Wed, 25 Jul 2012 13:22:20 -0600 From: Eric Blake MIME-Version: 1.0 References: <1343048885-1701-1-git-send-email-coreyb@linux.vnet.ibm.com> <1343048885-1701-5-git-send-email-coreyb@linux.vnet.ibm.com> In-Reply-To: <1343048885-1701-5-git-send-email-coreyb@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig60576CFDBD8EBD4BB57DB8BC" Subject: Re: [Qemu-devel] [PATCH v5 4/6] block: Convert open calls to qemu_open List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Bryant Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, libvir-list@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig60576CFDBD8EBD4BB57DB8BC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/23/2012 07:08 AM, Corey Bryant wrote: > This patch converts all block layer open calls to qemu_open. >=20 > Note that this adds the O_CLOEXEC flag to the changed open paths > when the O_CLOEXEC macro is defined. Is it actually adding O_CLOEXEC, or just the ability to use O_CLOEXEC? Or is the actual change that the end result is that the fd now has FD_CLOEXEC set unconditionally, whether by O_CLOEXEC (which the caller need not pass) or by fcntl()? > +++ b/block/raw-posix.c > @@ -572,8 +572,8 @@ static int raw_create(const char *filename, QEMUOpt= ionParameter *options) > options++; > } > =20 > - fd =3D open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, > - 0644); > + fd =3D qemu_open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY= , > + 0644); After all, I don't see O_CLOEXEC used here. > if (fd < 0) { > result =3D -errno; > } else { > @@ -846,7 +846,7 @@ static int hdev_open(BlockDriverState *bs, const ch= ar *filename, int flags) > if ( bsdPath[ 0 ] !=3D '\0' ) { > strcat(bsdPath,"s0"); > /* some CDs don't have a partition 0 */ > - fd =3D open(bsdPath, O_RDONLY | O_BINARY | O_LARGEFILE); > + fd =3D qemu_open(bsdPath, O_RDONLY | O_BINARY | O_LARGEFIL= E); Also, I still stand by my earlier claim that we don't need O_LARGEFILE here (we should already be configuring for 64-bit off_t by default), although cleaning that up is probably worth an independent commit. > +++ b/block/vdi.c > @@ -653,8 +653,9 @@ static int vdi_create(const char *filename, QEMUOpt= ionParameter *options) > options++; > } > =20 > - fd =3D open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | O_= LARGEFILE, > - 0644); > + fd =3D qemu_open(filename, > + O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | O_LARGEFI= LE, > + 0644); Another pointless O_LARGEFILE, and so forth. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig60576CFDBD8EBD4BB57DB8BC 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.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQEEdsAAoJEKeha0olJ0NqKSMIAIuZnEN9u0rbxzCltaeg3NvV wan+JybhOhJ1WHCQd2hkIgGRt5QGA3Z68sTlMzhBTJVFckrc3SgQufrEK897KtOT zt1SYK04zhqc4x54ycjKNVdtWgnbic0R5smRD+1cAEEEKK4FxWTb8AIdINUo1SV5 RHmz40aWxQE02uo0jh9jQuNL+bWCJmwVaBPYSja4oHbp/NzLT//aD1ecaQ/rDKTb ep+ay5dD7oUn74LRHio5aFiekSD3GxlpbJZ91nui5mvjKBiMxqoXvyLMySpHV6r9 ZRov17wnCD8FG0BkTHLtv07ST2VDU7kqk9V7jw+iUsUsoKjUtk21sQ4T8rD2n1Y= =hy6v -----END PGP SIGNATURE----- --------------enig60576CFDBD8EBD4BB57DB8BC--