|
From: | Wenchao Xia |
Subject: | Re: [Qemu-devel] [PATCH V12 6/7] libqblock API implement |
Date: | Thu, 29 Nov 2012 14:25:09 +0800 |
User-agent: | Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 |
δΊ 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
[Prev in Thread] | Current Thread | [Next in Thread] |