qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] RFC: QMP event notification for disk media eject
@ 2011-01-11 13:11 Luiz Capitulino
  2011-01-11 13:28 ` [Qemu-devel] " Kevin Wolf
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Luiz Capitulino @ 2011-01-11 13:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha, Markus Armbruster

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
 - new file path (to allow distinguishing eject from change)

Example:

  { "event": "BLOCK_MEDIA_CHANGE", "data": { "qdev-id": "myid",
                                             "new-path": "/foo/bar/dir/distro.iso" },
                                             ... }

BLOCK_MEDIA_EJECT
-----------------

This event is only emitted when a CDROM or a floppy disk is ejected.

The event contains one info one:

 - device name

Example:

  { "event": "BLOCK_MEDIA_EJECT", "data": { "device-name": "ide1-cd0" }, ... }

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-01-11 18:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-11 13:11 [Qemu-devel] RFC: QMP event notification for disk media eject Luiz Capitulino
2011-01-11 13:28 ` [Qemu-devel] " Kevin Wolf
2011-01-11 17:45   ` Luiz Capitulino
2011-01-11 18:21     ` Daniel P. Berrange
2011-01-11 14:06 ` Anthony Liguori
2011-01-11 14:29   ` Markus Armbruster
2011-01-11 17:47     ` Luiz Capitulino
2011-01-11 14:13 ` [Qemu-devel] " Markus Armbruster
2011-01-11 17:53   ` Luiz Capitulino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).