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

Re: [libvirt] [PATCH 5/8] Getting Block IO Throttle support to remote driver



On Thu, Oct 27, 2011 at 05:20:07PM +0800, Lei HH Li wrote:
> +static int
> +remoteDispatchDomainGetBlockIoThrottle(virNetServerPtr server ATTRIBUTE_UNUSED,
> +                                       virNetServerClientPtr client ATTRIBUTE_UNUSED,
> +                                       virNetMessageHeaderPtr hdr ATTRIBUTE_UNUSED,
> +                                       virNetMessageErrorPtr rerr,
> +                                       remote_domain_get_block_io_throttle_args *args,
> +                                       remote_domain_get_block_io_throttle_ret *ret)
> +{
> +    virDomainPtr dom = NULL;
> +    virDomainBlockIoThrottleInfo reply;
> +    int rv = -1;
> +    struct daemonClientPrivate *priv =
> +        virNetServerClientGetPrivateData(client);
> +
> +    if (!priv->conn) {
> +        virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
> +        goto cleanup;
> +    }
> +
> +    if (!(dom = get_nonnull_domain(priv->conn, args->dom)))
> +        goto cleanup;
> +
> +    rv = virDomainGetBlockIoThrottle(dom, args->disk, &reply, args->flags);
> +
> +    if (rv < 0)
> +        goto cleanup;

If not found, I would explicitly set found to 0.  Not strictly necessary I know,
but I would rather not have correctness of the API depend on the ret structure
being zeroed out somewhere else.

-- 
Adam Litke <agl us ibm com>
IBM Linux Technology Center


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