qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.2] fw_cfg: fix boot order bug when dynamic


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH for-2.2] fw_cfg: fix boot order bug when dynamically modified via QOM
Date: Tue, 25 Nov 2014 10:53:12 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0


On 25/11/2014 05:38, address@hidden wrote:
> From: Gonglei <address@hidden>
> 
> When we dynamically modify boot order, the length of
> boot order will be changed, but we don't update
> s->files->f[i].size with new length. This casuse
> seabios read a wrong vale of qemu cfg file about
> bootorder.
> 
> Cc: Gerd Hoffmann <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> Signed-off-by: Gonglei <address@hidden>
> ---
>  hw/nvram/fw_cfg.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index e7ed27e..a7122ee 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -523,6 +523,7 @@ void *fw_cfg_modify_file(FWCfgState *s, const char 
> *filename,
>                          void *data, size_t len)
>  {
>      int i, index;
> +    void *ptr = NULL;
>  
>      assert(s->files);
>  
> @@ -531,8 +532,10 @@ void *fw_cfg_modify_file(FWCfgState *s, const char 
> *filename,
>  
>      for (i = 0; i < index; i++) {
>          if (strcmp(filename, s->files->f[i].name) == 0) {
> -            return fw_cfg_modify_bytes_read(s, FW_CFG_FILE_FIRST + i,
> -                                     data, len);
> +            ptr = fw_cfg_modify_bytes_read(s, FW_CFG_FILE_FIRST + i,
> +                                           data, len);
> +            s->files->f[i].size   = cpu_to_be32(len);
> +            return ptr;
>          }
>      }
>      /* add new one */
> 

Applied, thanks.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]