Re: [PATCH V3] util: Add more virsysfs functions for handling resctrl sysfs

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

 



>  #define VIR_SYSFS_VALUE_MAXLEN 8192
>  #define SYSFS_SYSTEM_PATH "/sys/devices/system"
> +#define SYSFS_RESCTRL_PATH "/sys/fs/resctrl"
>
>  static const char *sysfs_system_path = SYSFS_SYSTEM_PATH;
> +static const char *sysfs_resctrl_path = SYSFS_RESCTRL_PATH;
>
>
>  void virSysfsSetSystemPath(const char *path)
> @@ -55,6 +58,20 @@ virSysfsGetSystemPath(void)
>      return sysfs_system_path;
>  }
>
> +void virSysfsSetResctrlPath(const char *path)
> +{
> +    if (path)
> +        sysfs_resctrl_path  = path;
> +    else
> +        sysfs_resctrl_path = SYSFS_RESCTRL_PATH;
> +}
> +
> +const char *
> +virSysfsGetResctrlPath(void)
> +{
> +    return sysfs_resctrl_path;
> +}
> +

NACK

This leads to an unnecessary code duplication (applies for most of the
functions introduced by this patch). Instead, virsysfs should be made generic
enough so it could be reused by any module doing sysfs related tasks, like for
example the recently added mediated device framework (otherwise a new
sysfs_foo_path = "/sys/bus/mdev/devices/" would need to be created as well).

Erik

--
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]
  Powered by Linux