[libvirt] [PATCH 4/9] qemu: Do not start with source for removable disks if tray is open

Osier Yang jyang at redhat.com
Mon Mar 12 04:55:55 UTC 2012


On 03/11/2012 10:44 PM, Paolo Bonzini wrote:
> Il 05/03/2012 11:25, Osier Yang ha scritto:
>> This is similiar with physical world, one will be surprised if the
>> box starts with medium exists while the tray is open.
>>
>> New tests are added, tests disk-{cdrom,floppy}-tray are for the qemu
>> supports "-device" flag, and disk-{cdrom,floppy}-no-device-cap are
>> for old qemu, i.e. which doesn't support "-device" flag.
>
> If the disk type is "block", and the source drive is a CD-ROM, the
> virtual tray state should be tied to the physical tray, even though this
> isn't always the case due to QEMU bugs.
>
> Perhaps you should fail creation if the tray attribute is "open" in the
> above circumstances.  Another possibility is to forbid specifying the
> tray attribute completely.

What will be the problem in such case if the tray is "open" and we
don't start with the physical CD-ROM in QEMU command line?

>
> Or you can just drop this patch, and only print the tray state in the
> virsh dumpxml output.  There are other attributes that already handled
> this way.
>

No, Print the tray status as internal XML is opposite with the
purpose of these patches, we don't want the domain migrated
or (saved + restored) see the medium still exists in guest
while it's ejected before. Thus we want the tray status
could be persistent XML, which we could looked up while
domain starting. So neither "forbid specifying the tray status"
nor "only print the XML internally" work.

The only choice for use is to "fail creation if the tray status
is open", that's the normal logic, and we can do in this way,
but I have to understand why we have to do so, :-)

Thanks for the input, Paolo.

Osier




More information about the libvir-list mailing list