Patchwork [V2,1/3,RFC] libqblock-adding libqblock-test

login
register
mail settings
Submitter Wayne Xia
Date Aug. 9, 2012, 10:11 a.m.
Message ID <1344507072-11106-1-git-send-email-xiawenc@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/176045/
State New
Headers show

Comments

Wayne Xia - Aug. 9, 2012, 10:11 a.m.
This patch modify Makefile and expose a API in block.c that libqblock
need.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
---
 Makefile |    3 +++
 block.c  |    2 +-
 block.h  |    1 +
 3 files changed, 5 insertions(+), 1 deletions(-)

Patch

diff --git a/Makefile b/Makefile
index 621cb86..a5691ee 100644
--- a/Makefile
+++ b/Makefile
@@ -160,6 +160,9 @@  tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \
 	iohandler.o cutils.o iov.o async.o
 tools-obj-$(CONFIG_POSIX) += compatfd.o
 
+libqblock-test$(EXESUF): libqblock.o libqblock-test.o $(tools-obj-y) $(block-obj-y)
+	$(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^ $(LIBS),"  LINK  $@")
+
 qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y)
 qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y)
 qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y)
diff --git a/block.c b/block.c
index b38940b..d30f363 100644
--- a/block.c
+++ b/block.c
@@ -196,7 +196,7 @@  static void bdrv_io_limits_intercept(BlockDriverState *bs,
 }
 
 /* check if the path starts with "<protocol>:" */
-static int path_has_protocol(const char *path)
+int path_has_protocol(const char *path)
 {
     const char *p;
 
diff --git a/block.h b/block.h
index c89590d..3aca2fd 100644
--- a/block.h
+++ b/block.h
@@ -403,4 +403,5 @@  typedef enum {
 #define BLKDBG_EVENT(bs, evt) bdrv_debug_event(bs, evt)
 void bdrv_debug_event(BlockDriverState *bs, BlkDebugEvent event);
 
+int path_has_protocol(const char *path);
 #endif