* [Qemu-devel] [PATCH] option: Tweak invalid size error message and unbreak iotest 049
@ 2017-02-27 12:55 Markus Armbruster
2017-02-27 19:34 ` Eric Blake
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Markus Armbruster @ 2017-02-27 12:55 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, mreitz, qemu-block, thuth
Commit 75cdcd1 neglected to update tests/qemu-iotests/049.out, and
made the error message for negative size worse. Fix that.
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
tests/qemu-iotests/049.out | 14 +++++++++-----
util/qemu-option.c | 2 +-
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/049.out b/tests/qemu-iotests/049.out
index 4673b67..34e66db 100644
--- a/tests/qemu-iotests/049.out
+++ b/tests/qemu-iotests/049.out
@@ -95,14 +95,14 @@ qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1024
qemu-img: Image size must be less than 8 EiB!
qemu-img create -f qcow2 -o size=-1024 TEST_DIR/t.qcow2
-qemu-img: Parameter 'size' expects a non-negative number below 2^64
+qemu-img: Value '-1024' is out of range for parameter 'size'
qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1k
qemu-img: Image size must be less than 8 EiB!
qemu-img create -f qcow2 -o size=-1k TEST_DIR/t.qcow2
-qemu-img: Parameter 'size' expects a non-negative number below 2^64
+qemu-img: Value '-1k' is out of range for parameter 'size'
qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- 1kilobyte
@@ -110,15 +110,19 @@ qemu-img: Invalid image size specified! You may use k, M, G, T, P or E suffixes
qemu-img: kilobytes, megabytes, gigabytes, terabytes, petabytes and exabytes.
qemu-img create -f qcow2 -o size=1kilobyte TEST_DIR/t.qcow2
-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
+qemu-img: Parameter 'size' expects a non-negative number below 2^64
+Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta-
+and exabytes, respectively.
+qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- foobar
qemu-img: Invalid image size specified! You may use k, M, G, T, P or E suffixes for
qemu-img: kilobytes, megabytes, gigabytes, terabytes, petabytes and exabytes.
qemu-img create -f qcow2 -o size=foobar TEST_DIR/t.qcow2
-qemu-img: Parameter 'size' expects a size
-You may use k, M, G or T suffixes for kilobytes, megabytes, gigabytes and terabytes.
+qemu-img: Parameter 'size' expects a non-negative number below 2^64
+Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta-
+and exabytes, respectively.
qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
== Check correct interpretation of suffixes for cluster size ==
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 419f252..5ce1b5c 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -179,7 +179,7 @@ void parse_option_size(const char *name, const char *value,
err = qemu_strtosz(value, NULL, &size);
if (err == -ERANGE) {
- error_setg(errp, "Value '%s' is too large for parameter '%s'",
+ error_setg(errp, "Value '%s' is out of range for parameter '%s'",
value, name);
return;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] option: Tweak invalid size error message and unbreak iotest 049
2017-02-27 12:55 [Qemu-devel] [PATCH] option: Tweak invalid size error message and unbreak iotest 049 Markus Armbruster
@ 2017-02-27 19:34 ` Eric Blake
2017-02-27 19:38 ` Thomas Huth
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Eric Blake @ 2017-02-27 19:34 UTC (permalink / raw)
To: Markus Armbruster, qemu-devel; +Cc: kwolf, thuth, qemu-block, mreitz
[-- Attachment #1: Type: text/plain, Size: 544 bytes --]
On 02/27/2017 06:55 AM, Markus Armbruster wrote:
> Commit 75cdcd1 neglected to update tests/qemu-iotests/049.out, and
> made the error message for negative size worse. Fix that.
>
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> tests/qemu-iotests/049.out | 14 +++++++++-----
> util/qemu-option.c | 2 +-
Reviewed-by: Eric Blake <eblake@redhat.com>
--
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 --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] option: Tweak invalid size error message and unbreak iotest 049
2017-02-27 12:55 [Qemu-devel] [PATCH] option: Tweak invalid size error message and unbreak iotest 049 Markus Armbruster
2017-02-27 19:34 ` Eric Blake
@ 2017-02-27 19:38 ` Thomas Huth
2017-02-27 21:31 ` Christian Borntraeger
2017-02-28 13:33 ` Kevin Wolf
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2017-02-27 19:38 UTC (permalink / raw)
To: Markus Armbruster, qemu-devel; +Cc: kwolf, mreitz, qemu-block
On 27.02.2017 13:55, Markus Armbruster wrote:
> Commit 75cdcd1 neglected to update tests/qemu-iotests/049.out, and
> made the error message for negative size worse. Fix that.
>
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> tests/qemu-iotests/049.out | 14 +++++++++-----
> util/qemu-option.c | 2 +-
> 2 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/tests/qemu-iotests/049.out b/tests/qemu-iotests/049.out
> index 4673b67..34e66db 100644
> --- a/tests/qemu-iotests/049.out
> +++ b/tests/qemu-iotests/049.out
> @@ -95,14 +95,14 @@ qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1024
> qemu-img: Image size must be less than 8 EiB!
>
> qemu-img create -f qcow2 -o size=-1024 TEST_DIR/t.qcow2
> -qemu-img: Parameter 'size' expects a non-negative number below 2^64
> +qemu-img: Value '-1024' is out of range for parameter 'size'
> qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
>
> qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1k
> qemu-img: Image size must be less than 8 EiB!
>
> qemu-img create -f qcow2 -o size=-1k TEST_DIR/t.qcow2
> -qemu-img: Parameter 'size' expects a non-negative number below 2^64
> +qemu-img: Value '-1k' is out of range for parameter 'size'
> qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
>
> qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- 1kilobyte
> @@ -110,15 +110,19 @@ qemu-img: Invalid image size specified! You may use k, M, G, T, P or E suffixes
> qemu-img: kilobytes, megabytes, gigabytes, terabytes, petabytes and exabytes.
>
> qemu-img create -f qcow2 -o size=1kilobyte TEST_DIR/t.qcow2
> -Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
> +qemu-img: Parameter 'size' expects a non-negative number below 2^64
> +Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta-
> +and exabytes, respectively.
> +qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
>
> qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- foobar
> qemu-img: Invalid image size specified! You may use k, M, G, T, P or E suffixes for
> qemu-img: kilobytes, megabytes, gigabytes, terabytes, petabytes and exabytes.
>
> qemu-img create -f qcow2 -o size=foobar TEST_DIR/t.qcow2
> -qemu-img: Parameter 'size' expects a size
> -You may use k, M, G or T suffixes for kilobytes, megabytes, gigabytes and terabytes.
> +qemu-img: Parameter 'size' expects a non-negative number below 2^64
> +Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta-
> +and exabytes, respectively.
> qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
>
> == Check correct interpretation of suffixes for cluster size ==
> diff --git a/util/qemu-option.c b/util/qemu-option.c
> index 419f252..5ce1b5c 100644
> --- a/util/qemu-option.c
> +++ b/util/qemu-option.c
> @@ -179,7 +179,7 @@ void parse_option_size(const char *name, const char *value,
>
> err = qemu_strtosz(value, NULL, &size);
> if (err == -ERANGE) {
> - error_setg(errp, "Value '%s' is too large for parameter '%s'",
> + error_setg(errp, "Value '%s' is out of range for parameter '%s'",
> value, name);
> return;
> }
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] option: Tweak invalid size error message and unbreak iotest 049
2017-02-27 12:55 [Qemu-devel] [PATCH] option: Tweak invalid size error message and unbreak iotest 049 Markus Armbruster
2017-02-27 19:34 ` Eric Blake
2017-02-27 19:38 ` Thomas Huth
@ 2017-02-27 21:31 ` Christian Borntraeger
2017-02-28 13:33 ` Kevin Wolf
3 siblings, 0 replies; 5+ messages in thread
From: Christian Borntraeger @ 2017-02-27 21:31 UTC (permalink / raw)
To: Markus Armbruster, qemu-devel; +Cc: kwolf, thuth, qemu-block, mreitz
On 02/27/2017 01:55 PM, Markus Armbruster wrote:
> Commit 75cdcd1 neglected to update tests/qemu-iotests/049.out, and
> made the error message for negative size worse. Fix that.
>
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
> tests/qemu-iotests/049.out | 14 +++++++++-----
> util/qemu-option.c | 2 +-
> 2 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/tests/qemu-iotests/049.out b/tests/qemu-iotests/049.out
> index 4673b67..34e66db 100644
> --- a/tests/qemu-iotests/049.out
> +++ b/tests/qemu-iotests/049.out
> @@ -95,14 +95,14 @@ qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1024
> qemu-img: Image size must be less than 8 EiB!
>
> qemu-img create -f qcow2 -o size=-1024 TEST_DIR/t.qcow2
> -qemu-img: Parameter 'size' expects a non-negative number below 2^64
> +qemu-img: Value '-1024' is out of range for parameter 'size'
> qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
>
> qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1k
> qemu-img: Image size must be less than 8 EiB!
>
> qemu-img create -f qcow2 -o size=-1k TEST_DIR/t.qcow2
> -qemu-img: Parameter 'size' expects a non-negative number below 2^64
> +qemu-img: Value '-1k' is out of range for parameter 'size'
> qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
>
> qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- 1kilobyte
> @@ -110,15 +110,19 @@ qemu-img: Invalid image size specified! You may use k, M, G, T, P or E suffixes
> qemu-img: kilobytes, megabytes, gigabytes, terabytes, petabytes and exabytes.
>
> qemu-img create -f qcow2 -o size=1kilobyte TEST_DIR/t.qcow2
> -Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
> +qemu-img: Parameter 'size' expects a non-negative number below 2^64
> +Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta-
> +and exabytes, respectively.
> +qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
>
> qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- foobar
> qemu-img: Invalid image size specified! You may use k, M, G, T, P or E suffixes for
> qemu-img: kilobytes, megabytes, gigabytes, terabytes, petabytes and exabytes.
>
> qemu-img create -f qcow2 -o size=foobar TEST_DIR/t.qcow2
> -qemu-img: Parameter 'size' expects a size
> -You may use k, M, G or T suffixes for kilobytes, megabytes, gigabytes and terabytes.
> +qemu-img: Parameter 'size' expects a non-negative number below 2^64
> +Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta-
> +and exabytes, respectively.
> qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
>
> == Check correct interpretation of suffixes for cluster size ==
> diff --git a/util/qemu-option.c b/util/qemu-option.c
> index 419f252..5ce1b5c 100644
> --- a/util/qemu-option.c
> +++ b/util/qemu-option.c
> @@ -179,7 +179,7 @@ void parse_option_size(const char *name, const char *value,
>
> err = qemu_strtosz(value, NULL, &size);
> if (err == -ERANGE) {
> - error_setg(errp, "Value '%s' is too large for parameter '%s'",
> + error_setg(errp, "Value '%s' is out of range for parameter '%s'",
> value, name);
> return;
> }
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] option: Tweak invalid size error message and unbreak iotest 049
2017-02-27 12:55 [Qemu-devel] [PATCH] option: Tweak invalid size error message and unbreak iotest 049 Markus Armbruster
` (2 preceding siblings ...)
2017-02-27 21:31 ` Christian Borntraeger
@ 2017-02-28 13:33 ` Kevin Wolf
3 siblings, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2017-02-28 13:33 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel, mreitz, qemu-block, thuth
Am 27.02.2017 um 13:55 hat Markus Armbruster geschrieben:
> Commit 75cdcd1 neglected to update tests/qemu-iotests/049.out, and
> made the error message for negative size worse. Fix that.
>
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-02-28 13:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-27 12:55 [Qemu-devel] [PATCH] option: Tweak invalid size error message and unbreak iotest 049 Markus Armbruster
2017-02-27 19:34 ` Eric Blake
2017-02-27 19:38 ` Thomas Huth
2017-02-27 21:31 ` Christian Borntraeger
2017-02-28 13:33 ` 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).