mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
xen: Allow to undefine a running domain (xm_internal)
This commit is contained in:
parent
b9736d5b21
commit
49186deda6
@ -1218,8 +1218,6 @@ int xenXMDomainUndefine(virDomainPtr domain) {
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (domain->id != -1)
|
|
||||||
return (-1);
|
|
||||||
if (domain->conn->flags & VIR_CONNECT_RO)
|
if (domain->conn->flags & VIR_CONNECT_RO)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
@ -1235,6 +1233,9 @@ int xenXMDomainUndefine(virDomainPtr domain) {
|
|||||||
if (unlink(entry->filename) < 0)
|
if (unlink(entry->filename) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (virDomainObjIsActive(vm)) {
|
||||||
|
vm->persistent = 0;
|
||||||
|
} else {
|
||||||
/* Remove the name -> filename mapping */
|
/* Remove the name -> filename mapping */
|
||||||
if (virHashRemoveEntry(priv->nameConfigMap, domain->name) < 0)
|
if (virHashRemoveEntry(priv->nameConfigMap, domain->name) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -1242,6 +1243,7 @@ int xenXMDomainUndefine(virDomainPtr domain) {
|
|||||||
/* Remove the config record itself */
|
/* Remove the config record itself */
|
||||||
if (virHashRemoveEntry(priv->configCache, entry->filename) < 0)
|
if (virHashRemoveEntry(priv->configCache, entry->filename) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user