]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
tools/xendomains: Restrict domid pattern in LIST_GREP
authorPeter Hoyes <Peter.Hoyes@arm.com>
Mon, 3 Oct 2022 14:42:16 +0000 (15:42 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 20 Oct 2022 16:38:56 +0000 (17:38 +0100)
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.

Fixes: 4a3a25678d92 ("libxl: allow creation of domains with a specified or random domid")
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
tools/hotplug/Linux/xendomains.in

index 334d244882c903d88cfc52f576a3db49abb8de5d..70f4129ef4bf24da30b05e5b568c01e39ed384bd 100644 (file)
@@ -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