qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 00/10]: QMP/HMP: Introduce tray handling commands
@ 2011-06-03 19:03 Luiz Capitulino
  2011-06-03 19:03 ` [Qemu-devel] [RFC 01/10] block: bdrv_eject(): Add 'force' parameter Luiz Capitulino
                   ` (11 more replies)
  0 siblings, 12 replies; 29+ messages in thread
From: Luiz Capitulino @ 2011-06-03 19:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, amit.shah, aliguori, armbru

In a recent discussion on the mailing list regarding the introduction of
the BLOCK_TRAY_OPEN and BLOCK_TRAY_CLOSE events[1], it was mentioned that
we need to fix the eject command and maybe introduce new commands first.

Here's a my proposal.

This series introduces three new commands:

 o blockdev-tray-open: opens the drive tray. Also Supports removing the inserted
   media. The BLOCK_TRAY_OPEN event is emitted if this command succeeds.
 o blockdev-tray-close: closes a drive tray. The BLOCK_TRAY_CLOSE event is
   emitted.
 o blockdev-media-insert: Inserts a media in the tray. The tray must empty
   and already opened. No event is emitted.

The existing 'eject' and 'change' commands are completely rewriten in terms
of the new commands. Besides fixing some bad behaviors, this also makes it
possible for the events to be automtically emitted.

Ejecting a device inside the guest (or closing its tray) also causes the
events to be emitted.

Everything which applies for the virtual tray seems to work as expected for
the host's tray. But more testing is needed.

 QMP/qmp-events.txt |   30 ++++++++++
 block.c            |   36 +++++++++++-
 block.h            |    6 +-
 block/raw.c        |    2 +-
 blockdev.c         |  157 ++++++++++++++++++++++++++++++++++++++++------------
 blockdev.h         |    3 +
 hw/ide/atapi.c     |    2 +-
 hw/ide/core.c      |    6 +-
 hw/scsi-disk.c     |    8 +-
 hw/virtio-blk.c    |    6 +-
 monitor.c          |    6 ++
 monitor.h          |    2 +
 qmp-commands.hx    |   84 ++++++++++++++++++++++++++++
 13 files changed, 294 insertions(+), 54 deletions(-)

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

end of thread, other threads:[~2012-01-11  7:34 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-03 19:03 [Qemu-devel] [RFC 00/10]: QMP/HMP: Introduce tray handling commands Luiz Capitulino
2011-06-03 19:03 ` [Qemu-devel] [RFC 01/10] block: bdrv_eject(): Add 'force' parameter Luiz Capitulino
2011-06-03 19:03 ` [Qemu-devel] [RFC 02/10] block: Rename bdrv_mon_event() Luiz Capitulino
2011-06-03 19:03 ` [Qemu-devel] [RFC 03/10] QMP: query-block: Add the 'tray-open' key Luiz Capitulino
2011-06-03 19:03 ` [Qemu-devel] [RFC 04/10] HMP: info block: Print " Luiz Capitulino
2011-06-06 13:19   ` Markus Armbruster
2011-06-06 14:46     ` Luiz Capitulino
2011-06-03 19:03 ` [Qemu-devel] [RFC 05/10] QMP: Introduce the blockdev-tray-open command Luiz Capitulino
2011-06-06 11:40   ` Amit Shah
2011-06-06 14:38     ` Luiz Capitulino
2011-06-07 13:29       ` Amit Shah
2011-06-07 13:53         ` Luiz Capitulino
2011-06-06 13:35   ` Markus Armbruster
2011-06-03 19:03 ` [Qemu-devel] [RFC 06/10] QMP: Introduce the blockdev-tray-close command Luiz Capitulino
2011-06-03 19:03 ` [Qemu-devel] [RFC 07/10] QMP: Introduce the blockdev-media-insert command Luiz Capitulino
2011-06-06 11:44   ` Amit Shah
2011-06-06 13:40   ` Markus Armbruster
2011-06-06 14:58     ` Luiz Capitulino
2011-06-03 19:04 ` [Qemu-devel] [RFC 08/10] QMP: Introduce the BLOCK_TRAY_OPEN and BLOCK_TRAY_CLOSE events Luiz Capitulino
2011-06-03 19:04 ` [Qemu-devel] [RFC 09/10] QMP/HMP: eject: Use blockdev-tray-open Luiz Capitulino
2011-06-03 19:04 ` [Qemu-devel] [RFC 10/10] QMP/HMP: change: Use QMP tray commands Luiz Capitulino
2011-06-06 11:48   ` Amit Shah
2011-06-06 14:45     ` Luiz Capitulino
2011-06-07 13:32       ` Amit Shah
2011-06-06 13:31 ` [Qemu-devel] [RFC 00/10]: QMP/HMP: Introduce tray handling commands Markus Armbruster
2011-06-06 14:56   ` Luiz Capitulino
2011-12-20  6:49 ` Osier Yang
2012-01-03 19:28   ` Luiz Capitulino
2012-01-11  7:34     ` Osier Yang

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).