Bug 582005 - libvirt: media eject/connect appears to work, but fails
libvirt: media eject/connect appears to work, but fails
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Veillard
Fedora Extras Quality Assurance
: 572094 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2010-04-13 16:01 EDT by Enrico Scholz
Modified: 2010-05-28 13:58 EDT (History)
9 users (show)

See Also:
Fixed In Version: libvirt-0.7.7-4.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-05-28 13:58:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
machine definition (2.48 KB, text/xml)
2010-04-13 16:01 EDT, Enrico Scholz
no flags Details

  None (edit)
Description Enrico Scholz 2010-04-13 16:01:00 EDT
Created attachment 406337 [details]
machine definition

Description of problem:

(Re)attaching cdrom disks or USB devices fails with recent libvirt/qemu combination.

E.g. after

| # virsh attach-disk XXX /srv/mnt/virt/iso/f10-i386.iso \
|     --mode readonly --driver file --type cdrom hdc
| Disk attached successfully

the device is not accessible from within the VM:

| # mount /dev/hdc  /mnt/
| mount: No medium found

An 'strace' log of qemu shows

| 20140 write(17, "\33[D\33...[D\33[Dchange
|  ide0-1-0 \"/srv/mnt/virt/iso/f10-i386.iso\"\33[K", 192) = 192
| ...
| 20140 write(17, "The ide0-1-0 device has not been found\r\n", 40) = 40

qemu cmdline is

/usr/bin/qemu-kvm -S -M pc -enable-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -name XXX -uuid d5ae5e2d-66f1-575d-8ee4-27bf1973830e -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/proveo-infoman.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=utc -boot c -drive if=none,media=cdrom,id=drive-ide0-1-0 -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive file=/dev/vg01/virt-proveo-infoman,if=none,id=drive-virtio-disk0,boot=on -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 -device rtl8139,vlan=0,id=net0,mac=54:52:00:09:18:92,bus=pci.0,addr=0x5 -net tap,fd=46,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -vnc -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3

Version-Release number of selected component (if applicable):


How reproducible:

Comment 1 Enrico Scholz 2010-04-13 16:04:29 EDT
(forget the "or USB devices" part; it is caused by SELinux denials)
Comment 2 Daniel Berrange 2010-04-15 07:15:49 EDT
This is fixed by patch 4 in this series. We used the wrong name for the eject command

Comment 3 Bill McGonigle 2010-04-29 14:13:11 EDT
This link doesn't seem to go to a patch series, but this one works:


except for the last chunk, which appears to patch a function not in the f12 virt preview version.

It fixed the problem for me, so I put my package up here:

in case anybody else is in the same boat.

I must admit, it was very slick to save the VM in the middle of a CentOS install, apply the patch, and then restore it, and continue to CD 2.  Good stuff.
Comment 4 Cole Robinson 2010-05-18 12:14:27 EDT
*** Bug 572094 has been marked as a duplicate of this bug. ***
Comment 5 Fedora Update System 2010-05-18 15:02:46 EDT
libvirt-0.7.7-4.fc13 has been submitted as an update for Fedora 13.
Comment 6 Fedora Update System 2010-05-19 15:14:24 EDT
libvirt-0.7.7-4.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update libvirt'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/libvirt-0.7.7-4.fc13
Comment 7 Fedora Update System 2010-05-28 13:58:29 EDT
libvirt-0.7.7-4.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.