virtual machine fails to start with connected audio cd

Bug #1390520 reported by wolfgang
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
QEMU
Won't Fix
Wishlist
Unassigned
libvirt (Ubuntu)
Invalid
Wishlist
Unassigned
Trusty
Won't Fix
Medium
Unassigned

Bug Description

when connecting a data cd with a virtual machine (IDE CDROM 1), the virtual machine starts up and the data cd is accessable (for example to install software package or drivers),
but connecting an audio cd the following error appears:

-------------------------------------------------------------------------------------------------------------------------------
cannot read header '/dev/sr0': Input/output error

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/details.py", line 2530, in _change_config_helper
    func(*args)
  File "/usr/share/virt-manager/virtManager/domain.py", line 850, in hotplug_storage_media
    self.attach_device(devobj)
  File "/usr/share/virt-manager/virtManager/domain.py", line 798, in attach_device
    self._backend.attachDevice(devxml)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 493, in attachDevice
    if ret == -1: raise libvirtError ('virDomainAttachDevice() failed', dom=self)
libvirtError: cannot read header '/dev/sr0': Input/output error
----------------------------------------------------------------------------------------------------------------------------

Description: Ubuntu 14.04.1 LTS
Release: 14.04

qemu:
  Installiert: 2.0.0+dfsg-2ubuntu1.6
  Installationskandidat: 2.0.0+dfsg-2ubuntu1.6

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for taking the time to report this bug.

The machine I have with me sadly doesn't have a cd drive, so I can't reproduce at the moment.

Could you please connect the audio cd again and then past the last few new lines from /var/log/syslog, as well as the file /var/log/libvirt/qemu/$VMNAME.log ?

Changed in libvirt (Ubuntu):
status: New → Incomplete
Revision history for this message
wolfgang (guitarrero) wrote : Re: [Bug 1390520] Re: virtual machine fails to start with connected audio cd

Hello Serge,

sorry, but there is no file "syslog" in the directory "/var/log".
Maybe in another directory?

Please find attaches the log-file of the VM.

Am Donnerstag, 20. November 2014, 22:54:16 schrieben Sie:
> Thanks for taking the time to report this bug.
>
> The machine I have with me sadly doesn't have a cd drive, so I can't
> reproduce at the moment.
>
> Could you please connect the audio cd again and then past the last few
> new lines from /var/log/syslog, as well as the file
> /var/log/libvirt/qemu/$VMNAME.log ?
>
> ** Changed in: libvirt (Ubuntu)
> Status: New => Incomplete
>
>

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for libvirt (Ubuntu) because there has been no activity for 60 days.]

Changed in libvirt (Ubuntu):
status: Incomplete → Expired
Revision history for this message
wolfgang (guitarrero) wrote :
Download full text (5.3 KiB)

the problem still exists in Ubuntu 14.10 (utopic) and Fedora 21

please inform me if you need further information.

error message in vmware detail page when connecting an audio cd to "IDE CDROM 1"
-------------------------------------------------------------------------------------------------------------------
cannot read header '/dev/sr0': Input/output error

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/details.py", line 2326, in _change_config_helper
    self.vm.hotplug(**hotplug_args)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1001, in hotplug
    self.attach_device(device)
  File "/usr/share/virt-manager/virtManager/domain.py", line 929, in attach_device
    self._backend.attachDevice(devxml)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 500, in attachDevice
    if ret == -1: raise libvirtError ('virDomainAttachDevice() failed', dom=self)
libvirtError: cannot read header '/dev/sr0': Input/output error

/var/log/messages:
-------------------------
Apr 5 21:36:27 majestix kernel: [ 6779.871482] sr 2:0:0:0: [sr0]
Apr 5 21:36:27 majestix kernel: [ 6779.871484] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Apr 5 21:36:27 majestix kernel: [ 6779.871485] sr 2:0:0:0: [sr0]
Apr 5 21:36:27 majestix kernel: [ 6779.871486] Sense Key : Illegal Request [current]
Apr 5 21:36:27 majestix kernel: [ 6779.871488] sr 2:0:0:0: [sr0]
Apr 5 21:36:27 majestix kernel: [ 6779.871490] Add. Sense: Illegal mode for this track
Apr 5 21:36:27 majestix kernel: [ 6779.871491] sr 2:0:0:0: [sr0] CDB:
Apr 5 21:36:27 majestix kernel: [ 6779.871491] Read(10): 28 00 00 00 00 00 00 00 08 00
Apr 5 21:36:27 majestix kernel: [ 6779.879255] sr 2:0:0:0: [sr0]
Apr 5 21:36:27 majestix kernel: [ 6779.879257] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Apr 5 21:36:27 majestix kernel: [ 6779.879258] sr 2:0:0:0: [sr0]
Apr 5 21:36:27 majestix kernel: [ 6779.879259] Sense Key : Illegal Request [current]
Apr 5 21:36:27 majestix kernel: [ 6779.879260] sr 2:0:0:0: [sr0]
Apr 5 21:36:27 majestix kernel: [ 6779.879261] Add. Sense: Illegal mode for this track
Apr 5 21:36:27 majestix kernel: [ 6779.879262] sr 2:0:0:0: [sr0] CDB:
Apr 5 21:36:27 majestix kernel: [ 6779.879263] Read(10): 28 00 00 00 00 00 00 00 02 00

/var/log/libvirt/qemu/win7.log:
------------------------------------------
2015-04-05 19:34:16.804+0000: starting up
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin QEMU_AUDIO_DRV=spice /usr/bin/kvm-spice -name Windows7 -S -machine pc-i440fx-utopic,accel=kvm,usb=off -cpu Haswell -m 2048 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid bce450f4-2bb5-4cc4-ba51-44c986570a22 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/Windows7.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -de...

Read more...

Changed in libvirt (Ubuntu):
status: Expired → Incomplete
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

It *looks* based on the windows7.log file as though you have the VM set to boot from the audio cd.

Could you please update the VM (in virt-manager or in the xml) to set bootindex=1 for the valid boot drive?

Revision history for this message
wolfgang (guitarrero) wrote :

Hi Serge,

here is a excerpt from my xml-file:

   <os>
      <type arch='x86_64' machine='pc-i440fx-utopic'>hvm</type>
      <boot dev='hd'/>
    </os>

    [...]

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/Windows7.img'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/sr0'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>

On which position in the XML-file should I add the parameter: bootindex=1 ??

Regards,
Wolfgang

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Sorry, the bootindex=1 is for qemu command line. In the libvirt xml you'll probably
want to use something like

<boot dev='hd'/>

in the <os>..</os> section.

Revision history for this message
wolfgang (guitarrero) wrote :

Hello Serge,

thanks for the hint.
But that is already included in my xml-file:

    <os>
      <type arch='x86_64' machine='pc-i440fx-utopic'>hvm</type>
      <boot dev='hd'/>
    </os>

Any other suggestions?!

I can access the cd/dvd-drive, and I can start programs (for example to install a driver or any other software).
But I can't read an audio-cd.

Maybe you can reproduce this behaviour on your own installation.

Regards,
Wolfgang

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

sorry I don't have access to any machines that actually have a cd drive.

But, earlier you had said that VMs could not boot when an audio cd was inserted. When you now say that you cannot play an audio-cd, do you mean on the host or inside a VM? Do you have /dev/cdrom as a symbolic link to /dev/sr0?

Revision history for this message
wolfgang (guitarrero) wrote :

Hello Serge,

starting the VM with an audio-cd in the cd-drive is no problem.

But - when the VM has started, I get no access to the audio-cd (please see attached screenshots).
When I try to access to cd-drive no message is written to the log-file.

Regards,
Wolfgang

Revision history for this message
wolfgang (guitarrero) wrote :
Revision history for this message
wolfgang (guitarrero) wrote :
Revision history for this message
wolfgang (guitarrero) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

To be clear, did you try doing

sudo ln -s /dev/sr0 /dev/cdrom

in the guest?

Revision history for this message
Chris J Arges (arges) wrote :

I can reproduce this issue on Trusty.

Changed in libvirt (Ubuntu):
status: Incomplete → Confirmed
importance: Undecided → Medium
Changed in libvirt (Ubuntu Trusty):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
delfinsk (stefan-kuhn-da) wrote :

I had this also on a Xenial 64-bit host.

Revision history for this message
FFO (fifo++) wrote :

Same on Yakketi: can access data CDs but not audio CDs from Windows VM.

Revision history for this message
FFO (fifo++) wrote :

Same on Yakketi: can access data CDs but not audio CDs from Windows VM.
Either with SATA or SCSI CDROM from QEMU (last test SCSI):

    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='sda' bus='sata'/>
      <readonly/>
      <shareable/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw' cache='directsync' io='native'/>
      <source dev='/dev/sr0'/>
      <target dev='sdc' bus='scsi'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I have a USB CD-Drive around now.
I started with the snippet as in comment #6 which will add the CD as:
-drive file=/dev/sr0,format=raw,if=none,id=drive-ide0-0-1,readonly=on

With that on boot in the log I see:
Domain id=7 is tainted: cdrom-passthrough

$ cdrdao disk-info /dev/sr0
Host
/dev/sr0: HL-DT-ST BD-RE BE14NU40 Rev: 1.00
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)
Toc Type : CD-DA or CD-ROM

Guest:
/dev/sr0: QEMU QEMU DVD-ROM Rev: 2.5+
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)
Toc Type : CD-DA or CD-ROM

Well that seemed the same, but I found that the guest does not "update" when I change the disk.
Switching tools to something that actually reads instead of using caches.

Host
$ cd-info /dev/sr0
Vendor : HL-DT-ST
Model : BD-RE BE14NU40
Revision : 1.00
Hardware : CD-ROM or DVD
[...]
  Can read CD-DA : Yes

Guest:
Vendor : QEMU
Model : QEMU DVD-ROM
Revision : 2.5+
Error in getting drive hardware properties
Error in getting drive reading properties
Error in getting drive writing properties

Hmm, not all capabilties on the qemu driver?

When reloading with the Audio Disc I see that the qemu access has issues accessing on top of the HW caps I see:
"Media Catalog Number (MCN): not supported by drive/driver"
[...]
CD-ROM with unknown filesystem

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I was going on wondering why the guest doesn't see the CD-change updates and found a bit.
You can update the changed disk via:
# really take out the disk
$ virsh change-media xenial-cdtest hdc --eject /dev/sr0
# insert new disk and let it load
$ virsh change-media xenial-cdtest hdc --insert /dev/sr0

But, it turns out already here is a difference, when inserting a data cd all is fine.
But when doing the same with an audio-cd on --insert I get:
error: Failed to complete action insert on media
error: cannot read header '/dev/sr0': Input/output error

That just matches the initial report, but is a way to try withotu rebooting guests.

I ried the data CD's I had still around they all refreshed nicely.
All audios disks I tried ailed the same way.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The closest I got was with virtio-scsi
I had some hope it would pass more, but IIRC at least in the past (https://bugzilla.redhat.com/show_bug.cgi?id=760885#c4) the driver should still be the same.

    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw' cache='directsync' io='native'/>
      <source dev='/dev/sr0'/>
      <target dev='sdc' bus='scsi'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <controller type='scsi' index='0' model='virtio-scsi'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>

Here at least the device capabilities seem good:
$ cd-info
Model : QEMU CD-ROM
Revision : 2.5+
[...]
  Can play audio : Yes
  Can read CD-DA : Yes
  Can read CD-R : Yes
  Can read CD-RW : Yes

Also the tracks are better but not good now:
CD-ROM Track List (1 - 1)
  #: MSF LSN Type Green? Copy?
  1: 00:02:00 000000 data false no
170: 58:20:56 262406 leadout (588 MB raw, 512 MB formatted)

Because what follows is:
Media Catalog Number (MCN): :8
Last CD Session LSN: 0
__________________________________
CD Analysis Report
CD-ROM with unknown filesystem

But should look like:
CD-ROM Track List (1 - 9)
  #: MSF LSN Type Green? Copy? Channels Premphasis?
  1: 00:02:00 000000 audio false no 2 no
  2: 06:13:10 027835 audio false no 2 no
  3: 11:57:33 053658 audio false no 2 no
  4: 18:21:19 082444 audio false no 2 no
  5: 25:53:23 116348 audio false no 2 no
  6: 34:13:28 153853 audio false no 2 no
  7: 39:00:39 175389 audio false no 2 no
  8: 44:56:37 202087 audio false no 2 no
  9: 51:27:11 231386 audio false no 2 no
170: 58:20:56 262406 leadout (588 MB raw, 588 MB formatted)
Media Catalog Number (MCN): 0000000000000
TRACK 1 ISRC: DENC11600285

" 1: 00:02:00 000000 data false no "
So it is still detected as data in the guest.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Just tried more recent libvirt-2.5/qemu-2.8 via Ubuntu-Cloud-Archive Ocata, but still the same.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I'm actually not so convinced this is "supposed" or expected to work, it might be worth to subscribe upstream qemu to get an expertise on that.

Revision history for this message
John Snow (jnsnow) wrote :

There is currently no expectation that Audio CDs will work on an emulated CD drive; as long as audio CDs aren't causing QEMU to crash or anything of the sort, this is wishlist and not a bug.

Still, I'll try to take a look later and see if there's an easy win here or not. I imagine we don't support many of the Audio CD commands that ATAPI drives need in order to service audio requests, but there may be some difficulty in the pass-through as well.

Changed in qemu:
assignee: nobody → John Snow (jnsnow)
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Since we are waiting on this as a wishlist feature on upstream I invalidate the tasks we have on the older releases for now.

Changed in libvirt (Ubuntu):
importance: Medium → Wishlist
Changed in libvirt (Ubuntu Trusty):
status: Confirmed → Won't Fix
Revision history for this message
John Snow (jnsnow) wrote :

Dropping from my queue due to capacity.

Changed in qemu:
assignee: John Snow (jnsnow) → nobody
Thomas Huth (th-huth)
Changed in qemu:
importance: Undecided → Wishlist
Revision history for this message
Thomas Huth (th-huth) wrote :

Sorry, since nobody seems to have capacity to work on this, it's unlikely that this will ever be implemented in QEMU. Thus I'm closing this as WontFix for now.

Changed in qemu:
status: New → Won't Fix
Changed in libvirt (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.