From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SekmN-0002XA-Uv for qemu-devel@nongnu.org; Wed, 13 Jun 2012 06:26:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SekmH-00011D-Pg for qemu-devel@nongnu.org; Wed, 13 Jun 2012 06:26:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65345) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SekmH-000111-HE for qemu-devel@nongnu.org; Wed, 13 Jun 2012 06:26:17 -0400 Message-ID: <4FD86ABD.501@redhat.com> Date: Wed, 13 Jun 2012 12:26:05 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1339170179-2554-1-git-send-email-coreyb@linux.vnet.ibm.com> <1339170179-2554-5-git-send-email-coreyb@linux.vnet.ibm.com> In-Reply-To: <1339170179-2554-5-git-send-email-coreyb@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 4/4] block: Convert open calls to qemu_open List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Bryant Cc: libvir-list@redhat.com, aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com Am 08.06.2012 17:42, schrieb Corey Bryant: > This patch converts all block layer open calls to qemu_open. This > enables all block layer open paths to dup(X) a pre-opened file > descriptor if the filename is of the format /dev/fd/X. This is > useful if QEMU is restricted from opening certain files. > > Note that this adds the O_CLOEXEC flag to the changed open paths > when the O_CLOEXEC macro is defined. > > v2: > -Convert calls to qemu_open instead of file_open (kwolf@redhat.com) > -Mention introduction of O_CLOEXEC (kwolf@redhat.com) > > Signed-off-by: Corey Bryant > @@ -950,7 +950,7 @@ static int floppy_probe_device(const char *filename) > if (strstart(filename, "/dev/fd", NULL)) > prio = 50; Good to have this context here. I think this has to be removed in another patch or all our file descriptors will become host_floppy... > > - fd = open(filename, O_RDONLY | O_NONBLOCK); > + fd = qemu_open(filename, O_RDONLY | O_NONBLOCK); > if (fd < 0) { > goto out; > } Kevin