qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v2] hw/block/fdc: floppy command FIFO memory ini


From: John Snow
Subject: Re: [Qemu-block] [PATCH v2] hw/block/fdc: floppy command FIFO memory initialization
Date: Wed, 29 May 2019 14:22:31 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1


On 5/29/19 2:20 PM, Andrey Shinkevich wrote:
> The uninitialized memory allocated for the command FIFO of the
> floppy controller during the VM hardware initialization incurs
> many unwanted reports by Valgrind when VM state is being saved.
> That verbosity hardens a search for the real memory issues when
> the iotests run. Particularly, the patch eliminates 20 unnecessary
> reports of the Valgrind tool in the iotest #169.
> 
> Signed-off-by: Andrey Shinkevich <address@hidden>
> ---
> v2:
>   01: The pointer unnecessary check 'if (fdctrl->fifo)' was removed
>       as suggested by John.
> 
>  hw/block/fdc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/block/fdc.c b/hw/block/fdc.c
> index 6f19f12..9af762b 100644
> --- a/hw/block/fdc.c
> +++ b/hw/block/fdc.c
> @@ -2647,6 +2647,7 @@ static void fdctrl_realize_common(DeviceState *dev, 
> FDCtrl *fdctrl,
>  
>      FLOPPY_DPRINTF("init controller\n");
>      fdctrl->fifo = qemu_memalign(512, FD_SECTOR_LEN);
> +    memset(fdctrl->fifo, 0, FD_SECTOR_LEN);
>      fdctrl->fifo_size = 512;
>      fdctrl->result_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
>                                               fdctrl_result_timer, fdctrl);
> 

Great, thanks!

Reviewed-by: John Snow <address@hidden>



reply via email to

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