[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] XendDomain.py, xc_linux_save.c:



ChangeSet 1.1510, 2005/05/23 11:17:35+01:00, cl349@xxxxxxxxxxxxxxxxxxxx

        XendDomain.py, xc_linux_save.c:
          Re-arrange layout of save/restore file.
        Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>



 libxc/xc_linux_save.c         |    9 ++++++---
 python/xen/xend/XendDomain.py |   20 ++++++++++----------
 2 files changed, 16 insertions(+), 13 deletions(-)


diff -Nru a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c       2005-05-23 12:04:36 -04:00
+++ b/tools/libxc/xc_linux_save.c       2005-05-23 12:04:36 -04:00
@@ -638,14 +638,17 @@
 
     /* Start writing out the saved-domain record. */
 
-    if ( xcio_write(ioctxt, "LinuxGuestRecord",    16) ||
-         xcio_write(ioctxt, &nr_pfns,              sizeof(unsigned long)) ||
-         xcio_write(ioctxt, pfn_to_mfn_frame_list, PAGE_SIZE) ){
+    if ( xcio_write(ioctxt, "LinuxGuestRecord",    16) ){
         xcio_error(ioctxt, "Error writing header");
         goto out;
     }
     if(write_vmconfig(ioctxt)){
         xcio_error(ioctxt, "Error writing vmconfig");
+        goto out;
+    }
+    if ( xcio_write(ioctxt, &nr_pfns,              sizeof(unsigned long)) ||
+         xcio_write(ioctxt, pfn_to_mfn_frame_list, PAGE_SIZE) ){
+        xcio_error(ioctxt, "Error writing header");
         goto out;
     }
 
diff -Nru a/tools/python/xen/xend/XendDomain.py 
b/tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       2005-05-23 12:04:36 -04:00
+++ b/tools/python/xen/xend/XendDomain.py       2005-05-23 12:04:36 -04:00
@@ -342,16 +342,6 @@
                 raise XendError("not a valid guest state file: found '%s'" %
                                 signature)
 
-            l = fd.read_exact(sizeof_unsigned_long,
-                              "not a valid guest state file: pfn count read")
-            nr_pfns = unpack("=L", l)[0]   # XXX endianess
-            if nr_pfns > 1024*1024:     # XXX
-                raise XendError(
-                    "not a valid guest state file: pfn count out of range")
-
-            pfn_to_mfn_frame_list = fd.read_exact(PAGE_SIZE,
-                "not a valid guest state file: pfn_to_mfn_frame_list read")
-
             l = fd.read_exact(sizeof_int,
                               "not a valid guest state file: config size read")
             vmconfig_size = unpack("i", l)[0] # XXX endianess
@@ -365,6 +355,16 @@
 
             vmconfig = p.get_val()
             dominfo = self.domain_configure(vmconfig)
+
+            l = fd.read_exact(sizeof_unsigned_long,
+                              "not a valid guest state file: pfn count read")
+            nr_pfns = unpack("=L", l)[0]   # XXX endianess
+            if nr_pfns > 1024*1024:     # XXX
+                raise XendError(
+                    "not a valid guest state file: pfn count out of range")
+
+            pfn_to_mfn_frame_list = fd.read_exact(PAGE_SIZE,
+                "not a valid guest state file: pfn_to_mfn_frame_list read")
 
             # XXXcl hack: fd.tell will sync up the object and
             #             underlying file descriptor

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.