qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/5]: QMP: Introduce GUEST_MEDIUM_EJECT & BLOCK_MEDIUM_CHANGED
@ 2012-02-07 18:09 Luiz Capitulino
  2012-02-07 18:09 ` [Qemu-devel] [PATCH 1/5] block: Rename bdrv_mon_event() & BlockMonEventAction Luiz Capitulino
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Luiz Capitulino @ 2012-02-07 18:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, eblake, armbru

I've tried to implement a BLOCK_MEDIUM_EJECT event that, as we discussed[1],
would be emitted by guest-initiated ejects and by the QMP/HMP eject and change
commands.

However, that turned to be a bit problematic, because the eject and change
commands don't exactly handle tray movements: they actually insert/purge a
medium from from the drive.

Consider this example: you have a medium inserted and locked; a first eject
from HMP will tell the guest to eject the medium; if the guest does eject, a
second eject from HMP will just purge the medium (in which case
BLOCK_MEDIUM_EJECT is a bad event to be emitted).

What we really want to do is to tell mngt that the medium was purged.

The same is valid for the change command: we want to inform mngt if a medium
was inserted or purged and not emulate tray movements with two eject events
as we discussed[1].

So, the solution I came up with is to have two events:

 o GUEST_MEDIUM_EJECTED: emitted when the tray state is changed by the guest
 o BLOCK_MEDIUM_CHANGED: emitted when there's a medium change. This should
   happen when the eject and change QMP/HMP commands are used

 QMP/qmp-events.txt |   38 ++++++++++++++++++++++++++++++++++++++
 block.c            |   33 ++++++++++++++++++++++++++++++---
 block.h            |    8 ++++----
 block/raw-posix.c  |    6 +++---
 block/raw.c        |    4 ++--
 block_int.h        |    2 +-
 hw/ide/atapi.c     |    2 +-
 hw/ide/core.c      |    8 ++++----
 hw/scsi-disk.c     |    8 ++++----
 hw/virtio-blk.c    |    6 +++---
 monitor.c          |    6 ++++++
 monitor.h          |    2 ++
 12 files changed, 98 insertions(+), 25 deletions(-)

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v3 0/5]: QMP: add DEVICE_TRAY_MOVED event
@ 2012-02-17 19:21 Luiz Capitulino
  2012-02-17 19:21 ` [Qemu-devel] [PATCH 2/5] block: bdrv_eject(): Make eject_flag a real bool Luiz Capitulino
  0 siblings, 1 reply; 18+ messages in thread
From: Luiz Capitulino @ 2012-02-17 19:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, eblake, armbru

The event name changed, which caused the subject to change too, hope this
won't cause confusion.

v3

o Rename the event to DEVICE_TRAY_MOVED
o Rename the 'ejected' event data to 'tray-open'
o Only call bdrv_eject() if the tray state changed
o Drop ide_tray_state_post_load()

 QMP/qmp-events.txt |   18 +++++++++++
 block.c            |   84 +++++++++++++++++++++++++++++++++------------------
 block.h            |    8 ++--
 block/raw-posix.c  |    6 ++--
 block/raw.c        |    2 +-
 block_int.h        |    2 +-
 hw/ide/atapi.c     |    7 +++-
 hw/ide/core.c      |   16 ++--------
 hw/scsi-disk.c     |   13 +++++---
 hw/virtio-blk.c    |    6 ++--
 monitor.c          |    3 ++
 monitor.h          |    1 +
 12 files changed, 104 insertions(+), 62 deletions(-)

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [Qemu-devel] [PULL 0/5]: QMP queue
@ 2012-02-23 14:42 Luiz Capitulino
  2012-02-23 14:42 ` [Qemu-devel] [PATCH 2/5] block: bdrv_eject(): Make eject_flag a real bool Luiz Capitulino
  0 siblings, 1 reply; 18+ messages in thread
From: Luiz Capitulino @ 2012-02-23 14:42 UTC (permalink / raw)
  To: aliguori; +Cc: qemu-devel

Contains only the DEVICE_TRAY_MOVED event series.

The changes (since 235fe3bfd46b1104575b540d0bc3fdf584030b99) are available
in the following repository:

    git://repo.or.cz/qemu/qmp-unstable.git queue/qmp

Luiz Capitulino (5):
      block: Rename bdrv_mon_event() & BlockMonEventAction
      block: bdrv_eject(): Make eject_flag a real bool
      block: Don't call bdrv_eject() if the tray state didn't change
      ide: drop ide_tray_state_post_load()
      qmp: add DEVICE_TRAY_MOVED event

 QMP/qmp-events.txt |   18 +++++++++++
 block.c            |   84 +++++++++++++++++++++++++++++++++------------------
 block.h            |    8 ++--
 block/raw-posix.c  |    6 ++--
 block/raw.c        |    2 +-
 block_int.h        |    2 +-
 hw/ide/atapi.c     |    7 +++-
 hw/ide/core.c      |   16 ++--------
 hw/scsi-disk.c     |   13 +++++---
 hw/virtio-blk.c    |    6 ++--
 monitor.c          |    3 ++
 monitor.h          |    1 +
 12 files changed, 104 insertions(+), 62 deletions(-)

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

end of thread, other threads:[~2012-02-23 14:43 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-07 18:09 [Qemu-devel] [RFC 0/5]: QMP: Introduce GUEST_MEDIUM_EJECT & BLOCK_MEDIUM_CHANGED Luiz Capitulino
2012-02-07 18:09 ` [Qemu-devel] [PATCH 1/5] block: Rename bdrv_mon_event() & BlockMonEventAction Luiz Capitulino
2012-02-07 18:09 ` [Qemu-devel] [PATCH 2/5] block: bdrv_eject(): Make eject_flag a real bool Luiz Capitulino
2012-02-07 18:09 ` [Qemu-devel] [PATCH 3/5] block: bdrv_eject(): Add tray_changed parameter Luiz Capitulino
2012-02-07 18:09 ` [Qemu-devel] [PATCH 4/5] qmp: add the GUEST_MEDIUM_EJECTED event Luiz Capitulino
2012-02-07 18:09 ` [Qemu-devel] [PATCH 5/5] qmp: add the BLOCK_MEDIUM_CHANGED event Luiz Capitulino
2012-02-09 15:01 ` [Qemu-devel] [RFC 0/5]: QMP: Introduce GUEST_MEDIUM_EJECT & BLOCK_MEDIUM_CHANGED Markus Armbruster
2012-02-09 16:07   ` Luiz Capitulino
2012-02-10  9:27     ` Markus Armbruster
2012-02-10 17:20       ` Luiz Capitulino
2012-02-10  7:58   ` Paolo Bonzini
2012-02-10  9:36     ` Markus Armbruster
2012-02-10 17:04       ` Luiz Capitulino
2012-02-10 17:55         ` Kevin Wolf
2012-02-10 19:39           ` Paolo Bonzini
2012-02-10 20:47             ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2012-02-17 19:21 [Qemu-devel] [PATCH v3 0/5]: QMP: add DEVICE_TRAY_MOVED event Luiz Capitulino
2012-02-17 19:21 ` [Qemu-devel] [PATCH 2/5] block: bdrv_eject(): Make eject_flag a real bool Luiz Capitulino
2012-02-23 14:42 [Qemu-devel] [PULL 0/5]: QMP queue Luiz Capitulino
2012-02-23 14:42 ` [Qemu-devel] [PATCH 2/5] block: bdrv_eject(): Make eject_flag a real bool 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).