From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdxZe-0005l4-4U for qemu-devel@nongnu.org; Thu, 29 Nov 2012 01:26:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdxZc-00012F-OA for qemu-devel@nongnu.org; Thu, 29 Nov 2012 01:26:13 -0500 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:44401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdxZc-00012B-6Q for qemu-devel@nongnu.org; Thu, 29 Nov 2012 01:26:12 -0500 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 29 Nov 2012 16:21:45 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qAT6FGXH4915642 for ; Thu, 29 Nov 2012 17:15:16 +1100 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qAT6Q5mj014649 for ; Thu, 29 Nov 2012 17:26:05 +1100 Message-ID: <50B6FFC5.1080401@linux.vnet.ibm.com> Date: Thu, 29 Nov 2012 14:25:09 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1354092935-6508-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1354092935-6508-7-git-send-email-xiawenc@linux.vnet.ibm.com> <50B5D690.6010909@redhat.com> In-Reply-To: <50B5D690.6010909@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V12 6/7] libqblock API implement List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, stefanha@gmail.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, blauwirbel@gmail.com 于 2012-11-28 17:17, Paolo Bonzini 写道: > Almost there... > > Il 28/11/2012 09:55, Wenchao Xia ha scritto: >> +/* This file was only used in libqblock, codes are copied from main-loop.c, >> + iohandler.c, compatfd.c now, it may have different implemention in the future. >> +*/ > > No need for this comment. > will remove. >> + >> +/* Signal fd support, original codes are from compatfd.c */ >> + >> bool qemu_signalfd_available(void) >> { >> return false; > > I think this stub can instead be placed in stubs/. > OK. >> +int qb_image_new(QBlockContext *context, >> + QBlockImage **p_qbi) >> +{ >> + *p_qbi = g_malloc0_n(1, sizeof(QBlockImage)); >> + (*p_qbi)->bdrvs = bdrv_new("hda"); >> + if ((*p_qbi)->bdrvs == NULL) { >> + QB_FREE(*p_qbi); >> + set_context_err(context, QB_ERR_INTERNAL_ERR, >> + "failed to create the driver."); >> + return context->err_ret; >> + } >> + return 0; >> +} > > The first reference should already be provided by qb_image_new. > OK. >> >> +__attribute__((constructor)) >> +static void libqblock_init(void) >> +{ >> + /* Todo: add an assertion about the ABI. */ >> + if (libqb_global_data.init_flag == 0) { >> + libqblock_runtime_init(); >> + libqb_global_data.init_flag = 1; >> + } >> +} > > > How can this be called with libqb_global_data.init_flag == 1? > OK, I will remove the if, but keep init_flag which can show library is already initialized. -- Best Regards Wenchao Xia