From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvrXe-0007ls-4F for qemu-devel@nongnu.org; Mon, 30 Jul 2012 11:06:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvrXZ-0007xN-4E for qemu-devel@nongnu.org; Mon, 30 Jul 2012 11:05:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvrXY-0007wl-Si for qemu-devel@nongnu.org; Mon, 30 Jul 2012 11:05:49 -0400 Message-ID: <5016A2C4.2020206@redhat.com> Date: Mon, 30 Jul 2012 17:05:40 +0200 From: Paolo Bonzini 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> In-Reply-To: <50169E93.1020502@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 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: jcody@redhat.com, eblake@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com Il 30/07/2012 16:47, Kevin Wolf ha scritto: >> > +BlockJobInfo *block_job_query(BlockJob *job) >> > +{ >> > + BlockJobInfo *info = g_new(BlockJobInfo, 1); >> > + info->type = g_strdup(job->job_type->job_type); >> > + info->device = g_strdup(bdrv_get_device_name(job->bs)); >> > + info->len = job->len; >> > + info->offset = job->offset; >> > + info->speed = job->speed; >> > + return info; >> > +} > 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. Paolo