qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2] Add -f option to qemu-nbd


From: Chun Yan Liu
Subject: Re: [Qemu-devel] [PATCH V2] Add -f option to qemu-nbd
Date: Thu, 17 Nov 2011 18:25:45 -0700

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.

If issuing two commands in a long enough inetval, the first one can work well, the second one will fail at nbd_init().


Thanks,

Chunyan


>>> Paolo Bonzini <address@hidden> 11/17/2011 9:41 PM >>>
On 11/17/2011 12:36 PM, Chunyan Liu wrote:
>
> Adding lock to the nbd device before connecting disk image to that device to
> handling race conditions.
This removes the possibility for other programs to lock.  Have you
checked what happens if you use the same device twice and whether you
can piggyback on e.g. an EBUSY from the NBD_SET_SOCK ioctl?

Paolo


reply via email to

[Prev in Thread] Current Thread [Next in Thread]