Bug 437174 - connecting a file to an existing cdrom creates unbootable guest
Summary: connecting a file to an existing cdrom creates unbootable guest
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: virt-manager
Version: 5.2
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Cole Robinson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-03-12 18:48 UTC by Cole Robinson
Modified: 2009-12-14 21:18 UTC (History)
2 users (show)

Fixed In Version: RHBA-2008-0480
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-21 17:29:06 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0480 0 normal SHIPPED_LIVE virt-manager bug fix and enhancement update 2008-05-20 13:36:50 UTC

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



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