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@xxxxxxxxxx> IBM Linux Technology Center -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list