ia64: Fix ia64 PV domain creation with new vhpt-size parameter.
authorKeir Fraser <keir@xensource.com>
Mon, 22 Oct 2007 13:21:13 +0000 (14:21 +0100)
committerKeir Fraser <keir@xensource.com>
Mon, 22 Oct 2007 13:21:13 +0000 (14:21 +0100)
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
tools/libxc/xc_dom.h
tools/libxc/xc_dom_ia64.c
tools/python/xen/lowlevel/xc/xc.c
tools/python/xen/xend/image.py

index 2a42b874fec8424b9d1903ee65f74e75d691085a..30111c98e2ac8da8580d5c0453ea7651282498e6 100644 (file)
@@ -95,6 +95,7 @@ struct xc_dom_image {
 
     int guest_xc;
     domid_t guest_domid;
+    int8_t vhpt_size_log2; /* for IA64 */
     int shadow_enabled;
 
     int xen_version;
index 1211eead52e284e6868ba7716c689cb8151e562f..fa2c9e61f7dc2bc2f33aaf8d0c9874c5a0c4244b 100644 (file)
@@ -260,7 +260,7 @@ int arch_setup_bootearly(struct xc_dom_image *dom)
     domctl.u.arch_setup.bp = (dom->start_info_pfn << PAGE_SHIFT)
         + sizeof(start_info_t);
     domctl.u.arch_setup.maxmem = dom->total_pages << PAGE_SHIFT;
-    domctl.u.arch_setup.vhpt_size_log2 = dom->flags;
+    domctl.u.arch_setup.vhpt_size_log2 = dom->vhpt_size_log2;
     rc = do_domctl(dom->guest_xc, &domctl);
     return rc;
 }
index 2cf5c5bb73364e815f9430e344905712ffffa1dc..4a2a64715ef6c163e1b22b36fb51fb62837d1426 100644 (file)
@@ -413,6 +413,7 @@ static PyObject *pyxc_linux_build(XcObject *self,
     char *image, *ramdisk = NULL, *cmdline = "", *features = NULL;
     int flags = 0;
     int store_evtchn, console_evtchn;
+    int vhpt = 0;
     unsigned int mem_mb;
     unsigned long store_mfn = 0;
     unsigned long console_mfn = 0;
@@ -425,20 +426,23 @@ static PyObject *pyxc_linux_build(XcObject *self,
                                 "console_evtchn", "image",
                                 /* optional */
                                 "ramdisk", "cmdline", "flags",
-                                "features", NULL };
+                                "features", "vhpt", NULL };
 
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssis", kwd_list,
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiis|ssisi", kwd_list,
                                       &domid, &store_evtchn, &mem_mb,
                                       &console_evtchn, &image,
                                       /* optional */
                                       &ramdisk, &cmdline, &flags,
-                                      &features) )
+                                      &features, &vhpt) )
         return NULL;
 
     xc_dom_loginit();
     if (!(dom = xc_dom_allocate(cmdline, features)))
         return pyxc_error_to_exception();
 
+    /* for IA64 */
+    dom->vhpt_size_log2 = vhpt;
+
     if ( xc_dom_linux_build(self->xc_handle, dom, domid, mem_mb, image,
                            ramdisk, flags, store_evtchn, &store_mfn,
                            console_evtchn, &console_mfn) != 0 ) {
index 0cd8fa4a07d2de71458d7ad8a41bacc2a5f03f9b..16e842bddd57fa5f0b06276cb6e6131f509e41a5 100644 (file)
@@ -198,6 +198,7 @@ class LinuxImageHandler(ImageHandler):
 
     ostype = "linux"
     flags = 0
+    vhpt = 0
 
     def buildDomain(self):
         store_evtchn = self.vm.getStorePort()
@@ -225,7 +226,8 @@ class LinuxImageHandler(ImageHandler):
                               cmdline        = self.cmdline,
                               ramdisk        = self.ramdisk,
                               features       = self.vm.getFeatures(),
-                              flags          = self.flags)
+                              flags          = self.flags,
+                              vhpt           = self.vhpt)
 
 class PPC_LinuxImageHandler(LinuxImageHandler):
 
@@ -533,9 +535,6 @@ class IA64_Linux_ImageHandler(LinuxImageHandler):
         LinuxImageHandler.configure(self, vmConfig)
         self.vhpt = int(vmConfig['platform'].get('vhpt',  0))
 
-    def buildDomain(self):
-        self.flags = self.vhpt
-        return LinuxImageHandler.buildDomain(self)
 
 class X86_HVM_ImageHandler(HVMImageHandler):