qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: RFC: QMP event notification for disk media eject


From: Kevin Wolf
Subject: [Qemu-devel] Re: RFC: QMP event notification for disk media eject
Date: Tue, 11 Jan 2011 14:28:23 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10

Am 11.01.2011 14:11, schrieb Luiz Capitulino:
> 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

Is there a reason why you use the device name instead of the drive
name/blockdev ID here?

>  - new file path (to allow distinguishing eject from change)

How do you distinguish? Would this key be missing for ejects? An empty
string? Something else?

> Example:
> 
>   { "event": "BLOCK_MEDIA_CHANGE", "data": { "qdev-id": "myid",
>                                              "new-path": 
> "/foo/bar/dir/distro.iso" },
>                                              ... }
> 
> BLOCK_MEDIA_EJECT
> -----------------
> 
> This event is only emitted when a CDROM or a floppy disk is ejected.
> 
> The event contains one info one:
> 
>  - device name
> 
> Example:
> 
>   { "event": "BLOCK_MEDIA_EJECT", "data": { "device-name": "ide1-cd0" }, ... }

I think it's called drive name in most other places.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]