bitkeeper revision 1.1159.258.36 (42305b3948mU75urrgzQftpV3eNPbg)
authoriap10@freefall.cl.cam.ac.uk <iap10@freefall.cl.cam.ac.uk>
Thu, 10 Mar 2005 14:35:37 +0000 (14:35 +0000)
committeriap10@freefall.cl.cam.ac.uk <iap10@freefall.cl.cam.ac.uk>
Thu, 10 Mar 2005 14:35:37 +0000 (14:35 +0000)
Tidy up ugly warning in debug builds from xc_linux_restore.
Signed-off-by: ian@xensource.com
tools/libxc/xc_linux_restore.c

index 1db39317de912f4187311ac6f23497720c8025be..46373a2806dc16ddd1b4c1a1395b1db2093e1041 100644 (file)
@@ -123,7 +123,7 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt)
     /* A temporary mapping of the guest's suspend record. */
     suspend_record_t *p_srec;
 
-    char *region_base;
+    char *region_base, *p_gdt;
 
     mmu_t *mmu = NULL;
 
@@ -565,6 +565,13 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt)
         ctxt.gdt_frames[i] = pfn_to_mfn_table[pfn];
     }
 
+    /* Zero hypervisor GDT entries (supresses ugly warning) */
+    p_gdt = xc_map_foreign_range(
+        xc_handle, dom, PAGE_SIZE, PROT_WRITE, ctxt.gdt_frames[0]);
+    memset( p_gdt + FIRST_RESERVED_GDT_ENTRY*8, 0,
+               NR_RESERVED_GDT_ENTRIES*8 );
+    munmap( p_gdt, PAGE_SIZE );
+
     /* Uncanonicalise the page table base pointer. */
     pfn = ctxt.pt_base >> PAGE_SHIFT;
     if ( (pfn >= nr_pfns) || ((pfn_type[pfn]&LTABTYPE_MASK) != L2TAB) )