Wire protocol format and remote driver for virDomainGetState

This commit is contained in:
Jiri Denemark
2011-04-26 16:47:22 +02:00
parent 46b95e6428
commit 9f181ebc14
4 changed files with 88 additions and 2 deletions

View File

@@ -2872,6 +2872,39 @@ cleanup:
return rv;
}
static int
remoteDispatchDomainGetState(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_get_state_args *args,
remote_domain_get_state_ret *ret)
{
virDomainPtr dom = NULL;
int rv = -1;
if (!conn) {
virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
goto cleanup;
}
if (!(dom = get_nonnull_domain(conn, args->dom)))
goto cleanup;
if (virDomainGetState(dom, &ret->state, &ret->reason, args->flags) < 0)
goto cleanup;
rv = 0;
cleanup:
if (rv < 0)
remoteDispatchError(rerr);
if (dom)
virDomainFree(dom);
return rv;
}
static int
remoteDispatchDomainEventsRegisterAny(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,