On 11/18/2011 02:25 AM, Chun Yan Liu wrote:
Yes. I have tested using same device twice as described in my previous
mail. Without lock:
If issuing "qemu-nbd -c /dev/nbd0 disk.img" and "qemu-nbd -c /dev/nbd0
disk1.img" almost at the same time, both can pass nbd_init() and get to
nbd_client(), then the latter one will fail and exit, but the first one
does not work well either (fail to show partitions.) That's why I think
we should add a lock in an earlier time.
This is an initialization problem. As Stefan wrote, functionality for
atomic acquisition of NBD devices is provided by the kernel; the problem
is simply that QEMU does not use it. :)
Paolo