From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, armbru@redhat.com, libvir-list@redhat.com,
jsnow@redhat.com, vsementsov@virtuozzo.com, eblake@redhat.com,
xiechanglong.d@gmail.com, wencongyang2@huawei.com,
nshirokovskiy@virtuozzo.com, pkrempa@redhat.com, den@openvz.org,
yur@virtuozzo.com, dim@virtuozzo.com, berrange@redhat.com,
kchamart@redhat.com
Subject: [PATCH v2 3/3] qapi: deprecate drive-backup
Date: Wed, 5 May 2021 16:58:03 +0300 [thread overview]
Message-ID: <20210505135803.67896-4-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20210505135803.67896-1-vsementsov@virtuozzo.com>
Modern way is using blockdev-add + blockdev-backup, which provides a
lot more control on how target is opened.
As example of drive-backup problems consider the following:
User of drive-backup expects that target will be opened in the same
cache and aio mode as source. Corresponding logic is in
drive_backup_prepare(), where we take bs->open_flags of source.
It works rather bad if source was added by blockdev-add. Assume source
is qcow2 image. On blockdev-add we should specify aio and cache options
for file child of qcow2 node. What happens next:
drive_backup_prepare() looks at bs->open_flags of qcow2 source node.
But there no BDRV_O_NOCAHE neither BDRV_O_NATIVE_AIO: BDRV_O_NOCAHE is
places in bs->file->bs->open_flags, and BDRV_O_NATIVE_AIO is nowhere,
as file-posix parse options and simply set s->use_linux_aio.
The documentation is updated in a minimal way, so that drive-backup is
noted only as a deprecated command, and blockdev-backup used in most of
places.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
TODO: We also need to deprecate drive-backup transaction action..
But union members in QAPI doesn't support 'deprecated' feature. I tried
to dig a bit, but failed :/ Markus, could you please help with it? At
least by advice?
docs/interop/live-block-operations.rst | 47 +++++++++++++++++---------
docs/system/deprecated.rst | 11 ++++++
qapi/block-core.json | 5 ++-
3 files changed, 46 insertions(+), 17 deletions(-)
diff --git a/docs/interop/live-block-operations.rst b/docs/interop/live-block-operations.rst
index 1073b930dc..f71f79ae2a 100644
--- a/docs/interop/live-block-operations.rst
+++ b/docs/interop/live-block-operations.rst
@@ -116,8 +116,8 @@ QEMU block layer supports.
(3) ``drive-mirror`` (and ``blockdev-mirror``): Synchronize a running
disk to another image.
-(4) ``drive-backup`` (and ``blockdev-backup``): Point-in-time (live) copy
- of a block device to a destination.
+(4) ``blockdev-backup`` (and deprecated ``drive-backup``): Point-in-time
+ (live) copy of a block device to a destination.
.. _`Interacting with a QEMU instance`:
@@ -553,13 +553,14 @@ Currently, there are four different kinds:
(3) ``none`` -- Synchronize only the new writes from this point on.
- .. note:: In the case of ``drive-backup`` (or ``blockdev-backup``),
- the behavior of ``none`` synchronization mode is different.
- Normally, a ``backup`` job consists of two parts: Anything
- that is overwritten by the guest is first copied out to
- the backup, and in the background the whole image is
- copied from start to end. With ``sync=none``, it's only
- the first part.
+ .. note:: In the case of ``blockdev-backup`` (or deprecated
+ ``drive-backup``), the behavior of ``none``
+ synchronization mode is different. Normally, a
+ ``backup`` job consists of two parts: Anything that is
+ overwritten by the guest is first copied out to the
+ backup, and in the background the whole image is copied
+ from start to end. With ``sync=none``, it's only the
+ first part.
(4) ``incremental`` -- Synchronize content that is described by the
dirty bitmap
@@ -924,19 +925,22 @@ Shutdown the guest, by issuing the ``quit`` QMP command::
}
-Live disk backup --- ``drive-backup`` and ``blockdev-backup``
--------------------------------------------------------------
+Live disk backup --- ``blockdev-backup`` and deprecated``drive-backup``
+-----------------------------------------------------------------------
-The ``drive-backup`` (and its newer equivalent ``blockdev-backup``) allows
+The ``blockdev-backup`` (and deprecated ``drive-backup``) allows
you to create a point-in-time snapshot.
-In this case, the point-in-time is when you *start* the ``drive-backup``
-(or its newer equivalent ``blockdev-backup``) command.
+In this case, the point-in-time is when you *start* the
+``blockdev-backup`` (or deprecated ``drive-backup``) command.
QMP invocation for ``drive-backup``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Note that ``drive-backup`` command is deprecated since Qemu 6.1 and
+will be removed in future.
+
Yet again, starting afresh with our example disk image chain::
[A] <-- [B] <-- [C] <-- [D]
@@ -961,11 +965,22 @@ will be issued, indicating the live block device job operation has
completed, and no further action is required.
+Moving from deprecated ``drive-backup`` to newer ``blockdev-backup``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``blockdev-backup`` differs in a way of specifying backup target.
+With ``blockdev-backup`` you can't specify filename as a target.
+Instead you use node-name of existing block node, which you may add
+by ``blockdev-add`` or ``blockdev-create`` commands. Correspondingly,
+``blockdev-backup`` doesn't have ``mode`` and ``format`` arguments
+which don't apply to existing block node. See following sections for
+details and examples.
+
+
Notes on ``blockdev-backup``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The ``blockdev-backup`` command is equivalent in functionality to
-``drive-backup``, except that it operates at node-level in a Block Driver
+The ``blockdev-backup`` operates at node-level in a Block Driver
State (BDS) graph.
E.g. the sequence of actions to create a point-in-time backup
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 80cae86252..676d72a1ed 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -186,6 +186,17 @@ Use the more generic commands ``block-export-add`` and ``block-export-del``
instead. As part of this deprecation, where ``nbd-server-add`` used a
single ``bitmap``, the new ``block-export-add`` uses a list of ``bitmaps``.
+``drive-backup`` (since 6.1)
+''''''''''''''''''''''''''''
+
+Use ``blockdev-backup`` in pair with ``blockdev-add`` instead.
+This change primarily separates the creation/opening process of the backup
+target with explicit, separate steps. ``blockdev-backup`` uses mostly the
+same arguments as ``drive-backup``, except the ``format`` and ``mode``
+options are removed in favor of using explicit ``blockdev-create`` and
+``blockdev-add`` calls. See :doc:`/interop/live-block-operations` for
+details.
+
System accelerators
-------------------
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 6d227924d0..8e2c6e1622 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1642,6 +1642,9 @@
# The operation can be stopped before it has completed using the
# block-job-cancel command.
#
+# Features:
+# @deprecated: This command is deprecated. Use @blockdev-backup instead.
+#
# Returns: - nothing on success
# - If @device is not a valid block device, GenericError
#
@@ -1657,7 +1660,7 @@
#
##
{ 'command': 'drive-backup', 'boxed': true,
- 'data': 'DriveBackup' }
+ 'data': 'DriveBackup', 'features': ['deprecated'] }
##
# @blockdev-backup:
--
2.29.2
next prev parent reply other threads:[~2021-05-05 14:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-05 13:58 [PATCH v2 0/3] qapi & doc: deprecate drive-backup Vladimir Sementsov-Ogievskiy
2021-05-05 13:58 ` [PATCH v2 1/3] docs/block-replication: use blockdev-backup Vladimir Sementsov-Ogievskiy
2021-05-14 20:23 ` John Snow
2021-05-05 13:58 ` [PATCH v2 2/3] docs/interop/bitmaps: " Vladimir Sementsov-Ogievskiy
2021-05-06 9:34 ` Kashyap Chamarthy
2021-05-14 20:27 ` John Snow
2021-05-05 13:58 ` Vladimir Sementsov-Ogievskiy [this message]
2021-05-06 9:57 ` [PATCH v2 3/3] qapi: deprecate drive-backup Kashyap Chamarthy
2021-05-14 22:38 ` John Snow
2021-05-24 14:06 ` Vladimir Sementsov-Ogievskiy
2021-05-24 18:37 ` John Snow
2021-09-01 13:29 ` Vladimir Sementsov-Ogievskiy
2021-09-01 14:33 ` Markus Armbruster
2021-06-08 11:12 ` Markus Armbruster
2021-06-08 11:46 ` Vladimir Sementsov-Ogievskiy
2021-06-09 10:49 ` Markus Armbruster
2021-07-05 19:12 ` Vladimir Sementsov-Ogievskiy
2021-09-15 19:25 ` Markus Armbruster
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=20210505135803.67896-4-vsementsov@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=den@openvz.org \
--cc=dim@virtuozzo.com \
--cc=eblake@redhat.com \
--cc=jsnow@redhat.com \
--cc=kchamart@redhat.com \
--cc=libvir-list@redhat.com \
--cc=nshirokovskiy@virtuozzo.com \
--cc=pkrempa@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=wencongyang2@huawei.com \
--cc=xiechanglong.d@gmail.com \
--cc=yur@virtuozzo.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).