Bug 372301 - [5.2] Cannot change the device by virsh attach-disk on RHEL5.1
Summary: [5.2] Cannot change the device by virsh attach-disk on RHEL5.1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: xen
Version: 5.1
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-09 08:51 UTC by Saori Fukuta
Modified: 2009-12-14 21:16 UTC (History)
1 user (show)

Fixed In Version: RHBA-2008-0305
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-21 15:20:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Fix device configure method args (840 bytes, patch)
2008-01-25 18:25 UTC, Daniel Berrangé
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0305 0 normal SHIPPED_LIVE xen bug fix and enhancement update 2008-05-20 18:04:30 UTC

Description Saori Fukuta 2007-11-09 08:51:17 UTC
Description of problem:
  virsh attach-disk failed by the following message when I executed
  it on RHEL-5.1(xen-3.0.3-41.el5).
    'device_configure() takes exactly 2 arguments (3 given)'
  Of course, the command succeed at fedora8(xen-3.1.0-10.fc8). I guess 
  the cause is that the devid was removed by the following patch at xend.

  [0] changeset 11139
  Implement xm block-configure for CD-ROMs. 
  http://xenbits.xensource.com/xen-unstable.hg?rev/ff124973a28a
  
  -    def device_configure(self, dev_config, devid):
  +    def device_configure(self, dev_config):
           """Configure an existing device.

  So, we need some patch to fix this problem.
  [1] part of changeset 12071 to add the devid
  [XEND] Massive XendDomain XendDomainInfo reorganisation to use XendConfig. 
  http://xenbits.xensource.com/xen-unstable.hg?rev/9a932b5c7947
  
  [2] changeset 12407, to be able to omit the devid
  Fix xm block-configure, by allowing the device ID to be unspecified inside 
  http://xenbits.xensource.com/xen-unstable.hg?rev/f026d4091322
  
  [3] changeset 13333
  [XEND] Fix broken block-configure. 
  http://xenbits.xensource.com/xen-unstable.hg?rev/bf605c314a91

Version-Release number of selected component (if applicable):
  from RPM (RHEL5.1 RC):
    kernel-xen (kernel-xen-2.6.18-52.el5)
    xen (xen-3.0.3-41.el5)
  from cvs:
    libvirt: upstream(revision 1.799)

How reproducible:
  Always

Steps to Reproduce:
  1. Start the guest domain
     # virsh start guest_dom
  2. Change the device 
  # virsh attach-disk HVM_RH51_5 /mnt/rhel51rc/x86/RHEL5.1-Server-20071003.0-
i386-DVD.iso hdc --type cdrom --mode readonly --driver file
  3. Get the following message
  libvir: Xen Daemon error : POST operation failed: (xend.err 'device_configure
() takes exactly 2 arguments (3 given)')

Actual results:
  We cannot change the device by virsh attach-disk.

Expected results:
  We can change the device by virsh attach-disk.

Additional info:
  None

Comment 1 Daniel Veillard 2007-11-09 14:06:14 UTC
Hum, annoying, this sure should be fixed for 5.2, it's unclear yet
if it's better to fix in xen or in libvirt, but something needs to 
be done !

  thanks for raising the issue !

Daniel

Comment 2 RHEL Program Management 2007-11-09 14:14:42 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 4 Daniel Veillard 2007-12-11 09:28:49 UTC
Libvirt part of that bug is handled as #346281

Daniel

Comment 5 Saori Fukuta 2007-12-18 08:18:58 UTC
Hi,

Do you know whether there has been any progress for this BZ in xen ?
If it's better to fix in xen for this, I want to change the 'Component' to Xen.

Regards,
Saori

Comment 7 Daniel Berrangé 2008-01-17 21:31:53 UTC
This bug should have been against 'xen', since bug 346281 tracks the libvirt
side of it.


Comment 8 Daniel Berrangé 2008-01-25 18:25:03 UTC
Created attachment 292968 [details]
Fix device configure method args

The 4 quoted changesets upstream are completely unneccessary. 99% of the quoted
code in them is XenAPI refactoring, and then fixing stuff which was broken by
the refactoring. The only change needed is to add  'devid=None' to the
device_configure() method. With this applied I can successfully change CDROM
media multiple times in a guest using virsh.

Comment 9 Daniel Berrangé 2008-01-30 00:29:31 UTC
The fix for this is built into  xen-3.0.3-52.el5

* Tue Jan 29 2008 Daniel P. Berrange <berrange> - 3.0.3-52.el5
- Fix CDROM media changes (rhbz #372301)



Comment 12 errata-xmlrpc 2008-05-21 15:20:53 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-0305.html



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