Skip to contentSkip to conversation

vtpm Mini-Os domain: hotplug fix

PATCH New Matthew Fioravante 1 participant 1 message Sep 3, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vtpm Mini-Os domain: hotplug fix

This patch fixes a bug in the vtpm-stubdom implementation. Guest domains talk to vtpms using the vtpm device driver, so each guest has a vtpm device with backend="domname of vtpm."

Whenever one of these guest domains would be brought up the hotplug scripts would run and pause the domain. The vtpm hotplug scripts are only neccessary if the vtpm's backend domain is dom0. This patch disables hotplugging for vtpm devices with backends that are not dom0.

tools/python/xen/xend/server/tpmif.py +16 -0
diff -r 1831912d4109 tools/python/xen/xend/server/tpmif.py
@@ -44,6 +44,22 @@
         DevController.__init__(self, vm)
 
 
+    def createDevice(self, config):
+        #Disable hotplug scripts if backend is not dom0
+        import xen.xend.XendDomain
+        xd = xen.xend.XendDomain.instance()
+        backdom_name = config.get('backend')
+        if backdom_name is None:
+            backdom = xen.xend.XendDomain.DOM0_ID
+        else:
+            bd = xd.domain_lookup_nr(backdom_name)
+            backdom = bd.getDomid()
+
+	if backdom != xen.xend.XendDomain.DOM0_ID:
+	   self.hotplug = False
+
+        return DevController.createDevice(self, config)
+
     def getDeviceDetails(self, config):
         """@see DevController.getDeviceDetails"""
 

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