Re: [PATCH 3/4] vhost-user: Monitor slave channel in vhost_user_read()

2021-03-09 Thread Greg Kurz
On Tue, 9 Mar 2021 15:18:56 + Stefan Hajnoczi wrote: > On Mon, Mar 08, 2021 at 01:31:40PM +0100, Greg Kurz wrote: > > @@ -363,8 +367,30 @@ static int vhost_user_read(struct vhost_dev *dev, > > VhostUserMsg *msg) > > qemu_chr_be_update_read_handlers(chr->chr, ctxt); > > qemu_chr_fe_

Re: [PATCH 3/4] vhost-user: Monitor slave channel in vhost_user_read()

2021-03-09 Thread Stefan Hajnoczi
On Mon, Mar 08, 2021 at 01:31:40PM +0100, Greg Kurz wrote: > @@ -363,8 +367,30 @@ static int vhost_user_read(struct vhost_dev *dev, > VhostUserMsg *msg) > qemu_chr_be_update_read_handlers(chr->chr, ctxt); > qemu_chr_fe_add_watch(chr, G_IO_IN | G_IO_HUP, vhost_user_read_cb, > &data); >

[PATCH 3/4] vhost-user: Monitor slave channel in vhost_user_read()

2021-03-08 Thread Greg Kurz
Now that everything is in place, have the nested event loop to monitor the slave channel. The source in the main event loop is destroyed and recreated to ensure any pending even for the slave channel that was previously detected is purged. This guarantees that the main loop wont invoke slave_read()