Red Hat Bugzilla – Bug 372301
[5.2] Cannot change the device by virsh attach-disk on RHEL5.1
Last modified: 2009-12-14 16:16:09 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.
 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.
 part of changeset 12071 to add the devid
[XEND] Massive XendDomain XendDomainInfo reorganisation to use XendConfig.
 changeset 12407, to be able to omit the devid
Fix xm block-configure, by allowing the device ID to be unspecified inside
 changeset 13333
[XEND] Fix broken block-configure.
Version-Release number of selected component (if applicable):
from RPM (RHEL5.1 RC):
libvirt: upstream(revision 1.799)
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)')
We cannot change the device by virsh attach-disk.
We can change the device by virsh attach-disk.
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 !
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
Libvirt part of that bug is handled as #346281
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.
This bug should have been against 'xen', since bug 346281 tracks the libvirt
side of it.
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.
The fix for this is built into xen-3.0.3-52.el5
* Tue Jan 29 2008 Daniel P. Berrange <firstname.lastname@example.org> - 3.0.3-52.el5
- Fix CDROM media changes (rhbz #372301)
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.