From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36109 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q9HCA-0003oS-W8 for qemu-devel@nongnu.org; Mon, 11 Apr 2011 09:30:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9HC9-0002T4-5B for qemu-devel@nongnu.org; Mon, 11 Apr 2011 09:30:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61261) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9HC8-0002So-RC for qemu-devel@nongnu.org; Mon, 11 Apr 2011 09:30:21 -0400 Message-ID: <4DA30265.1080000@redhat.com> Date: Mon, 11 Apr 2011 16:30:13 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: To O_EXCL or not to O_EXCL open host_cdrom References: <20110411050732.GA7523@amit-x200.redhat.com> <20110411083143.GA22987@stefanha-thinkpad.localdomain> In-Reply-To: <20110411083143.GA22987@stefanha-thinkpad.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Markus Armbruster , qemu-devel , Ryan Harper , Amit Shah , Christoph Hellwig On 04/11/2011 11:31 AM, Stefan Hajnoczi wrote: > On Mon, Apr 11, 2011 at 10:37:32AM +0530, Amit Shah wrote: > > On (Fri) 08 Apr 2011 [12:33:27], Stefan Hajnoczi wrote: > > > The other concern I have about using O_EXCL is that we expose > > > ourselves to race conditions if there is ever a need to re-open the > > > device. When QEMU closes its file descriptor another program may be > > > scheduled to run and open the device with O_EXCL. Now QEMU will not > > > be able to open the CD-ROM anymore. > > > > The admins should really be the ones worrying about this, not QEMU. > > Think of a desktop use case. virt-manager lets me pass through the host > CD-ROM today. Desktops have hald/udisks and you can't expect users to > disable/reenable those services just for QEMU. It should be solved at that level then. If I insert a disc into an assigned cd-rom drive, I shouldn't get a file manager or autorun window to pop in the host, just the guest. So: libvirt should inform the rest of the system that it is taking over the cd-rom and as far as they're concerned, it no longer exists. -- error compiling committee.c: too many arguments to function