Hi All, Everytime I upgrade to a new version of Xen (just did 4.2.1 this weekend) I find the xendomains script completely unusable. I use xl exclusively and the behaviour is slightly different to what the script appears to be expecting. Am I the only one that has this problem? I have an Ubuntu 12.04 based Xen server and a Scientific Linux 6.3 based server and both suffer the same problem. I am no bash guru, so apologies if there are better/cleaner ways. I did submit it as a patch on the devel list but it got ignored plus I have no idea if it works for xm or not. Thanks for reading, Ian. diff: --- xendomains.421 2012-12-17 15:00:34.000000000 +0000 +++ xendomains 2013-01-06 11:14:44.622409914 +0000 @@ -27,11 +27,13 @@ # boots / shuts down. ### END INIT INFO +HEADCOMP="LinuxGuestRecord" CMD=xm $CMD list &> /dev/null if test $? -ne 0 then CMD=xl + HEADCOMP="Xen saved domain" fi $CMD list &> /dev/null @@ -202,10 +204,10 @@ done } -LIST_GREP=''((domain\|(domid\|(name\|^{$\|"name":\|"domid":'' +LIST_GREP=''((domain$\|(domid\|(name\|^{$\|"name":\|"domid":'' parseln() { - if [[ "$1" =~ ''(domain'' ]] || [[ "$1" = "{" ]]; then + if [[ "$1" = ''(domain'' ]] || [[ "$1" = "{" ]]; then name=;id elif [[ "$1" =~ ''(name'' ]]; then name=$(echo $1 | sed -e ''s/^.*(name \(.*\))$/\1/'') @@ -255,7 +257,7 @@ for dom in $XENDOMAINS_SAVE/*; do if [ -f $dom ] ; then HEADER=`head -c 16 $dom | head -n 1 2> /dev/null` - if [ $HEADER = "LinuxGuestRecord" ]; then + if [ "$HEADER" = "$HEADCOMP" ]; then echo -n " ${dom##*/}" XMR=`$CMD restore $dom 2>&1 1>/dev/null` #$CMD restore $dom _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Sorry for resending this but I am keen for a response either way and nobody did. Thanks, Ian. ----- Forwarded Message ----- Hi All, Everytime I upgrade to a new version of Xen (just did 4.2.1 this weekend) I find the xendomains script completely unusable. I use xl exclusively and the behaviour is slightly different to what the script appears to be expecting. Am I the only one that has this problem? I have an Ubuntu 12.04 based Xen server and a Scientific Linux 6.3 based server and both suffer the same problem. I am no bash guru, so apologies if there are better/cleaner ways. I did submit it as a patch on the devel list but it got ignored plus I have no idea if it works for xm or not. Thanks for reading, Ian.>diff: > > > > >--- xendomains.421 2012-12-17 15:00:34.000000000 +0000 >+++ xendomains 2013-01-06 11:14:44.622409914 +0000 >@@ -27,11 +27,13 @@ > # boots / shuts down. > ### END INIT INFO > >+HEADCOMP="LinuxGuestRecord" > CMD=xm > $CMD list &> /dev/null > if test $? -ne 0 > then > CMD=xl >+ HEADCOMP="Xen saved domain" > fi > > $CMD list &> /dev/null >@@-202,10 +204,10 @@>done> } > >-LIST_GREP=''((domain\|(domid\|(name\|^{$\|"name":\|"domid":'' >+LIST_GREP=''((domain$\|(domid\|(name\|^{$\|"name":\|"domid":'' > parseln() > { >- if [[ "$1" =~ ''(domain'' ]] || [[ "$1" = "{" ]]; then >+ if [[ "$1" = ''(domain'' ]] || [[ "$1" = "{" ]]; then > name=;id> elif [[ "$1" =~ ''(name'' ]]; then > name=$(echo $1 | sed -e ''s/^.*(name \(.*\))$/\1/'') >@@ -255,7 +257,7 @@ > for dom in $XENDOMAINS_SAVE/*; do > if [ -f $dom ] ; then > HEADER=`head -c 16 $dom | head -n 1 2>/dev/null`>- if [ $HEADER = "LinuxGuestRecord" ]; then >+ if [ "$HEADER" = "$HEADCOMP" ]; then > echo -n " ${dom##*/}" > XMR=`$CMD restore $dom 2>&1 1>/dev/null` > #$CMD restore $dom > > >
On Mon, 2013-01-07 at 12:42 +0000, Ian Murray wrote:> Hi All, > > > Everytime I upgrade to a new version of Xen (just did 4.2.1 this > weekend) I find the xendomains script completely unusable. I use xl > exclusively and the behaviour is slightly different to what the script > appears to be expecting. > > > Am I the only one that has this problem? I have an Ubuntu 12.04 based > Xen server and a Scientific Linux 6.3 based server and both suffer the > same problem.We''ve certainly had some reports of it working but I expect those people are using the mode where it shutsdown and restarts domains rather than suspends so perhaps not so many people notice the suspend mode is broken.> I am no bash guru, so apologies if there are better/cleaner ways. I > did submit it as a patch on the devel list but it got ignored plus I > have no idea if it works for xm or not.Please can you resubmit this patch to xen-devel according to http://wiki.xen.org/wiki/Submitting_Xen_Patches (in particular this one is missing a S-o-b and is whitespace damaged) Apologies for this having fallen through the cracks last time, it''s fine to ping when a patch goes unremarked upon (the wiki recommends after 2 weeks or so). Thanks, Ian.
> We''ve certainly had some reports of it working but I expect those people > are using the mode where it shutsdown and restarts domains rather than > suspends so perhaps not so many people notice the suspend mode is > broken.Thanks for responding. I''ve never really tried in anything but the default mode. The behaviour I got was suspend domains, but then not wake them properly. It seems like xm and xl have different header strings, which is reflected in the patch.> > Please can you resubmit this patch to xen-devel according to > http://wiki.xen.org/wiki/Submitting_Xen_Patches (in particular this one > is missing a S-o-b and is whitespace damaged)I will do, although I must stress that I haven''t tested it against xm and I know it works okay in my environment but I could be missing something.> > Apologies for this having fallen through the cracks last time, it''s fine > to ping when a patch goes unremarked upon (the wiki recommends after 2 > weeks or so). >No worries, I will try again. Thanks again, Ian.
On Thu, 2013-01-10 at 10:32 +0000, Ian Murray wrote:> > > We''ve certainly had some reports of it working but I expect those people > > are using the mode where it shutsdown and restarts domains rather than > > suspends so perhaps not so many people notice the suspend mode is > > broken. > > > Thanks for responding. > > I''ve never really tried in anything but the default mode. The > behaviour I got was suspend domains, but then not wake them properly. > It seems like xm and xl have different header strings, which is > reflected in the patch. > > > > > Please can you resubmit this patch to xen-devel according to > > http://wiki.xen.org/wiki/Submitting_Xen_Patches (in particular this one > > is missing a S-o-b and is whitespace damaged) > > I will do, although I must stress that I haven''t tested it against xm > and I know it works okay in my environment but I could be missing > something. > > > > > Apologies for this having fallen through the cracks last time, it''s fine > > to ping when a patch goes unremarked upon (the wiki recommends after 2 > > weeks or so). > > > > No worries, I will try again.Did you resend this? I''m afraid can''t find it if so. Ian.> > Thanks again, > > Ian. > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xen.org > http://lists.xen.org/xen-users
Apparently Analagous Threads
- [Patch[ xl problems with xendomains
- Xen 4.2.2 /etc/init.d/xendomains save and restore of domains does not work
- Bug#772274: xen-utils-common: when upgrading package: insserv: Service xenstored has to be enabled to start service xendomains
- [PATCH] Make xendomains ignore lost+found
- DomU suspension/hibernation