All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxl: do not ignore the per-device msitranslate and power_mgmt opts
@ 2012-06-27 13:53 Stefano Stabellini
  2012-06-27 14:59 ` Ian Campbell
  0 siblings, 1 reply; 3+ messages in thread
From: Stefano Stabellini @ 2012-06-27 13:53 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Campbell, Stefano Stabellini

Do not ignore the per-device msitranslate and power_mgmt options: they
need to be appended to the bdf.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index de1b79f..d329fa6 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -21,6 +21,7 @@
 #define PCI_BDF                "%04x:%02x:%02x.%01x"
 #define PCI_BDF_SHORT          "%02x:%02x.%01x"
 #define PCI_BDF_VDEVFN         "%04x:%02x:%02x.%01x@%02x"
+#define PCI_OPTIONS            "msitranslate=%d,power_mgmt=%d"
 #define PCI_BDF_XSPATH         "%04x-%02x-%02x-%01x"
 
 static unsigned int pcidev_encode_bdf(libxl_device_pci *pcidev)
@@ -814,12 +815,14 @@ static int qemu_pci_add_xenstore(libxl__gc *gc, uint32_t domid,
     path = libxl__sprintf(gc, "/local/domain/0/device-model/%d/parameter",
                           domid);
     if (pcidev->vdevfn) {
-        libxl__xs_write(gc, XBT_NULL, path, PCI_BDF_VDEVFN,
+        libxl__xs_write(gc, XBT_NULL, path, PCI_BDF_VDEVFN","PCI_OPTIONS,
                         pcidev->domain, pcidev->bus, pcidev->dev,
-                        pcidev->func, pcidev->vdevfn);
+                        pcidev->func, pcidev->vdevfn, pcidev->msitranslate,
+                        pcidev->power_mgmt);
     } else {
-        libxl__xs_write(gc, XBT_NULL, path, PCI_BDF, pcidev->domain,
-                        pcidev->bus, pcidev->dev, pcidev->func);
+        libxl__xs_write(gc, XBT_NULL, path, PCI_BDF","PCI_OPTIONS,
+                        pcidev->domain,  pcidev->bus, pcidev->dev,
+                        pcidev->func, pcidev->msitranslate, pcidev->power_mgmt);
     }
 
     libxl__qemu_traditional_cmd(gc, domid, "pci-ins");

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] libxl: do not ignore the per-device msitranslate and power_mgmt opts
  2012-06-27 13:53 [PATCH] libxl: do not ignore the per-device msitranslate and power_mgmt opts Stefano Stabellini
@ 2012-06-27 14:59 ` Ian Campbell
  2012-06-28 14:50   ` Ian Jackson
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2012-06-27 14:59 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel

On Wed, 2012-06-27 at 14:53 +0100, Stefano Stabellini wrote:
> Do not ignore the per-device msitranslate and power_mgmt options: they
> need to be appended to the bdf.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> 
> diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
> index de1b79f..d329fa6 100644
> --- a/tools/libxl/libxl_pci.c
> +++ b/tools/libxl/libxl_pci.c
> @@ -21,6 +21,7 @@
>  #define PCI_BDF                "%04x:%02x:%02x.%01x"
>  #define PCI_BDF_SHORT          "%02x:%02x.%01x"
>  #define PCI_BDF_VDEVFN         "%04x:%02x:%02x.%01x@%02x"
> +#define PCI_OPTIONS            "msitranslate=%d,power_mgmt=%d"
>  #define PCI_BDF_XSPATH         "%04x-%02x-%02x-%01x"
>  
>  static unsigned int pcidev_encode_bdf(libxl_device_pci *pcidev)
> @@ -814,12 +815,14 @@ static int qemu_pci_add_xenstore(libxl__gc *gc, uint32_t domid,
>      path = libxl__sprintf(gc, "/local/domain/0/device-model/%d/parameter",
>                            domid);
>      if (pcidev->vdevfn) {
> -        libxl__xs_write(gc, XBT_NULL, path, PCI_BDF_VDEVFN,
> +        libxl__xs_write(gc, XBT_NULL, path, PCI_BDF_VDEVFN","PCI_OPTIONS,
>                          pcidev->domain, pcidev->bus, pcidev->dev,
> -                        pcidev->func, pcidev->vdevfn);
> +                        pcidev->func, pcidev->vdevfn, pcidev->msitranslate,
> +                        pcidev->power_mgmt);
>      } else {
> -        libxl__xs_write(gc, XBT_NULL, path, PCI_BDF, pcidev->domain,
> -                        pcidev->bus, pcidev->dev, pcidev->func);
> +        libxl__xs_write(gc, XBT_NULL, path, PCI_BDF","PCI_OPTIONS,
> +                        pcidev->domain,  pcidev->bus, pcidev->dev,
> +                        pcidev->func, pcidev->msitranslate, pcidev->power_mgmt);
>      }
>  
>      libxl__qemu_traditional_cmd(gc, domid, "pci-ins");

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libxl: do not ignore the per-device msitranslate and power_mgmt opts
  2012-06-27 14:59 ` Ian Campbell
@ 2012-06-28 14:50   ` Ian Jackson
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Jackson @ 2012-06-28 14:50 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel, Stefano Stabellini

Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: do not ignore the per-device msitranslate and power_mgmt opts"):
> On Wed, 2012-06-27 at 14:53 +0100, Stefano Stabellini wrote:
> > Do not ignore the per-device msitranslate and power_mgmt options: they
> > need to be appended to the bdf.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-28 14:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-27 13:53 [PATCH] libxl: do not ignore the per-device msitranslate and power_mgmt opts Stefano Stabellini
2012-06-27 14:59 ` Ian Campbell
2012-06-28 14:50   ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.