[HVM] Save/restore: don't try to set the console ring MFN
authorTim Deegan <Tim.Deegan@xensource.com>
Thu, 8 Feb 2007 15:00:33 +0000 (15:00 +0000)
committerTim Deegan <Tim.Deegan@xensource.com>
Thu, 8 Feb 2007 15:00:33 +0000 (15:00 +0000)
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>
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

index 6622b49f79cfbcbdfd56acda9cbbc98699fd2a51..4cf27fdb8bfde3d840a51369f8fa161641a8bcbf 100644 (file)
@@ -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;
 
index 7b5a2af0a4b599fb769a81c5c421678fe41f59a4..3800b0cb13cfdff6b234536a6e890ad6bcfd5479 100644 (file)
@@ -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);
 
 /**
index f45c2ebb0db70f4404b553ab26722ca07eced2ce..6f4f28f988ffa82f2b2ed63360eb055ec448e61c 100644 (file)
@@ -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;
index 6eda8edf767d1deac9991fb66df13afba3c85128..63368bd654f48fc442385e51e363d073c4a15b91 100644 (file)
@@ -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:
index 8e26d9bb70bf6ddd23ded22c616a47b77deae673..6629e3308288f1faa98b81233703e9b08205866e 100644 (file)
@@ -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);
     }