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

Eric Blake eblake at redhat.com
Thu Jan 3 00:01:45 UTC 2013


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130102/8290dfb6/attachment-0001.sig>


More information about the libvir-list mailing list