From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeobA-0002Na-IU for qemu-devel@nongnu.org; Wed, 13 Jun 2012 10:31:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Seob4-0000HT-BO for qemu-devel@nongnu.org; Wed, 13 Jun 2012 10:31:04 -0400 Received: from e38.co.us.ibm.com ([32.97.110.159]:53420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Seob4-0000Gv-4h for qemu-devel@nongnu.org; Wed, 13 Jun 2012 10:30:58 -0400 Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Jun 2012 08:30:50 -0600 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id C284AC9006E for ; Wed, 13 Jun 2012 10:30:46 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5DEUlaQ111240 for ; Wed, 13 Jun 2012 10:30:47 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5DEUkkY018225 for ; Wed, 13 Jun 2012 11:30:47 -0300 Message-ID: <4FD8A415.2080501@linux.vnet.ibm.com> Date: Wed, 13 Jun 2012 10:30:45 -0400 From: Corey Bryant 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> <4FD86ABD.501@redhat.com> In-Reply-To: <4FD86ABD.501@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed 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: Kevin Wolf Cc: libvir-list@redhat.com, aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com On 06/13/2012 06:26 AM, Kevin Wolf wrote: > 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... > Good catch, thanks. I just sent a patch to fix this. >> >> - fd = open(filename, O_RDONLY | O_NONBLOCK); >> + fd = qemu_open(filename, O_RDONLY | O_NONBLOCK); >> if (fd < 0) { >> goto out; >> } > > Kevin > -- Regards, Corey