Skip to contentSkip to conversation

tools/xl: Fix regular expression for autobaloon mode detection based on xen command line.

PATCH In review Dmitry Isaikin 2 participants 2 messages Sep 13, 2021 – Sep 14, 2021 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 tools/xl: Fix regular expression for autobaloon mode detection based on xen command line.

In reply to a message not in the archive

The case of specifying a negative size was handled incorrectly.

From misc/xen-command-line documentation:

dom0_mem (x86)
= List of ( min:<sz> | max:<sz> | <sz> )

If a size is positive, it represents an absolute value.
If a size is negative, it is subtracted from the total available memory.

---
 tools/xl/xl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/xl/xl.c +1 -1
index 4107d10fd4..a9f7e769fd 100644
@@ -81,7 +81,7 @@ static int auto_autoballoon(void)
         return 1; /* default to on */
 
     ret = regcomp(&regex,
-                  "(^| )dom0_mem=((|min:|max:)[0-9]+[bBkKmMgG]?,?)+($| )",
+                  "(^| )dom0_mem=((|min:|max:)-?[0-9]+[bBkKmMgG]?,?)+($| )",
                   REG_NOSUB | REG_EXTENDED);
     if (ret)
         return 1;
Signature · 1 line
2.33.0
#2 lore raw

Dmitry Isaikin writes ("[PATCH 1/1] tools/xl: Fix regular expression for autobaloon mode detection based on xen command line."):

Quoted 1 line

The case of specifying a negative size was handled incorrectly.

Thank you. The change looks good to me. Did you test that after your change, the functionality works ?

Ian.