Bug 372301 - [5.2] Cannot change the device by virsh attach-disk on RHEL5.1
[5.2] Cannot change the device by virsh attach-disk on RHEL5.1
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: xen (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Berrange
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2007-11-09 03:51 EST by Saori Fukuta
Modified: 2009-12-14 16:16 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2008-0305
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-21 11:20:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Fix device configure method args (840 bytes, patch)
2008-01-25 13:25 EST, Daniel Berrange
no flags Details | Diff

  None (edit)
Description Saori Fukuta 2007-11-09 03:51:17 EST
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. 
  -    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. 
  [2] changeset 12407, to be able to omit the devid
  Fix xm block-configure, by allowing the device ID to be unspecified inside 
  [3] changeset 13333
  [XEND] Fix broken block-configure. 

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:

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:
Comment 1 Daniel Veillard 2007-11-09 09:06:14 EST
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 !

Comment 2 RHEL Product and Program Management 2007-11-09 09:14:42 EST
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
Comment 4 Daniel Veillard 2007-12-11 04:28:49 EST
Libvirt part of that bug is handled as #346281

Comment 5 Saori Fukuta 2007-12-18 03:18:58 EST

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.

Comment 7 Daniel Berrange 2008-01-17 16:31:53 EST
This bug should have been against 'xen', since bug 346281 tracks the libvirt
side of it.
Comment 8 Daniel Berrange 2008-01-25 13:25:03 EST
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 Berrange 2008-01-29 19:29:31 EST
The fix for this is built into  xen-3.0.3-52.el5

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

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


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