direct-io.hg

changeset 13834:16ba1d434f89

[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@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Thu Feb 08 15:00:33 2007 +0000 (2007-02-08)
parents 9c88b5f3b4eb
children d609929f1408
files tools/libxc/xc_hvm_restore.c tools/libxc/xenguest.h tools/libxc/xg_private.c tools/python/xen/xend/XendCheckpoint.py tools/xcutils/xc_restore.c
line diff
     1.1 --- a/tools/libxc/xc_hvm_restore.c	Thu Feb 08 13:43:19 2007 +0000
     1.2 +++ b/tools/libxc/xc_hvm_restore.c	Thu Feb 08 15:00:33 2007 +0000
     1.3 @@ -69,7 +69,6 @@ read_exact(int fd, void *buf, size_t cou
     1.4  int xc_hvm_restore(int xc_handle, int io_fd,
     1.5                       uint32_t dom, unsigned long nr_pfns,
     1.6                       unsigned int store_evtchn, unsigned long *store_mfn,
     1.7 -                     unsigned int console_evtchn, unsigned long *console_mfn,
     1.8                       unsigned int pae, unsigned int apic)
     1.9  {
    1.10      DECLARE_DOMCTL;
    1.11 @@ -104,8 +103,8 @@ int xc_hvm_restore(int xc_handle, int io
    1.12      memsize = (unsigned long long)*store_mfn;
    1.13      v_end = memsize << 20;
    1.14  
    1.15 -    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", 
    1.16 -            dom, nr_pfns, store_evtchn, *store_mfn, console_evtchn, *console_mfn, pae, apic);
    1.17 +    DPRINTF("xc_hvm_restore:dom=%d, nr_pfns=0x%lx, store_evtchn=%d, *store_mfn=%ld, pae=%u, apic=%u.\n", 
    1.18 +            dom, nr_pfns, store_evtchn, *store_mfn, pae, apic);
    1.19  
    1.20      max_pfn = nr_pfns;
    1.21  
     2.1 --- a/tools/libxc/xenguest.h	Thu Feb 08 13:43:19 2007 +0000
     2.2 +++ b/tools/libxc/xenguest.h	Thu Feb 08 15:00:33 2007 +0000
     2.3 @@ -58,8 +58,7 @@ int xc_linux_restore(int xc_handle, int 
     2.4   */
     2.5  int xc_hvm_restore(int xc_handle, int io_fd, uint32_t dom,
     2.6                        unsigned long nr_pfns, unsigned int store_evtchn,
     2.7 -                      unsigned long *store_mfn, unsigned int console_evtchn,
     2.8 -                      unsigned long *console_mfn,
     2.9 +                      unsigned long *store_mfn, 
    2.10                        unsigned int pae, unsigned int apic);
    2.11  
    2.12  /**
     3.1 --- a/tools/libxc/xg_private.c	Thu Feb 08 13:43:19 2007 +0000
     3.2 +++ b/tools/libxc/xg_private.c	Thu Feb 08 15:00:33 2007 +0000
     3.3 @@ -210,8 +210,7 @@ int xc_hvm_save(int xc_handle, int io_fd
     3.4  __attribute__((weak)) 
     3.5  int xc_hvm_restore(int xc_handle, int io_fd, uint32_t dom,
     3.6                     unsigned long nr_pfns, unsigned int store_evtchn,
     3.7 -                   unsigned long *store_mfn, unsigned int console_evtchn,
     3.8 -                   unsigned long *console_mfn,
     3.9 +                   unsigned long *store_mfn,
    3.10                     unsigned int pae, unsigned int apic)
    3.11  {
    3.12      errno = ENOSYS;
     4.1 --- a/tools/python/xen/xend/XendCheckpoint.py	Thu Feb 08 13:43:19 2007 +0000
     4.2 +++ b/tools/python/xen/xend/XendCheckpoint.py	Thu Feb 08 15:00:33 2007 +0000
     4.3 @@ -239,8 +239,11 @@ def restore(xd, fd, dominfo = None, paus
     4.4  
     4.5          forkHelper(cmd, fd, handler.handler, True)
     4.6  
     4.7 -        if handler.store_mfn is None or handler.console_mfn is None:
     4.8 -            raise XendError('Could not read store/console MFN')
     4.9 +        if handler.store_mfn is None:
    4.10 +            raise XendError('Could not read store MFN')
    4.11 +
    4.12 +        if not is_hvm and handler.console_mfn is None:
    4.13 +            raise XendError('Could not read console MFN')        
    4.14  
    4.15          dominfo.waitForDevices() # Wait for backends to set up
    4.16          if not paused:
     5.1 --- a/tools/xcutils/xc_restore.c	Thu Feb 08 13:43:19 2007 +0000
     5.2 +++ b/tools/xcutils/xc_restore.c	Thu Feb 08 15:00:33 2007 +0000
     5.3 @@ -45,14 +45,15 @@ main(int argc, char **argv)
     5.4           /* pass the memsize to xc_hvm_restore to find the store_mfn */
     5.5          store_mfn = hvm;
     5.6          ret = xc_hvm_restore(xc_fd, io_fd, domid, nr_pfns, store_evtchn,
     5.7 -                &store_mfn, console_evtchn, &console_mfn, pae, apic);
     5.8 +                &store_mfn, pae, apic);
     5.9      } else 
    5.10          ret = xc_linux_restore(xc_fd, io_fd, domid, nr_pfns, store_evtchn,
    5.11                  &store_mfn, console_evtchn, &console_mfn);
    5.12  
    5.13      if (ret == 0) {
    5.14  	printf("store-mfn %li\n", store_mfn);
    5.15 -	printf("console-mfn %li\n", console_mfn);
    5.16 +        if (!hvm)
    5.17 +            printf("console-mfn %li\n", console_mfn);
    5.18  	fflush(stdout);
    5.19      }
    5.20