diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index aca00c0974e5f31c192cbc9473a7a611c59191b3..a1dd64087b3bca2178d8c81d39ca1add566702b0 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -8038,6 +8038,47 @@ remoteDomainInterfaceAddresses(virDomainPtr dom, } +static int +remoteDomainRename(virDomainPtr dom, const char *new_name, unsigned int flags) +{ + int rv = -1; + struct private_data *priv = dom->conn->privateData; + remote_domain_rename_args args; + remote_domain_rename_ret ret; + char *tmp = NULL; + + if (VIR_STRDUP(tmp, new_name) < 0) + return -1; + + remoteDriverLock(priv); + + make_nonnull_domain(&args.dom, dom); + args.new_name = new_name ? (char **)&new_name : NULL; + args.flags = flags; + + memset(&ret, 0, sizeof(ret)); + + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_RENAME, + (xdrproc_t)xdr_remote_domain_rename_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_rename_ret, (char *)&ret) == -1) { + goto done; + } + + rv = ret.retcode; + + if (rv == 0) { + VIR_FREE(dom->name); + dom->name = tmp; + tmp = NULL; + } + + done: + remoteDriverUnlock(priv); + VIR_FREE(tmp); + return rv; +} + + /* get_nonnull_domain and get_nonnull_network turn an on-wire * (name, uuid) pair into virDomainPtr or virNetworkPtr object. * These can return NULL if underlying memory allocations fail, diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 92a92e2bfa247f2006e5b1f48b847413c07bb669..80f4a8b3a18191100132ed17dafaadb12e1af0d0 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -5708,7 +5708,7 @@ enum remote_procedure { REMOTE_PROC_DOMAIN_SET_USER_PASSWORD = 357, /** - * @generate: both + * @generate: server * @acl: domain:write * @acl: domain:save */