Bug 1175147

Summary: Inactive external snapshot can't work after libvirtd restart
Product: Red Hat Enterprise Linux 6 Reporter: Shanzhi Yu <shyu>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.6CC: dyuan, eblake, libvirt-maint, mzhan, rbalakri, virt-bugs, yanyang
Target Milestone: rcKeywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1175123 Environment:
Last Closed: 2015-01-20 09:17:17 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:
Bug Depends On: 1175123    
Bug Blocks:    

Description Shanzhi Yu 2014-12-17 09:22:16 UTC
Also reproduce this with libvirt-0.10.2-47.el6.x86_64, so clone new one on RHEL6

+++ This bug was initially created as a clone of Bug #1175123 +++

Description of problem:

Inactive external snapshot can't work after libvirtd restart

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

libvirt-1.2.8-10.el7.x86_64

How reproducible:

100%

Steps to Reproduce:
1.Prepare a shut off guest 
# virsh list --inactive 
 Id    Name                           State
----------------------------------------------------
 -     rhel7                          shut off

2.Create external snapshot for shot off guest

# virsh snapshot-create-as rhel7 ss --disk-only 
Domain snapshot ss created

3.Check guest source file

# virsh dumpxml rhel7|grep "source file"
      <source file='/var/lib/libvirt/images/rhel7-qcow2v3.ss'/>

4.Restart libvirt, do check in step 3 again

# systemctl restart  libvirtd.service

# virsh dumpxml rhel7|grep "source file" 
      <source file='/var/lib/libvirt/images/rhel7-qcow2v3.img'/>

Actual results:


Expected results:

source file should point to new snapshot file in step 4

Additional info:

This was first reported by Eric Blake
http://www.redhat.com/archives/libvir-list/2014-December/msg00369.html

Comment 1 Peter Krempa 2015-01-16 09:44:49 UTC
Upstream fix:

commit 9f974858dde667bda55fbfbec56aa16d9ced870d
Author: Shanzhi Yu <shyu>
Date:   Sun Dec 7 00:32:18 2014 +0800

    qemu: snapshot: inactive external snapshot can't work after libvirtd restart
    
    When create inactive external snapshot, after update disk definitions,
    virDomainSaveConfig is needed, if not after restart libvirtd the new snapshot
    file definitions in xml will be lost.