From: Ian Murray Subject: Re: [PATCH] Xendomains was not correctly suspending domains when a STOP was issued. Date: Thu, 27 Jun 2013 12:51:55 +0100 (BST) Message-ID: <1372333915.32035.YahooMailNeo@web171303.mail.ir2.yahoo.com> References: <1371904691-9842-1-git-send-email-murrayie@yahoo.co.uk> <1372332750.28443.44.camel@zakaz.uk.xensource.com> Reply-To: Ian Murray Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1372332750.28443.44.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org ----- Original Message ----- > From: Ian Campbell > To: Ian Murray > Cc: xen-devel@lists.xen.org > Sent: Thursday, 27 June 2013, 12:32 > Subject: Re: [Xen-devel] [PATCH] Xendomains was not correctly suspending domains when a STOP was issued. > = > On Sat, 2013-06-22 at 13:38 +0100, Ian Murray wrote: >> The regex was not selecting the { when parsing JSON output of xl list -= l. >> It was also not selecting (domain when parsing xl list -l when SXP = > selected. >> = >> Pefixed { with 4 spaces, and removed an extra ( before domain in the re= gex >> string >> = >> Added quotes around the grep strings so the spaces inserted into the st= ring >> didn't not break the grepping. >> = >> This has now been tested against 4.3RC5 > = > I also tested on current staging with xl (json), xl (sxp) and xm (sxp) > with two domains and it worked fine where previously the xl json case > would try and suspend the same domain twice (I didn't bother testing the > old case for the other two at that point). > = Thanks. BTW, the JSON output of 4.3 looked the same to me as 4.2.2 (i.e. ba= dly formed), so I am not sure the patch you mentioned to make it well-forme= d was in as of 4.3 RC5. if/when the well formed patch is introduced (if it= isn't already), it may very well break this (xendomains) patch. >> Signed-off-by: Ian Murray > = > Acked-by: Ian Campbell > = > And applied. > = Thanks. Have a good release. :) >> --- >> =A0 tools/hotplug/Linux/init.d/xendomains |=A0 10 +++++----- >> =A0 1 file changed, 5 insertions(+), 5 deletions(-) >> = >> diff --git a/tools/hotplug/Linux/init.d/xendomains = > b/tools/hotplug/Linux/init.d/xendomains >> index 730541e..38371af 100644 >> --- a/tools/hotplug/Linux/init.d/xendomains >> +++ b/tools/hotplug/Linux/init.d/xendomains >> @@ -206,7 +206,7 @@ rdnames() >> =A0 =A0 =A0 done >> =A0 } >> =A0 = >> = > -LIST_GREP=3D'((domain\|(domid\|(name\|^{$\|"name":\|"domid":' >> +LIST_GREP=3D'(domain\|(domid\|(name\|^=A0 =A0 = > {$\|"name":\|"domid":' >> =A0 parseln() >> =A0 { >> =A0 =A0 =A0 if [[ "$1" =3D~ '(domain' ]] || [[ "$1" =3D = > "{" ]]; then >> @@ -237,7 +237,7 @@ is_running() >> =A0 =A0=A0=A0 =A0=A0=A0 RC=3D0 >> =A0 =A0=A0=A0 =A0=A0=A0 ;; >> =A0 =A0=A0=A0 esac >> -=A0 =A0 done < <($CMD list -l | grep $LIST_GREP) >> +=A0 =A0 done < <($CMD list -l | grep "$LIST_GREP") >> =A0 =A0 =A0 return $RC >> =A0 } >> =A0 = >> @@ -319,7 +319,7 @@ all_zombies() >> =A0 =A0=A0=A0 if test "$state" !=3D "-b---d" -a "$state" = > !=3D "-----d"; then >> =A0 =A0=A0=A0 =A0 =A0 return 1; >> =A0 =A0=A0=A0 fi >> -=A0 =A0 done < <($CMD list -l | grep $LIST_GREP) >> +=A0 =A0 done < <($CMD list -l | grep "$LIST_GREP") >> =A0 =A0 =A0 return 0 >> =A0 } >> =A0 = >> @@ -450,7 +450,7 @@ stop() >> =A0 =A0=A0=A0 =A0 =A0 fi >> =A0 =A0=A0=A0 =A0 =A0 kill $WDOG_PID >/dev/null 2>&1 >> =A0 =A0=A0=A0 fi >> -=A0 =A0 done < <($CMD list -l | grep $LIST_GREP) >> +=A0 =A0 done < <($CMD list -l | grep "$LIST_GREP") >> =A0 = >> =A0 =A0 =A0 # NB. this shuts down ALL Xen domains (politely), not just t= he ones in >> =A0 =A0 =A0 # AUTODIR/* >> @@ -487,7 +487,7 @@ check_domain_up() >> =A0 =A0=A0=A0 =A0=A0=A0 return 0 >> =A0 =A0=A0=A0 =A0=A0=A0 ;; >> =A0 =A0=A0=A0 esac >> -=A0 =A0 done < <($CMD list -l | grep $LIST_GREP) >> +=A0 =A0 done < <($CMD list -l | grep "$LIST_GREP") >> =A0 =A0 =A0 return 1 >> =A0 } >> =A0 = > = > = > = > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel > =