debuggers.hg

changeset 20993:4a4caf3c052d

hotplug: ignore xenstore-read error

The failure to read "backend/tap/<domid>/*" in the xenstore is a usual
case since the domain is gone after xenstore-ls command is executed.
The error should be ignored.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Feb 16 09:28:39 2010 +0000 (2010-02-16)
parents ae2b7f1c89c8
children 7d565d58f498
files tools/hotplug/Linux/blktap tools/hotplug/Linux/block
line diff
     1.1 --- a/tools/hotplug/Linux/blktap	Tue Feb 16 09:27:45 2010 +0000
     1.2 +++ b/tools/hotplug/Linux/blktap	Tue Feb 16 09:28:39 2010 +0000
     1.3 @@ -23,7 +23,7 @@ check_blktap_sharing()
     1.4      do
     1.5          for dev in $(xenstore-list "$base_path/$dom")
     1.6          do
     1.7 -            params=$(xenstore_read "$base_path/$dom/$dev/params" | cut -d: -f2)
     1.8 +            params=$(xenstore_read_default "$base_path/$dom/$dev/params" "" | cut -d: -f2)
     1.9              if [ "$file" = "$params" ]
    1.10              then
    1.11  
    1.12 @@ -35,7 +35,7 @@ check_blktap_sharing()
    1.13                          return
    1.14                      fi
    1.15                  else 
    1.16 -                    local m=$(xenstore_read "$base_path/$dom/$dev/mode")
    1.17 +                    local m=$(xenstore_read_default "$base_path/$dom/$dev/mode" "")
    1.18                      m=$(canonicalise_mode "$m")
    1.19  
    1.20                      if [ "$m" = 'w' ] 
     2.1 --- a/tools/hotplug/Linux/block	Tue Feb 16 09:27:45 2010 +0000
     2.2 +++ b/tools/hotplug/Linux/block	Tue Feb 16 09:28:39 2010 +0000
     2.3 @@ -100,7 +100,7 @@ check_sharing()
     2.4              return
     2.5            fi
     2.6          else
     2.7 -          local m=$(xenstore_read "$base_path/$dom/$dev/mode")
     2.8 +          local m=$(xenstore_read_default "$base_path/$dom/$dev/mode" "")
     2.9            m=$(canonicalise_mode "$m")
    2.10  
    2.11            if [ "$m" = 'w' ]