]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/block/fdc: floppy command FIFO memory initialization
authorAndrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Wed, 29 May 2019 18:20:27 +0000 (21:20 +0300)
committerMax Reitz <mreitz@redhat.com>
Fri, 14 Jun 2019 12:16:57 +0000 (14:16 +0200)
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 <andrey.shinkevich@virtuozzo.com>
Message-id: 1559154027-282547-1-git-send-email-andrey.shinkevich@virtuozzo.com
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
hw/block/fdc.c

index a64378f84bbdce35f2aff43a77c8a7b37bc91b4b..77af9979de1c7651f1421109413bd70b173d1d8f 100644 (file)
@@ -2648,6 +2648,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);