mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
qemu: remove possible garbage left from previous rename/undefine
Due to failures to unlink 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@virtuozzo.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
773c7c4361
commit
b814d499a7
@ -6719,6 +6719,9 @@ qemuDomainDefineXMLFlags(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
def = NULL;
|
||||
|
||||
if (!oldDef && qemuDomainNamePathsCleanup(cfg, vm->def->name, false) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
||||
driver->xmlopt, cfg->configDir) < 0)
|
||||
goto cleanup;
|
||||
@ -19179,6 +19182,9 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
|
||||
vm->def->name)))
|
||||
return -1;
|
||||
|
||||
if (qemuDomainNamePathsCleanup(cfg, new_name, false) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (vm->autostart) {
|
||||
if (!(new_dom_autostart_link = virDomainConfigFile(cfg->autostartDir,
|
||||
new_dom_name)) ||
|
||||
|
@ -5137,6 +5137,9 @@ qemuMigrationDstPersist(virQEMUDriverPtr driver,
|
||||
priv->qemuCaps)))
|
||||
goto error;
|
||||
|
||||
if (!oldPersist && qemuDomainNamePathsCleanup(cfg, vmdef->name, false) < 0)
|
||||
goto error;
|
||||
|
||||
if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0 &&
|
||||
!ignoreSaveError)
|
||||
goto error;
|
||||
|
Loading…
Reference in New Issue
Block a user