Re: [PATCH 3/8] Use VIR_ERR_CONFIG_UNSUPPORTED if requested security driver is disabled

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

 



On 08/10/2012 07:47 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> There is currently no way to distinguish the case that a requested
> security driver was disabled, from the case where no security driver
> was available. Use VIR_ERR_CONFIG_UNSUPPORTED as the error when an
> explicitly requested security driver was disabled
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  src/security/security_driver.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/security/security_driver.c b/src/security/security_driver.c
> index 7ff5f17..f450a94 100644
> --- a/src/security/security_driver.c
> +++ b/src/security/security_driver.c
> @@ -72,6 +72,12 @@ virSecurityDriverPtr virSecurityDriverLookup(const char *name,
>  
>          case SECURITY_DRIVER_DISABLE:
>              VIR_DEBUG("Not enabled name=%s", tmp->name);
> +            if (name && STREQ(tmp->name, name)) {

Possibly simpler as 'if (STREQ_NULLABLE(tmp->name, name))'

> +                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> +                               _("Security driver %s not enabled"),
> +                               name);
> +                return NULL;
> +            }

ACK, whether or not you micro-optimize.

-- 
Eric Blake   eblake@xxxxxxxxxx    +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]