]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: snapshot: Save persistent domain config when taking external snapshot
authorPeter Krempa <pkrempa@redhat.com>
Mon, 30 Jun 2014 11:44:26 +0000 (13:44 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 30 Jun 2014 13:14:07 +0000 (15:14 +0200)
Commit 55bbb011b965c7962933604c70f61cef45e8ec04 introduced a regression
where we forgot to save the persistent domain configuration after an
external snapshot. This would make libvirt forget the snapshots and
effectively revert to the previous state in the following scenario:

1) Start VM
2) Take snapshot
3) Destroy VM
4) Restart libvirtd

Also fix spurious blank line added by patch mentioned above.

src/qemu/qemu_driver.c

index d34da6f5b8b9adc4a30397c459dce4cc5f2079d3..775f6ab3ef467ea21a64e386ad44d709e872404f 100644 (file)
@@ -13126,8 +13126,10 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
             int indx = virDomainDiskIndexByName(vm->newDef,
                                                 vm->def->disks[i]->dst,
                                                 false);
-            if (indx >= 0)
+            if (indx >= 0) {
                 persistDisk = vm->newDef->disks[indx];
+                persist = true;
+            }
         }
 
         ret = qemuDomainSnapshotCreateSingleDiskActive(driver, vm,
@@ -13173,7 +13175,6 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
                         persistDisk = vm->newDef->disks[indx];
                         persist = true;
                     }
-
                 }
 
                 qemuDomainSnapshotUndoSingleDiskActive(driver, vm,