aboutsummaryrefslogtreecommitdiff
path: root/migration/qemu-file-channel.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-01-13 14:19:24 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-01-13 14:19:24 +0000
commit45240eed4f064576d589ea60ebadf3c11d7ab891 (patch)
tree9384e23478ab00d726eeb0a7e403f97284262933 /migration/qemu-file-channel.c
parent6b63d126121a9535784003924fcb67f574a6afc0 (diff)
parent91d48e520a4a4f72e97aeb333029694f5d57cc93 (diff)
downloadqemu-45240eed4f064576d589ea60ebadf3c11d7ab891.zip
qemu-45240eed4f064576d589ea60ebadf3c11d7ab891.tar.gz
qemu-45240eed4f064576d589ea60ebadf3c11d7ab891.tar.bz2
Merge remote-tracking branch 'remotes/armbru/tags/pull-yank-2021-01-13' into staging
Yank patches patches for 2021-01-13 # gpg: Signature made Wed 13 Jan 2021 09:25:46 GMT # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-yank-2021-01-13: tests/test-char.c: Wait for the chardev to connect in char_socket_client_dupid_test io: Document qmp oob suitability of qio_channel_shutdown and io_shutdown io/channel-tls.c: make qio_channel_tls_shutdown thread-safe migration: Add yank feature chardev/char-socket.c: Add yank feature block/nbd.c: Add yank feature Introduce yank feature Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'migration/qemu-file-channel.c')
-rw-r--r--migration/qemu-file-channel.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c
index d2ce32f..afc3a7f 100644
--- a/migration/qemu-file-channel.c
+++ b/migration/qemu-file-channel.c
@@ -27,6 +27,7 @@
#include "qemu-file.h"
#include "io/channel-socket.h"
#include "qemu/iov.h"
+#include "qemu/yank.h"
static ssize_t channel_writev_buffer(void *opaque,
@@ -104,6 +105,12 @@ static int channel_close(void *opaque, Error **errp)
int ret;
QIOChannel *ioc = QIO_CHANNEL(opaque);
ret = qio_channel_close(ioc, errp);
+ if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)
+ && OBJECT(ioc)->ref == 1) {
+ yank_unregister_function(MIGRATION_YANK_INSTANCE,
+ yank_generic_iochannel,
+ QIO_CHANNEL(ioc));
+ }
object_unref(OBJECT(ioc));
return ret;
}