On Thu, Feb 14, 2019 at 10:38:35PM +0000, Alex Bennée wrote: > Laszlo Ersek <ler...@redhat.com> 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