From ef95407147b986fe0d362d41c3372081bcb7a17a Mon Sep 17 00:00:00 2001 From: Giuseppe Maxia Date: Thu, 27 Jun 2024 09:40:32 +0200 Subject: [PATCH 1/3] Add Xmlns field to types.RequestVirtualHardwareSection Signed-off-by: Giuseppe Maxia --- types/v56/vm_types.go | 1 + 1 file changed, 1 insertion(+) diff --git a/types/v56/vm_types.go b/types/v56/vm_types.go index be1d18e6f..782dbc7e0 100644 --- a/types/v56/vm_types.go +++ b/types/v56/vm_types.go @@ -226,6 +226,7 @@ type Adapter struct { type RequestVirtualHardwareSection struct { // Extends OVF Section_Type XMLName xml.Name `xml:"ovf:VirtualHardwareSection"` + Xmlns string `xml:"xmlns,attr,omitempty"` Ovf string `xml:"xmlns:ovf,attr"` Vssd string `xml:"xmlns:vssd,attr"` Rasd string `xml:"xmlns:rasd,attr"` From 6e897f1789bca2e085339eae59d3758b018e0b59 Mon Sep 17 00:00:00 2001 From: Giuseppe Maxia Date: Thu, 27 Jun 2024 09:41:15 +0200 Subject: [PATCH 2/3] Force Xmlns value in input to updateExtraConfig Signed-off-by: Giuseppe Maxia --- govcd/vm.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/govcd/vm.go b/govcd/vm.go index cf4ec478a..67be0e723 100644 --- a/govcd/vm.go +++ b/govcd/vm.go @@ -2171,12 +2171,13 @@ func (vm *VM) updateExtraConfig(update []*types.ExtraConfigMarshal, wantDelete b } requestVirtualHardwareSection := &types.RequestVirtualHardwareSection{ - Info: "Virtual hardware requirements", - Ovf: types.XMLNamespaceOVF, - Rasd: types.XMLNamespaceRASD, - Vssd: types.XMLNamespaceVSSD, - Ns4: types.XMLNamespaceVCloud, - Vmw: types.XMLNamespaceVMW, + Info: "Virtual hardware requirements", + Ovf: types.XMLNamespaceOVF, + Rasd: types.XMLNamespaceRASD, + Vssd: types.XMLNamespaceVSSD, + Ns4: types.XMLNamespaceVCloud, + Vmw: types.XMLNamespaceVMW, + Xmlns: types.XMLNamespaceVCloud, Type: virtualHardwareSection.Type, System: virtualHardwareSection.System, From f82b10d158112626d8e011097e36c996b80a639f Mon Sep 17 00:00:00 2001 From: Giuseppe Maxia Date: Thu, 27 Jun 2024 09:47:55 +0200 Subject: [PATCH 3/3] Add changelog item Signed-off-by: Giuseppe Maxia --- .changes/v2.25.0/690-bug-fixes.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 .changes/v2.25.0/690-bug-fixes.md diff --git a/.changes/v2.25.0/690-bug-fixes.md b/.changes/v2.25.0/690-bug-fixes.md new file mode 100644 index 000000000..15decc4f3 --- /dev/null +++ b/.changes/v2.25.0/690-bug-fixes.md @@ -0,0 +1 @@ +* Patched `vm.updateExtraConfig` method that could sometimes fail due to random mishandling of XML namespaces in upstream libraries [GH-690]