Due to failures on previous rename/undefine we can already have
autolink etc files for the domain to be defined. Remove them.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/qemu/qemu_driver.c | 6 ++++++
src/qemu/qemu_migration.c | 3 +++
2 files changed, 9 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e1b9240893..f534f8ec99 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7644,6 +7644,9 @@ qemuDomainDefineXMLFlags(virConnectPtr conn,
goto cleanup;
def = NULL;
+ if (!oldDef && qemuDomainNamePathsCleanup(cfg, vm->def->name, true)
< 0)
+ goto cleanup;
+
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
driver->xmlopt, cfg->configDir) < 0)
goto cleanup;
@@ -22030,6 +22033,9 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
vm->def->name)))
goto cleanup;
+ if (qemuDomainNamePathsCleanup(cfg, new_name, true) < 0)
+ goto cleanup;
+
if (vm->autostart) {
if (!(new_dom_autostart_link = virDomainConfigFile(cfg->autostartDir,
new_dom_name)) ||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 3fc5388d6a..2e49e466f2 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -4915,6 +4915,9 @@ qemuMigrationDstPersist(virQEMUDriverPtr driver,
priv->qemuCaps)))
goto error;
+ if (!oldDef && qemuDomainNamePathsCleanup(cfg, vmdef->name, true) < 0)
+ goto error;
+
if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0 &&
!ignoreSaveError)
goto error;
--
2.23.0