[RFC: vf-token 1/5] virpci: Define vf-token

Peter Krempa pkrempa at redhat.com
Fri Oct 6 07:23:52 UTC 2023


On Thu, Oct 05, 2023 at 16:05:00 -0700, Vivek Kashyap wrote:
> Define the vf-token extension for PCI device
> 
> Signed-off-by: Vivek Kashyap <vivek.kashyap at linux.intel.com>
> ---
>  src/util/virpci.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/src/util/virpci.h b/src/util/virpci.h
> index faca6cf6f9..b4e9e95d88 100644
> --- a/src/util/virpci.h
> +++ b/src/util/virpci.h
> @@ -50,7 +50,15 @@ struct _virZPCIDeviceAddress {
>      /* Don't forget to update virPCIDeviceAddressCopy if needed. */
>  };
>  
> +typedef struct _virPCIDeviceToken virPCIDeviceToken;
> +
> +struct _virPCIDeviceToken {
> +    unsigned char uuid[VIR_UUID_BUFLEN];
> +    bool isSet;
> +};
> +
>  #define VIR_PCI_DEVICE_ADDRESS_FMT "%04x:%02x:%02x.%d"
> +#define VIR_PCI_DEVICE_TOKEN_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
>  
>  /* Represents format of PF's phys_port_name in switchdev mode:
>   * 'p%u' or 'p%us%u'. New line checked since value is read from sysfs file.
> @@ -65,6 +73,7 @@ struct _virPCIDeviceAddress {
>      virTristateSwitch multi;
>      int extFlags; /* enum virPCIDeviceAddressExtensionFlags */
>      virZPCIDeviceAddress zpci;
> +    virPCIDeviceToken token;
>      /* Don't forget to update virPCIDeviceAddressCopy if needed. */
>  };
>  
> @@ -269,6 +278,8 @@ int virPCIDeviceAddressParse(char *address, virPCIDeviceAddress *bdf);
>  
>  bool virZPCIDeviceAddressIsIncomplete(const virZPCIDeviceAddress *addr);
>  bool virZPCIDeviceAddressIsPresent(const virZPCIDeviceAddress *addr);
> +bool virPCIVFIOTokenIDIsPresent(const virPCIDeviceToken *token);
> +bool virDeviceExtensionIsPresent(const virPCIDeviceAddress *pci);

These function definitions should go into the patch that actually
implements the functions themselves.


More information about the libvir-list mailing list