directory /var/lib alway is Persistence directory, but in redhat system, /var/run is
memory directory.
our running domain xml is saved at /var/run/libvirt/qemu. so if we cold reset system,
the /var/run/libvirt/qemu directory is clear, but /var/lib/libvirt/qemu/domain-*** is
saved. so there
have same /var/run/libvirt/qemu/domain-*** directory will be left over at system cold
reset.
---
src/qemu/qemu_domain.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ed27a91..1b42ae5 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1646,7 +1646,7 @@ qemuDomainSetPrivatePathsOld(virQEMUDriverPtr driver,
if (!priv->libDir &&
virAsprintf(&priv->libDir, "%s/domain-%s",
- cfg->libDir, vm->def->name) < 0)
+ cfg->stateDir, vm->def->name) < 0)
goto cleanup;
if (!priv->channelTargetDir &&
@@ -1674,7 +1674,7 @@ qemuDomainSetPrivatePaths(virQEMUDriverPtr driver,
goto cleanup;
if (!priv->libDir &&
- virAsprintf(&priv->libDir, "%s/domain-%s", cfg->libDir,
domname) < 0)
+ virAsprintf(&priv->libDir, "%s/domain-%s", cfg->stateDir,
domname) < 0)
goto cleanup;
if (!priv->channelTargetDir &&
--
2.8.3