WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Tidy up the restore path following HVM sa

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Tidy up the restore path following HVM save/restore patches.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Jan 2007 10:45:07 -0800
Delivery-date: Fri, 19 Jan 2007 10:45:14 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1169201559 0
# Node ID 683bc79cf579d83be451daded565454d81dffdea
# Parent  5633bb2abeafb08485aaea712c36aaf19f5517f5
Tidy up the restore path following HVM save/restore patches.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendCheckpoint.py |   26 ++++++++++----------------
 1 files changed, 10 insertions(+), 16 deletions(-)

diff -r 5633bb2abeaf -r 683bc79cf579 tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Thu Jan 18 18:19:54 2007 -0800
+++ b/tools/python/xen/xend/XendCheckpoint.py   Fri Jan 19 10:12:39 2007 +0000
@@ -175,29 +175,24 @@ def restore(xd, fd, dominfo = None, paus
     nr_pfns = (dominfo.getMemoryTarget() + 3) / 4 
 
     # if hvm, pass mem size to calculate the store_mfn
-    hvm  = 0
-    apic = 0
-    pae  = 0
     image_cfg = dominfo.info.get('image', {})
-    hvm  = image_cfg.has_key('hvm')
-    if hvm:
-        # the 'memory' in config has been removed
+    is_hvm  = image_cfg.has_key('hvm')
+    if is_hvm:
         hvm  = dominfo.info['memory_static_min']
         apic = dominfo.info['image']['hvm'].get('apic', 0)
         pae  = dominfo.info['image']['hvm'].get('pae',  0)
         log.info("restore hvm domain %d, mem=%d, apic=%d, pae=%d",
                  dominfo.domid, hvm, apic, pae)
+    else:
+        hvm  = 0
+        apic = 0
+        pae  = 0
 
     try:
-        if hvm:
-            l = read_exact(fd, sizeof_unsigned_int,
-                           "not a valid hvm guest state file: pfn count read")
-            nr_pfns = unpack("I", l)[0]    # native sizeof int
-        else: 
-            l = read_exact(fd, sizeof_unsigned_long,
-                           "not a valid guest state file: pfn count read")
-
+        l = read_exact(fd, sizeof_unsigned_long,
+                       "not a valid guest state file: pfn count read")
         max_pfn = unpack("L", l)[0]    # native sizeof long
+
         if max_pfn > 16*1024*1024:     # XXX 
             raise XendError(
                 "not a valid guest state file: pfn count out of range")
@@ -208,7 +203,6 @@ def restore(xd, fd, dominfo = None, paus
                   dominfo.info['memory_static_max'],
                   dominfo.info['memory_static_min'], nr_pfns)
 
-
         balloon.free(xc.pages_to_kib(nr_pfns) + shadow * 1024)
 
         shadow_cur = xc.shadow_mem_control(dominfo.getDomid(), shadow)
@@ -231,7 +225,7 @@ def restore(xd, fd, dominfo = None, paus
             dominfo.unpause()
 
          # get qemu state and create a tmp file for dm restore
-        if hvm:
+        if is_hvm:
             qemu_signature = read_exact(fd, len(QEMU_SIGNATURE),
                                         "invalid device model signature read")
             if qemu_signature != QEMU_SIGNATURE:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Tidy up the restore path following HVM save/restore patches., Xen patchbot-unstable <=