From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, xieyongji@bytedance.com, kwolf@redhat.com,
hreitz@redhat.com, Coiby.Xu@gmail.com, pbonzini@redhat.com,
eduardo@habkost.net, mark.cave-ayland@ilande.co.uk,
michael.roth@amd.com, kkostiuk@redhat.com, qemu-block@nongnu.org
Subject: Re: [PATCH 2/7] block: Improve errors about block sizes
Date: Thu, 10 Oct 2024 16:05:16 +0100 [thread overview]
Message-ID: <ZwftLPKwkdrQbprq@redhat.com> (raw)
In-Reply-To: <20241010145630.985335-3-armbru@redhat.com>
On Thu, Oct 10, 2024 at 04:56:25PM +0200, Markus Armbruster wrote:
> Block sizes need to be a power of two between 512 and an arbitrary
> limit, currently 2MiB.
>
> Commit 5937835ac4c factored block size checking out of set_blocksize()
> into new check_block_size(), for reuse in block/export/.
>
> Its two error messages are okay for the original purpose:
>
> $ qemu-system-x86_64 -device ide-hd,physical_block_size=1
> qemu-system-x86_64: -device ide-hd,physical_block_size=1: Property .physical_block_size doesn't take value 1 (minimum: 512, maximum: 2097152)
> $ qemu-system-x86_64 -device ide-hd,physical_block_size=513
> qemu-system-x86_64: -device ide-hd,physical_block_size=513: Property .physical_block_size doesn't take value '513', it's not a power of 2
>
> They're mildly off for block exports:
>
> $ qemu-storage-daemon --blockdev node-name=nod0,driver=file,filename=foo.img --export type=vduse-blk,id=exp0,node-name=nod0,name=foo,logical-block-size=1
> qemu-storage-daemon: --export type=vduse-blk,id=exp0,node-name=nod0,name=foo,logical-block-size=1: Property exp0.logical-block-size doesn't take value 1 (minimum: 512, maximum: 2097152)
>
> The error message talks about a property. CLI options like --export
> don't have properties, they have parameters.
>
> Replace the two error messages by a single one that's okay for both
> purposes. Looks like this:
>
> qemu-storage-daemon: --export type=vduse-blk,id=exp0,node-name=nod0,name=foo,logical-block-size=1: parameter logical-block-size must be a power of 2 between 512 and 2097152
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> util/block-helpers.c | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2024-10-10 15:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 14:56 [PATCH 0/7] error: Eliminate QERR_PROPERTY_VALUE_OUT_OF_RANGE Markus Armbruster
2024-10-10 14:56 ` [PATCH 1/7] error: Drop superfluous #include "qapi/qmp/qerror.h" Markus Armbruster
2024-10-10 15:01 ` Daniel P. Berrangé
2024-10-10 14:56 ` [PATCH 2/7] block: Improve errors about block sizes Markus Armbruster
2024-10-10 15:05 ` Daniel P. Berrangé [this message]
2024-10-10 14:56 ` [PATCH 3/7] block: Adjust check_block_size() signature Markus Armbruster
2024-10-10 15:06 ` Daniel P. Berrangé
2024-10-10 14:56 ` [PATCH 4/7] target/i386/cpu: Avoid mixing signed and unsigned in property setters Markus Armbruster
2024-10-10 15:52 ` Daniel P. Berrangé
2024-10-10 14:56 ` [PATCH 5/7] target/i386/cpu: Improve errors for out of bounds property values Markus Armbruster
2024-10-10 15:56 ` Daniel P. Berrangé
2024-10-10 14:56 ` [PATCH 6/7] hw/intc/openpic: " Markus Armbruster
2024-10-10 15:56 ` Daniel P. Berrangé
2024-10-10 14:56 ` [PATCH 7/7] qerror: QERR_PROPERTY_VALUE_OUT_OF_RANGE is no longer used, drop Markus Armbruster
2024-10-10 15:57 ` Daniel P. Berrangé
2024-10-10 14:59 ` [PATCH 0/7] error: Eliminate QERR_PROPERTY_VALUE_OUT_OF_RANGE Markus Armbruster
2024-10-10 16:07 ` Daniel P. Berrangé
2024-10-10 17:03 ` Markus Armbruster
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=ZwftLPKwkdrQbprq@redhat.com \
--to=berrange@redhat.com \
--cc=Coiby.Xu@gmail.com \
--cc=armbru@redhat.com \
--cc=eduardo@habkost.net \
--cc=hreitz@redhat.com \
--cc=kkostiuk@redhat.com \
--cc=kwolf@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=michael.roth@amd.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=xieyongji@bytedance.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.