On Mon, May 11, 2020 at 01:14:47PM +0200, Lukas Straub wrote: > Add yank option which is passed to the socket-channel. > > Signed-off-by: Lukas Straub <lukasstra...@web.de> > --- > chardev/char-socket.c | 8 ++++++++ > chardev/char.c | 3 +++ > qapi/char.json | 5 ++++- > 3 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/chardev/char-socket.c b/chardev/char-socket.c > index 185fe38dda..e476358941 100644 > --- a/chardev/char-socket.c > +++ b/chardev/char-socket.c > @@ -65,6 +65,7 @@ typedef struct { > int max_size; > int do_telnetopt; > int do_nodelay; > + int do_yank; > int *read_msgfds; > size_t read_msgfds_num; > int *write_msgfds; > @@ -877,6 +878,9 @@ static int tcp_chr_new_client(Chardev *chr, > QIOChannelSocket *sioc) > if (s->do_nodelay) { > qio_channel_set_delay(s->ioc, false); > } > + if (s->do_yank) { > + qio_channel_set_yank(s->ioc, true); > + }
This should call yank_register_function() to register a local callback, which then invokes qio_channel_shutdown() upon acting, avoiding the need to add this qio_channel_set_yank method. Likewise for the migration code in the next patch. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|