[pve-devel] [PATCH v3 28/30] common: skip target_hd when deserializing InstallConfig

Aaron Lauterer a.lauterer at proxmox.com
Thu Mar 28 14:50:26 CET 2024


as only the 'path' property is serialized -> deserialization is
problematic. The information would be present in the 'run-env-info-json',
but for now there is no need for it in any code that deserializes the
low-level config. Therefore we are currently skipping it on
deserialization

If we need it in the future, we need to think about how to handle the
deserialization.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 proxmox-installer-common/src/setup.rs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/proxmox-installer-common/src/setup.rs b/proxmox-installer-common/src/setup.rs
index 743e7a9..f9f9e82 100644
--- a/proxmox-installer-common/src/setup.rs
+++ b/proxmox-installer-common/src/setup.rs
@@ -414,7 +414,12 @@ pub struct InstallConfig {
 
     #[serde(
         serialize_with = "serialize_disk_opt",
-        skip_serializing_if = "Option::is_none"
+        skip_serializing_if = "Option::is_none",
+        // only the 'path' property is serialized -> deserialization is problematic
+        // The information would be present in the 'run-env-info-json', but for now there is no
+        // need for it in any code that deserializes the low-level config. Therefore we are
+        // currently skipping it on deserialization
+        skip_deserializing
     )]
     pub target_hd: Option<Disk>,
     #[serde(skip_serializing_if = "BTreeMap::is_empty")]
-- 
2.39.2





More information about the pve-devel mailing list