[libvirt] [PATCH] phyp: Don't do a flags check in the storage driver

Eric Blake eblake at redhat.com
Fri Nov 12 15:24:53 UTC 2010


On 11/12/2010 06:03 AM, Matthias Bolte wrote:
> This makes the storage driver fail when the connection is
> opened with the VIR_CONNECT_RO flag, resulting in a read-only
> connection with no storage driver.
> ---
>  src/phyp/phyp_driver.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
> index a685bd1..4c723a2 100644
> --- a/src/phyp/phyp_driver.c
> +++ b/src/phyp/phyp_driver.c
> @@ -3927,10 +3927,8 @@ phypDomainSetCPU(virDomainPtr dom, unsigned int nvcpus)
>  static virDrvOpenStatus
>  phypVIOSDriverOpen(virConnectPtr conn,
>                     virConnectAuthPtr auth ATTRIBUTE_UNUSED,
> -                   int flags)
> +                   int flags ATTRIBUTE_UNUSED)
>  {
> -    virCheckFlags(0, VIR_DRV_OPEN_ERROR);
> -

This lets all possible flags through, even bits that are not yet
defined.  Wouldn't the better approach be to fix virCheckFlags() to
change 0 to the actual read-only bit that we expect to ignore, while
still forbidding the remaining 31 bits for future extensibility?

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
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/20101112/fbb12637/attachment-0001.sig>


More information about the libvir-list mailing list