nbd: treat EPIPE from NBD_DO_IT as success
This can be seen with "qemu-nbd -v -c", which returns 1 instead of 0when you disconnect with "qemu-nbd -d".
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-nbd: trap SIGTERM
The client process right now uses SIGTERM to interrupt the server side.This does not affect the exit status of "qemu-nbd -v -c" because theserver is a child process. This will change when both sides will bein the same process, and anyway cleaning up things nicely upon SIGTERM...
qemu-nbd: rename socket variable
It will be moved to a global variable by the next patch, and itwould conflict with the socket function.
qemu-nbd: move client to a thread
This avoids that qemu-nbd uses both forking and threads, which donot 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,...
qemu-nbd: print error messages from the daemon through a pipe
In order to get nice error messages, keep the qemu-nbd process runninguntil before issuing NBD_DO_IT and connected to the daemon with a pipe.This lets the qemu-nbd process relay error messages from the daemon and...
qemu-nbd: fix socket creation race
Now that the client and server are in the same process, there isno need to race on the creation of the socket. We can open thelistening socket before starting the client thread.
This avoids that "qemu-nbd -v -c" prints this once before connecting...
qemu-nbd: open the block device after starting the client thread
This is cleaner, because we do not need to close the block device whenthere is an error opening /dev/nbdX. It was done this way only toprint errors before daemonizing.
At the same time, use atexit to ensure that the block device is closed...
block: Fix vpc initialization of the Dynamic Disk Header
The Data Offset field in the Dynamic Disk Header is an 8 byte field.Although the specification (2006-10-11) gives an example of initializingonly the first 4 bytes, images generated by Microsoft on Windows initialize...
atapi: implement eject requests
scsi-disk: implement eject requests
View all revisions | View revisions
Also available in: Atom