Re: [PATCH 1/2] virnetdev: move virNetDevSysfsFile() upwards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14.04.2015 18:21, Lubomir Rintel wrote:
> ...and provide a bogus implementation for non-Linux. No functional change.
> We'd like to use it from within virNetDevSetNamespace() to determine if we need
> to move a 802.11 PHY to a namespace when moving the interface.
> ---
>  src/util/virnetdev.c | 34 ++++++++++++++++++++++------------
>  1 file changed, 22 insertions(+), 12 deletions(-)
> 
> diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
> index 9a6d4e7..ee60f09 100644
> --- a/src/util/virnetdev.c
> +++ b/src/util/virnetdev.c
> @@ -114,6 +114,28 @@ struct _virNetDevMcastList {
>      virNetDevMcastEntryPtr *entries;
>  };
>  
> +#ifdef __linux__
> +# define NET_SYSFS "/sys/class/net/"
> +
> +static int
> +virNetDevSysfsFile(char **pf_sysfs_device_link, const char *ifname,
> +               const char *file)
> +{
> +
> +    if (virAsprintf(pf_sysfs_device_link, NET_SYSFS "%s/%s", ifname, file) < 0)
> +        return -1;
> +    return 0;
> +}
> +#else
> +static int
> +virNetDevSysfsFile(char **pf_sysfs_device_link, const char *ifname,
> +               const char *file)

Not that I reviewed the whole patch set (maybe tomorrow), but these
arguments are missing ATTRIBUTE_UNUSED. Just a small nit that can be
fixed before pushing. No need for v2.

ACK

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]