]> xenbits.xensource.com Git - xen.git/commitdiff
Xendomains was not correctly suspending domains when a STOP was issued.
authorIan Murray <murrayie@yahoo.co.uk>
Sat, 22 Jun 2013 12:38:11 +0000 (13:38 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 27 Jun 2013 10:55:43 +0000 (11:55 +0100)
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 regex
string

Added quotes around the grep strings so the spaces inserted into the string
didn't not break the grepping.

This has now been tested against 4.3RC5

Signed-off-by: Ian Murray <murrayie@yahoo.co.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
tools/hotplug/Linux/init.d/xendomains

index 730541ec2eae598bcaa4092fa1fe8a92c05c83bb..38371af6a4bb23e8b1c1d2869ff534e18d1b1e56 100644 (file)
@@ -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
 }