]> xenbits.xensource.com Git - xenclient/xen.git/commitdiff
patch tools_get_vgapt_option
authorVincent Hanquez <vincent@snarc.org>
Wed, 17 Dec 2008 17:32:01 +0000 (17:32 +0000)
committerVincent Hanquez <vincent@snarc.org>
Wed, 17 Dec 2008 17:32:01 +0000 (17:32 +0000)
tools/libxc/xenguest.h
tools/libxc/xg_private.c
tools/python/xen/lowlevel/xc/xc.c
tools/python/xen/xend/XendConfig.py
tools/python/xen/xend/image.py
tools/python/xen/xm/create.py

index ba60326a47847c583eabb25d0cc68bec651010a4..4e96f376eba79bc89217e3ca9047dfb9135037dc 100644 (file)
@@ -125,10 +125,12 @@ int xc_linux_build_mem(int xc_handle,
                        unsigned int console_evtchn,
                        unsigned long *console_mfn);
 
+#define USE_VGA_PASSTHROUGH_IN_HVM_BUILD
 int xc_hvm_build(int xc_handle,
                  uint32_t domid,
                  int memsize,
-                 const char *image_name);
+                 const char *image_name,
+                 int vga_pt_enabled);
 
 int xc_hvm_build_mem(int xc_handle,
                      uint32_t domid,
index d7620933cdda3f428e1b23b380b111a28211af4e..5067488a0139a1a51e560f4bcb522d377fcb6387 100644 (file)
@@ -177,7 +177,8 @@ __attribute__((weak))
     int xc_hvm_build(int xc_handle,
                      uint32_t domid,
                      int memsize,
-                     const char *image_name)
+                     const char *image_name,
+                     int vga_pt_enabled)
 {
     errno = ENOSYS;
     return -1;
index 59a16b3ee7bf4d7659b6c02c3b4086f123bc9c0d..ee51a7e3662884218e9cabd6406bd6601b2f5509 100644 (file)
@@ -887,17 +887,17 @@ static PyObject *pyxc_hvm_build(XcObject *self,
     int i;
 #endif
     char *image;
-    int memsize, vcpus = 1, acpi = 0, apic = 1;
+    int memsize, vcpus = 1, acpi = 0, apic = 1, vga_pt = 0;
 
     static char *kwd_list[] = { "domid",
                                 "memsize", "image", "vcpus", "acpi",
-                                "apic", NULL };
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iii", kwd_list,
+                               "apic", "vga_pt", NULL };
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list,
                                       &dom, &memsize,
-                                      &image, &vcpus, &acpi, &apic) )
+                                      &image, &vcpus, &acpi, &apic, &vga_pt) )
         return NULL;
 
-    if ( xc_hvm_build(self->xc_handle, dom, memsize, image) != 0 )
+    if ( xc_hvm_build(self->xc_handle, dom, memsize, image, vga_pt) != 0 )
         return pyxc_error_to_exception();
 
 #if !defined(__ia64__)
index b16a90710ecf7476836a3205559abf36a042c090..156648117317e2abec01715b84d75feb1c082edf 100644 (file)
@@ -166,6 +166,8 @@ XENAPI_PLATFORM_CFG_TYPES = {
     'guest_os_type': str,
     'hap': int,
     'xen_extended_power_mgmt': int,
+    'vga_passthrough' : int,
+    'dom0_input' : str,
 }
 
 # Xen API console 'other_config' keys.
index e101665a150fae7af9bc4407fbc0f66387c0dd32..6b55a9491c8eb750b88083e183ece8b43a33b966 100644 (file)
@@ -268,6 +268,9 @@ class ImageHandler:
         vnc_config = {}
         has_vnc = int(vmConfig['platform'].get('vnc', 0)) != 0
         has_sdl = int(vmConfig['platform'].get('sdl', 0)) != 0
+        has_vga_passthrough = int(vmConfig['platform'].get('vga_passthrough', 0)) != 0;
+        dom0_input = vmConfig['platform'].get('dom0_input');
+
         opengl = 1
         keymap = vmConfig['platform'].get("keymap")
         for dev_uuid in vmConfig['console_refs']:
@@ -290,7 +293,7 @@ class ImageHandler:
             ret.append("-k")
             ret.append(keymap)
 
-        if has_vnc:
+        if has_vnc and not has_vga_passthrough:
             if not vnc_config:
                 for key in ('vncunused', 'vnclisten', 'vncdisplay',
                             'vncpasswd'):
@@ -340,6 +343,13 @@ class ImageHandler:
 
         if int(vmConfig['platform'].get('monitor', 0)) != 0:
             ret = ret + ['-monitor', 'vc']
+
+        if has_vga_passthrough:
+            ret.append('-vga-passthrough');
+        if dom0_input:
+            ret.append('-dom0-input')
+            ret.append(dom0_input);
+
         return ret
 
     def getDeviceModelArgs(self, restore = False):
@@ -703,6 +713,7 @@ class HVMImageHandler(ImageHandler):
         self.apic = int(vmConfig['platform'].get('apic', 0))
         self.acpi = int(vmConfig['platform'].get('acpi', 0))
         self.guest_os_type = vmConfig['platform'].get('guest_os_type')
+        self.vga_pt = int(vmConfig['platform'].get('vga_passthrough', 0))
            
 
     # Return a list of cmd line args to the device models based on the
@@ -808,13 +819,15 @@ class HVMImageHandler(ImageHandler):
         log.debug("vcpus          = %d", self.vm.getVCpuCount())
         log.debug("acpi           = %d", self.acpi)
         log.debug("apic           = %d", self.apic)
+        log.debug("vga_pt         = %d", self.vga_pt)
 
         rc = xc.hvm_build(domid          = self.vm.getDomid(),
                           image          = self.loader,
                           memsize        = mem_mb,
                           vcpus          = self.vm.getVCpuCount(),
                           acpi           = self.acpi,
-                          apic           = self.apic)
+                          apic           = self.apic,
+                          vga_pt         = self.vga_pt)
         rc['notes'] = { 'SUSPEND_CANCEL': 1 }
 
         rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
index 11661e7e10506169489105ea10fde78771fffaa1..f8a1edf1788ca7cfba8cc70480f8054d0a038f47 100644 (file)
@@ -869,7 +869,7 @@ def configure_hvm(config_image, vals):
              'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor',
              'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
              'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check',
-             'viridian', 'xen_extended_power_mgmt' ]
+             'viridian', 'xen_extended_power_mgmt', 'vga_passthrough', 'dom0_input' ]
 
     for a in args:
         if a in vals.__dict__ and vals.__dict__[a] is not None: