[libvirt] [PATCH] vmx: Relax virtualHW.version check

Matthias Bolte matthias.bolte at googlemail.com
Sat May 10 14:41:16 UTC 2014


The original implementation of the VMX config parser assumed that the
virtualHW.version would have more influence on the content of the VMX
file than it actually seems to have. It started with accepting only
version 4. Additonal versions were added later without any additional
changes in the parser itself. This suggests that the influence of the
virtualHW.version on the content and format of the VMX file is small
or non-existent.

The parser worked without any changes across several virtualHW and
vSphere versions. So instead of adding new virtualHW.version values to
the parser as they come along, or adding an extra flag to allow unknown
virtualHW.version values just relax the check to require version 4 or
later.
---

This patch is meant as a alternative for this patch series:
https://www.redhat.com/archives/libvir-list/2014-May/msg00122.html

 src/vmx/vmx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 169440c..ce228d4 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -1316,12 +1316,10 @@ virVMXParseConfig(virVMXContext *ctx,
         goto cleanup;
     }
 
-    if (virtualHW_version != 4 && virtualHW_version != 7 &&
-        virtualHW_version != 8 && virtualHW_version != 9 &&
-        virtualHW_version != 10) {
+    if (virtualHW_version < 4) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Expecting VMX entry 'virtualHW.version' to be "
-                         "4, 7, 8, 9 or 10 but found %lld"),
+                         "4 or higher but found %lld"),
                        virtualHW_version);
         goto cleanup;
     }
-- 
1.8.1.2




More information about the libvir-list mailing list