From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvudh-0007wA-5G for qemu-devel@nongnu.org; Fri, 10 Feb 2012 12:52:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rvudc-0003Wm-D0 for qemu-devel@nongnu.org; Fri, 10 Feb 2012 12:52:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvudc-0003Wc-6T for qemu-devel@nongnu.org; Fri, 10 Feb 2012 12:52:00 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1AHpw45032495 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 10 Feb 2012 12:51:58 -0500 Message-ID: <4F355A0A.6050503@redhat.com> Date: Fri, 10 Feb 2012 18:55:22 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1328638189-9534-1-git-send-email-lcapitulino@redhat.com> <4F34CE19.7010806@redhat.com> <20120210150456.7de8af48@doriath.home> In-Reply-To: <20120210150456.7de8af48@doriath.home> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 0/5]: QMP: Introduce GUEST_MEDIUM_EJECT & BLOCK_MEDIUM_CHANGED List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Paolo Bonzini , eblake@redhat.com, Markus Armbruster , qemu-devel@nongnu.org Am 10.02.2012 18:04, schrieb Luiz Capitulino: > This reminds me about an earlier try where I did the following, iirc: > > 1. added commands blockdev-tray-open, blockdev-tray-close, blockdev-medium-insert, > blockdev-medium-remove > 2. added the events: BLOCK_TRAY_OPEN, BLOCK_TRAY_CLOSE, BLOCK_MEDIUM_INSERTED > BLOCK_MEDIUM_REMOVED, which would be emitted when the relating command is issued > (maybe the events could just be BLOCK_TRAY_CHANGED & BLOCK_MEDIUM_CHANGED) > 3. re-wrote eject and change in terms of the new commands, note that you get the > events for free > > Now, maybe the guest eject could also emit BLOCK_TRAY_OPEN & BLOCK_TRAY_CLOSE. Then > I think this is a complete solution. > > Do you guys agree? Looks good to me in general. I'm not sure how you're imagining to implement this, I would prefer not to emit events from the device code, but only from block.c. Another interesting point is what to do with host CD-ROM passthrough. I think the TRAY_OPEN/CLOSE part is doable (do Paolo's patches actually do that, so that we just need to add an event?). We would have to fake MEDIUM_REMOVED/INSERTED immediately before a TRAY_CLOSE if the medium has changed. LOCK/UNLOCK (which you forgot in your list) is only initiated by the guest or monitor (eject -f), so there's nothing special with passthrough. Kevin