Bug 437174

Summary: connecting a file to an existing cdrom creates unbootable guest
Product: Red Hat Enterprise Linux 5 Reporter: Cole Robinson <crobinso>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 5.2CC: gozen, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0480 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 17:29:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Accommodate driver tag when connecting cdrom media
none
Additional fix to allow inserting a file backed cdrom none

Description Cole Robinson 2008-03-12 18:48:53 UTC
With a xen fv guest, attempting to connect a file iso to an empty cdrom
succeeds, but prevents the guest from booting.

Steps to reproduce:
1) Add a cdrom to an inactive fv guest, disconnect the media.
2) Connect a file to the cdrom, notice the disk type stays as 'block'
3) Attempt to boot the guest, see error:

Error starting domain: virDomainCreate() failed POST operation failed: (xend.err
'Device 832 (vbd) could not be connected.\nDevice /root/f8.iso is mounted
read-write in the privileged domain,\nand so cannot be mounted read-only by a
guest.')

This happens because libvirt in 5.2 inserts a <driver> tag when a disk is
defined. Empty disks default to block type, <driver name='phy'>. When we add the
new occupied device we weren't changing this driver field, so it was reverting
back to block type and attempting to treat the flat file like a block device,
causing failure.

Comment 1 Cole Robinson 2008-03-12 18:48:53 UTC
Created attachment 297822 [details]
Accommodate driver tag when connecting cdrom media

Comment 2 Cole Robinson 2008-03-12 19:18:32 UTC
This fix is needed to solve bug 223444, and to enable any multi cd installs. The
fix is not intrusive, only affects the connect / disconnect portion of the code,
which without this fix is broken anyways. I'm requesting this be raised as an
exception for inclusion in RHEL5.2.

Comment 3 Bill Burns 2008-03-12 19:24:49 UTC
Requesting exception. This is not a regression, but it fixes functionality that
was partially fixed by bz 223444.

Comment 6 Cole Robinson 2008-03-18 19:51:25 UTC
Fix built in virt-manager-0.5.3-5.el5:

[crobinso@dhcp83-95 RHEL-5]$ brew latest-pkg dist-5E-qu-candidate virt-manager
Build                                     Tag                   Built by
----------------------------------------  --------------------  ----------------
virt-manager-0.5.3-5.el5                  dist-5E-qu-candidate  crobinso


Comment 8 Gurhan Ozen 2008-04-21 20:14:59 UTC
Cole, 
Trying these steps is giving me the following error when trying to connect a
file to the cdrom:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/details.py", line 760, in connect_cdrom
    self.vm.connect_cdrom_device(type, source, target)
  File "/usr/share/virt-manager/virtManager/domain.py", line 576, in
connect_cdrom_device
    driver_fragment.setProp("name", type)
AttributeError: 'list' object has no attribute 'setProp'


# rpm -q virt-manager
virt-manager-0.5.3-7.el5


Comment 10 Cole Robinson 2008-04-21 20:59:33 UTC
Created attachment 303204 [details]
Additional fix to allow inserting a file backed cdrom

Hmm, don't know how I botched the testing on this one. This patch on top of the
previous one fixes the issue.

This should be pulled in for 5.2, the functionality didn't work to begin with,
so this new patch poses no harm of regression. Other bugs stated above depend
on this to work as well, so we really need it fixed.

Comment 13 Cole Robinson 2008-04-22 16:31:02 UTC
Built into virt-manager-0.5.3-8

$ brew latest-pkg dist-5E-qu-candidate virt-manager
Build                                     Tag                   Built by
----------------------------------------  --------------------  ----------------
virt-manager-0.5.3-8.el5                  dist-5E-qu-candidate  crobinso

Comment 16 errata-xmlrpc 2008-05-21 17:29:06 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0480.html