[libvirt] [PATCH v2 2/4] util: new function virPCIDeviceGetConfigPath()

Andrea Bolognani abologna at redhat.com
Thu Nov 24 14:40:27 UTC 2016


On Mon, 2016-11-21 at 00:01 -0500, Laine Stump wrote:
> The path to the config file for a PCI device is conventiently stored
> in a virPCIDevice object, but that object's contents aren't directly
> visible outside of virpci.c, so we need to have an accessor function
> for it if anyone needs to look at it.
> ---
> New in "V2"
> 
> src/libvirt_private.syms | 1 +
>  src/util/virpci.c        | 6 ++++++
>  src/util/virpci.h        | 1 +
>  3 files changed, 8 insertions(+)
> 
> diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
> index 1c0b912..77e4b63 100644
> --- a/src/libvirt_private.syms
> +++ b/src/libvirt_private.syms
> @@ -2135,6 +2135,7 @@ virPCIDeviceCopy;
>  virPCIDeviceDetach;
>  virPCIDeviceFileIterate;
>  virPCIDeviceFree;
> +virPCIDeviceGetConfigPath;
>  virPCIDeviceGetDriverPathAndName;
>  virPCIDeviceGetIOMMUGroupDev;
>  virPCIDeviceGetIOMMUGroupList;
> diff --git a/src/util/virpci.c b/src/util/virpci.c
> index 6c8174a..0c06249 100644
> --- a/src/util/virpci.c
> +++ b/src/util/virpci.c
> @@ -1848,6 +1848,12 @@ virPCIDeviceGetName(virPCIDevicePtr dev)
>      return dev->name;
>  }
>  
> +const char *
> +virPCIDeviceGetConfigPath(virPCIDevicePtr dev)

Documentation maybe? Then again, it's a trivial
accessor.

> +{
> +    return dev->path;
> +}
> +
>  void virPCIDeviceSetManaged(virPCIDevicePtr dev, bool managed)
>  {
>      dev->managed = managed;
> diff --git a/src/util/virpci.h b/src/util/virpci.h
> index 5c63eab..a5e8d00 100644
> --- a/src/util/virpci.h
> +++ b/src/util/virpci.h
> @@ -97,6 +97,7 @@ virPCIDevicePtr virPCIDeviceNew(unsigned int domain,
>  virPCIDevicePtr virPCIDeviceCopy(virPCIDevicePtr dev);
>  void virPCIDeviceFree(virPCIDevicePtr dev);
>  const char *virPCIDeviceGetName(virPCIDevicePtr dev);
> +const char *virPCIDeviceGetConfigPath(virPCIDevicePtr dev);
>  
>  int virPCIDeviceDetach(virPCIDevicePtr dev,
>                         virPCIDeviceListPtr activeDevs,

ACK whether or not you decide to add documentation.

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list