Received: from eggs.gnu.org ([2001:4830:134:3::10]:46497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2ZXL-00071y-MD for qemu-devel@nongnu.org; Tue, 17 May 2016 03:35:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2ZXJ-0003gx-AD for qemu-devel@nongnu.org; Tue, 17 May 2016 03:35:26 -0400 From: Fam Zheng Date: Tue, 17 May 2016 15:35:09 +0800 Message-Id: <1463470536-8981-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v5 00/27] block: Lock images when opening List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Max Reitz , Jeff Cody , Markus Armbruster , Eric Blake , John Snow , qemu-block@nongnu.org, berrange@redhat.com, pbonzini@redhat.com, den@openvz.org, stefanha@redhat.com v5: - Change "lock-image=on/off" to "lock-mode=exclusive/shared/off". Default is "lock-mode=exclusive" to exclusively lock RW images and shared lock RO images; with lock-mode="shared", RW images are shared locked too; lock-mode=off turns off image locking completely. - Use F_OFD_SETLK fcntl so that close/dup on different fds are not a problem. - Update test cases. Fam Zheng (27): block: Add flag bits for image locking qapi: Add lock-mode in blockdev-add options blockdev: Add and parse "lock-mode" option for image locking block: Introduce image file locking block: Add bdrv_image_locked block: Make bdrv_reopen_{commit, abort} private functions block: Handle image locking during reopen osdep: Add qemu_lock_fd and qemu_unlock_fd osdep: Introduce qemu_dup raw-posix: Use qemu_dup raw-posix: Implement .bdrv_lockf gluster: Implement .bdrv_lockf qemu-io: Add "-L" option for BDRV_O_NO_LOCK qemu-img: Add "-L" option to sub commands qemu-img: Update documentation of "-L" option qemu-nbd: Add "--no-lock/-L" option block: Don't lock drive-backup target image in none mode mirror: Disable image locking on target backing chain qemu-iotests: 140: Disable image lock for qemu-io access qemu-iotests: 046: Move version detection out from verify_io qemu-iotests: Wait for QEMU processes before checking image in 091 qemu-iotests: 030: Disable image lock when checking test image iotests: 087: Disable image lock in cases where file is shared iotests: Disable image locking in 085 tests: Use null-co:// instead of /dev/null block: Turn on image locking by default qemu-iotests: Add test case 153 for image locking block.c | 70 +++++++- block/gluster.c | 31 ++++ block/raw-posix.c | 32 +++- blockdev.c | 34 ++++ include/block/block.h | 7 +- include/block/block_int.h | 11 ++ include/qemu/osdep.h | 3 + qapi/block-core.json | 20 ++- qemu-img-cmds.hx | 44 ++--- qemu-img.c | 90 ++++++++-- qemu-img.texi | 3 + qemu-io.c | 24 ++- qemu-nbd.c | 7 +- qemu-nbd.texi | 2 + tests/drive_del-test.c | 2 +- tests/nvme-test.c | 2 +- tests/qemu-iotests/030 | 2 +- tests/qemu-iotests/046 | 22 +-- tests/qemu-iotests/085 | 3 +- tests/qemu-iotests/087 | 6 + tests/qemu-iotests/091 | 3 + tests/qemu-iotests/091.out | 1 + tests/qemu-iotests/140 | 2 +- tests/qemu-iotests/153 | 197 +++++++++++++++++++++ tests/qemu-iotests/153.out | 426 +++++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/group | 1 + tests/usb-hcd-uhci-test.c | 2 +- tests/usb-hcd-xhci-test.c | 2 +- tests/virtio-blk-test.c | 2 +- tests/virtio-scsi-test.c | 4 +- util/osdep.c | 37 ++++ 31 files changed, 1014 insertions(+), 78 deletions(-) create mode 100755 tests/qemu-iotests/153 create mode 100644 tests/qemu-iotests/153.out -- 2.8.2