From 2a413d30957bfc5e4b1bf68cb7b38cfe0e660b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Czern=C3=BD?= Date: Mon, 7 Jun 2021 11:19:30 +0200 Subject: [PATCH] B #5317: Fix updateconf for FILES_DS (#1275) (cherry picked from commit cf9b5bffad14a7abaf6b11cddd61a55953c58f86) --- src/vm/VirtualMachine.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index ba949ebfd7..2003dd7cdc 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -2930,7 +2930,11 @@ int VirtualMachine::updateconf(VirtualMachineTemplate* tmpl, string &err) string files_ds_new = context_new->vector_value("FILES_DS"); context_new = context_new->clone(); - context_new->remove("FILES_DS"); + + if (files_ds == files_ds_new) + { + context_new->remove("FILES_DS"); + } context_new->replace("TARGET", context_bck->vector_value("TARGET")); context_new->replace("DISK_ID", context_bck->vector_value("DISK_ID")); @@ -2948,7 +2952,7 @@ int VirtualMachine::updateconf(VirtualMachineTemplate* tmpl, string &err) context_new = obj_template->get("CONTEXT"); - if ( !files_ds.empty() && !files_ds_new.empty()) + if ((files_ds == files_ds_new) && !files_ds.empty()) { context_new->replace("FILES_DS", files_ds); }