Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/conf/domain_conf.c | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 88d50d27f5..1c29a2d929 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3918,22 +3918,24 @@ void virDomainObjAssignDef(virDomainObj *domain,
else
virDomainDefFree(domain->newDef);
domain->newDef = g_steal_pointer(def);
- } else {
- if (live) {
- /* save current configuration to be restored on domain shutdown */
- if (!domain->newDef)
- domain->newDef = domain->def;
- else
- virDomainDefFree(domain->def);
- domain->def = g_steal_pointer(def);
- } else {
- if (oldDef)
- *oldDef = domain->def;
- else
- virDomainDefFree(domain->def);
- domain->def = g_steal_pointer(def);
- }
+ return;
+ }
+
+ if (live) {
+ /* save current configuration to be restored on domain shutdown */
+ if (!domain->newDef)
+ domain->newDef = domain->def;
+ else
+ virDomainDefFree(domain->def);
+ domain->def = g_steal_pointer(def);
+ return;
}
+
+ if (oldDef)
+ *oldDef = domain->def;
+ else
+ virDomainDefFree(domain->def);
+ domain->def = g_steal_pointer(def);
}
--
2.35.3