Red Hat Bugzilla – Bug 234840
Add a virsh block-attach/block-detach command
Last modified: 2007-11-30 17:07:43 EST
Description of problem:
It would be very useful to have virsh able to block-attach/block-detach devices,
as xm can currently do:
# xm block-attach <dom> <backend> <frontend> <mode>
# xm block-detach <dom> <vdev>
In particular it would be good to use a virsh block-attach command, and REALLY
useful to use the block-detach command; currently the block-detach syntax is
horrible since the user has to figure out what vdev corresponds to the block
device they originally attached.
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
In libvirt-0.2.3-1.el5 which was recently built for dist-5E-qu-candidate there
is a generic command line 'virsh device-attach' and 'virsh device-detach' which
allow a snippet of XML describing the libvirt device to be provided.
# cat > newdev.xml <<EOF
<disk type='file' device='disk'>
# virsh attach-device myguest newdev.xml
NB, this only works for paravirt guests since HVM does not have device hotplug.
Added an extra patch which is upstream which work by giving the arguments
directly on the command line instead of via an XML file. The patch was
Tue Jun 19 11:11:18 CEST 2007 Daniel Veillard <firstname.lastname@example.org>
* src/virsh.c: applied patch from Masayuki Sunou providing a pair
of alternate attach/detach commands
I guess this really fixes the issue, a new package libvirt-0.2.3-3.el5
has been pushed to dist-5E-qu-candidate with those.
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.