From patchwork Fri Nov 8 10:16:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 11234511 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D56A7139A for ; Fri, 8 Nov 2019 10:19:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B5C262178F for ; Fri, 8 Nov 2019 10:19:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5C262178F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iT1Ma-00081T-7m for patchwork-qemu-devel@patchwork.kernel.org; Fri, 08 Nov 2019 05:19:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46291) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iT1KI-00068z-1z for qemu-devel@nongnu.org; Fri, 08 Nov 2019 05:17:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iT1KG-0004xM-31 for qemu-devel@nongnu.org; Fri, 08 Nov 2019 05:17:09 -0500 Received: from relay.sw.ru ([185.231.240.75]:56108) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iT1K8-0004ua-UE; Fri, 08 Nov 2019 05:17:01 -0500 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1iT1K3-0002Yp-Os; Fri, 08 Nov 2019 13:16:55 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v2 1/2] qapi: add filter-node-name option to drive-mirror Date: Fri, 8 Nov 2019 13:16:54 +0300 Message-Id: <20191108101655.10611-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191108101655.10611-1-vsementsov@virtuozzo.com> References: <20191108101655.10611-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, pkrempa@redhat.com, libvir-list@redhat.com, armbru@redhat.com, philmd@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, jsnow@redhat.com, vsementsov@virtuozzo.com, dinechin@redhat.com, den@openvz.org, mlevitsk@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" To correspond to blockdev-mirror command and make it possible to deprecate implicit filters in the next commit. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 7 +++++++ blockdev.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index aa97ee2641..93530d3a13 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1992,6 +1992,12 @@ # @on-target-error: the action to take on an error on the target, # default 'report' (no limitations, since this applies to # a different block device than @device). +# +# @filter-node-name: the node name that should be assigned to the +# filter driver that the mirror job inserts into the graph +# above @device. If this option is not given, a node name is +# autogenerated. (Since: 4.2) +# # @unmap: Whether to try to unmap target sectors where source has # only zero. If true, and target unallocated sectors will read as zero, # target image sectors will be unmapped; otherwise, zeroes will be @@ -2022,6 +2028,7 @@ '*speed': 'int', '*granularity': 'uint32', '*buf-size': 'int', '*on-source-error': 'BlockdevOnError', '*on-target-error': 'BlockdevOnError', + '*filter-node-name': 'str', '*unmap': 'bool', '*copy-mode': 'MirrorCopyMode', '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } } diff --git a/blockdev.c b/blockdev.c index 8e029e9c01..2ca614c77f 100644 --- a/blockdev.c +++ b/blockdev.c @@ -4008,7 +4008,7 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp) arg->has_on_source_error, arg->on_source_error, arg->has_on_target_error, arg->on_target_error, arg->has_unmap, arg->unmap, - false, NULL, + arg->has_filter_node_name, arg->filter_node_name, arg->has_copy_mode, arg->copy_mode, arg->has_auto_finalize, arg->auto_finalize, arg->has_auto_dismiss, arg->auto_dismiss,