From: Luiz Capitulino <lcapitulino@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: RFC: QMP event notification for disk media eject
Date: Tue, 11 Jan 2011 15:47:20 -0200 [thread overview]
Message-ID: <20110111154720.699df286@doriath> (raw)
In-Reply-To: <m362tvecp3.fsf@blackfin.pond.sub.org>
On Tue, 11 Jan 2011 15:29:12 +0100
Markus Armbruster <armbru@redhat.com> wrote:
> Anthony Liguori <anthony@codemonkey.ws> writes:
>
> > On 01/11/2011 07:11 AM, Luiz Capitulino wrote:
> >> 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" },
> >> ... }
> >>
> >
> > I think this is short sighted as block devices are not simply
> > expressed in terms of new-path. You would need to do something like:
> >
> > { 'blockdev': {'file': '/foo/bar/dir/distro.iso', 'cache', 'off', ...}}
> >
> > And that adds a lot of complexity that I'm not sure is really
> > justified. Tray status is really what you're interested in.
>
> I figure the important bit is the notification that tray status changed.
> If management software wants to know more, it can query when it gets the
> event.
Which means you're in favor of the BLOCK_MEDIA_EJECT event, right?
>
> > The user
> > cannot directly change the media, only the management tools can so why
> > would the management tools need to be notified about something that
> > they did?
>
next prev parent reply other threads:[~2011-01-11 17:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2011-01-11 14:13 ` [Qemu-devel] " Markus Armbruster
2011-01-11 17:53 ` Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110111154720.699df286@doriath \
--to=lcapitulino@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).