[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 00/10]: QMP/HMP: Introduce tray handling commands
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [RFC 00/10]: QMP/HMP: Introduce tray handling commands |
Date: |
Fri, 3 Jun 2011 16:03:52 -0300 |
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(-)
- [Qemu-devel] [RFC 00/10]: QMP/HMP: Introduce tray handling commands,
Luiz Capitulino <=
- [Qemu-devel] [RFC 01/10] block: bdrv_eject(): Add 'force' parameter, Luiz Capitulino, 2011/06/03
- [Qemu-devel] [RFC 02/10] block: Rename bdrv_mon_event(), Luiz Capitulino, 2011/06/03
- [Qemu-devel] [RFC 03/10] QMP: query-block: Add the 'tray-open' key, Luiz Capitulino, 2011/06/03
- [Qemu-devel] [RFC 04/10] HMP: info block: Print the 'tray-open' key, Luiz Capitulino, 2011/06/03
- [Qemu-devel] [RFC 06/10] QMP: Introduce the blockdev-tray-close command, Luiz Capitulino, 2011/06/03
- [Qemu-devel] [RFC 07/10] QMP: Introduce the blockdev-media-insert command, Luiz Capitulino, 2011/06/03