[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] hw/block: report when pflash backing file isn't
From: |
Geert Stappers |
Subject: |
Re: [Qemu-devel] [PATCH] hw/block: report when pflash backing file isn't aligned |
Date: |
Fri, 15 Feb 2019 07:23:18 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Thu, Feb 14, 2019 at 10:38:35PM +0000, Alex Bennée wrote:
> Laszlo Ersek <address@hidden> writes:
> > On 02/14/19 16:57, Alex Bennée wrote:
> >> + /*
> >> + * Validate the backing store is the right size for pflash
> >> + * devices. It has to be padded to a multiple of the flash block
> >> + * size.
> >> + */
> >> + if (pfl->blk) {
> >> + uint64_t backing_len = blk_getlength(pfl->blk);
> >> + if (device_len != backing_len) {
> >> + error_setg(errp, "backing file wrong size "
> >> + "(%" PRId64 " != %" PRId64")", backing_len,
> >> device_len);
> >> + return;
> >> + }
> >> + }
> >>
> >> memory_region_init_rom_device(
> >> &pfl->mem, OBJECT(dev),
> >>
>
> > - from a user POV, I find it more useful if the error message also shows
> > which quantity is which, not just two inequal numbers.
>
> How about:
>
> "backing file size (%) not enough for whole device (%)"
>
> ?
>
from a user POV, I find it more useful if the error messsage
resembles the actual test in the source. Above is test !=
How about
"backing file size (%) not equal to whole device size (%)"
?
Groeten
Geert Stappers
--
Leven en laten leven