mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Wire protocol format and remote driver for virDomainGetState
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user