ia64/xen-unstable

changeset 5088:9e133359e477

bitkeeper revision 1.1510 (4291adbf-g-WMA-w33q-SnHuwoX3BA)

XendDomain.py, xc_linux_save.c:
Re-arrange layout of save/restore file.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Mon May 23 10:17:35 2005 +0000 (2005-05-23)
parents 3a30cc8f8ec3
children b04f8c2a95d6
files tools/libxc/xc_linux_save.c tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/libxc/xc_linux_save.c	Mon May 23 08:51:36 2005 +0000
     1.2 +++ b/tools/libxc/xc_linux_save.c	Mon May 23 10:17:35 2005 +0000
     1.3 @@ -638,9 +638,7 @@ int xc_linux_save(int xc_handle, XcIOCon
     1.4  
     1.5      /* Start writing out the saved-domain record. */
     1.6  
     1.7 -    if ( xcio_write(ioctxt, "LinuxGuestRecord",    16) ||
     1.8 -         xcio_write(ioctxt, &nr_pfns,              sizeof(unsigned long)) ||
     1.9 -         xcio_write(ioctxt, pfn_to_mfn_frame_list, PAGE_SIZE) ){
    1.10 +    if ( xcio_write(ioctxt, "LinuxGuestRecord",    16) ){
    1.11          xcio_error(ioctxt, "Error writing header");
    1.12          goto out;
    1.13      }
    1.14 @@ -648,6 +646,11 @@ int xc_linux_save(int xc_handle, XcIOCon
    1.15          xcio_error(ioctxt, "Error writing vmconfig");
    1.16          goto out;
    1.17      }
    1.18 +    if ( xcio_write(ioctxt, &nr_pfns,              sizeof(unsigned long)) ||
    1.19 +         xcio_write(ioctxt, pfn_to_mfn_frame_list, PAGE_SIZE) ){
    1.20 +        xcio_error(ioctxt, "Error writing header");
    1.21 +        goto out;
    1.22 +    }
    1.23  
    1.24      print_stats( xc_handle, domid, 0, &stats, 0 );
    1.25  
     2.1 --- a/tools/python/xen/xend/XendDomain.py	Mon May 23 08:51:36 2005 +0000
     2.2 +++ b/tools/python/xen/xend/XendDomain.py	Mon May 23 10:17:35 2005 +0000
     2.3 @@ -342,16 +342,6 @@ class XendDomain:
     2.4                  raise XendError("not a valid guest state file: found '%s'" %
     2.5                                  signature)
     2.6  
     2.7 -            l = fd.read_exact(sizeof_unsigned_long,
     2.8 -                              "not a valid guest state file: pfn count read")
     2.9 -            nr_pfns = unpack("=L", l)[0]   # XXX endianess
    2.10 -            if nr_pfns > 1024*1024:     # XXX
    2.11 -                raise XendError(
    2.12 -                    "not a valid guest state file: pfn count out of range")
    2.13 -
    2.14 -            pfn_to_mfn_frame_list = fd.read_exact(PAGE_SIZE,
    2.15 -                "not a valid guest state file: pfn_to_mfn_frame_list read")
    2.16 -
    2.17              l = fd.read_exact(sizeof_int,
    2.18                                "not a valid guest state file: config size read")
    2.19              vmconfig_size = unpack("i", l)[0] # XXX endianess
    2.20 @@ -366,6 +356,16 @@ class XendDomain:
    2.21              vmconfig = p.get_val()
    2.22              dominfo = self.domain_configure(vmconfig)
    2.23  
    2.24 +            l = fd.read_exact(sizeof_unsigned_long,
    2.25 +                              "not a valid guest state file: pfn count read")
    2.26 +            nr_pfns = unpack("=L", l)[0]   # XXX endianess
    2.27 +            if nr_pfns > 1024*1024:     # XXX
    2.28 +                raise XendError(
    2.29 +                    "not a valid guest state file: pfn count out of range")
    2.30 +
    2.31 +            pfn_to_mfn_frame_list = fd.read_exact(PAGE_SIZE,
    2.32 +                "not a valid guest state file: pfn_to_mfn_frame_list read")
    2.33 +
    2.34              # XXXcl hack: fd.tell will sync up the object and
    2.35              #             underlying file descriptor
    2.36              ignore = fd.tell()