From: Eric Blake <eblake@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/3] block: Add QMP support for streaming to an intermediate layer
Date: Fri, 20 Feb 2015 15:38:04 -0700 [thread overview]
Message-ID: <54E7B74C.7010307@redhat.com> (raw)
In-Reply-To: <49b845c4a362ffd64ec78bbe0b165cd7addd2a4b.1424439295.git.berto@igalia.com>
[-- Attachment #1: Type: text/plain, Size: 1864 bytes --]
On 02/20/2015 06:53 AM, Alberto Garcia wrote:
> This adds the 'top' parameter to the 'block-stream' QMP command and
> checks that its value is valid before passing it to stream_start().
>
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
> blockdev.c | 19 +++++++++++++++----
> hmp.c | 2 +-
> include/qapi/qmp/qerror.h | 3 +++
> qapi/block-core.json | 18 ++++++++++++++----
> qmp-commands.hx | 2 +-
> 5 files changed, 34 insertions(+), 10 deletions(-)
> @@ -2123,12 +2125,21 @@ void qmp_block_stream(const char *device,
> aio_context = bdrv_get_aio_context(bs);
> aio_context_acquire(aio_context);
>
> - if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_STREAM, errp)) {
> + if (has_top) {
> + top_bs = bdrv_find_backing_image(bs, top);
> + if (top_bs == NULL) {
> + error_set(errp, QERR_TOP_NOT_FOUND, top);
> + goto out;
> + }
If I understand correctly, bdrv_find_backing_image has problems for
backing nodes that don't have a file name. Given our shift towards node
names, I think we really want to target node names rather than file
names when specifying which node we will use as the top bound receiving
the stream operations.
> +++ b/include/qapi/qmp/qerror.h
> @@ -127,6 +127,9 @@ void qerror_report_err(Error *err);
> #define QERR_SET_PASSWD_FAILED \
> ERROR_CLASS_GENERIC_ERROR, "Could not set password"
>
> +#define QERR_TOP_NOT_FOUND \
> + ERROR_CLASS_GENERIC_ERROR, "Top '%s' not found"
> +
Please don't. Just use error_setg() at the right place with the direct
message (existing QERR_ macros are a legacy holdover, and we shouldn't
be creating more of them).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-02-20 22:38 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-20 13:53 [Qemu-devel] [PATCH 0/3] Support streaming to an intermediate layer Alberto Garcia
2015-02-20 13:53 ` [Qemu-devel] [PATCH 1/3] block: " Alberto Garcia
2015-03-05 14:04 ` Kevin Wolf
2015-03-05 14:58 ` Alberto Garcia
2015-03-05 15:15 ` Kevin Wolf
2015-03-05 15:47 ` Alberto Garcia
2015-03-12 13:18 ` Alberto Garcia
2015-02-20 13:53 ` [Qemu-devel] [PATCH 2/3] block: Add QMP support for " Alberto Garcia
2015-02-20 22:38 ` Eric Blake [this message]
2015-02-23 12:23 ` Alberto Garcia
2015-02-23 13:04 ` Kevin Wolf
2015-02-24 14:08 ` Markus Armbruster
2015-03-05 14:09 ` Kevin Wolf
2015-03-05 15:12 ` Alberto Garcia
2015-03-11 16:38 ` Alberto Garcia
2015-03-12 15:45 ` Kevin Wolf
2015-03-17 15:00 ` Alberto Garcia
2015-03-17 15:22 ` Eric Blake
2015-03-17 15:40 ` Alberto Garcia
2015-03-17 15:28 ` Kevin Wolf
2015-03-18 12:29 ` Alberto Garcia
2015-02-20 13:53 ` [Qemu-devel] [PATCH 3/3] docs: Document how to stream " Alberto Garcia
2015-02-20 17:34 ` [Qemu-devel] [PATCH 0/3] Support streaming " Eric Blake
2015-02-20 19:05 ` Alberto Garcia
2015-02-20 22:49 ` Eric Blake
2015-02-22 15:08 ` Alberto Garcia
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=54E7B74C.7010307@redhat.com \
--to=eblake@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--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).