From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v3 24/24] xl: Add new option dtdev Date: Mon, 23 Feb 2015 14:45:31 +0000 Message-ID: <1424702731.27930.129.camel@citrix.com> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-25-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YPuHj-00059p-NO for xen-devel@lists.xenproject.org; Mon, 23 Feb 2015 14:46:59 +0000 In-Reply-To: <1421159133-31526-25-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, tim@xen.org, Ian Jackson , stefano.stabellini@citrix.com, Wei Liu List-Id: xen-devel@lists.xenproject.org On Tue, 2015-01-13 at 14:25 +0000, Julien Grall wrote: > The option "dtdev" will be used to passthrough a non-PCI device described > in the device tree to a guest. > > Signed-off-by: Julien Grall > Cc: Ian Jackson > Cc: Wei Liu > > --- > Changes in v2: > - libxl_device_dt has been rename to libxl_device_dtdev > - use xrealloc instead of realloc > --- > docs/man/xl.cfg.pod.5 | 5 +++++ > tools/libxl/xl_cmdimpl.c | 21 ++++++++++++++++++++- > 2 files changed, 25 insertions(+), 1 deletion(-) > > diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 > index 225b782..cfd3d5f 100644 > --- a/docs/man/xl.cfg.pod.5 > +++ b/docs/man/xl.cfg.pod.5 > @@ -721,6 +721,11 @@ More information about Xen gfx_passthru feature is available > on the XenVGAPassthrough L > wiki page. > > +=item B > + > +Specifies the host device node to passthrough to this guest. Each DTDEV_PATH ^tree? s/node/nodes/ either way. > +is the absolute path in the device tree. Can it be an alias? > =item B > > Allow guest to access specific legacy I/O ports. Each B > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > index 31e89e8..80c9df6 100644 > --- a/tools/libxl/xl_cmdimpl.c > +++ b/tools/libxl/xl_cmdimpl.c > @@ -986,7 +986,7 @@ static void parse_config_data(const char *config_source, > long l; > XLU_Config *config; > XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids, *vtpms; > - XLU_ConfigList *channels, *ioports, *irqs, *iomem, *viridian; > + XLU_ConfigList *channels, *ioports, *irqs, *iomem, *viridian, *dtdevs; > int num_ioports, num_irqs, num_iomem, num_cpus, num_viridian; > int pci_power_mgmt = 0; > int pci_msitranslate = 0; > @@ -1746,6 +1746,25 @@ skip_vfb: > libxl_defbool_set(&b_info->u.pv.e820_host, true); > } > > + if (!xlu_cfg_get_list (config, "dtdev", &dtdevs, 0, 0)) { > + d_config->num_dtdevs = 0; > + d_config->dtdevs = NULL; > + for (i = 0; (buf = xlu_cfg_get_listitem(dtdevs, i)) != NULL; i++) { > + libxl_device_dtdev *dtdev; > + > + d_config->dtdevs = (libxl_device_dtdev *) xrealloc(d_config->dtdevs, sizeof (libxl_device_dtdev) * (d_config->num_dtdevs + 1)); Please wrap the long line. (I know there is some bad precedent in this file...)