From: Mukesh Rathor Subject: [PATCH] libxc: failure to save/restore 32bit HVM guest Date: Mon, 23 Nov 2009 15:14:06 -0800 Message-ID: <20091123151406.36e032c8@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org 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 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;