From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VX7pv-0003la-Hs for qemu-devel@nongnu.org; Fri, 18 Oct 2013 07:03:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VX7po-0001xd-Op for qemu-devel@nongnu.org; Fri, 18 Oct 2013 07:03:19 -0400 Date: Fri, 18 Oct 2013 13:03:09 +0200 From: Stefan Hajnoczi Message-ID: <20131018110309.GB15317@stefanha-thinkpad.redhat.com> References: <1382037806-9393-1-git-send-email-sw@weilnetz.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1382037806-9393-1-git-send-email-sw@weilnetz.de> Subject: Re: [Qemu-devel] [PATCH] virtio: Remove unneeded memcpy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: qemu-trivial@nongnu.org, Stefan Hajnoczi , qemu-devel , Anthony Liguori On Thu, Oct 17, 2013 at 09:23:26PM +0200, Stefan Weil 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 > Signed-off-by: Stefan Weil > --- > hw/block/virtio-blk.c | 1 - > 1 file changed, 1 deletion(-) Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan