Bug 804601 - Controllers do not support virsh attach/detach-device --persistent
Controllers do not support virsh attach/detach-device --persistent
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
x86_64 Linux
high Severity medium
: rc
: ---
Assigned To: Osier Yang
Virtualization Bugs
Depends On:
Blocks: 804821 840699
  Show dependency treegraph
Reported: 2012-03-19 07:44 EDT by Paolo Bonzini
Modified: 2013-02-21 02:08 EST (History)
10 users (show)

See Also:
Fixed In Version: libvirt-0.10.0-0rc1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-02-21 02:08:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Paolo Bonzini 2012-03-19 07:44:07 EDT
Description of problem:
Configuration of controllers cannot be changed with virsh attach-device and virsh detach-device.  It doesn't seem hard to do

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Define a domain.
2. Put the following line in a file scsi.xml:

<controller type='scsi' model='virtio-scsi'/>

3. Execute the following command:

virsh attach-device --persistent prova scsi.xml
Actual results:
"error: unsupported configuration: persistent attach of device is not supported"

Expected results:
Controller is added to the domain configuration

Additional info:
detach-device is also unsupported.
Comment 5 Osier Yang 2012-07-23 10:12:46 EDT
v2 posted upstream.

Comment 6 Osier Yang 2012-08-03 00:23:04 EDT
Author: Osier Yang <jyang@redhat.com>
Date:   Mon Jul 23 16:18:57 2012 +0800

    qemu: Allow to attach/detach controller device persistently
Comment 8 weizhang 2012-08-23 23:54:02 EDT
Verify pass on

1. Start a guest named rhel6u3
2. Prepare a controller xml
# cat controller.xml 
<controller type='scsi' model='virtio-scsi'/>

3. # virsh attach-device --persistent rhel6u3 controller.xml 
Device attached successfully
# virsh dumpxml rhel6u3
    <controller type='scsi' index='0' model='virtio-scsi'>
# virsh dumpxml rhel6u3 --inactive
    <controller type='scsi' index='0' model='virtio-scsi'>

# cat scsi-disk.xml
 <disk type='file' device='disk'>
 <driver name='qemu' type='raw' cache='none'/>
 <source file='/var/lib/libvirt/images/local.img'/>
 <target dev='sdb' bus='scsi'/>
# virsh attach-device rhel6u3 scsi-disk.xml
Device attached successfully

# virsh detach-device --persistent rhel6u3 controller.xml 
error: Failed to detach device from controller.xml
error: operation failed: device cannot be detached: device is busy

# virsh detach-device rhel6u3 scsi-disk.xml 
Device detached successfully

# virsh detach-device --persistent rhel6u3 controller.xml 
Device detached successfully

# virsh dumpxml rhel6u3
no scsi controller

# virsh dumpxml rhel6u3 --inactive
no scsi controller
Comment 9 errata-xmlrpc 2013-02-21 02:08:43 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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