[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH v3 01/11] block: Accept node-name f
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH v3 01/11] block: Accept node-name for block-stream |
Date: |
Thu, 07 Jul 2016 14:59:07 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Thu 07 Jul 2016 02:11:27 PM CEST, Kevin Wolf wrote:
> In order to remove the necessity to use BlockBackend names in the
> external API, we want to allow node-names everywhere. This converts
> block-stream to accept a node-name without lifting the restriction that
> we're operating at a root node.
>
> In case of an invalid device name, the command returns the GenericError
> error class now instead of DeviceNotFound, because this is what
> qmp_get_root_bs() returns.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> blockdev.c | 32 ++++++++++++++++++++------------
> qapi/block-core.json | 5 +----
> qmp-commands.hx | 2 +-
> tests/qemu-iotests/030 | 2 +-
> 4 files changed, 23 insertions(+), 18 deletions(-)
>
> diff --git a/blockdev.c b/blockdev.c
> index 0f8065c..01e57c9 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -1172,6 +1172,23 @@ fail:
> return dinfo;
> }
>
> +static BlockDriverState *qmp_get_root_bs(const char *name, Error **errp)
> +{
> + BlockDriverState *bs;
> +
> + bs = bdrv_lookup_bs(name, name, errp);
> + if (bs == NULL) {
> + return NULL;
> + }
> +
> + if (!bdrv_has_blk(bs)) {
> + error_setg(errp, "Need a root block node");
> + return NULL;
> + }
Since b6d2e59995f when you create a block job a new BlockBackend is
created on top of the BDS. What happens with this check if we allow
creating jobs in a non-root BDS?
Berto
[Qemu-devel] [PATCH v3 02/11] block: Accept node-name for block-commit, Kevin Wolf, 2016/07/07
[Qemu-devel] [PATCH v3 03/11] block: Accept node-name for blockdev-backup, Kevin Wolf, 2016/07/07