Bug 437174 - connecting a file to an existing cdrom creates unbootable guest
connecting a file to an existing cdrom creates unbootable guest
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: virt-manager (Show other bugs)
5.2
All Linux
low Severity low
: rc
: ---
Assigned To: Cole Robinson
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-12 14:48 EDT by Cole Robinson
Modified: 2009-12-14 16:18 EST (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2008-0480
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-21 13:29:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Accommodate driver tag when connecting cdrom media (1.07 KB, patch)
2008-03-12 14:48 EDT, Cole Robinson
no flags Details | Diff
Additional fix to allow inserting a file backed cdrom (1.08 KB, patch)
2008-04-21 16:59 EDT, Cole Robinson
no flags Details | Diff

  None (edit)
Description Cole Robinson 2008-03-12 14:48:53 EDT
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 14:48:53 EDT
Created attachment 297822 [details]
Accommodate driver tag when connecting cdrom media
Comment 2 Cole Robinson 2008-03-12 15:18:32 EDT
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 15:24:49 EDT
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 15:51:25 EDT
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 16:14:59 EDT
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 16:59:33 EDT
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 12:31:02 EDT
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 13:29:06 EDT
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

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