qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, stefanha@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 03/12] hmp: Make block_stream set an explicit job ID
Date: Fri, 11 Nov 2016 17:55:02 +0100	[thread overview]
Message-ID: <1478883311-24052-4-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1478883311-24052-1-git-send-email-kwolf@redhat.com>

From: Alberto Garcia <berto@igalia.com>

A job ID is always required in order to create a block job on a
non-root node. The default ID (obtained with bdrv_get_device_name())
is otherwise empty in this scenario and the job cannot be created.

The HMP block_stream command doesn't set a job ID and therefore it
doesn't allow streaming to intermediate nodes. One solution is to add
an extra parameter to set a job ID. The other solution is to simply
use the node name passed to block_stream as job ID. This won't work
if it's automatically generated (because it contains a '#') but is
otherwise simple enough for all other cases.

This way 'block_stream node3' will create a job with the ID 'node3'
and the good old 'block_stream virtio0' will keep the previous
behaviour and use 'virtio0' for the job ID.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hmp.c b/hmp.c
index b5e3f54..819166d 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1570,7 +1570,7 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict)
     const char *base = qdict_get_try_str(qdict, "base");
     int64_t speed = qdict_get_try_int(qdict, "speed", 0);
 
-    qmp_block_stream(false, NULL, device, base != NULL, base, false, NULL,
+    qmp_block_stream(true, device, device, base != NULL, base, false, NULL,
                      false, NULL, qdict_haskey(qdict, "speed"), speed,
                      true, BLOCKDEV_ON_ERROR_REPORT, &error);
 
-- 
1.8.3.1

  parent reply	other threads:[~2016-11-11 16:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 01/12] block/nbd: Fix the leaked visitor Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 02/12] block/ssh: Code cleanup for unused parameter Kevin Wolf
2016-11-11 16:55 ` Kevin Wolf [this message]
2016-11-11 16:55 ` [Qemu-devel] [PULL 04/12] raw_bsd: move check to prevent overflow Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 05/12] raw_bsd: don't check size alignment when only offset is set Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 06/12] qcow2: Remove stale FIXME comment Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 07/12] nfs: Fix memory leak in nfs_file_create() Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 08/12] block: Fix bdrv_iterate_format() sorting Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 09/12] block: Emit modules in bdrv_iterate_format() Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 10/12] iotests: Skip test 162 if there is no SSH support Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 11/12] iotests: Always use -machine accel=qtest Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 12/12] raw-posix: Rename 'raw_s' to 'rs' Kevin Wolf

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=1478883311-24052-4-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).