All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Shinkevich via <qemu-devel@nongnu.org>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, fam@euphon.net, stefanha@redhat.com,
	kwolf@redhat.com, mreitz@redhat.com, armbru@redhat.com,
	jsnow@redhat.com, eblake@redhat.com, den@openvz.org,
	vsementsov@virtuozzo.com, andrey.shinkevich@virtuozzo.com
Subject: [PATCH v12 04/14] qapi: add filter-node-name to block-stream
Date: Thu, 22 Oct 2020 21:13:33 +0300	[thread overview]
Message-ID: <1603390423-980205-5-git-send-email-andrey.shinkevich@virtuozzo.com> (raw)
In-Reply-To: <1603390423-980205-1-git-send-email-andrey.shinkevich@virtuozzo.com>

Provide the possibility to pass the 'filter-node-name' parameter to the
block-stream job as it is done for the commit block job.

Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/monitor/block-hmp-cmds.c | 4 ++--
 block/stream.c                 | 4 +++-
 blockdev.c                     | 4 +++-
 include/block/block_int.h      | 7 ++++++-
 qapi/block-core.json           | 6 ++++++
 5 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c
index d15a2be..e8a58f3 100644
--- a/block/monitor/block-hmp-cmds.c
+++ b/block/monitor/block-hmp-cmds.c
@@ -508,8 +508,8 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict)
 
     qmp_block_stream(true, device, device, base != NULL, base, false, NULL,
                      false, NULL, qdict_haskey(qdict, "speed"), speed, true,
-                     BLOCKDEV_ON_ERROR_REPORT, false, false, false, false,
-                     &error);
+                     BLOCKDEV_ON_ERROR_REPORT, false, NULL, false, false, false,
+                     false, &error);
 
     hmp_handle_error(mon, error);
 }
diff --git a/block/stream.c b/block/stream.c
index 8ce6729..e0540ee 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -221,7 +221,9 @@ static const BlockJobDriver stream_job_driver = {
 void stream_start(const char *job_id, BlockDriverState *bs,
                   BlockDriverState *base, const char *backing_file_str,
                   int creation_flags, int64_t speed,
-                  BlockdevOnError on_error, Error **errp)
+                  BlockdevOnError on_error,
+                  const char *filter_node_name,
+                  Error **errp)
 {
     StreamBlockJob *s;
     BlockDriverState *iter;
diff --git a/blockdev.c b/blockdev.c
index fe6fb5d..c917625 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2499,6 +2499,7 @@ void qmp_block_stream(bool has_job_id, const char *job_id, const char *device,
                       bool has_backing_file, const char *backing_file,
                       bool has_speed, int64_t speed,
                       bool has_on_error, BlockdevOnError on_error,
+                      bool has_filter_node_name, const char *filter_node_name,
                       bool has_auto_finalize, bool auto_finalize,
                       bool has_auto_dismiss, bool auto_dismiss,
                       Error **errp)
@@ -2581,7 +2582,8 @@ void qmp_block_stream(bool has_job_id, const char *job_id, const char *device,
     }
 
     stream_start(has_job_id ? job_id : NULL, bs, base_bs, base_name,
-                 job_flags, has_speed ? speed : 0, on_error, &local_err);
+                 job_flags, has_speed ? speed : 0, on_error,
+                 filter_node_name, &local_err);
     if (local_err) {
         error_propagate(errp, local_err);
         goto out;
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 38cad9d..f782737 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -1134,6 +1134,9 @@ int is_windows_drive(const char *filename);
  *                  See @BlockJobCreateFlags
  * @speed: The maximum speed, in bytes per second, or 0 for unlimited.
  * @on_error: The action to take upon error.
+ * @filter_node_name: The node name that should be assigned to the filter
+ * driver that the commit job inserts into the graph above @bs. NULL means
+ * that a node name should be autogenerated.
  * @errp: Error object.
  *
  * Start a streaming operation on @bs.  Clusters that are unallocated
@@ -1146,7 +1149,9 @@ int is_windows_drive(const char *filename);
 void stream_start(const char *job_id, BlockDriverState *bs,
                   BlockDriverState *base, const char *backing_file_str,
                   int creation_flags, int64_t speed,
-                  BlockdevOnError on_error, Error **errp);
+                  BlockdevOnError on_error,
+                  const char *filter_node_name,
+                  Error **errp);
 
 /**
  * commit_start:
diff --git a/qapi/block-core.json b/qapi/block-core.json
index ee5ebef..0a64306 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -2542,6 +2542,11 @@
 #            'stop' and 'enospc' can only be used if the block device
 #            supports io-status (see BlockInfo).  Since 1.3.
 #
+# @filter-node-name: the node name that should be assigned to the
+#                    filter driver that the stream job inserts into the graph
+#                    above @device. If this option is not given, a node name is
+#                    autogenerated. (Since: 5.2)
+#
 # @auto-finalize: When false, this job will wait in a PENDING state after it has
 #                 finished its work, waiting for @block-job-finalize before
 #                 making any block graph changes.
@@ -2572,6 +2577,7 @@
   'data': { '*job-id': 'str', 'device': 'str', '*base': 'str',
             '*base-node': 'str', '*backing-file': 'str', '*speed': 'int',
             '*on-error': 'BlockdevOnError',
+            '*filter-node-name': 'str',
             '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
 
 ##
-- 
1.8.3.1



  parent reply	other threads:[~2020-10-22 18:18 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 18:13 [PATCH v12 00/14] Apply COR-filter to the block-stream permanently Andrey Shinkevich via
2020-10-22 18:13 ` [PATCH v12 01/14] copy-on-read: support preadv/pwritev_part functions Andrey Shinkevich via
2020-10-22 18:13 ` [PATCH v12 02/14] block: add insert/remove node functions Andrey Shinkevich via
2020-10-23 14:24   ` Vladimir Sementsov-Ogievskiy
2020-10-23 14:32     ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 03/14] copy-on-read: add filter drop function Andrey Shinkevich via
2020-10-23 14:32   ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` Andrey Shinkevich via [this message]
2020-10-22 18:13 ` [PATCH v12 05/14] qapi: create BlockdevOptionsCor structure for COR driver Andrey Shinkevich via
2020-10-23 14:51   ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 06/14] copy-on-read: pass bottom node name to " Andrey Shinkevich via
2020-10-23 14:45   ` Vladimir Sementsov-Ogievskiy
2020-10-23 15:31     ` Andrey Shinkevich
2020-10-23 16:01       ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 07/14] copy-on-read: limit COR operations to bottom node Andrey Shinkevich via
2020-10-23 14:59   ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 08/14] iotests: add #310 to test bottom node in COR driver Andrey Shinkevich via
2020-10-27 14:23   ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 09/14] block: modify the comment for BDRV_REQ_PREFETCH flag Andrey Shinkevich via
2020-10-27 14:44   ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 10/14] block: include supported_read_flags into BDS structure Andrey Shinkevich via
2020-10-27 14:50   ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 11/14] copy-on-read: add support for read flags to COR-filter Andrey Shinkevich via
2020-10-27 14:46   ` Vladimir Sementsov-Ogievskiy
2020-10-27 14:56     ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 12/14] copy-on-read: skip non-guest reads if no copy needed Andrey Shinkevich via
2020-10-22 18:13 ` [PATCH v12 13/14] stream: skip filters when writing backing file name to QCOW2 header Andrey Shinkevich via
2020-10-27 15:09   ` Vladimir Sementsov-Ogievskiy
2020-10-27 16:01     ` Andrey Shinkevich
2020-10-27 16:21       ` Vladimir Sementsov-Ogievskiy
2020-10-27 16:42         ` Andrey Shinkevich
2020-10-27 16:44           ` Vladimir Sementsov-Ogievskiy
2020-10-22 18:13 ` [PATCH v12 14/14] block: apply COR-filter to block-stream jobs Andrey Shinkevich via
2020-10-27 16:13   ` Vladimir Sementsov-Ogievskiy
2020-10-27 17:48     ` Andrey Shinkevich
2020-10-27 17:57       ` Vladimir Sementsov-Ogievskiy
2020-10-27 18:24         ` Andrey Shinkevich
2020-12-02 18:18           ` Andrey Shinkevich
2020-12-03 19:19             ` Vladimir Sementsov-Ogievskiy

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=1603390423-980205-5-git-send-email-andrey.shinkevich@virtuozzo.com \
    --to=qemu-devel@nongnu.org \
    --cc=andrey.shinkevich@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@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 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.