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

Re: [libvirt] [PATCH 4/8] Add new API virDomainGetBlockIoThrottle



On Thu, Oct 27, 2011 at 05:20:06PM +0800, Lei HH Li wrote:
> +int virDomainGetBlockIoThrottle(virDomainPtr dom,
> +                                const char *disk,
> +                                virDomainBlockIoThrottleInfoPtr reply,
> +                                unsigned int flags)
> +{
> +    virConnectPtr conn;
> +
> +    VIR_DOMAIN_DEBUG(dom, "disk=%p, reply=%p, flags=%x",
> +                     disk, reply, flags);
> +
> +    virResetLastError();
> +
> +    if (!VIR_IS_CONNECTED_DOMAIN (dom)) {
> +        virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
> +        virDispatchError(NULL);
> +        return -1;
> +    }
> +    conn = dom->conn;
> +
> +    if (dom->conn->flags & VIR_CONNECT_RO) {
> +        virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
> +        goto error;
> +    }

You should be able to get the current settings with a read-only connection.

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


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