From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sx150-00089M-BJ for qemu-devel@nongnu.org; Thu, 02 Aug 2012 15:29:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sx14z-0006rk-BJ for qemu-devel@nongnu.org; Thu, 02 Aug 2012 15:29:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sx14z-0006rb-2w for qemu-devel@nongnu.org; Thu, 02 Aug 2012 15:29:05 -0400 Message-ID: <501AD4FB.5080104@redhat.com> Date: Thu, 02 Aug 2012 15:28:59 -0400 From: Jeff Cody MIME-Version: 1.0 References: <1343127865-16608-1-git-send-email-pbonzini@redhat.com> <1343127865-16608-5-git-send-email-pbonzini@redhat.com> <50169E93.1020502@redhat.com> <5016A2C4.2020206@redhat.com> <50179BA6.9000507@redhat.com> <50179C60.30105@redhat.com> In-Reply-To: <50179C60.30105@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 04/47] block: add block_job_query Reply-To: jcody@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , eblake@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com On 07/31/2012 04:50 AM, Paolo Bonzini wrote: > Il 31/07/2012 10:47, Kevin Wolf ha scritto: >>>>>> Why did you convert the initialisation to separate statement? If you >>>>>> really want to do this, I think using g_new0 would be safer now, but I >>>>>> actually like compound literals better. >>>> >>>> Later on I will have some more initialization beyond the list of fields, >>>> so I preferred an explicit list. I can change it back if you prefer. >> What I'm really interested in is having zero-initialisation for any not >> explicitly initialised fields, just to be on the safe side. You can do >> that with g_new0() or with compound literals, that's a matter of taste. > > Yes, and in fact I even have a change to g_new0 later in the series. > I'll squash that change in this patch. > > Paolo > > +1 on this... interestingly, I just ran into an issue with this patch while testing block-job-query on my commit patches - I got a segfault on the command query, because has_target was not initialized to 0, and so the target ptr was invalid. Changing it to g_new0() fixes it. Jeff