Re: [Qemu-devel] [PATCH 1/3] block/file-posix: Pass FD to locking helpers

2018-04-26 Thread Fam Zheng
On Sat, 04/21 00:09, Max Reitz wrote: > raw_apply_lock_bytes() and raw_check_lock_bytes() currently take a > BDRVRawState *, but they only use the lock_fd field. During image > creation, we do not have a BDRVRawState, but we do have an FD; so if we > want to reuse the functions there, we should mo

[Qemu-devel] [PATCH 1/3] block/file-posix: Pass FD to locking helpers

2018-04-20 Thread Max Reitz
raw_apply_lock_bytes() and raw_check_lock_bytes() currently take a BDRVRawState *, but they only use the lock_fd field. During image creation, we do not have a BDRVRawState, but we do have an FD; so if we want to reuse the functions there, we should modify them to receive only the FD. Signed-off-