# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1170946833 0
# Node ID 16ba1d434f89f8a1dfe201ad40ea2781093f1b45
# Parent 9c88b5f3b4ebeed872c2395cd83f738e77592c10
[HVM] Save/restore: don't try to set the console ring MFN
in a HVM restore. In particular, don't print an uninitialized stack
variable, which causes XMLRPC exceptions in xend.
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
tools/libxc/xc_hvm_restore.c | 5 ++---
tools/libxc/xenguest.h | 3 +--
tools/libxc/xg_private.c | 3 +--
tools/python/xen/xend/XendCheckpoint.py | 7 +++++--
tools/xcutils/xc_restore.c | 5 +++--
5 files changed, 12 insertions(+), 11 deletions(-)
diff -r 9c88b5f3b4eb -r 16ba1d434f89 tools/libxc/xc_hvm_restore.c
--- a/tools/libxc/xc_hvm_restore.c Thu Feb 08 13:43:19 2007 +0000
+++ b/tools/libxc/xc_hvm_restore.c Thu Feb 08 15:00:33 2007 +0000
@@ -69,7 +69,6 @@ int xc_hvm_restore(int xc_handle, int io
int xc_hvm_restore(int xc_handle, int io_fd,
uint32_t dom, unsigned long nr_pfns,
unsigned int store_evtchn, unsigned long *store_mfn,
- unsigned int console_evtchn, unsigned long *console_mfn,
unsigned int pae, unsigned int apic)
{
DECLARE_DOMCTL;
@@ -104,8 +103,8 @@ int xc_hvm_restore(int xc_handle, int io
memsize = (unsigned long long)*store_mfn;
v_end = memsize << 20;
- DPRINTF("xc_hvm_restore:dom=%d, nr_pfns=0x%lx, store_evtchn=%d,
*store_mfn=%ld, console_evtchn=%d, *console_mfn=%ld, pae=%u, apic=%u.\n",
- dom, nr_pfns, store_evtchn, *store_mfn, console_evtchn,
*console_mfn, pae, apic);
+ DPRINTF("xc_hvm_restore:dom=%d, nr_pfns=0x%lx, store_evtchn=%d,
*store_mfn=%ld, pae=%u, apic=%u.\n",
+ dom, nr_pfns, store_evtchn, *store_mfn, pae, apic);
max_pfn = nr_pfns;
diff -r 9c88b5f3b4eb -r 16ba1d434f89 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h Thu Feb 08 13:43:19 2007 +0000
+++ b/tools/libxc/xenguest.h Thu Feb 08 15:00:33 2007 +0000
@@ -58,8 +58,7 @@ int xc_linux_restore(int xc_handle, int
*/
int xc_hvm_restore(int xc_handle, int io_fd, uint32_t dom,
unsigned long nr_pfns, unsigned int store_evtchn,
- unsigned long *store_mfn, unsigned int console_evtchn,
- unsigned long *console_mfn,
+ unsigned long *store_mfn,
unsigned int pae, unsigned int apic);
/**
diff -r 9c88b5f3b4eb -r 16ba1d434f89 tools/libxc/xg_private.c
--- a/tools/libxc/xg_private.c Thu Feb 08 13:43:19 2007 +0000
+++ b/tools/libxc/xg_private.c Thu Feb 08 15:00:33 2007 +0000
@@ -210,8 +210,7 @@ __attribute__((weak))
__attribute__((weak))
int xc_hvm_restore(int xc_handle, int io_fd, uint32_t dom,
unsigned long nr_pfns, unsigned int store_evtchn,
- unsigned long *store_mfn, unsigned int console_evtchn,
- unsigned long *console_mfn,
+ unsigned long *store_mfn,
unsigned int pae, unsigned int apic)
{
errno = ENOSYS;
diff -r 9c88b5f3b4eb -r 16ba1d434f89 tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py Thu Feb 08 13:43:19 2007 +0000
+++ b/tools/python/xen/xend/XendCheckpoint.py Thu Feb 08 15:00:33 2007 +0000
@@ -239,8 +239,11 @@ def restore(xd, fd, dominfo = None, paus
forkHelper(cmd, fd, handler.handler, True)
- if handler.store_mfn is None or handler.console_mfn is None:
- raise XendError('Could not read store/console MFN')
+ if handler.store_mfn is None:
+ raise XendError('Could not read store MFN')
+
+ if not is_hvm and handler.console_mfn is None:
+ raise XendError('Could not read console MFN')
dominfo.waitForDevices() # Wait for backends to set up
if not paused:
diff -r 9c88b5f3b4eb -r 16ba1d434f89 tools/xcutils/xc_restore.c
--- a/tools/xcutils/xc_restore.c Thu Feb 08 13:43:19 2007 +0000
+++ b/tools/xcutils/xc_restore.c Thu Feb 08 15:00:33 2007 +0000
@@ -45,14 +45,15 @@ main(int argc, char **argv)
/* pass the memsize to xc_hvm_restore to find the store_mfn */
store_mfn = hvm;
ret = xc_hvm_restore(xc_fd, io_fd, domid, nr_pfns, store_evtchn,
- &store_mfn, console_evtchn, &console_mfn, pae, apic);
+ &store_mfn, pae, apic);
} else
ret = xc_linux_restore(xc_fd, io_fd, domid, nr_pfns, store_evtchn,
&store_mfn, console_evtchn, &console_mfn);
if (ret == 0) {
printf("store-mfn %li\n", store_mfn);
- printf("console-mfn %li\n", console_mfn);
+ if (!hvm)
+ printf("console-mfn %li\n", console_mfn);
fflush(stdout);
}
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|