]> git.proxmox.com Git - mirror_qemu.git/commitdiff
file-posix: Add 'locking' option
authorFam Zheng <famz@redhat.com>
Tue, 2 May 2017 16:35:50 +0000 (00:35 +0800)
committerKevin Wolf <kwolf@redhat.com>
Thu, 11 May 2017 09:08:40 +0000 (11:08 +0200)
Making this option available even before implementing it will let
converting tests easier: in coming patches they can specify the option
already when necessary, before we actually write code to lock the
images.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/file-posix.c
qapi/block-core.json

index 19c48a043e909a8d9c7c49c84bf04c135a85192e..d13e99c43f0638a143e8a329aa2e6e6279dbb8db 100644 (file)
@@ -392,6 +392,11 @@ static QemuOptsList raw_runtime_opts = {
             .type = QEMU_OPT_STRING,
             .help = "host AIO implementation (threads, native)",
         },
+        {
+            .name = "locking",
+            .type = QEMU_OPT_STRING,
+            .help = "file locking mode (on/off/auto, default: auto)",
+        },
         { /* end of list */ }
     },
 };
index 30d5952321df33d0e4aab710edf36cf36e65f776..52e3ecd505a3517b058b2e95f9706bfc051128c6 100644 (file)
 #
 # @filename:    path to the image file
 # @aio:         AIO backend (default: threads) (since: 2.8)
+# @locking:     whether to enable file locking. If set to 'auto', only enable
+#               when Open File Descriptor (OFD) locking API is available
+#               (default: auto, since 2.10)
 #
 # Since: 2.9
 ##
 { 'struct': 'BlockdevOptionsFile',
   'data': { 'filename': 'str',
+            '*locking': 'OnOffAuto',
             '*aio': 'BlockdevAioOptions' } }
 
 ##