On Fri, Feb 22, 2013 at 09:06:42 +0100, Peter Krempa wrote:
On 02/19/13 13:35, Jiri Denemark wrote:
> Introduce virDomainMigrateGetCompressionCache and
> virDomainMigrateSetCompressionCache APIs.
> ---
> +virDomainMigrateGetCompressionCache(virDomainPtr domain,
> + unsigned long long *cacheSize,
> + unsigned int flags)
> +{
> + virConnectPtr conn;
> +
> + VIR_DOMAIN_DEBUG(domain, "cacheSize=%p, flags=%x", cacheSize,
flags);
> +
> + virResetLastError();
> +
> + if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
> + virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
> + virDispatchError(NULL);
> + return -1;
> + }
> +
> + conn = domain->conn;
> +
> + virCheckNonNullArgGoto(cacheSize, error);
> +
> + if (conn->flags & VIR_CONNECT_RO) {
> + virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
IMHO the *get* function could be allowed to work on RO connections.
Yeah, I actually copied this from virDomainMigrateGetMaxSpeed, which
means it could be fixed too.
Jirka