[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] virtio: Remove unneeded memcpy
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] virtio: Remove unneeded memcpy |
Date: |
Thu, 17 Oct 2013 21:09:23 +0100 |
On 17 October 2013 20:23, Stefan Weil <address@hidden> wrote:
> Report from valgrind:
>
> ==19521== Source and destination overlap in memcpy(0x31d38938, 0x31d38938, 64)
> ==19521== at 0x4A0A343: memcpy@@GLIBC_2.14 (in
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==19521== by 0x42774E: virtio_blk_device_init (virtio-blk.c:686)
> ==19521== by 0x46EE9E: virtio_device_init (virtio.c:1158)
> ==19521== by 0x25405E: device_realize (qdev.c:178)
> ==19521== by 0x2559B5: device_set_realized (qdev.c:699)
> ==19521== by 0x3A819B: property_set_bool (object.c:1315)
> ==19521== by 0x3A6CE0: object_property_set (object.c:803)
>
> Valgrind is right: blk == &s->blks, so it is a memcpy of 64 byte with
> source == destination which can be removed.
>
> Reported-by: Dave Airlie <address@hidden>
> Signed-off-by: Stefan Weil <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
I did a quick eyeball of the other memcpy()s in hw/*/*virtio*
and I think this is the only one with this problem.
-- PMM