Skip to contentSkip to conversation

hotplug: ignore xenstore-read error

PATCH New Kouya Shimura 1 participant 1 message Feb 16, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hotplug: ignore xenstore-read error

A guest occasionally fails to reboot. xend.log shows:

[2010-02-16 09:52:46 5413] ERROR (XendDomainInfo:2061) Failed to restart domain 82. Traceback (most recent call last):
File "usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 2047, in _restart
new_dom.waitForDevices()
File "usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 1068, in waitForDevices
self.getDeviceController(devclass).waitForDevices()
File "usr/lib64/python2.4/site-packages/xen/xend/server/DevController.py", line 140, in waitForDevices
return map(self.waitForDevice, self.deviceIDs())
File "usr/lib64/python2.4/site-packages/xen/xend/server/DevController.py", line 164, in waitForDevice
raise VmError("Device %s (%s) could not be connected. "
VmError: Device 51712 (tap) could not be connected. xenstore-read backend/tap/82/51712/params failed.

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.

This patch should be applied to xen-3.4 too.

tools/hotplug/Linux/blktap +2 -2
diff -r 3a0bd7ca6b11 tools/hotplug/Linux/blktap
@@ -23,7 +23,7 @@ check_blktap_sharing()
     do
         for dev in $(xenstore-list "$base_path/$dom")
         do
-            params=$(xenstore_read "$base_path/$dom/$dev/params" | cut -d: -f2)
+            params=$(xenstore_read_default "$base_path/$dom/$dev/params" "" | cut -d: -f2)
             if [ "$file" = "$params" ]
             then
 
@@ -35,7 +35,7 @@ check_blktap_sharing()
                         return
                     fi
                 else 
-                    local m=$(xenstore_read "$base_path/$dom/$dev/mode")
+                    local m=$(xenstore_read_default "$base_path/$dom/$dev/mode" "")
                     m=$(canonicalise_mode "$m")
 
                     if [ "$m" = 'w' ] 
tools/hotplug/Linux/block +1 -1
diff -r 3a0bd7ca6b11 tools/hotplug/Linux/block
@@ -100,7 +100,7 @@ check_sharing()
             return
           fi
         else
-          local m=$(xenstore_read "$base_path/$dom/$dev/mode")
+          local m=$(xenstore_read_default "$base_path/$dom/$dev/mode" "")
           m=$(canonicalise_mode "$m")
 
           if [ "$m" = 'w' ]

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel