Skip to contentSkip to conversation

xend: Give stubdom flag to xc_save

PATCH In review Yosuke Iwamatsu 1 participant 1 message Dec 16, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 xend: Give stubdom flag to xc_save

Thanks,
-----------------------
Yosuke Iwamatsu
NEC Corporation

xend: Give stubdom flag to xc_save.

tools/python/xen/xend/XendCheckpoint.py +2 -1
diff -r 6595393a3d28 tools/python/xen/xend/XendCheckpoint.py
@@ -90,6 +90,7 @@ def save(fd, dominfo, network, live, dst
 
         image_cfg = dominfo.info.get('image', {})
         hvm = dominfo.info.is_hvm()
+        stubdom = (dominfo.info.get_dm_type() == 'stubdom-dm')
 
         # xc_save takes three customization parameters: maxit, max_f, and
         # flags the last controls whether or not save is 'live', while the
@@ -99,7 +100,7 @@ def save(fd, dominfo, network, live, dst
         # more information.
         cmd = [xen.util.auxbin.pathTo(XC_SAVE), str(fd),
                str(dominfo.getDomid()), "0", "0", 
-               str(int(live) | (int(hvm) << 2)) ]
+               str(int(live) | (int(hvm) << 2) | (int(stubdom) << 4))]
         log.debug("[xc_save]: %s", string.join(cmd))
 
         def saveInputHandler(line, tochild):
tools/python/xen/xend/XendConfig.py +3 -0
diff -r 6595393a3d28 tools/python/xen/xend/XendConfig.py
@@ -1987,6 +1987,9 @@ class XendConfig(dict):
     def is_hvm(self):
         return self['HVM_boot_policy'] != ''
 
+    def get_dm_type(self):
+        return self['platform'].get('device_model', '').split('/')[-1]
+
     def target(self):
         return self['target']
 

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