From: Tim Deegan Date: Thu, 8 Feb 2007 15:00:33 +0000 (+0000) Subject: [HVM] Save/restore: don't try to set the console ring MFN X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15347^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=de602931ef7752d469b206b21ffad7f38810cda6;p=xen.git [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 --- diff --git a/tools/libxc/xc_hvm_restore.c b/tools/libxc/xc_hvm_restore.c index 6622b49f79..4cf27fdb8b 100644 --- a/tools/libxc/xc_hvm_restore.c +++ b/tools/libxc/xc_hvm_restore.c @@ -69,7 +69,6 @@ read_exact(int fd, void *buf, size_t count) 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_fd, 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 --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h index 7b5a2af0a4..3800b0cb13 100644 --- a/tools/libxc/xenguest.h +++ b/tools/libxc/xenguest.h @@ -58,8 +58,7 @@ int xc_linux_restore(int xc_handle, int io_fd, uint32_t dom, */ 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 --git a/tools/libxc/xg_private.c b/tools/libxc/xg_private.c index f45c2ebb0d..6f4f28f988 100644 --- a/tools/libxc/xg_private.c +++ b/tools/libxc/xg_private.c @@ -210,8 +210,7 @@ int xc_hvm_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters, __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 --git a/tools/python/xen/xend/XendCheckpoint.py b/tools/python/xen/xend/XendCheckpoint.py index 6eda8edf76..63368bd654 100644 --- a/tools/python/xen/xend/XendCheckpoint.py +++ b/tools/python/xen/xend/XendCheckpoint.py @@ -239,8 +239,11 @@ def restore(xd, fd, dominfo = None, paused = False): 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 --git a/tools/xcutils/xc_restore.c b/tools/xcutils/xc_restore.c index 8e26d9bb70..6629e33082 100644 --- a/tools/xcutils/xc_restore.c +++ b/tools/xcutils/xc_restore.c @@ -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); }