From nobody Mon Feb 9 06:01:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1635946214606316.7530960274604; Wed, 3 Nov 2021 06:30:14 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-430-UGm4VQtVOJe8jWg5hLQ_DQ-1; Wed, 03 Nov 2021 09:30:10 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A5C395721E; Wed, 3 Nov 2021 13:30:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7AF4B708DF; Wed, 3 Nov 2021 13:30:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 37451181A1D1; Wed, 3 Nov 2021 13:30:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A3DTqKf026623 for ; Wed, 3 Nov 2021 09:29:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id EC9872026D46; Wed, 3 Nov 2021 13:29:51 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6C462026D65 for ; Wed, 3 Nov 2021 13:29:48 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C2515811E78 for ; Wed, 3 Nov 2021 13:29:48 +0000 (UTC) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2119.outbound.protection.outlook.com [40.107.20.119]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-383-VRv3NIGKP-6hlSd8W87V8g-3; Wed, 03 Nov 2021 09:29:45 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB5256.eurprd08.prod.outlook.com (2603:10a6:20b:e7::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Wed, 3 Nov 2021 13:29:39 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::a994:9f7c:53a5:84bc]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::a994:9f7c:53a5:84bc%5]) with mapi id 15.20.4649.020; Wed, 3 Nov 2021 13:29:39 +0000 Received: from kvm.ch-qa.sw.ru (130.117.225.5) by AS9PR0301CA0015.eurprd03.prod.outlook.com (2603:10a6:20b:468::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Wed, 3 Nov 2021 13:29:38 +0000 X-MC-Unique: UGm4VQtVOJe8jWg5hLQ_DQ-1 X-MC-Unique: VRv3NIGKP-6hlSd8W87V8g-3 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 3/3] qapi: deprecate drive-backup Date: Wed, 3 Nov 2021 14:29:12 +0100 Message-ID: <20211103132912.1977438-4-vsementsov@virtuozzo.com> In-Reply-To: <20211103132912.1977438-1-vsementsov@virtuozzo.com> References: <20211103132912.1977438-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: AS9PR0301CA0015.eurprd03.prod.outlook.com (2603:10a6:20b:468::23) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02671726-5ee7-4439-70b5-08d99ecdfc6f X-MS-TrafficTypeDiagnostic: AM6PR08MB5256: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: cf0nWX55ELPOufYb8A9Pg4zNb09zinsy6qLV3/J+Ivj1TMVN9SYAZUGMuwh6RIwvINcAxyV4I7MJDxxkbOujaEvAml4NiPGs5Ubinyzk0ROhtf4FgccjysrEl3/7Zw4pqQtUqA94jWdEtoGCwSvoZvMUcg2xbLcY/5tFCQk1ZHxTjLxmd+7qcnW4RYf+cqMVUyc0GPjyruCtDjmCt4eP414tiqM1SAg07AclY1KMEJGTUM+EnIRPwhxjNbrxwDCk5jM4Qr0oSQvtAd2tEYrdkPFAAkZzkOUuA9yPExqfQqXuRlnaSNxHeuRSkfCGb/4El1EW4bVNllK82Ldaro+Zn3HXlZgMYPvJq3d8qGkxccsSowd6U66+LBBSwIKkyLdC4Uwix6ljwyXXtLjfIOPK+7+Tn2CBbaIAQpOLUotED+nO/o950xE3nwig4Loi7tI7WahVo1BhYZniUiOVxBgDDD6b8YN6Fmmhc4AQGJeXXdPx8MCDwyFPAA5PtLYxTg2XIJ2FuIssmKfPVORybOaW9MQ3B1hfQLqX5BS7NrX83yy9UNEy3y7Zr725t7XWGfrYz9O+cTRipb41lA/4WbaSGbaep4AG19uRq+fEL5JF84/2lEhsJL8pMFJXMTGs01lTVgdVgJWYIU+4XdaQA1B/F+nZWv326W6HeHr1MZdwybkXSdnQYglAzf/QvHfwlAVRUAJS9qYxUKmEQpGZNcmSWg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(1076003)(8676002)(52116002)(6486002)(6506007)(508600001)(6666004)(186003)(8936002)(2906002)(83380400001)(956004)(2616005)(36756003)(66946007)(5660300002)(38100700002)(66476007)(86362001)(6916009)(38350700002)(4326008)(6512007)(66556008)(316002)(26005); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?yRNwGu3uHUkdWIuTT9Vkd2VkrBoZ/9+zPko0RjQ0sCp2JI0juVN38MFMEv4+?= =?us-ascii?Q?FWof2Whp9NtxCR7WcvyZm1W1HVeyUrwbk0zM08oNKIxw8eV3/tSjgcqYaxtD?= =?us-ascii?Q?Jb07bB3TzcqQtuwNq4XsTuSL2wtkmV0TyLp+s46wG5QJGm+P888KWFnPqSwJ?= =?us-ascii?Q?lr8x6nMUih8ERL+Gav5EeK6SzH+LKyzWxFkCljg5+YzVNItPUaOGrUAkJulp?= =?us-ascii?Q?93T+kmTvJDE7tS/VU4PYaPjpIOFk+qj8Ybk5awC62cC+/L2ad5rRXGDLm4Gt?= =?us-ascii?Q?6vG6rIWxk8K4RcnVmCIzq+4C/dCLtsZWm2I8DmrWWnqA63KvQdKZnnS+n1JE?= =?us-ascii?Q?GybViev+h0dHPp5KiN9LHu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ascii?Q?fcV8hBQEV91DpaMW9hq+Ijw7oYF3BbLfr5d6/WloTzdjWN2XElIMXk5in7gn?= =?us-ascii?Q?1hu9gfBvY8hKyCx2RT9H85HHLpmLlzRrFMV+gKoZ0I1J8YbMqiAHYPAt5Oh7?= =?us-ascii?Q?g/KPjMAYZjt1TRWhUjTRvRRJXsklXb/11CK+mucNu/IfOzjPhb6QnNFO6bMJ?= =?us-ascii?Q?jjY1hHAl6tCAQg/nxVdLvx7Ro1NXjbJpYtOW6BufMQRjd0eJvTaCuB91W8vs?= =?us-ascii?Q?Vh9i76tNmhkkz8HiFEhVpj60MDu6hoGot1SL5kk7pIkXPKkxoHQtQnJnJJ6F?= =?us-ascii?Q?73+jz6ye0AZzgi+9TFFtazJo2Ua6xIqg4Dchgi2BmoR3E4RTT81ziHJhWwyp?= =?us-ascii?Q?HyU5r90X6OnPQSacmZITY/1OIpBEABmAQcvmE8sgp3ijt/38beyJx7D+9v4F?= =?us-ascii?Q?GJ9BAg=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02671726-5ee7-4439-70b5-08d99ecdfc6f X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2021 13:29:39.1486 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: V7Llyh4ri1fqYV8JsB2IlQ3bkuLb/mShQ63tfYKaEZN5OLYHTiyN0lG63tKOX63iJ4ueak3diaLbkrkj5tphp/O7ykbUk1A6Kk5dVLwj3OA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5256 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 1A3DTqKf026623 X-loop: libvir-list@redhat.com Cc: vsementsov@virtuozzo.com, libvir-list@redhat.com, jsnow@redhat.com, xiechanglong.d@gmail.com, qemu-devel@nongnu.org, armbru@redhat.com, wencongyang2@huawei.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1635946216088100001 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Kashyap Chamarthy --- docs/about/deprecated.rst | 11 ++++++ docs/interop/live-block-operations.rst | 47 +++++++++++++++++--------- qapi/block-core.json | 5 ++- 3 files changed, 46 insertions(+), 17 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 25b7ec8d92..4a4910143f 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -234,6 +234,17 @@ single ``bitmap``, the new ``block-export-add`` uses a= list of ``bitmaps``. Member ``values`` in return value elements with meta-type ``enum`` is deprecated. Use ``members`` instead. =20 +``drive-backup`` (since 6.2) +'''''''''''''''''''''''''''' + +Use ``blockdev-backup`` in combination 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 ------------------- =20 diff --git a/docs/interop/live-block-operations.rst b/docs/interop/live-blo= ck-operations.rst index 9e3635b233..d403d96f58 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. =20 -(4) ``drive-backup`` (and ``blockdev-backup``): Point-in-time (live) copy - of a block device to a destination. +(4) ``blockdev-backup`` (and the deprecated ``drive-backup``): + Point-in-time (live) copy of a block device to a destination. =20 =20 .. _`Interacting with a QEMU instance`: @@ -555,13 +555,14 @@ Currently, there are four different kinds: =20 (3) ``none`` -- Synchronize only the new writes from this point on. =20 - .. 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=3Dnone``, 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=3Dnone``, it's only the + first part. =20 (4) ``incremental`` -- Synchronize content that is described by the dirty bitmap @@ -928,19 +929,22 @@ Shutdown the guest, by issuing the ``quit`` QMP comma= nd:: } =20 =20 -Live disk backup --- ``drive-backup`` and ``blockdev-backup`` -------------------------------------------------------------- +Live disk backup --- ``blockdev-backup`` and the deprecated``drive-backup`` +--------------------------------------------------------------------------- =20 -The ``drive-backup`` (and its newer equivalent ``blockdev-backup``) allows +The ``blockdev-backup`` (and the deprecated ``drive-backup``) allows you to create a point-in-time snapshot. =20 -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. =20 =20 QMP invocation for ``drive-backup`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 +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:: =20 [A] <-- [B] <-- [C] <-- [D] @@ -965,11 +969,22 @@ will be issued, indicating the live block device job = operation has completed, and no further action is required. =20 =20 +Moving from the deprecated ``drive-backup`` to newer ``blockdev-backup`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +``blockdev-backup`` differs from ``drive-backup`` in how you specify +the 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 an existing block node. See +following sections for details and examples. + + Notes on ``blockdev-backup`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 -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`` command operates at node-level in a Block Driver State (BDS) graph. =20 E.g. the sequence of actions to create a point-in-time backup diff --git a/qapi/block-core.json b/qapi/block-core.json index b290782bf2..f4968d6404 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1709,6 +1709,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 # @@ -1724,7 +1727,7 @@ # ## { 'command': 'drive-backup', 'boxed': true, - 'data': 'DriveBackup' } + 'data': 'DriveBackup', 'features': ['deprecated'] } =20 ## # @blockdev-backup: --=20 2.31.1