Skip to contentSkip to conversation

libxl/xl implement xen_platform_pci enable/disable

PATCH New Stefano Stabellini 1 participant 1 message Jun 7, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl/xl implement xen_platform_pci enable/disable

Hi all,
this patch implements xen_platform_pci support in xl/libxl to allow users to disable the xen platform pci device from the VM config file.

---

tools/libxl/libxl.c +1 -0
diff -r cb75117829a6 tools/libxl/libxl.c
@@ -1159,6 +1159,7 @@
 
     path = libxl_sprintf(ctx, "/local/domain/0/device-model/%d", info->domid);
     xs_mkdir(ctx->xsh, XBT_NULL, path);
+    libxl_xs_write(ctx, XBT_NULL, libxl_sprintf(ctx, "%s/disable_pf", path), "%d", !info->xen_platform_pci);
 
     libxl_create_logfile(ctx, libxl_sprintf(ctx, "qemu-dm-%s", info->dom_name), &logfile);
     logfile_w = open(logfile, O_WRONLY|O_CREAT, 0644);
tools/libxl/libxl.h +1 -0
diff -r cb75117829a6 tools/libxl/libxl.h
@@ -164,6 +164,7 @@
     bool apic; /* apic enabled or disabled */
     int vcpus; /* max number of vcpus */
     int vcpu_avail; /* vcpus actually available */
+    int xen_platform_pci; /* enable/disable the xen platform pci device */
     char **extra; /* extra parameters pass directly to qemu, NULL terminated */
     /* Network is missing */
 } libxl_device_model_info;
tools/libxl/xl_cmdimpl.c +3 -0
diff -r cb75117829a6 tools/libxl/xl_cmdimpl.c
@@ -240,6 +240,7 @@
     dm_info->boot = "cda";
     dm_info->usb = 0;
     dm_info->usbdevice = NULL;
+    dm_info->xen_platform_pci = 1;
 }
 
 static void init_nic_info(libxl_device_nic *nic_info, int devnum)
@@ -869,6 +870,8 @@
             dm_info->usb = l;
         if (!xlu_cfg_get_string (config, "usbdevice", &buf))
             dm_info->usbdevice = strdup(buf);
+        if (!xlu_cfg_get_long (config, "xen_platform_pci", &l))
+            dm_info->xen_platform_pci = l;
     }
 
     dm_info->type = c_info->hvm ? XENFV : XENPV;