On Tue, 17 Jan 2023 09:53:46 +0100 Thomas Huth <th...@redhat.com> wrote:
[...] > > +static void *s390_pv_do_unprot_async_fn(void *p) > > +{ > > + s390_pv_cmd_exit(KVM_PV_ASYNC_CLEANUP_PERFORM, NULL); > > + return NULL; > > +} > > + > > +bool s390_pv_vm_try_disable_async(void) > > +{ > > + QemuThread *t; > > + > > + if (!kvm_check_extension(kvm_state, > > KVM_CAP_S390_PROTECTED_ASYNC_DISABLE)) { > > + return false; > > + } > > + if (s390_pv_cmd(KVM_PV_ASYNC_CLEANUP_PREPARE, NULL) != 0) { > > + return false; > > + } > > + > > + t = g_malloc0(sizeof(QemuThread)); > > Sorry for not noticing it in v1 already ... but isn't this leaking memory? > Who's supposed to free "t" again? I assumed that QEMU_THREAD_DETACHED took care of that; it seems like I was mistaken (oops). I'll find a way to fix this > > Thomas > > > > + qemu_thread_create(t, "async_cleanup", s390_pv_do_unprot_async_fn, > > NULL, > > + QEMU_THREAD_DETACHED); > > + > > + return true; > > +} >