[fedora-virt] CD-ROM Puzzle

Amit Shah amit.shah at redhat.com
Mon Sep 12 05:50:34 UTC 2011


On (Fri) 09 Sep 2011 [16:45:31], Ken Smith wrote:
> Hi Folks,
> 
> Been using KVM on Fedora 13/14 for a while now.
> 
> I have set up a FC14 machine with 2 linux and one windows guest. I'm 
> finding that I can't get the CD to work reliably and there seems to be 
> some kind of conflict/competition between the VM's and the host for the 
> CD. I have deleted the CD device from the Windows VM and that has helped.

Looks like you're passing on your host CD device to the guests.  This
use-case is known to cause problems: there are multiple programs that
use the CD/DVD device thinking they're the only users of the device,
but in fact they're not.

There's udisks, which polls for CD changes on hosts and Linux guests
(udisks replaced HAL, which used to do the polling earlier).  There
must be a similar program on Windows, which polls for new media
insertion.

Then there might be some other udev-activated programs which might
monitor for CD changes.

With libvirt in the picture, you have libvirt as well as udisks racing
for the device.  SELinux permission/context changes are also made if
the disc is mounted locally, giving the current user logged into an X
session the privileges to access the data on the disc (so there might
be PolicyKit racing for the device as well).

> If I mount a CD on one of the linux VM's, when I unmount it I find I 
> can't eject it without powering down the host hardware. If I run the 
> FC14 host without libvirt running all seems normal.

One of the programs might be locking the disc door on the device,
causing the device to not eject.  When you say 'without libvirt', I
assume you mean without any guests running.  Which means just the host
and its programs have control over the device, which is fine, since
that's normal host operation.  With libvirt (and multiple guests
contending for the device as if they're the sole owners of the
device), things start getting funny.

> I'm sure there are some simple steps I'm missing because having to power 
> off the whole box to eject a CD is a bit of a time waster.....never mind 
> having to shut down the other VM's that are there.

I don't think there are easy answers yet; all the programs involved
are going to have to be changed to ensure they drop the assumption
that they're the only programs accessing the device (which may not be
possible with some programs at all), by at least having them to poll
the device for its status before assuming the last set status is the
current status.

		Amit


More information about the virt mailing list