WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 6/7] libxl_qmp, Introduce libxl__qmp_pci_add.

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 6/7] libxl_qmp, Introduce libxl__qmp_pci_add.
From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Date: Fri, 7 Oct 2011 17:01:12 +0100
Cc: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Fri, 07 Oct 2011 09:04:55 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=OVzXm4u08+2kFAUyJdid6YV8+B0DPIK+gQyZoEQM0W8=; b=erR1Xur6mPEG+onLtwEyR8tgHZNXzUcX3Z2vROwraptq3lEGcRRF4aPSE7pHYgdiwe Ea0sCpMd32PG24Jc0KbDkQGjcAJWV9wYR2H3J2VSX2ltxYdSGTo6FLMrBsblv6ijSiOd wDE11rWv0vJE2hO8x//y6fOGhoymuftSgG55Q=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1317991406.21903.343.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1317989418-25463-1-git-send-email-anthony.perard@xxxxxxxxxx> <1317989418-25463-7-git-send-email-anthony.perard@xxxxxxxxxx> <1317991406.21903.343.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, Oct 7, 2011 at 13:43, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
> On Fri, 2011-10-07 at 13:10 +0100, Anthony PERARD wrote:
>> This function insert a PCI passthrough device in qemu.
>>
>> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
>> ---
>>  tools/libxl/libxl_internal.h |    2 +
>>  tools/libxl/libxl_qmp.c      |   89 
>> ++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 91 insertions(+), 0 deletions(-)
>>
>> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
>> index 4dd0f91..78e1be2 100644
>> --- a/tools/libxl/libxl_internal.h
>> +++ b/tools/libxl/libxl_internal.h
>> @@ -119,6 +119,7 @@ typedef struct {
>>  } libxl__device;
>>
>>  #define XC_PCI_BDF             "0x%x, 0x%x, 0x%x, 0x%x"
>> +#define PCI_DEVFN(slot, func)   ((((slot) & 0x1f) << 3) | ((func) & 0x07))
>
> No need to include the domain or dev in this? The name is pretty weird
> if you don't include the dev portion.  Looks like this is actually a
> vdevfn? xl has an open coded instance of this pattern for that -- worth
> adding a public macro?

I have actual copy the macro from qemu, and I think "slot === dev". I
think the macro come from linux/pci.h.
But yes, I use it to store the vdevfn.

> FWIW pcidev_encode_bdf() exists which encodes the whole lot from a
> libxl_device_pci, if that what you end up needing.

If the vdefvn should contain the virtual bus and domain number, so
yes, that will be the function I need.

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel