Skip to contentSkip to conversation

tools: fix inverted logic check

PATCH New Christoph Egger 1 participant 1 message Jun 25, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: fix inverted logic check

Hi!

Attached patch fixes an inverted logic check. Also add a sanity check to device_model.
With this,

device_model = 'qemu_dm'

now really works.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
tools/python/xen/xend/XendConfig.py +3 -1
diff -r f3a909c8e8e6 tools/python/xen/xend/XendConfig.py
@@ -463,9 +463,11 @@ class XendConfig(dict):
             if 'device_model' not in self['platform']:
                 self['platform']['device_model'] = auxbin.pathTo("qemu-dm")
             # device_model may be set to 'qemu-dm' or 'stubdom-dm' w/o a path
-            if os.path.dirname(self['platform']['device_model']) != "":
+            if os.path.dirname(self['platform']['device_model']) == "":
                 self['platform']['device_model'] = \
                     auxbin.pathTo(self['platform']['device_model'])
+            if not os.path.exists(self['platform']['device_model']):
+                raise VmError("device model '%s' not found" % str(self['platform']['device_model']))
 
         if self.is_hvm():
             if 'timer_mode' not in self['platform']:

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