[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/7] qemu-img amend: Support multiple -o options
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 7/7] qemu-img amend: Support multiple -o options |
Date: |
Wed, 19 Feb 2014 16:12:58 +0100 |
Multiple -o options has the same meaning as having a single option with
all settings in the order of their respective -o options.
Signed-off-by: Kevin Wolf <address@hidden>
---
qemu-img.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index e0d19f8..1a98926 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2783,18 +2783,16 @@ static int img_amend(int argc, char **argv)
if (is_help_option(optarg)) {
options_help = true;
} else if (!options) {
- options = optarg;
+ options = g_strdup(optarg);
} else {
- error_report("-o cannot be used multiple times. Please use
a "
- "single -o option with comma-separated
settings "
- "instead.");
- return 1;
+ options = g_strdup_printf("%s,%s", options, optarg);
}
break;
case 'f':
if (fmt) {
error_report("-f may only be specified once");
- return 1;
+ ret = -1;
+ goto out;
}
fmt = optarg;
break;
@@ -2850,6 +2848,8 @@ out:
}
free_option_parameters(create_options);
free_option_parameters(options_param);
+ g_free(options);
+
if (ret) {
return 1;
}
--
1.8.1.4
- [Qemu-devel] [PATCH 2/7] qemu-img convert: Detect options specified more than once, (continued)
- [Qemu-devel] [PATCH 2/7] qemu-img convert: Detect options specified more than once, Kevin Wolf, 2014/02/19
- [Qemu-devel] [PATCH 1/7] qemu-img create: Detect options specified more than once, Kevin Wolf, 2014/02/19
- [Qemu-devel] [PATCH 3/7] qemu-img amend: Detect options specified more than once, Kevin Wolf, 2014/02/19
- [Qemu-devel] [PATCH 4/7] qemu-img: Detect options specified more than once, Kevin Wolf, 2014/02/19
- [Qemu-devel] [PATCH 5/7] qemu-img create: Support multiple -o options, Kevin Wolf, 2014/02/19
- [Qemu-devel] [PATCH 6/7] qemu-img convert: Support multiple -o options, Kevin Wolf, 2014/02/19
- [Qemu-devel] [PATCH 7/7] qemu-img amend: Support multiple -o options,
Kevin Wolf <=
- Re: [Qemu-devel] [PATCH 0/7] qemu-img: Fix handling of multiply specified options, Markus Armbruster, 2014/02/20