All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: pbonzini@redhat.com, eblake@redhat.com, qemu-devel@nongnu.org,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 4/4] qmp: add BLOCK_MEDIUM_EJECT event
Date: Fri, 17 Feb 2012 12:44:28 +0100	[thread overview]
Message-ID: <m3obsx4rc3.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <4F3E239C.6050402@redhat.com> (Kevin Wolf's message of "Fri, 17 Feb 2012 10:53:32 +0100")

Kevin Wolf <kwolf@redhat.com> writes:

> Am 16.02.2012 19:30, schrieb Markus Armbruster:
>> Let's figure out how this stuff really works.
>> 
>> 1. Guest load/eject
>> 
>> Guest commands load or eject.  Device model updates its state of virtual
>> tray (e.g. IDEState member tray_open) unless locked, then calls
>> bdrv_eject().
>> 
>> bdrv_eject() is a no-op except for pass-through backends such as
>> host_cdrom.
>> 
>> Note: device models call bdrv_eject() whether the state changed or not.
>> The only use for that I can see is syncing a wayward physical tray to
>> the virtual one.  Shouldn't be necessary with Paolo's recent work,
>> should it?
>
> The one case that I'm unsure about is migration. I thought we sync the
> physical tray with the virtual one then (or at least we discussed it),
> but I don't really know what we do today, or even what the right thing
> to do is in some cases.

I looked into this back when I moved tray stuff into device models.  I
believe it needs fixing, but my patch was flawed[*], so I shelved it.

Whether migration makes sense while the host CD-ROM is passed through is
a valid question.

>> I figure Luiz's patch works.  But maybe it could be simplified some by
>> replacing bdrv_dev_change_media_cb() by a "open/close tray" callback
>> that returns whether it moved.  bdrv_dev_change_media_cb() would then
>> simply open the tray, emit event if it moved, close the tray, emit event
>> if it moved.
>
> Yes, I had the same impression after reading the first few paragraphs of
> your analysis (which looks right to me).

If I understand Luiz correctly, he'd like to do that in a follow-up
patch.


[*] http://lists.nongnu.org/archive/html/qemu-devel/2011-09/msg00324.html

  parent reply	other threads:[~2012-02-17 11:44 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-15 18:42 [Qemu-devel] [PATCH v2 0/4]: QMP: add BLOCK_MEDIUM_EJECT event Luiz Capitulino
2012-02-15 18:42 ` [Qemu-devel] [PATCH 1/4] block: Rename bdrv_mon_event() & BlockMonEventAction Luiz Capitulino
2012-02-15 18:42 ` [Qemu-devel] [PATCH 2/4] block: bdrv_eject(): Make eject_flag a real bool Luiz Capitulino
2012-02-15 18:42 ` [Qemu-devel] [PATCH 3/4] block: bdrv_eject(): Add tray_changed parameter Luiz Capitulino
2012-02-15 18:42 ` [Qemu-devel] [PATCH 4/4] qmp: add BLOCK_MEDIUM_EJECT event Luiz Capitulino
2012-02-16  9:25   ` Markus Armbruster
2012-02-16 13:14     ` Luiz Capitulino
2012-02-16 13:19       ` Luiz Capitulino
2012-02-16 13:31       ` Kevin Wolf
2012-02-16 14:10         ` Luiz Capitulino
2012-02-17 10:32           ` Paolo Bonzini
2012-02-17 11:03             ` Kevin Wolf
2012-02-17 11:48               ` Markus Armbruster
2012-02-17 12:12                 ` Kevin Wolf
2012-02-17 12:43                   ` Markus Armbruster
2012-02-16 18:30         ` Markus Armbruster
2012-02-16 19:08           ` Luiz Capitulino
2012-02-17  9:53           ` Kevin Wolf
2012-02-17 10:48             ` Paolo Bonzini
2012-02-17 11:50               ` Markus Armbruster
2012-02-17 11:44             ` Markus Armbruster [this message]
2012-02-17 11:56               ` Luiz Capitulino
2012-02-17 10:45           ` Paolo Bonzini
2012-02-17 11:57             ` Markus Armbruster
2012-02-17 10:49 ` [Qemu-devel] [PATCH v2 0/4]: QMP: " Paolo Bonzini
2012-02-17 11:58   ` 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=m3obsx4rc3.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.