From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51388 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pciqc-0007F5-OZ for qemu-devel@nongnu.org; Tue, 11 Jan 2011 13:21:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pciqa-0007e1-Sn for qemu-devel@nongnu.org; Tue, 11 Jan 2011 13:21:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pciqa-0007de-Lb for qemu-devel@nongnu.org; Tue, 11 Jan 2011 13:21:32 -0500 Date: Tue, 11 Jan 2011 18:21:23 +0000 From: "Daniel P. Berrange" Message-ID: <20110111182123.GB24387@redhat.com> References: <20110111111148.1b94b4a4@doriath> <4D2C5AF7.6040502@redhat.com> <20110111154549.4c17c35c@doriath> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20110111154549.4c17c35c@doriath> Subject: [Qemu-devel] Re: RFC: QMP event notification for disk media eject Reply-To: "Daniel P. Berrange" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Kevin Wolf , stefanha@gmail.com, qemu-devel@nongnu.org, Markus Armbruster On Tue, Jan 11, 2011 at 03:45:49PM -0200, Luiz Capitulino wrote: > On Tue, 11 Jan 2011 14:28:23 +0100 > Kevin Wolf wrote: > > > Am 11.01.2011 14:11, schrieb Luiz Capitulino: > > > Hi there, > > > > > > I need feedback on a new QMP event. > > > > > > Problem > > > ======= > > > > > > There's no way for a management tool to detect that a guest OS has ejected the > > > media in a CDROM or Floppy disk drive (I'm discarding polling, because it's > > > undesirable at best). > > > > > > The end result is that the management tool can get confused, this is happening > > > with libvirt when migration is involved: if the guest is saved/restored or > > > migrated, then libvirt will start the guest again with media still present. > > > > > > NOTE: Most of the analysis here was done by Daniel Berrange. > > > > > > Solution > > > ======== > > > > > > We need a new QMP event to solve that. There are two possible events, a > > > general one and a very specific one. > > > > > > There are 3 scenarios in which both events should be emitted: > > > > > > 1. When guest OS ejects media > > > 2. When 'eject' monitor command is run > > > 3. When 'change' monitor command is run > > > > > > BLOCK_MEDIA_CHANGE > > > ------------------ > > > > > > This is the general event, it's emitted when any removable block device > > > is changed. > > > > > > Ideally, the event should contain two pieces of info: > > > > > > - qdev device name > > > > Is there a reason why you use the device name instead of the drive > > name/blockdev ID here? > > Good question, this is a copy & paste from Daniel initial request, so > he's the best person to answer that question. There isn't any reason I chose one over the other, libvirt certainly doesn't care - we can hook into either option. I assume the best thing is to use the same identifier that we already use in BLOCK_IO_ERROR event, for sake of consistency. Daniel