qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Gonglei <arei.gonglei@huawei.com>, Weidong Huang <hwd@huawei.com>
Cc: libvir-list@redhat.com, Kevin Wolf <kwolf@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	stefanha@redhat.com, armbru@redhat.com
Subject: Re: [Qemu-devel] Close the BlockDriverState when guest eject the media
Date: Fri, 24 Oct 2014 12:32:50 -0600	[thread overview]
Message-ID: <544A9B52.504@redhat.com> (raw)
In-Reply-To: <5445F8F2.9080509@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 1884 bytes --]

On 10/21/2014 12:10 AM, Gonglei wrote:

>>>> There is a problem.
>>>>
>>>> 1. Qemu receive the "eject" command.
>>>> 2. Runs "eject_request_cb" when an eject request is issued from the monitor, the tray
>>>> is closed, and the medium is locked. But the drive is not closed.
>>>> 3. Guest agree with opening tray and qemu will call bdrv_eject to complete. The drive is
>>>> still not close.
>>>>
>>>> So the result of the monitor command "eject" is not to remove the medium in this situation.
>>>
>>> Now I understand, thanks for explaining.
>>>
>>> But I think libvirt can actually work correctly with what qemu offers
>>> today. qemu returns an error if the medium cannot be removed with the
>>> 'eject' command and it only sends an eject request to the guest.

This whole area of interaction is messy, and this is not the first time
someone has tried to improve it.  Is qemu actually issuing an error
message in this case, and is it distinguishable from other errors?

>>>
>>> With this error, libvirt can know that the DEVICE_TRAY_MOVED event
>>> doesn't mean that the medium has removed, but that it needs to issue
>>> another 'eject' command.
>>>
>>> If this isn't implemented correctly in libvirt today, this needs a
>>> libvirt fix rather than a qemu one.

Yes, patching libvirt to recognize this situation and try a second time
to remove the disk from the tray once the guest has opened the try, in
order to completely close out the drive, makes sense.

>>>
>>
>>
>> hi all!
>>
>> How about fix it in libvirt?
>>
> 
> Cc'ing Eric for more attention.
> 
> Maybe He can give you some suggestion :)

At this point, it may be best to make sure there is a bugzilla entry
against libvirt, to make sure it is not forgotten.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  reply	other threads:[~2014-10-24 18:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-18 10:02 [Qemu-devel] Close the BlockDriverState when guest eject the media Weidong Huang
2014-10-20  9:41 ` Kevin Wolf
2014-10-20 11:27   ` Weidong Huang
2014-10-20 11:39     ` Kevin Wolf
2014-10-21  0:46       ` Weidong Huang
2014-10-21  5:53       ` Weidong Huang
2014-10-21  6:10         ` Gonglei
2014-10-24 18:32           ` Eric Blake [this message]
2014-10-27  8:21             ` Markus Armbruster
2014-10-20 12:12     ` Markus Armbruster
2014-10-21  5:06       ` Weidong Huang
2014-10-21  8:33         ` Markus Armbruster
2014-10-21  9:17           ` Gonglei

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=544A9B52.504@redhat.com \
    --to=eblake@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=hwd@huawei.com \
    --cc=kwolf@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).