From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 23/24] libxl: Add support for non-PCI passthrough Date: Thu, 29 Jan 2015 13:51:04 +0000 Message-ID: <54CA3AC8.4020405@linaro.org> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-24-git-send-email-julien.grall@linaro.org> <54CA22A3.1040001@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YGpVO-0003kE-HX for xen-devel@lists.xenproject.org; Thu, 29 Jan 2015 13:51:34 +0000 Received: by mail-wi0-f170.google.com with SMTP id bs8so10252862wib.1 for ; Thu, 29 Jan 2015 05:51:33 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Wei Liu , ian.campbell@citrix.com, tim@xen.org, Ian Jackson , stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 29/01/15 12:31, Stefano Stabellini wrote: > On Thu, 29 Jan 2015, Julien Grall wrote: >> Hi Stefano, >> >> On 29/01/15 11:12, Stefano Stabellini wrote: >>>> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c >>>> index 029d2e2..b7ef528 100644 >>>> --- a/tools/libxl/libxl_create.c >>>> +++ b/tools/libxl/libxl_create.c >>>> @@ -1430,6 +1430,16 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev, >>> >>> I think you should at least rename domcreate_attach_pci to something >>> more generic, like domcreate_attach_dev. >> >> Actually I was planning to add a domcreate_attach_dtdev but I forgot >> about it. >> >> What the best approach for this? > > Either one would work. But don't add non-PCI passthrough code to a > function named domcreate_attach_pci :-) Right, it was a quick & dirty implementation which I forgot to clean up. >>> >>>> } >>>> } >>>> >>>> + for (i = 0; i < d_config->num_dtdevs; i++) { >>>> + >>>> + ret = libxl__device_dt_add(gc, domid, &d_config->dtdevs[i]); >>>> + if (ret < 0) { >>>> + LIBXL__LOG(ctx, LIBXL__LOG_ERROR, >>>> + "libxl__device_dt_add failed: %d\n", ret); >>>> + goto error_out; >>>> + } >>>> + } >>> >>> You are allowed to call xc_* functions from here. The >>> libxl__device_dt_add wrapper doesn't add much value. >> >> I would like to keep the wrapper. It's in sync with the PCI solution and >> it will avoid refactoring later for add new code. > > But in the PCI case there is a lot of code in the function. > Regardless if you think it is useful, keep it. If we plan to implement a proper platform device pass-through we will have to add lots of code. Wei, Ian & Ian, do you have any opinions? Regards, -- Julien Grall