]> git.proxmox.com Git - mirror_qemu.git/commit - qemu-nbd.c
qemu-nbd: open the block device after starting the client thread
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 4 Nov 2011 14:51:24 +0000 (15:51 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 11 Nov 2011 13:02:58 +0000 (14:02 +0100)
commit802ddc375acabf06c0cb5a2716ca3573bc9ca89f
tree6bcec5b805731e5013e8b0a205e92d04cd1757ee
parentf1ef5555c24914f8ad4051a20571a5c62022d928
qemu-nbd: open the block device after starting the client thread

This is cleaner, because we do not need to close the block device when
there is an error opening /dev/nbdX.  It was done this way only to
print errors before daemonizing.

At the same time, use atexit to ensure that the block device is closed
whenever we exit.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-nbd.c