Bug 677226

Summary: virsh update-device can't update an xml file as to an inactive domain
Product: Red Hat Enterprise Linux 6 Reporter: Takuma Umeya <tumeya>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: eblake, jwest, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-08 02:22:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Takuma Umeya 2011-02-14 06:46:59 UTC
Description of problem:
virsh update-device can't update an xml file as to an inactive domain. The following error messages appear: 
virsh update-device <domian-id> <xml-file>
error: Failed to update device from <xml-file>
error: Requested operation is not valid: cannot attach device on inactive domain

The operation works without error with active domain.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux Version Number: 6.0
Kernel Version: kernel-2.6.32-71.el6.i686
Related Package Version: libvirt-client-0.8.1-27.el6.i686 

How reproducible:
Always

Steps to Reproduce:
1. Make sure the guest is stopped. 
2. Attach a DVD image to the kvm guest OS by virt-manager.
3. Create an xml file to detach the DVD image. E.g: 
# less /tmp/foo.xml
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>
4. Update an xml file of the kvm guest. 
# virsh update-device <domain-id> /tmp/foo.xml  


Actual results:
virsh update-device can't update an xml file because the domain is inactive. 

Expected results:
virsh update-device should be able to update the xml file. 


Additional info:

Comment 3 Eric Blake 2011-03-08 02:22:36 UTC

*** This bug has been marked as a duplicate of bug 598792 ***