]> git.proxmox.com Git - mirror_qemu.git/commit - qemu-nbd.c
qemu-nbd: move client to a thread
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 4 Nov 2011 14:51:21 +0000 (15:51 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 11 Nov 2011 13:02:58 +0000 (14:02 +0100)
commita517e88baa9bef2b5c54a11d62b2b2ab2a5c4ab7
tree1bc7bb584791935ae923b50779b7ea8c8458638b
parentb32f6c28d5c753a8c667453f6300a2650bc52a47
qemu-nbd: move client to a thread

This avoids that qemu-nbd uses both forking and threads, which do
not behave well together.

qemu-nbd is already Unix only, and there is no qemu_thread_join,
so for now use pthreads.

Since the parent and child no longer have separate file descriptors,
we can open the NBD device before daemonizing, instead of checking
with access(2) and restricting the open to the client only.

Reported-by: Pierre Riteau <pierre.riteau@irisa.fr>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-nbd.c