* [Qemu-devel] [PATCH] hmp: Make block_stream set an explicit job ID
@ 2016-11-04 13:44 Alberto Garcia
2016-11-04 14:06 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Alberto Garcia @ 2016-11-04 13:44 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-block, Kevin Wolf, Alberto Garcia
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>
---
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);
--
2.10.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: Make block_stream set an explicit job ID
2016-11-04 13:44 [Qemu-devel] [PATCH] hmp: Make block_stream set an explicit job ID Alberto Garcia
@ 2016-11-04 14:06 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2016-11-04 14:06 UTC (permalink / raw)
To: Alberto Garcia; +Cc: qemu-devel, qemu-block
Am 04.11.2016 um 14:44 hat Alberto Garcia geschrieben:
> 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>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-04 14:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04 13:44 [Qemu-devel] [PATCH] hmp: Make block_stream set an explicit job ID Alberto Garcia
2016-11-04 14:06 ` Kevin Wolf
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).