xend: Fix building PV guests after introducing new HVM-HAP config option.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 29 Jan 2008 15:16:35 +0000 (15:16 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 29 Jan 2008 15:16:35 +0000 (15:16 +0000)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/python/xen/xend/XendConfig.py
tools/python/xen/xend/XendDomainInfo.py

index f543e93f264e24bb37460356da4c27d22ad7da3b..3a1419cbdcbc8eed753bd665e1e240d21d3d81c4 100644 (file)
@@ -1595,4 +1595,4 @@ class XendConfig(dict):
         return stored_type or (self.is_hvm() and 'hvm' or 'linux')
 
     def is_hap(self):
-        return self['platform']['hap']
+        return self['platform'].get('hap', 0)
index ca3083bae2f65d95507a72e5b7864935dcef2c66..fc8f073ec8042a2a205d16e140f3e352a52be779 100644 (file)
@@ -1626,19 +1626,14 @@ class XendDomainInfo:
         @raise: VmError on error
         """
 
-        hvm_bit_offset = 0
-
-        hap_bit_offset = 1
-
         log.debug('XendDomainInfo.constructDomain')
 
         self.shutdownStartTime = None
 
+        hap = 0
         hvm = self.info.is_hvm()
-
-        hap = self.info.is_hap()
-
         if hvm:
+            hap = self.info.is_hap()
             info = xc.xeninfo()
             if 'hvm' not in info['xen_caps']:
                 raise VmError("HVM guest support is unavailable: is VT/AMD-V "
@@ -1663,7 +1658,7 @@ class XendDomainInfo:
                 domid = 0,
                 ssidref = ssidref,
                 handle = uuid.fromString(self.info['uuid']),
-                flags = int((hvm << hvm_bit_offset) | (hap << hap_bit_offset)),
+                flags = int((hvm << 0) | (hap << 1)),
                 target = self.info.target())
         except Exception, e:
             # may get here if due to ACM the operation is not permitted