mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
migration: Add yank feature
Register yank functions on sockets to shut them down. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <484c6a14cc2506bebedd5a237259b91363ff8f88.1609167865.git.lukasstraub2@web.de> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
committed by
Markus Armbruster
parent
8ee4480692
commit
b5eea99ec2
@@ -18,6 +18,8 @@
|
||||
#include "trace.h"
|
||||
#include "qapi/error.h"
|
||||
#include "io/channel-tls.h"
|
||||
#include "io/channel-socket.h"
|
||||
#include "qemu/yank.h"
|
||||
|
||||
/**
|
||||
* @migration_channel_process_incoming - Create new incoming migration channel
|
||||
@@ -35,6 +37,11 @@ void migration_channel_process_incoming(QIOChannel *ioc)
|
||||
trace_migration_set_incoming_channel(
|
||||
ioc, object_get_typename(OBJECT(ioc)));
|
||||
|
||||
if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)) {
|
||||
yank_register_function(MIGRATION_YANK_INSTANCE, yank_generic_iochannel,
|
||||
QIO_CHANNEL(ioc));
|
||||
}
|
||||
|
||||
if (s->parameters.tls_creds &&
|
||||
*s->parameters.tls_creds &&
|
||||
!object_dynamic_cast(OBJECT(ioc),
|
||||
@@ -67,6 +74,12 @@ void migration_channel_connect(MigrationState *s,
|
||||
ioc, object_get_typename(OBJECT(ioc)), hostname, error);
|
||||
|
||||
if (!error) {
|
||||
if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)) {
|
||||
yank_register_function(MIGRATION_YANK_INSTANCE,
|
||||
yank_generic_iochannel,
|
||||
QIO_CHANNEL(ioc));
|
||||
}
|
||||
|
||||
if (s->parameters.tls_creds &&
|
||||
*s->parameters.tls_creds &&
|
||||
!object_dynamic_cast(OBJECT(ioc),
|
||||
|
||||
Reference in New Issue
Block a user