From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsBwG-0002VE-Mt for qemu-devel@nongnu.org; Mon, 07 Jan 2013 07:36:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsBwF-0000QN-CU for qemu-devel@nongnu.org; Mon, 07 Jan 2013 07:36:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsBwF-0000QH-47 for qemu-devel@nongnu.org; Mon, 07 Jan 2013 07:36:23 -0500 From: Markus Armbruster References: <13C5521D-B7F1-4A0B-B0DC-BD839C29106A@dlhnet.de> <50E72299.9030002@redhat.com> Date: Mon, 07 Jan 2013 13:36:18 +0100 In-Reply-To: (Peter Lieven's message of "Mon, 7 Jan 2013 08:19:48 +0100") Message-ID: <87fw2db265.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] QEMU CDROM tray-open and locked logic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: Paolo Bonzini , "qemu-devel@nongnu.org" Peter Lieven writes: > Hi Paolo, > > Am 04.01.2013 um 19:42 schrieb Paolo Bonzini : > >> Il 04/01/2013 11:26, Peter Lieven ha scritto: >>> Hi, >>> >>> i have observed the following with qemu-kvm-1.2.0 which I think is not right: >>> >>> a) if the CDROM is locked and I sent a eject command I get the error that the >>> CDROM is locked, but its ejected nevertheless. >> >> That's because the CD-ROM sends an "eject requested" event, and udev >> does the unlock & eject itself. > > ah ok, this explains it. > >> >>> b) if I eject the CDROM in the OS I see tray-open=1 and locked=1. In the >>> tray-open=1 state the CDROM can`t be locked, can it? >> >> A "real" CD-ROM drive could have the tray open and not responding to the >> button. Table 330 of MMC6 matches "Operation Lock, current prevent >> state Locked, No media present" to "No Error, media insertion is not >> permitted". I cannot check right now what happens later and whether >> QEMU's behavior makes sense. > > okay, so this could be also correct. For what it's worth, my physical CD-ROM can be locked while the tray is open. It stays locked when the tray closes. > last question. if the OS opens the tray, the cdrom is still inserted in the > case that the iso is still inserted. this behavior is also ok, but its a little > confusing. this leads to a lot of cases that have to be checked regarding > cdroms in qemu. I'm not sure I got your question, but perhaps the following helps anyway. OS opening the tray affects just the tray. It doesn't remove media from the tray. This is important, because programs exist that open the tray, close the tray, and expect to get their medium back unless the user actively changed it. See commit 4be9762a and https://bugzilla.redhat.com/show_bug.cgi?id=558256#c7.