[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-users] Xen 4.2.2 /etc/init.d/xendomains save and restore of domains does not work



Hello,

in the last days I switched from Xen 4.2.1 to Xen 4.2.2 (source from git repository tag 4.2.2)


commit a125ec6a4a2f028f97f0bdd8946d347a36dbe76b
Author: Jan Beulich <jbeulich@xxxxxxxx>
Date:   Tue Apr 23 18:42:55 2013 +0200

    update Xen version to 4.2.2


My "base system" is a debian squeeze. For Xen I use the xl toolstack.

Since updating to 4.2.2 the autosave and autorestore of domains dos not work any more.

The reason is that there are some bugs in /etc/init.d/xendomains

At the end of the mail there is a diff of my corrections. The correction are only tested on my system under xl toolstack


1)  @@ -182,7 +182,7 @@ The rdname does not report any domain name

2) @@ -254,8 +254,8 @@ The header of a saved domain does not contain "LinuxGuestRecord" instead it contains "Xen saved domain".

3) @@ -365,11 +365,11 @@ The escape character `\´ in front of `$´ in `case \"\$name\"´ in suspress Variable expansion I think The leading `(´ in ($NAMES) is wrong in sh/bash is wrong because than the content of `$name´ will be compared to `(whateverinnames´ and that could not match. I think the same bug is in `(*)´

4) @@ -430,6 +430,7 @@
+5) @@ -446,6 +447,7 @@ The variables `name´ and `id´ must be cleared. If not you get on the next loop name and id mixed from different domains.

I hope that helps.

Best wishes


Andreas

------BEGIN Attachment -------------------------------------------------
> diff -u .xendomains.original xendomains
--- .xendomains.original        2013-06-25 07:42:29.000000000 +0200
+++ xendomains  2013-06-30 10:48:06.000000000 +0200
@@ -182,7 +182,7 @@
 rdname()
 {
     NM=$($CMD create --quiet --dryrun --defconfig "$1" |
-         sed -n 's/^.*(name \(.*\))$/\1/p')
+         sed -n 's/^.*"name": "\(.*\)",$/\1/p')
 }

 rdnames()
@@ -254,8 +254,8 @@
        saved_domains=`ls $XENDOMAINS_SAVE`
         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
+ HEADER=`{ head -c 16 $dom; echo ""; } | head -n 1 2> /dev/null` + if [ "$HEADER" = "LinuxGuestRecord" -o "$HEADER" = "Xen saved domain" ]; then
                     echo -n " ${dom##*/}"
                     XMR=`$CMD restore $dom 2>&1 1>/dev/null`
                     #$CMD restore $dom
@@ -365,11 +365,11 @@
        echo -n " $name"
        if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
            eval "
-           case \"\$name\" in
-               ($NAMES)
+           case \"$name\" in
+               $NAMES)
                    # nothing
                    ;;
-               (*)
+                *)
                    echo -e '(skip)'
                    continue
                    ;;
@@ -430,6 +430,7 @@
                kill $WDOG_PID >/dev/null 2>&1
                echo -e .
                usleep 1000
+               name=;id=
                continue
            fi
        fi
@@ -446,6 +447,7 @@
            fi
            kill $WDOG_PID >/dev/null 2>&1
        fi
+       name=;id=
     done < <($CMD list -l | grep $LIST_GREP)

     # NB. this shuts down ALL Xen domains (politely), not just the ones in
------END Attachment ---------------------------------------------

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.