[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 1/6] qemu-img: add support for --object with
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v2 1/6] qemu-img: add support for --object with 'dd' command |
Date: |
Fri, 3 Feb 2017 22:01:53 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 03.02.2017 13:02, Daniel P. Berrange wrote:
> The qemu-img dd command added --image-opts support, but missed
> the corresponding --object support. This prevented passing
> secrets (eg auth passwords) needed by certain disk images.
>
> Reviewed-by: Eric Blake <address@hidden>
> Signed-off-by: Daniel P. Berrange <address@hidden>
> ---
> qemu-img.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/qemu-img.c b/qemu-img.c
> index 74e3362..391a141 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -3949,6 +3949,7 @@ static int img_dd(int argc, char **argv)
> };
> const struct option long_options[] = {
> { "help", no_argument, 0, 'h'},
> + { "object", required_argument, 0, OPTION_OBJECT},
> { "image-opts", no_argument, 0, OPTION_IMAGE_OPTS},
> { 0, 0, 0, 0 }
> };
> @@ -3971,6 +3972,14 @@ static int img_dd(int argc, char **argv)
> case 'h':
> help();
> break;
> + case OPTION_OBJECT: {
> + QemuOpts *opts;
> + opts = qemu_opts_parse_noisily(&qemu_object_opts,
> + optarg, true);
> + if (!opts) {
> + return 1;
> + }
> + } break;
> case OPTION_IMAGE_OPTS:
> image_opts = true;
> break;
> @@ -4015,6 +4024,13 @@ static int img_dd(int argc, char **argv)
> ret = -1;
> goto out;
> }
> +
> + if (qemu_opts_foreach(&qemu_object_opts,
> + user_creatable_add_opts_foreach,
> + NULL, NULL)) {
> + return 1;
Why not ret = -1; goto out; like the other code around this block?
(Same for the case block above.)
Max
> + }
> +
> blk1 = img_open(image_opts, in.filename, fmt, 0, false, false);
>
> if (!blk1) {
>
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-block] [PATCH v2 6/6] qemu-img: copy *key-secret opts when opening newly created files, (continued)
[Qemu-block] [PATCH v2 4/6] qemu-img: add support for -o arg to dd command, Daniel P. Berrange, 2017/02/03
[Qemu-block] [PATCH v2 3/6] qemu-img: add support for conv=nocreat, notrunc args to dd command, Daniel P. Berrange, 2017/02/03
[Qemu-block] [PATCH v2 1/6] qemu-img: add support for --object with 'dd' command, Daniel P. Berrange, 2017/02/03
- Re: [Qemu-block] [PATCH v2 1/6] qemu-img: add support for --object with 'dd' command,
Max Reitz <=
[Qemu-block] [PATCH v2 5/6] qemu-img: introduce --target-image-opts for 'convert' command, Daniel P. Berrange, 2017/02/03