On Fri, Apr 02, 2010 at 02:12:12PM -0600, Eric Blake wrote:
On 04/02/2010 01:54 PM, Daniel Veillard wrote:
> +static int
> +remoteDispatchDomainHasManagedSaveImage (struct qemud_server *server
ATTRIBUTE_UNUSED,
> + struct qemud_client *client
ATTRIBUTE_UNUSED,
> + virConnectPtr conn,
> + remote_message_header *hdr
ATTRIBUTE_UNUSED,
> + remote_error *rerr,
> + remote_domain_has_managed_save_image_args
*args,
> + void *ret ATTRIBUTE_UNUSED)
> +{
> + virDomainPtr dom;
> +
> + dom = get_nonnull_domain (conn, args->dom);
> + if (dom == NULL) {
> + remoteDispatchConnError(rerr, conn);
> + return -1;
> + }
> +
> + if (virDomainHasManagedSaveImage (dom, args->flags) == -1) {
> + virDomainFree(dom);
> + remoteDispatchConnError(rerr, conn);
> + return -1;
> + }
> + virDomainFree(dom);
> + return 0;
> +}
Shouldn't this be able to return 1 in the case where
virDomainHasManagedSaveImage returns 1?
yes it's a bug, we need a real return value structure
> +static int
> +remoteDomainHasManagedSaveImage (virDomainPtr domain, unsigned int flags)
> +{
> + int rv = -1;
> + remote_domain_has_managed_save_image_args args;
> + struct private_data *priv = domain->conn->privateData;
> +
> + remoteDriverLock(priv);
> +
> + make_nonnull_domain (&args.dom, domain);
> + args.flags = flags;
> +
> + if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_HAS_MANAGED_SAVE_IMAGE,
> + (xdrproc_t) xdr_remote_domain_has_managed_save_image_args, (char *)
&args,
> + (xdrproc_t) xdr_void, (char *) NULL) == -1)
> + goto done;
> +
> + rv = 0;
> +
> +done:
> + remoteDriverUnlock(priv);
> + return rv;
> +}
Likewise.
Yup, I end up with the following change on top of the previous patch,
thanks a lot !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/