[libvirt] [PATCH 4/8] Add new API virDomainGetBlockIoThrottle
Adam Litke
agl at us.ibm.com
Thu Oct 27 21:04:35 UTC 2011
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 at us.ibm.com>
IBM Linux Technology Center
More information about the libvir-list
mailing list