diff options
author | Jiri Denemark <jdenemar@redhat.com> | 2015-12-10 16:09:09 +0100 |
---|---|---|
committer | Jiri Denemark <jdenemar@redhat.com> | 2016-01-21 16:36:08 +0100 |
commit | 0b50f4a025e15a0a05ac718edb783ede15ab6361 (patch) | |
tree | 11ce96a83d7649dc8bcf13e96bce8cfba4d124c0 /daemon | |
parent | e2b86f580c1b9d7361f74b7abc9606281b6d6a3e (diff) | |
download | libvirt-0b50f4a025e15a0a05ac718edb783ede15ab6361.tar.gz |
Introduce migration iteration event
The VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION event will be triggered
whenever VIR_DOMAIN_JOB_MEMORY_ITERATION changes its value, i.e.,
whenever a new iteration over guest memory pages is started during
migration.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/remote.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/daemon/remote.c b/daemon/remote.c index 3a3eb09130..370f442885 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -1079,6 +1079,37 @@ remoteRelayDomainEventDeviceAdded(virConnectPtr conn, } +static int +remoteRelayDomainEventMigrationIteration(virConnectPtr conn, + virDomainPtr dom, + int iteration, + void *opaque) +{ + daemonClientEventCallbackPtr callback = opaque; + remote_domain_event_callback_migration_iteration_msg data; + + if (callback->callbackID < 0 || + !remoteRelayDomainEventCheckACL(callback->client, conn, dom)) + return -1; + + VIR_DEBUG("Relaying domain migration pass event %s %d, " + "callback %d, iteration %d", + dom->name, dom->id, callback->callbackID, iteration); + + /* build return data */ + memset(&data, 0, sizeof(data)); + data.callbackID = callback->callbackID; + make_nonnull_domain(&data.dom, dom); + + data.iteration = iteration; + + remoteDispatchObjectEventSend(callback->client, remoteProgram, + REMOTE_PROC_DOMAIN_EVENT_CALLBACK_MIGRATION_ITERATION, + (xdrproc_t)xdr_remote_domain_event_callback_migration_iteration_msg, + &data); + + return 0; +} static virConnectDomainEventGenericCallback domainEventCallbacks[] = { @@ -1102,6 +1133,7 @@ static virConnectDomainEventGenericCallback domainEventCallbacks[] = { VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventTunable), VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventAgentLifecycle), VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventDeviceAdded), + VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventMigrationIteration), }; verify(ARRAY_CARDINALITY(domainEventCallbacks) == VIR_DOMAIN_EVENT_ID_LAST); |