tools/xendomains: Restrict domid pattern in LIST_GREP
PATCH 1/1 tools/xendomains: Restrict domid pattern in LIST_GREP
From: Peter Hoyes <[email protected]>
The xendomains script uses the output of xl list -l to collect the id and name of each domain, which is used in the shutdown logic, amongst other purposes.
The linked commit added a "domid" field to libxl_domain_create_info. This causes the output of xl list -l to contain two "domid"s per domain, which may not be equal. This in turn causes xendomains stop to issue two shutdown commands per domain, one of which is to a duplicate and/or invalid domid.
To work around this, make the LIST_GREP pattern more restrictive for domid, so it only detects the domid at the top level and not the domid inside c_info.
or random domid")
--- tools/hotplug/Linux/xendomains.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/hotplug/Linux/xendomains.in +1 -1
@@ -211,7 +211,7 @@ get_xsdomid() fi } -LIST_GREP='(domain\|(domid\|(name\|^ {$\|"name":\|"domid":' +LIST_GREP='(domain\|(domid\|(name\|^ {$\|"name":\|^ "domid":' parseln() { if [[ "$1" =~ '(domain' ]] || [[ "$1" = "{" ]]; then
Signature · 1 line
2.25.1
Hi,
Gentil ping on this one as it might be a suitable one for 4.17
Cheers
Bertrand
Quoted 41 lines · Peter Hoyes
From: Peter Hoyes <[email protected]>
The xendomains script uses the output of
xl list -lto collect the id and name of each domain, which is used in the shutdown logic, amongst other purposes.The linked commit added a "domid" field to
libxl_domain_create_info. This causes the output ofxl list -lto contain two "domid"s per domain, which may not be equal. This in turn causesxendomains stopto issue two shutdown commands per domain, one of which is to a duplicate and/or invalid domid.To work around this, make the
LIST_GREPpattern more restrictive for domid, so it only detects the domid at the top level and not the domid insidec_info.Fixes 4a3a25678d92 ("libxl: allow creation of domains with a specifiedor random domid")
Signed-off-by Peter Hoyes <[email protected]>---
tools/hotplug/Linux/xendomains.in| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)tools/hotplug/Linux/xendomains.in +1
-1@@ -211,7 +211,7 @@ get_xsdomid() fi } -LIST_GREP='(domain\|(domid\|(name\|^ {$\|"name":\|"domid":' +LIST_GREP='(domain\|(domid\|(name\|^ {$\|"name":\|^ "domid":' parseln() { if [[ "$1" =~ '(domain' ]] || [[ "$1" = "{" ]]; thenSignature · 1 line
2.25.1
Anthony PERARD
Acked-byQuoted 3 lines · Bertrand Marquis
Hi,
Gentil ping on this one as it might be a suitable one for 4.17
Yeah, that might be a good bug fix to have.
Quoted 13 lines
Quoted 13 lines · Peter Hoyes
From: Peter Hoyes <[email protected]>
The xendomains script uses the output of
xl list -lto collect the id and name of each domain, which is used in the shutdown logic, amongst other purposes.The linked commit added a "domid" field to
libxl_domain_create_info. This causes the output ofxl list -lto contain two "domid"s per domain, which may not be equal. This in turn causesxendomains stopto issue two shutdown commands per domain, one of which is to a duplicate and/or invalid domid.
Quoted 7 lines
Quoted 7 lines
To work around this, make the
LIST_GREPpattern more restrictive for domid, so it only detects the domid at the top level and not the domid insidec_info.Fixes 4a3a25678d92 ("libxl: allow creation of domains with a specifiedor random domid")
Signed-off-by Peter Hoyes <[email protected]>
Parsing json with bash, grep and sed, what could go wrong :-). Anyway, patch looks fine:
Thanks,
Signature · 1 line
Anthony PERARD
Hi,
Quoted 10 lines
-----Original Message-----
From: Anthony PERARD <[email protected]>
Subject: Re: [PATCH]tools/xendomains: Restrict domid pattern inLIST_GREPQuoted 3 lines · Bertrand Marquis
Hi,
Gentil ping on this one as it might be a suitable one for 4.17
Yeah, that might be a good bug fix to have.
Agreed.
Quoted 21 lines
Quoted 6 lines
Quoted 6 lines · Peter Hoyes
From: Peter Hoyes <[email protected]>
The xendomains script uses the output of
xl list -lto collect the id and name of each domain, which is used in the shutdown logic,amongst
Quoted 5 lines
Quoted 5 lines
other purposes.
The linked commit added a "domid" field to
libxl_domain_create_info. This causes the output ofxl list -lto contain two "domid"s per domain, which may not be equal. This in turn causesxendomains stopto
Quoted 1 line
Quoted 1 line
issue two shutdown commands per domain, one of which is to a
duplicate
Quoted 6 lines
Quoted 6 lines
and/or invalid domid.
To work around this, make the
LIST_GREPpattern more restrictive for domid, so it only detects the domid at the top level and not the domid insidec_info.
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Fixes 4a3a25678d92 ("libxl: allow creation of domains with a specifiedor random domid")
Signed-off-by Peter Hoyes <[email protected]>Parsing json with bash, grep and sed, what could go wrong :-). Anyway, patch looks fine:
Acked-by Anthony PERARD <[email protected]>
Kind regards,
Henry
Quoted 5 lines
Thanks,
--
Anthony PERARD