Blame SOURCES/kvm-docs-Add-image-locking-subsection.patch

9bac43
From c83bac681bd10d576c3af9a45b49065aa6b7330e Mon Sep 17 00:00:00 2001
9bac43
From: Fam Zheng <famz@redhat.com>
9bac43
Date: Thu, 30 Nov 2017 09:25:42 +0100
9bac43
Subject: [PATCH 05/36] docs: Add image locking subsection
9bac43
9bac43
RH-Author: Fam Zheng <famz@redhat.com>
9bac43
Message-id: <20171130092544.19231-4-famz@redhat.com>
9bac43
Patchwork-id: 78016
9bac43
O-Subject: [RHV7.5 qemu-kvm-ma PATCH 3/5] docs: Add image locking subsection
9bac43
Bugzilla: 1494210
9bac43
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9bac43
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
9bac43
RH-Acked-by: John Snow <jsnow@redhat.com>
9bac43
9bac43
This documents the image locking feature and explains when and how
9bac43
related options can be used.
9bac43
9bac43
Signed-off-by: Fam Zheng <famz@redhat.com>
9bac43
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9bac43
(cherry picked from commit b1d1cb272882dd6868740155120f6aeb260a204c)
9bac43
Signed-off-by: Fam Zheng <famz@redhat.com>
9bac43
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9bac43
---
9bac43
 docs/qemu-block-drivers.texi | 36 ++++++++++++++++++++++++++++++++++++
9bac43
 qemu-doc.texi                |  1 +
9bac43
 2 files changed, 37 insertions(+)
9bac43
9bac43
diff --git a/docs/qemu-block-drivers.texi b/docs/qemu-block-drivers.texi
9bac43
index d3b8f3b..aa64e60 100644
9bac43
--- a/docs/qemu-block-drivers.texi
9bac43
+++ b/docs/qemu-block-drivers.texi
9bac43
@@ -785,6 +785,42 @@ warning: ssh server @code{ssh.example.com:22} does not support fsync
9bac43
 With sufficiently new versions of libssh2 and OpenSSH, @code{fsync} is
9bac43
 supported.
9bac43
 
9bac43
+@node disk_image_locking
9bac43
+@subsection Disk image file locking
9bac43
+
9bac43
+By default, QEMU tries to protect image files from unexpected concurrent
9bac43
+access, as long as it's supported by the block protocol driver and host
9bac43
+operating system. If multiple QEMU processes (including QEMU emulators and
9bac43
+utilities) try to open the same image with conflicting accessing modes, all but
9bac43
+the first one will get an error.
9bac43
+
9bac43
+This feature is currently supported by the file protocol on Linux with the Open
9bac43
+File Descriptor (OFD) locking API, and can be configured to fall back to POSIX
9bac43
+locking if the POSIX host doesn't support Linux OFD locking.
9bac43
+
9bac43
+To explicitly enable image locking, specify "locking=on" in the file protocol
9bac43
+driver options. If OFD locking is not possible, a warning will be printed and
9bac43
+the POSIX locking API will be used. In this case there is a risk that the lock
9bac43
+will get silently lost when doing hot plugging and block jobs, due to the
9bac43
+shortcomings of the POSIX locking API.
9bac43
+
9bac43
+QEMU transparently handles lock handover during shared storage migration.  For
9bac43
+shared virtual disk images between multiple VMs, the "share-rw" device option
9bac43
+should be used.
9bac43
+
9bac43
+Alternatively, locking can be fully disabled by "locking=off" block device
9bac43
+option. In the command line, the option is usually in the form of
9bac43
+"file.locking=off" as the protocol driver is normally placed as a "file" child
9bac43
+under a format driver. For example:
9bac43
+
9bac43
+@code{-blockdev driver=qcow2,file.filename=/path/to/image,file.locking=off,file.driver=file}
9bac43
+
9bac43
+To check if image locking is active, check the output of the "lslocks" command
9bac43
+on host and see if there are locks held by the QEMU process on the image file.
9bac43
+More than one byte could be locked by the QEMU instance, each byte of which
9bac43
+reflects a particular permission that is acquired or protected by the running
9bac43
+block driver.
9bac43
+
9bac43
 @c man end
9bac43
 
9bac43
 @ignore
9bac43
diff --git a/qemu-doc.texi b/qemu-doc.texi
9bac43
index b0db386..6af38de 100644
9bac43
--- a/qemu-doc.texi
9bac43
+++ b/qemu-doc.texi
9bac43
@@ -405,6 +405,7 @@ encrypted disk images.
9bac43
 * disk_images_iscsi::         iSCSI LUNs
9bac43
 * disk_images_gluster::       GlusterFS disk images
9bac43
 * disk_images_ssh::           Secure Shell (ssh) disk images
9bac43
+* disk_image_locking::        Disk image file locking
9bac43
 @end menu
9bac43
 
9bac43
 @node disk_images_quickstart
9bac43
-- 
9bac43
1.8.3.1
9bac43