> > +int
> > +set_exit_with_parent(void)
> > +{
> > + int r;
> > + pthread_attr_t attrs;
> > + pthread_t exit_with_parent_thread;
> > +
> > + /*
> > + * We have to block waiting for kevent, so that requires that we
> > + * start a background thread.
> > + */
> > + pthread_attr_init(&attrs);
> > + pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED);
> > + r = pthread_create(&exit_with_parent_thread, NULL,
> > + exit_with_parent_loop, NULL);
>
>
> QemuThread exit_with_parent_thread;
> qemu_thread_create(&exit_with_parent_thread,
> "exit-parent",
> exit_with_parent_loop,
> QEMU_THREAD_DETACHED);
>
> mostly just so we get the thread name set.
Right, this (macOS) is the part I didn't even compile test yet, hence
why the patch is WIP. We do compile the same code in nbdkit, but I
could be sure it'll work in macOS. I'll make sure to fix this to make
it qemu-native, and test it before posting the real patch :-)
> Broadly looks good to me.
Thanks, I'll incorporate all those suggestions into the real version.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v