diff mbox

[10/52] xen/arch/x86/hvm/vmx/vmcs.c: let custom parameter parsing routines return errno

Message ID 20170809070706.13481-11-jgross@suse.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jürgen Groß Aug. 9, 2017, 7:06 a.m. UTC
Modify the custom parameter parsing routines in:

xen/arch/x86/hvm/vmx/vmcs.c

to indicate whether the parameter value was parsed successfully.

Cc: Jun Nakajima <jun.nakajima@intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 2008fee280..4ddcbd7e5e 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -74,9 +74,10 @@  static s8 __read_mostly opt_ept_ad = -1;
  *  pml                 Enable PML
  *  ad                  Use A/D bits
  */
-static void __init parse_ept_param(char *s)
+static int __init parse_ept_param(char *s)
 {
     char *ss;
+    int rc = 0;
 
     do {
         bool_t val = !!strncmp(s, "no-", 3);
@@ -92,9 +93,13 @@  static void __init parse_ept_param(char *s)
             opt_pml_enabled = val;
         else if ( !strcmp(s, "ad") )
             opt_ept_ad = val;
+        else
+            rc = -EINVAL;
 
         s = ss + 1;
     } while ( ss );
+
+    return rc;
 }
 custom_param("ept", parse_ept_param);