From: Paolo Bonzini <pbonzini@redhat.com>
To: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com,
stefanha@gmail.com, qemu-devel@nongnu.org, blauwirbel@gmail.com,
kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH V10 4/7] libqblock build system
Date: Tue, 20 Nov 2012 11:26:56 +0100 [thread overview]
Message-ID: <50AB5AF0.8010701@redhat.com> (raw)
In-Reply-To: <1353404767-4495-5-git-send-email-xiawenc@linux.vnet.ibm.com>
Mostly looks good...
Il 20/11/2012 10:46, Wenchao Xia ha scritto:
> +libqblock="yes"
Please make the default the empty string, i.e. "build if and only if
libtool is present".
>
> +##########################################
> +# libqblock probe
> +if test "$libqblock" != "no" ; then
> +# libqblock depends on libtool, default to yes if libtool exist
> + if ! has $libtool; then
> + echo
> + echo "Warning: libqblock needs libtool"
> + echo "Setting libqblock option to no."
> + echo
> + libqblock="no"
> + fi
> +fi
> #
Please fail here if libqblock=yes but libtool is not found.
> +#library objects
> +libqblock-obj-y= libqblock/libqblock.o libqblock/libqblock-error.o
> +extra-obj-y= main-loop.o qemu-timer.o qemu-tool.o iohandler.o \
> + compatfd.o
Are all of these really necessary? Instead of
main-loop/compatfd/iohandler, I think you can just add a new
libqblock/libqblock-aio.c file, and copy these definitions from main-loop.c:
QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
void qemu_aio_flush(void)
bool qemu_aio_wait(void)
void qemu_aio_set_fd_handler(int fd,
IOHandler *io_read,
IOHandler *io_write,
AioFlushHandler *io_flush,
void *opaque);
void qemu_aio_set_event_notifier(EventNotifier *notifier,
EventNotifierHandler *io_read,
AioFlushEventNotifierHandler *io_flush);
and also include part of qemu_init_main_loop in the creation of a new
QBlockContext (the first time it's called). We can later map each
QBlockContext to a different AioContext. Please document somewhere that
the library is not yet thread-safe.
> diff --git a/tests/Makefile b/tests/Makefile
> index ef6c9f2..997dbcc 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -84,6 +84,23 @@ check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)
> qtest-obj-y = tests/libqtest.o $(oslib-obj-y) libqemustub.a
> $(check-qtest-y): $(qtest-obj-y)
>
> +#libqblock build rules
> +check-libqblock-$(CONFIG_LIBQBLOCK) = tests/check-libqblock-qcow2$(EXESUF)
> +
> +$(check-libqblock-y): QEMU_INCLUDES += -I$(SRC_PATH)/tests -I$(SRC_PATH)/$(LIBQBLOCK_DIR)
> +LIBQBLOCK_TEST_DIR = tests/test_images
> +LIBQBLOCK_DIR = libqblock
> +LIBQBLOCK_SO = $(LIBQBLOCK_DIR)/.libs/libqblock.so
> +LIBQBLOCK_SO_LINK_FLAG = -Wl,-rpath,$(LIBQBLOCK_DIR)/.libs
These two should not be required. Just link in libqblock/libqblock.la
and libtool will do all of its magic.
Paolo
> +
> +#use libtool to link check-libqblock, use LIBQBLOCK_SO_LINK_FLAG to add lib search diretory
> +LTLINK_CHECK_LIBQBLOCK = $(call quiet-command, $(LIBTOOL) --mode=link --quiet --tag=CC \
> + $(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) $(LIBQBLOCK_SO_LINK_FLAG) \
> + -o $@ $(sort $(1)) $(LIBS), "lt LINK $(TARGET_DIR) $@")
> +
> +$(check-libqblock-y): %$(EXESUF): %.o
> + $(call LTLINK_CHECK_LIBQBLOCK, $^ $(LIBQBLOCK_SO))
next prev parent reply other threads:[~2012-11-20 10:27 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-20 9:46 [Qemu-devel] [PATCH V10 0/7] libqblock qemu block layer library Wenchao Xia
2012-11-20 9:46 ` [Qemu-devel] [PATCH V10 1/7] Buildsystem fix distclean error for pixman Wenchao Xia
2012-11-21 22:54 ` Peter Maydell
2012-11-22 1:50 ` Wenchao Xia
2012-11-20 9:46 ` [Qemu-devel] [PATCH V10 2/7] Buildsystem clean tests directory clearly Wenchao Xia
2012-11-20 9:46 ` [Qemu-devel] [PATCH V10 3/7] block export function path_has_protocol Wenchao Xia
2012-11-20 9:46 ` [Qemu-devel] [PATCH V10 4/7] libqblock build system Wenchao Xia
2012-11-20 10:26 ` Paolo Bonzini [this message]
2012-11-21 3:03 ` Wenchao Xia
2012-11-21 7:56 ` Paolo Bonzini
2012-11-22 1:47 ` Wenchao Xia
2012-11-20 9:46 ` [Qemu-devel] [PATCH V10 5/7] libqblock type defines Wenchao Xia
2012-11-20 10:30 ` Paolo Bonzini
2012-11-21 3:12 ` Wenchao Xia
2012-11-21 8:05 ` Paolo Bonzini
2012-11-22 1:50 ` Wenchao Xia
2012-11-20 9:46 ` [Qemu-devel] [PATCH V10 6/7] libqblock API Wenchao Xia
2012-11-20 10:41 ` Paolo Bonzini
2012-11-21 3:40 ` Wenchao Xia
2012-11-21 8:04 ` Paolo Bonzini
2012-11-22 1:48 ` Wenchao Xia
2012-11-20 9:46 ` [Qemu-devel] [PATCH V10 7/7] libqblock test example Wenchao Xia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50AB5AF0.8010701@redhat.com \
--to=pbonzini@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=blauwirbel@gmail.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=xiawenc@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).