[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] [RFC] Fix RegEx Issues with xendomains for both SXP and JSON outputs of lx list -l
On Thu, 2013-06-20 at 13:00 +0100, Ian Murray wrote: > (Resent, as Yahoo seems to silently drop sentemail with the subject > starting with a square open bracket. Space inserted - apologies if > received more than once) How very unhelpful of them! FWIW This seems to be the first one which made it into the list archives as well as my INBOX. I'm working through my post-vacation backlog this morning but I hope to have a chance to look at this vs. 4.3-rc soon since I think it is a worthwhile bugfix for 4.3. George, what does your release manager's hat think? > Modifications to xendomains so that it correctly identifies a new domain > entry when parsing the output of xl list -l. For both SXP and JSON > outputs, it was failing to spot a new domain entry and was saving the > second domain under a filename generated from the first domain's name. > > I have listed this as RFC because although it is a patch against 4.3RC5, > I have not had a chance to test against RC5, only 4.2.2. I won't get an > opportunity until the weekend, so I invite comment and anybody to give > it a test against RC5. Ian C has already commented elsewhere that the xl > list -l JSON output has been altered between 4.2.x and 4.3RC5, so this > might affect the indentation (the 4 spaces in the middle of the > LIST_GREP variable) - the trigger for new domain data is ' {' in JSON > version (in at least 4.2.2) and '(domain' in SXP version. Not tested > against xm. > > It seems there is a problem in 4.2.2's implementation of SXP output of > xl list -l in that all domain ID's are outputted as -1. Ian C suggested > applying a change that originally went into 4.3 to resolve this issue. > This seemed to do the trick (see thread [Xen-users] DomU > suspension/hibernation ) Would you be able to submit that backport as a patch against the 4.2 staging branch and CC myself and Ian Jackson <ian.jackson@xxxxxxxxxxxxx> ? This isn't a straight forward backport, since the majority of the commit is not a suitable candidate, but if you reference in the commit message the original commit id/subject and point out that only the one hunk is a useful bug fix which is why it's been split out then I think it would be fine to have in the next 4.2 release. Thanks, Ian. > > Thanks to David Sutton for tracking through the issues with me and Ian C > for guidance and assistance. > > > Signed-off-by: Ian Murray <murrayie@xxxxxxxxxxx> > > > 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() > done > } > > -LIST_GREP='((domain\|(domid\|(name\|^{$\|"name":\|"domid":' > +LIST_GREP='(domain\|(domid\|(name\|^ {$\|"name":\|"domid":' > parseln() > { > if [[ "$1" =~ '(domain' ]] || [[ "$1" = "{" ]]; then > @@ -237,7 +237,7 @@ is_running() > RC=0 > ;; > esac > - done < <($CMD list -l | grep $LIST_GREP) > + done < <($CMD list -l | grep "$LIST_GREP") > return $RC > } > > @@ -319,7 +319,7 @@ all_zombies() > if test "$state" != "-b---d" -a "$state" != "-----d"; then > return 1; > fi > - done < <($CMD list -l | grep $LIST_GREP) > + done < <($CMD list -l | grep "$LIST_GREP") > return 0 > } > > @@ -450,7 +450,7 @@ stop() > fi > kill $WDOG_PID >/dev/null 2>&1 > fi > - done < <($CMD list -l | grep $LIST_GREP) > + done < <($CMD list -l | grep "$LIST_GREP") > > # NB. this shuts down ALL Xen domains (politely), not just the ones in > # AUTODIR/* > @@ -487,7 +487,7 @@ check_domain_up() > return 0 > ;; > esac > - done < <($CMD list -l | grep $LIST_GREP) > + done < <($CMD list -l | grep "$LIST_GREP") > return 1 > } _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |