Bug 677547

Summary: Virsh save a shutoff guest get 'error: cannot resolve symlink'
Product: Red Hat Enterprise Linux 6 Reporter: zhanghaiyan <yoyzhang>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.1CC: dallan, dyuan, eblake, jyang, llim, syeghiay, veillard, xen-maint
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.8.7-7.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:27:32 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 zhanghaiyan 2011-02-15 07:58:50 UTC
Description of problem:
Virsh save a shutoff guest get 'error: cannot resolve symlink'

Version-Release number of selected component (if applicable):
- libvirt-0.8.7-6.el6.x86_64
- kernel-2.6.32-113.el6.x86_64
- qemu-kvm-0.12.1.2-2.144.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.# virsh list --all
 Id Name                 State
----------------------------------
  - rhel6                shut off
2. # virsh save rhel6 rhel6.save
error: Failed to save domain rhel6 to rhel6.save
error: cannot resolve symlink /tmp/rhel6.save: No such file or directory
3. # touch rhel6.save
4. # virsh save rhel6 rhel6.save
error: Failed to save domain rhel6 to rhel6.save
error: Requested operation is not valid: domain is not running
5. # cat /var/log/libvirtd.log 
02:56:37.950: 8023: info : libvirt version: 0.8.7, package: 6.el6 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2011-02-11-11:31:35, hs20-bc2-4.build.redhat.com)
02:56:37.950: 8023: warning : SELinuxRestoreSecurityFileLabel:434 : cannot resolve symlink /tmp/rhel6.save: No such file or directory
02:56:37.950: 8023: warning : qemudDomainSaveFlag:4978 : failed to restore save state label on /tmp/rhel6.save

Actual results:
step3, failed symlink error

Expected results:
step3 should fail the same as step4

Additional info:
In bug 672449, the issue was resolved. But in my test environment, I downgrade libvirt to -4 (the same with https://bugzilla.redhat.com/show_bug.cgi?id=672449#c7), but still got the same error. Is it possible kernel or qemu-kvm did some change ?

Comment 4 Osier Yang 2011-02-15 08:18:18 UTC
Though marking it as "regression" is fine, but it's not regression by fix of #BZ 672449, this bug is about "save", 672449 is about "managedsave".

Comment 5 zhanghaiyan 2011-02-15 08:20:04 UTC
manage save works well 
# virsh managedsave rhel6
error: Failed to save domain rhel6 state
error: Requested operation is not valid: domain is not running

but save to the same path failed
# virsh save rhel6 /var/lib/libvirt/qemu/rhel6.save
error: Failed to save domain rhel6 to /var/lib/libvirt/qemu/rhel6.save
error: cannot resolve symlink /var/lib/libvirt/qemu/rhel6.save: No such file or directory

Comment 6 zhanghaiyan 2011-02-15 08:21:17 UTC
(In reply to comment #4)
> Though marking it as "regression" is fine, but it's not regression by fix of
> #BZ 672449, this bug is about "save", 672449 is about "managedsave".

yup, you're right, thanks.

Comment 7 Osier Yang 2011-02-15 08:30:43 UTC
http://www.redhat.com/archives/libvir-list/2011-February/msg00503.html

patch posted to upstream.

Comment 8 Osier Yang 2011-02-17 03:36:37 UTC
patch posted internally, move to POST.

http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-February/msg01073.html

Comment 10 zhanghaiyan 2011-02-18 06:31:07 UTC
Verified PASS with libvirt-0.8.7-7.el6.x86_64
- kernel-2.6.32-113.el6.x86_64
- qemu-kvm-0.12.1.2-2.145.el6.x86_64

# getenforce 
Enforcing

1. # virsh list --all
 Id Name                 State
----------------------------------
  - rhel6                shut off
2. # ll /tmp/rhel6.save
ls: cannot access /tmp/rhel6.save: No such file or directory
3. # virsh save rhel6 /tmp/rhel6.save
error: Failed to save domain rhel6 to /tmp/rhel6.save
error: Requested operation is not valid: domain is not running

Comment 13 errata-xmlrpc 2011-05-19 13:27:32 UTC
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 therefore 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.

http://rhn.redhat.com/errata/RHBA-2011-0596.html