summaryrefslogtreecommitdiffstats
path: root/hw/block
diff options
context:
space:
mode:
authorAndrey Shinkevich2019-05-29 20:20:27 +0200
committerMax Reitz2019-06-14 14:16:57 +0200
commit6653d1318d623681fc7e849e9ae5069ad144864a (patch)
tree9cc14b6fb6f5c51c85558ab4012951501ec9d3bd /hw/block
parentiotests: Fix intermittent failure in 219 (diff)
downloadqemu-6653d1318d623681fc7e849e9ae5069ad144864a.tar.gz
qemu-6653d1318d623681fc7e849e9ae5069ad144864a.tar.xz
qemu-6653d1318d623681fc7e849e9ae5069ad144864a.zip
hw/block/fdc: floppy command FIFO memory initialization
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>
Diffstat (limited to 'hw/block')
-rw-r--r--hw/block/fdc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index a64378f84b..77af9979de 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -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);