
On 06/11/2012 04:33 AM, Peter Krempa wrote:
This patch wires up the RPC protocol handlers for virConnectListAllDomains(). The RPC generator has no support for the way how virConnectListAllDomains() returns the results so the handler code had to be done manually.
The new api is handled by REMOTE_PROC_CONNECT_LIST_ALL_DOMAINS, with number 271 and marked with high priority.
271 is already claimed <evil_laugh>MuaaHaHa</evil_laugh> You'll have to tweak this to apply onto the latest libvirt.git, but the conflict resolution should be trivial.
--- Diff to v2: - fixed spelling and style nits - changed the boolean flag that tells the remote side if the list is needed to ing
s/ing/int/
static int +remoteDispatchConnectListAllDomains(virNetServerPtr server ATTRIBUTE_UNUSED, + virNetServerClientPtr client, + virNetMessagePtr msg ATTRIBUTE_UNUSED, + virNetMessageErrorPtr rerr, + remote_connect_list_all_domains_args *args, + remote_connect_list_all_domains_ret *ret) +{ + virDomainPtr *doms = NULL; + int ndomains = 0; + int i; + int rv = -1; + struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); + + if (!priv->conn) { + virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open")); + goto cleanup; + } + + if ((ndomains = virConnectListAllDomains(priv->conn, + args->need_results ? &doms : NULL, + args->flags)) < 0) + goto cleanup; + + if (doms) {
if (doms && ndomains) { to avoid a pointless alloc.
@@ -5111,6 +5174,7 @@ static virDriver remote_driver = { .domainGetDiskErrors = remoteDomainGetDiskErrors, /* 0.9.10 */ .domainSetMetadata = remoteDomainSetMetadata, /* 0.9.10 */ .domainGetMetadata = remoteDomainGetMetadata, /* 0.9.10 */ + .listAllDomains = remoteConnectListAllDomains, /* 0.9.13 */
I would have listed this earlier, next to the remoteConnectListDomains entry, but no big deal. ACK with the rebase and nit fixed. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org