From: Peter Krempa Date: Mon, 30 Jun 2014 11:44:26 +0000 (+0200) Subject: qemu: snapshot: Save persistent domain config when taking external snapshot X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9036b31aeddb63db198576b8eaba331df105c0c6;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git qemu: snapshot: Save persistent domain config when taking external snapshot 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. --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d34da6f5b..775f6ab3e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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,