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

[Xen-bugs] [Bug 1471] xendomains incorrectly checks status of running domains



http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1471





------- Comment #1 from ezaton@xxxxxxxxx  2010-10-12 12:35 -------
I have tested and seen this solution in 4.1 testing, used on Centos 5.5 x86_64.
xendomains script cannot detect VMs. The parseln function returns empty values. 
The "=~" is not being correctly interpreted, this the function returns empty
results, and leaves the guests up and running.
I have used somewhat "heavier" command (grep) to work around this issue:


diff xendomains xendomains.new 

185c185
<     if [[ "$1" =~ '(domain' ]]; then
---
>     if  echo "$1" | grep '(domain' >/dev/null 2>&1 ; then
187c187
<     else if [[ "$1" =~ '(name' ]]; then
---
>     else if echo "$1" | grep '(name' >/dev/null 2>&1 ; then
189c189
<     else if [[ "$1" =~ '(domid' ]]; then
---
>     else if echo "$1" | grep '(domid' >/dev/null 2>&1 ; then


The resulting parseln function looks like this:

parseln()
{
    if  echo "$1" | grep '(domain' >/dev/null 2>&1 ; then
        name=;id=
    else if echo "$1" | grep '(name' >/dev/null 2>&1 ; then
        name=$(echo $1 | sed -e 's/^.*(name \(.*\))$/\1/')
    else if echo "$1" | grep '(domid' >/dev/null 2>&1 ; then
        id=$(echo $1 | sed -e 's/^.*(domid \(.*\))$/\1/')
    fi; fi; fi

    [ -n "$name" -a -n "$id" ] && return 0 || return 1
}


-- 
Configure bugmail: 
http://bugzilla.xensource.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

_______________________________________________
Xen-bugs mailing list
Xen-bugs@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-bugs


 


Rackspace

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