Re: [PATCH 1/6] util: Prepare helpers for unpriv_sgio setting

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

 



On 01/02/2013 07:37 AM, Osier Yang wrote:
> "virGetDeviceID" could be used across the sources, but it doesn't
> relate with this series, and could be done later.
> 
> * src/util/virutil.h: (Declare virGetDeviceID, and
>                        vir{Get,Set}DeviceUnprivSGIO)
> * src/util/virutil.c: (Implement virGetDeviceID and
>                        vir{Get,Set}DeviceUnprivSGIO)
> * src/libvirt_private.syms: Export private symbols of upper helpers
> ---
>  src/libvirt_private.syms |    3 +
>  src/util/virutil.c       |  140 ++++++++++++++++++++++++++++++++++++++++++++++
>  src/util/virutil.h       |   11 ++++
>  3 files changed, 154 insertions(+), 0 deletions(-)

ACK.

> +int
> +virSetDeviceUnprivSGIO(const char *path,
> +                       const char *sysfs_dir,
> +                       int unpriv_sgio)
> +{
> +    char *sysfs_path = NULL;
> +    char *val = NULL;
> +    int ret = -1;
> +    int rc;
> +
> +    if (!(sysfs_path = virGetUnprivSGIOSysfsPath(path, sysfs_dir)))
> +        return -1;
> +
> +    if (!virFileExists(sysfs_path)) {
> +        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +                       _("unpriv_sgio is not supported by this kernel"));
> +        goto cleanup;

If 'unpriv_sgio' is 0 here, does it make the logic in any later patches
easier to return success in that case (you are setting things to the
default)?  But I'm okay with keeping it as a failure.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]