Re: [PATCH 3/3] upgrader:refine upgrader.py


Junjie Mao
 

"Li, Ziheng" <ziheng.li@...> writes:

From 5820f56aca3c934fd02e14bd08bbb4843a8324c1 Mon Sep 17 00:00:00 2001
From: Ziheng Li <ziheng.li@...>
Date: Wed, 1 Jun 2022 15:39:25 +0800
Subject: [PATCH 3/3] upgrader:refine upgrader.py

In the process of upgrading scenario XML, deleted
the " clos" node.

Tracked-On: #7660
Signed-off-by: Ziheng Li <ziheng.li@...>
---
misc/config_tools/scenario_config/upgrader.py | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/misc/config_tools/scenario_config/upgrader.py b/misc/config_tools/scenario_config/upgrader.py
index 396d1d48b..b1d8d09de 100755
--- a/misc/config_tools/scenario_config/upgrader.py
+++ b/misc/config_tools/scenario_config/upgrader.py
@@ -869,6 +869,11 @@ class ScenarioUpgrader(ScenarioTransformer):
logging.error(f"Cannot infer the loader order of VM {self.old_xml_etree.getelementpath(old_node)}")
continue

+ vcpu_clos_node = old_node.xpath("./clos/vcpu_clos")
+ if vcpu_clos_node:
+ for node in vcpu_clos_node:
+ self.old_data_nodes.discard(node)
+
Silently dropping users' cache allocation policies is not a good
practice. You need to warn the user explicitly when any meaningful data
is discarded during the upgrade.

You can instead add an object of class `DiscardedDataFilter` to the
array `filters` in class `UpgradingScenarioStage`.

--
Best Regards
Junjie Mao

root_node.append(new_node)
for k, v in old_node.items():
new_node.set(k, v)
--
2.25.1

Join acrn-dev@lists.projectacrn.org to automatically receive all group messages.