All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [PULL 10/19] Document qemu-img options data_file and data_file_raw
Date: Fri, 14 May 2021 18:45:05 +0200	[thread overview]
Message-ID: <20210514164514.1057680-11-mreitz@redhat.com> (raw)
In-Reply-To: <20210514164514.1057680-1-mreitz@redhat.com>

From: Connor Kuehl <ckuehl@redhat.com>

The contents of this patch were initially developed and posted by Han
Han[1], however, it appears the original patch was not applied. Since
then, the relevant documentation has been moved and adapted to a new
format.

I've taken most of the original wording and tweaked it according to
some of the feedback from the original patch submission. I've also
adapted it to restructured text, which is the format the documentation
currently uses.

[1] https://lists.nongnu.org/archive/html/qemu-block/2019-10/msg01253.html

Fixes: https://bugzilla.redhat.com/1763105
Signed-off-by: Han Han <hhan@redhat.com>
Suggested-by: Max Reitz <mreitz@redhat.com>
[ Max: provided description of data_file_raw behavior ]
Signed-off-by: Connor Kuehl <ckuehl@redhat.com>
Message-Id: <20210505195512.391128-1-ckuehl@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 docs/tools/qemu-img.rst | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst
index c9efcfaefc..cfe1147879 100644
--- a/docs/tools/qemu-img.rst
+++ b/docs/tools/qemu-img.rst
@@ -866,6 +866,37 @@ Supported image file formats:
     issue ``lsattr filename`` to check if the NOCOW flag is set or not
     (Capital 'C' is NOCOW flag).
 
+  ``data_file``
+    Filename where all guest data will be stored. If this option is used,
+    the qcow2 file will only contain the image's metadata.
+
+    Note: Data loss will occur if the given filename already exists when
+    using this option with ``qemu-img create`` since ``qemu-img`` will create
+    the data file anew, overwriting the file's original contents. To simply
+    update the reference to point to the given pre-existing file, use
+    ``qemu-img amend``.
+
+  ``data_file_raw``
+    If this option is set to ``on``, QEMU will always keep the external data
+    file consistent as a standalone read-only raw image.
+
+    It does this by forwarding all write accesses to the qcow2 file through to
+    the raw data file, including their offsets. Therefore, data that is visible
+    on the qcow2 node (i.e., to the guest) at some offset is visible at the same
+    offset in the raw data file. This results in a read-only raw image. Writes
+    that bypass the qcow2 metadata may corrupt the qcow2 metadata because the
+    out-of-band writes may result in the metadata falling out of sync with the
+    raw image.
+
+    If this option is ``off``, QEMU will use the data file to store data in an
+    arbitrary manner. The file’s content will not make sense without the
+    accompanying qcow2 metadata. Where data is written will have no relation to
+    its offset as seen by the guest, and some writes (specifically zero writes)
+    may not be forwarded to the data file at all, but will only be handled by
+    modifying qcow2 metadata.
+
+    This option can only be enabled if ``data_file`` is set.
+
 ``Other``
 
   QEMU also supports various other image file formats for
-- 
2.31.1



  parent reply	other threads:[~2021-05-14 17:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 16:44 [PULL 00/19] Block patches Max Reitz
2021-05-14 16:44 ` [PULL 01/19] iotests/231: Update expected deprecation message Max Reitz
2021-05-14 16:44 ` [PULL 02/19] block/rbd: Add an escape-aware strchr helper Max Reitz
2021-05-14 16:44 ` [PULL 03/19] monitor: hmp_qemu_io: acquire aio contex, fix crash Max Reitz
2021-05-20 13:44   ` Peter Maydell
2021-05-20 13:51     ` Max Reitz
2021-05-14 16:44 ` [PULL 04/19] mirror: stop cancelling in-flight requests on non-force cancel in READY Max Reitz
2021-05-14 16:45 ` [PULL 05/19] qemu-iotests: do not buffer the test output Max Reitz
2021-05-14 16:45 ` [PULL 06/19] qemu-iotests: allow passing unittest.main arguments to the test scripts Max Reitz
2021-05-14 16:45 ` [PULL 07/19] qemu-iotests: move command line and environment handling from TestRunner to TestEnv Max Reitz
2021-05-14 16:45 ` [PULL 08/19] qemu-iotests: let "check" spawn an arbitrary test command Max Reitz
2021-05-14 16:45 ` [PULL 09/19] qemu-iotests: fix case of SOCK_DIR already in the environment Max Reitz
2021-05-14 16:45 ` Max Reitz [this message]
2021-05-14 16:45 ` [PULL 11/19] block/copy-on-read: use bdrv_drop_filter() and drop s->active Max Reitz
2021-05-14 16:45 ` [PULL 12/19] qemu-iotests: fix pylint 2.8 consider-using-with error Max Reitz
2021-05-14 16:45 ` [PULL 13/19] block/write-threshold: don't use write notifiers Max Reitz
2021-05-14 16:45 ` [PULL 14/19] block: drop " Max Reitz
2021-05-14 16:45 ` [PULL 15/19] test-write-threshold: rewrite test_threshold_(not_)trigger tests Max Reitz
2021-05-14 16:45 ` [PULL 16/19] block/write-threshold: drop extra APIs Max Reitz
2021-05-14 16:45 ` [PULL 17/19] test-write-threshold: drop extra tests Max Reitz
2021-05-14 16:45 ` [PULL 18/19] test-write-threshold: drop extra TestStruct structure Max Reitz
2021-05-14 16:45 ` [PULL 19/19] write-threshold: deal with includes Max Reitz
2021-05-17 12:56 ` [PULL 00/19] Block patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210514164514.1057680-11-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.