WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-users] Error in /etc/init.d/xendomains if using option XEN_DOMAINS_

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-users] Error in /etc/init.d/xendomains if using option XEN_DOMAINS_AUTO_ONLY=true - saving of the domains always fails / shutdown is called
From: "Artur Linhart - Linux communication" <AL.LINUX@xxxxxxxxxxx>
Date: Thu, 11 Sep 2008 03:12:32 +0200
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 10 Sep 2008 18:14:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AckTqK0Fp/Xag37SQQWNi/fYY9SHhQ==

Hello,

 

for everybody who develops or uses the script /etc/init.d/xendomains, there is a serious error in this script.

 

If the given variable XEN_DOMAINS_AUTO_ONLY is set to true in /etc/sysconfig/xendomains, then the saving of the domains always fails – the domains are shut down instead of the saving. This is very bad especially for some HVM domains which MUST be saved instead of shut down, it affects also the wished migration of the domain to another machine, etc. The error code is in the beginning of the loop in the stop() procedure:

 

stop()

{

    # Collect list of domains to shut down

    if test "$XENDOMAINS_AUTO_ONLY" = "true"; then

        rdnames

    fi

    echo -n "Shutting down Xen domains:"

    while read LN; do

        parseln "$LN"

        if test $id = 0; then continue; fi

        echo -n " $name"

        if test "$XENDOMAINS_AUTO_ONLY" = "true"; then

            case $name in

                ($NAMES)

                    # nothing

                    ;;

                (*)

                    echo -n "(skip)"

                    continue

                    ;;

            esac

        fi

 

.....

 

}

 

The case cause is not evaluated correctly in the case "$XENDOMAINS_AUTO_ONLY" = "true" - it falls always to the possibility (*) in the case there are more than one domain specified in /etc/xen/auto - then in $NAMES there is for example something like DomName1|DomName2 what is then incorrectly handled and it never matches the $name parameter even if it is filled by DomName1 or DomName2 or whatever else. So there comes the „continue“ statement and nothing is made with the given domain, no saving, no migration to another machine, nothing. The domains are then shut down with the shutdown of all remaining „non-auto“ domains

 

The correct way is to evaluate the case using eval:

 

stop()

{

    # Collect list of domains to shut down

    if test "$XENDOMAINS_AUTO_ONLY" = "true"; then

        rdnames

    fi

    echo -n "Shutting down Xen domains:"

    while read LN; do

        parseln "$LN"

        if test $id = 0; then continue; fi

        echo -n " $name"

        if test "$XENDOMAINS_AUTO_ONLY" = "true"; then

            eval "

            case $name in

                ($NAMES)

                    # nothing

                    ;;

                (*)

                    echo -n '(skip)'

                    continue

                    ;;

            esac

            "

        fi

...

}

- in this case the variable $NAMES is substituted first into the case, which is then evaluated with the help of the eval built-in.

 

This error can be found in version 3.1.0 as well as in version 3.2.1 of Xen.

 

Please repair it for the next version of Xen, it cost me some hours to track it out, so please do not waste this time by other users too. This is a serious bug causing crash of the HVM domains not reacting on shutdown.

 

      With regards

 

            Artur Linhart

            http://www.bcpraha.cz

 

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-users] Error in /etc/init.d/xendomains if using option XEN_DOMAINS_AUTO_ONLY=true - saving of the domains always fails / shutdown is called, Artur Linhart - Linux communication <=