From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXGmO-0000Ul-TB for qemu-devel@nongnu.org; Wed, 23 May 2012 14:59:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXGmN-0003x2-AQ for qemu-devel@nongnu.org; Wed, 23 May 2012 14:59:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57395) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXGmN-0003w8-1p for qemu-devel@nongnu.org; Wed, 23 May 2012 14:59:27 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4NIxOoZ029640 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 23 May 2012 14:59:24 -0400 Message-ID: <4FBD338A.7050105@redhat.com> Date: Wed, 23 May 2012 20:59:22 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1337700600-23870-1-git-send-email-alevy@redhat.com> In-Reply-To: <1337700600-23870-1-git-send-email-alevy@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv2 1/3] ui/spice-display.c: add missing initialization for valgrind List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alon Levy Cc: qemu-devel@nongnu.org On 05/22/12 17:29, Alon Levy wrote: > We can't initialize QXLDevSurfaceCreate field by field because it has a > pa hole, and so 4 bytes remain uninitialized when building on x86-64, so > just memset. So you get valgrind warnings for the hole? why? nobody should ever access the hole, so the missing initialization should not hurt in theory ... > Signed-off-by: Alon Levy > --- > ui/spice-display.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/ui/spice-display.c b/ui/spice-display.c > index 5418eb3..3e8f0b3 100644 > --- a/ui/spice-display.c > +++ b/ui/spice-display.c > @@ -244,6 +244,8 @@ void qemu_spice_create_host_primary(SimpleSpiceDisplay *ssd) > { > QXLDevSurfaceCreate surface; > > + memset(&surface, 0, sizeof(surface)); > + > dprint(1, "%s: %dx%d\n", __FUNCTION__, > ds_get_width(ssd->ds), ds_get_height(ssd->ds)); >