mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
Fix impl of virDomainCreateWithFlags remote client helper
In the following commit:
commit 03d813bbcd
Author: Marek Marczykowski <marmarek@invisiblethingslab.com>
Date: Thu May 23 02:01:30 2013 +0200
remote: fix dom->id after virDomainCreateWithFlags
The virDomainCreateWithFlags remote client helper was made to
invoke REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID to refresh the 'id'
of the domain, following the pattern used in the previous
virDomainCreate method impl.
The remote protocol for virDomainCreateWithFlags though did
actually fix the design flaw in virDomainCreate, by directly
returning the new domain info. For some reason, this data was
never used. So we can just use that data now instead.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
bfd663ef97
commit
ddaf15d7a3
@ -2415,8 +2415,7 @@ remoteDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
|
||||
int rv = -1;
|
||||
struct private_data *priv = dom->conn->privateData;
|
||||
remote_domain_create_with_flags_args args;
|
||||
remote_domain_lookup_by_uuid_args args2;
|
||||
remote_domain_lookup_by_uuid_ret ret2;
|
||||
remote_domain_create_with_flags_args ret;
|
||||
|
||||
remoteDriverLock(priv);
|
||||
|
||||
@ -2425,23 +2424,12 @@ remoteDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
|
||||
|
||||
if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS,
|
||||
(xdrproc_t)xdr_remote_domain_create_with_flags_args, (char *)&args,
|
||||
(xdrproc_t)xdr_void, (char *)NULL) == -1) {
|
||||
(xdrproc_t)xdr_remote_domain_create_with_flags_ret, (char *)&ret) == -1) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Need to do a lookup figure out ID of newly started guest, because
|
||||
* bug in design of REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS means we aren't getting
|
||||
* it returned.
|
||||
*/
|
||||
memcpy(args2.uuid, dom->uuid, VIR_UUID_BUFLEN);
|
||||
memset(&ret2, 0, sizeof(ret2));
|
||||
if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID,
|
||||
(xdrproc_t) xdr_remote_domain_lookup_by_uuid_args, (char *) &args2,
|
||||
(xdrproc_t) xdr_remote_domain_lookup_by_uuid_ret, (char *) &ret2) == -1)
|
||||
goto done;
|
||||
|
||||
dom->id = ret2.dom.id;
|
||||
xdr_free((xdrproc_t) &xdr_remote_domain_lookup_by_uuid_ret, (char *) &ret2);
|
||||
dom->id = ret.dom.id;
|
||||
xdr_free((xdrproc_t) &xdr_remote_domain_create_with_flags_ret, (char *) &ret);
|
||||
rv = 0;
|
||||
|
||||
done:
|
||||
|
Loading…
Reference in New Issue
Block a user