Hi Phil,

On 03/04/19 20:48, Philippe Mathieu-Daudé wrote:

> [PMD: rebased on 'pflash: Fixes and cleanups'
>       replaced CFI_PFLASH01 -> PFLASH_CFI01]

[...]

> -#define FLASH_MAP_UNIT_MAX 2
> +static PFlashCFI01 *pc_pflash_create(const char *name)
> +{
> +    DeviceState *dev = qdev_create(NULL, TYPE_PFLASH_CFI01);
> +
> +    qdev_prop_set_uint64(dev, "sector-length", 4096);

[...]

> -static void pc_system_flash_init(MemoryRegion *rom_memory)
> +static void pc_system_flash_map(PCMachineState *pcms,
> +                                MemoryRegion *rom_memory)
>  {
> -    int unit;
> -    DriveInfo *pflash_drv;
> +    hwaddr total_size = 0;
> +    int i;
>      BlockBackend *blk;
>      int64_t size;
> -    char *fatal_errmsg = NULL;
> -    hwaddr phys_addr = 0x100000000ULL;
>      uint32_t sector_size = 4096;

[...]

> +        if (size == 0) {
> +            error_report("system firmware block device %s is empty",
> +                         blk_name(blk));
> +            exit(1);
> +        }
> +        if (size == 0 || size % sector_size != 0) {

I think you missed my points (1) and (2), and Markus's followup, here:

https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg07018.html

Thanks
Laszlo

Reply via email to