Bug 844266

Summary: Fail to modify the domain xml with saved file
Product: Red Hat Enterprise Linux 6 Reporter: zhenfeng wang <zhwang>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.4CC: acathrow, dallan, dyasny, dyuan, eblake, gsun, honzhang, mzhan, rwu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.10.0-0rc1.el6 Doc Type: Bug Fix
Doc Text:
Cause: The condition checking if the save image XML change was successful was inverted. Consequence: Virsh said it failed when it was successful and vice versa. Fix: Invert the condition. Result: Success and failure get reported correctly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:20:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description zhenfeng wang 2012-07-30 07:23:42 UTC
Description of problem:
It reported "saved fail" when i modified the domain xml with saved file,but actually ,it saved successully

Version-Release number of selected component (if applicable):
# rpm -qa|grep libvirt
 libvirt-python-0.9.13-3.el6.x86_64
 libvirt-0.9.13-3.el6.x86_64
 libvirt-client-0.9.13-3.el6.x86_64
 libvirt-docs-0.9.13-2.el6.x86_64
 libvirt-devel-0.9.13-3.el6.x86_64
 qemu-kvm-rhev-0.12.1.2-2.299.el6.x86_64
# uname -r
 2.6.32-293.el6.x86_64
How reproducible:
100%

Steps to Reproduce:
1.# virsh save-image-edit rhel6-qcow2.save
 ..snip...

 <on_poweroff>destroy</on_poweroff>
 <on_reboot>restart</on_reboot>
 <on_crash>restart</on_crash>
 ..snip...

Edit the xml:
 Update "<on_crash>restart</on_crash>" to"<on_crash>destroy</on_crash>"

2.Then save,it reported:
 # virsh save-image-edit rhel6-qcow2.save 
 Failed. Try again? [y,n,f,?]:n

3.# virsh restore rhel6-qcow2.save
 Domain restored from rhel6-qcow2.save

# virsh dumpxml rhel6-qcow2

 ..snip...
 <on_poweroff>destroy</on_poweroff>
 <on_reboot>restart</on_reboot>
 <on_crash>destroy</on_crash>
 ..snip...
  
Actual results:
when modify the xml, it saved successfully ,but reported " saved fail" error information

Expected results:
when modify the xml,it saved successfully and no reporting error information

Additional info:

Comment 3 Ján Tomko 2012-08-10 13:22:23 UTC
Upstream patch proposed:

https://www.redhat.com/archives/libvir-list/2012-August/msg00688.html

Comment 4 Ján Tomko 2012-08-14 07:56:57 UTC
Fixed by commit 863399f06b8dad8d7fc2e4b962d3cc566b69ed4c
    virsh: say save-image-edit failed only when it does

Comment 7 hongming 2012-08-27 02:10:30 UTC
Verified it using libvirt-0.10.0-0rc1.el6.x86_64. The result is expected. So move its status to VERIFIED.



Steps

1. # virsh save-image-edit rhel6.save

Edit the xml:
 Update "<on_crash>restart</on_crash>" to"<on_crash>destroy</on_crash>"

2. Save it .

State file rhel6.save edited.


3. # virsh restore rhel6.save
Domain restored from rhel6.save


4. # virsh dumpxml rhel6
......
  <on_crash>destroy</on_crash>
......

Comment 8 errata-xmlrpc 2013-02-21 07:20:21 UTC
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.

http://rhn.redhat.com/errata/RHSA-2013-0276.html