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

Re: [libvirt] [PATCH 13/20] phyp: reject unknown flags



On Wed, Jul 06, 2011 at 05:23:56PM -0600, Eric Blake wrote:
> * src/phyp/phyp_driver.c (phypOpen, phypDomainReboot)
> (phypVIOSDriverOpen): Reject unknown flags.
> ---
>  src/phyp/phyp_driver.c |   12 +++++++++---
>  1 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
> index d1ab5b4..93f22eb 100644
> --- a/src/phyp/phyp_driver.c
> +++ b/src/phyp/phyp_driver.c
> @@ -1128,7 +1128,7 @@ exit:
> 
>  static virDrvOpenStatus
>  phypOpen(virConnectPtr conn,
> -         virConnectAuthPtr auth, unsigned int flags ATTRIBUTE_UNUSED)
> +         virConnectAuthPtr auth, unsigned int flags)
>  {
>      LIBSSH2_SESSION *session = NULL;
>      ConnectionData *connection_data = NULL;
> @@ -1138,6 +1138,8 @@ phypOpen(virConnectPtr conn,
>      char *char_ptr;
>      char *managed_system = NULL;
> 
> +    virCheckFlags(0, VIR_DRV_OPEN_ERROR);
> +
>      if (!conn || !conn->uri)
>          return VIR_DRV_OPEN_DECLINED;
> 
> @@ -3389,7 +3391,7 @@ cleanup:
>  }
> 
>  static int
> -phypDomainReboot(virDomainPtr dom, unsigned int flags ATTRIBUTE_UNUSED)
> +phypDomainReboot(virDomainPtr dom, unsigned int flags)
>  {
>      int result = -1;
>      ConnectionData *connection_data = dom->conn->networkPrivateData;
> @@ -3402,6 +3404,8 @@ phypDomainReboot(virDomainPtr dom, unsigned int flags ATTRIBUTE_UNUSED)
>      char *ret = NULL;
>      virBuffer buf = VIR_BUFFER_INITIALIZER;
> 
> +    virCheckFlags(0, -1);
> +
>      virBufferAddLit(&buf, "chsysstate");
>      if (system_type == HMC)
>          virBufferAsprintf(&buf, " -m %s", managed_system);
> @@ -3725,8 +3729,10 @@ phypDomainSetCPU(virDomainPtr dom, unsigned int nvcpus)
>  static virDrvOpenStatus
>  phypVIOSDriverOpen(virConnectPtr conn,
>                     virConnectAuthPtr auth ATTRIBUTE_UNUSED,
> -                   unsigned int flags ATTRIBUTE_UNUSED)
> +                   unsigned int flags)
>  {
> +    virCheckFlags(0, VIR_DRV_OPEN_ERROR);
> +
>      if (conn->driver->no != VIR_DRV_PHYP)
>          return VIR_DRV_OPEN_DECLINED;
> 

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


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