Bug 507537

Summary: Transient domains is still defined after destroy
Product: [Community] Virtualization Tools Reporter: Federico Simoncelli <federico.simoncelli>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: berrange, crobinso, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 507304 Environment:
Last Closed: 2009-06-27 13:48:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
libvirt-0.6.5-fix-destroy-after-restart.patch none

Description Federico Simoncelli 2009-06-23 08:40:58 UTC
+++ This bug was initially created as a clone of Bug #507304 +++

Description of problem:
Destroying a transient domain after libvirt restart leaves the domain defined.

Version-Release number of selected component (if applicable):
libvirt-0.6.4 + "Fix re-detection of transient VMs after libvirtd restart" patch.

Ref:
http://git.et.redhat.com/?p=libvirt.git;a=commit;h=524188b221f5e8dc66a7f203e1633dab3aa8dcf2

(I searched for other related fix which might affect my tests but I didn't find any).

Steps to Reproduce:
1. Start a transient vm.
2. Restart libvirtd.
3. List all the domains (virsh list --all).
  
Actual results:
The transient vm is still defined.

Expected results:
The transient vm should be completely removed.

Additional info:

[root@node1 ~]# virsh list --all
 Id Name                 State
----------------------------------

[root@node1 ~]# virsh create test1.xml
Domain test1 created from test1.xml

[root@node1 ~]# virsh list --all
 Id Name                 State
----------------------------------
  1 test1                running

[root@node1 ~]# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
[root@node1 ~]# virsh list --all
 Id Name                 State
----------------------------------
  1 test1                running

[root@node1 ~]# virsh destroy test1
Domain test1 destroyed

[root@node1 ~]# virsh list --all
 Id Name                 State
----------------------------------
  - test1                shut off

[root@node1 ~]# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
[root@node1 ~]# virsh list --all
 Id Name                 State
----------------------------------

Comment 1 Daniel Berrangé 2009-06-23 09:05:56 UTC
Reminder to myself of where the problem is....

(09:52:11 AM) danpb: simon3z: i think that that is a bug in 
(09:52:17 AM) danpb: virDomainLoadAllConfigs
(09:52:34 AM) danpb: it is always setting
(09:52:35 AM) danpb:             dom->persistent = 1;
(09:52:46 AM) danpb: when it should be actually doing that conditionally
(09:53:06 AM) danpb:         if (!liveStatus)
(09:53:06 AM) danpb:              dom->persistent = 1;

Comment 2 Federico Simoncelli 2009-06-23 09:06:17 UTC
Created attachment 349065 [details]
libvirt-0.6.5-fix-destroy-after-restart.patch

Proposed patch. (Thanks to Daniel P. Berrange)

Comment 3 Daniel Veillard 2009-06-27 13:48:28 UTC
That was commited upstream, so that will be in 0.6.5 next week,

  thanks !

Daniel