On 11/9/21 08:23, Denis Plotnikov wrote:
Ping ping!
Looks good, but can you explain why it's okay to call it before qemu_chr_cleanup() and user_creatable_cleanup()?
I think a better solution to the ordering problem would be: qemu_chr_cleanup(); user_creatable_cleanup(); flush_rcu(); monitor_cleanup(); with something like this: diff --git a/chardev/char-fe.c b/chardev/char-fe.c index 7789f7be9c..f0c3ea5447 100644 --- a/chardev/char-fe.c +++ b/chardev/char-fe.c @@ -195,6 +195,7 @@ bool qemu_chr_fe_init(CharBackend *b, int tag = 0; if (s) { + object_ref(OBJECT(s)); if (CHARDEV_IS_MUX(s)) { MuxChardev *d = MUX_CHARDEV(s); @@ -241,6 +242,7 @@ void qemu_chr_fe_deinit(CharBackend *b, bool del) } else { object_unref(obj); } + object_unref(obj); } b->chr = NULL; } to keep the chardev live between qemu_chr_cleanup() and monitor_cleanup(). Paolo