From: Peter Hoyes <Peter.Hoyes@arm.com>
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>
---
tools/hotplug/Linux/xendomains.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/hotplug/Linux/xendomains.in b/tools/hotplug/Linux/xendomains.in
index 334d244882..70f4129ef4 100644
--- a/tools/hotplug/Linux/xendomains.in
+++ b/tools/hotplug/Linux/xendomains.in
@@ -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
--
2.25.1
Hi,
Gentil ping on this one as it might be a suitable one for 4.17
Cheers
Bertrand
> On 3 Oct 2022, at 15:42, Peter Hoyes <Peter.Hoyes@arm.com> wrote:
>
> From: Peter Hoyes <Peter.Hoyes@arm.com>
>
> 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>
> ---
> tools/hotplug/Linux/xendomains.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/hotplug/Linux/xendomains.in b/tools/hotplug/Linux/xendomains.in
> index 334d244882..70f4129ef4 100644
> --- a/tools/hotplug/Linux/xendomains.in
> +++ b/tools/hotplug/Linux/xendomains.in
> @@ -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
> --
> 2.25.1
>
On Tue, Oct 18, 2022 at 08:13:57AM +0000, Bertrand Marquis wrote:
> 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.
> > On 3 Oct 2022, at 15:42, Peter Hoyes <Peter.Hoyes@arm.com> wrote:
> > From: Peter Hoyes <Peter.Hoyes@arm.com>
> >
> > 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>
Parsing json with bash, grep and sed, what could go wrong :-). Anyway,
patch looks fine:
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Thanks,
--
Anthony PERARD
Hi,
> -----Original Message-----
> From: Anthony PERARD <anthony.perard@citrix.com>
> Subject: Re: [PATCH] tools/xendomains: Restrict domid pattern in LIST_GREP
>
> On Tue, Oct 18, 2022 at 08:13:57AM +0000, Bertrand Marquis wrote:
> > 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.
>
> > > On 3 Oct 2022, at 15:42, Peter Hoyes <Peter.Hoyes@arm.com> wrote:
> > > From: Peter Hoyes <Peter.Hoyes@arm.com>
> > >
> > > 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>
>
> Parsing json with bash, grep and sed, what could go wrong :-). Anyway,
> patch looks fine:
>
> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
Kind regards,
Henry
>
> Thanks,
>
> --
> Anthony PERARD
© 2016 - 2026 Red Hat, Inc.