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-devel

[Xen-devel] [PATCH] libxc: failure to save/restore 32bit HVM guest

To: "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] libxc: failure to save/restore 32bit HVM guest
From: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>
Date: Mon, 23 Nov 2009 15:14:06 -0800
Cc:
Delivery-date: Mon, 23 Nov 2009 15:14:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Following appears to be an obvious bug. Save/restore of HVM guests
works fine after the following fix. Including the patch, please let me
know if you agree. I'll make parallel fix in our previous versions
here.

thanks,
Mukesh


Signed-off-by: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>

diff -r c8caa281a75a tools/libxc/xc_core.c
--- a/tools/libxc/xc_core.c     Mon Nov 23 08:06:54 2009 +0000
+++ b/tools/libxc/xc_core.c     Mon Nov 23 15:10:33 2009 -0800
@@ -628,7 +628,7 @@
         PERROR("Could not get section header for .xen_prstatus");
         goto out;
     }
-    filesz = sizeof(ctxt[0].c) * nr_vcpus;
+    filesz = sizeof(*ctxt) * nr_vcpus;
     sts = xc_core_shdr_set(shdr, strtab, XEN_DUMPCORE_SEC_PRSTATUS,
                            SHT_PROGBITS, offset, filesz,
                            __alignof__(ctxt[0].c), sizeof(ctxt[0].c));
@@ -755,7 +755,7 @@
         goto out;
 
     /* prstatus: .xen_prstatus */
-    sts = dump_rtn(args, (char *)&ctxt[0].c, sizeof(ctxt[0].c) *
nr_vcpus);
+    sts = dump_rtn(args, (char *)&ctxt[0].c, sizeof(*ctxt) * nr_vcpus);
     if ( sts != 0 )
         goto out;

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