Skip to contentSkip to conversation

qemu-io - an I/O path exerciser

Qemu-devel Christoph Hellwig 4 participants 8 messages Mar 14, 2009 – Mar 19, 2009 Kbuild

lore
Share & tools
lore

Christoph Hellwig

author Applied
#0 lore raw

This patch adds a new qemu-io tool that links against the block layer and image formats and allow to exercise them without needing a guest image.

It is inspired by the xfs_io tool which does the same for plain file I/O. In fact the libxcmd library which is the backend of xfs_io is reused by this tool in a cutdown fashing.

In the future I'll add more commands to exercise the other bdrv methods. This tool is the basis of the I/O path test suite I'm working.

Note: this patch needs my previous patch

[PATCH 2/6] change vectored block I/O API to plain iovecs

applied.

Makefile +3 -1
Index: qemu/Makefile
===================================================================
@@ -206,7 +206,9 @@ qemu-img$(EXESUF): qemu-img.o qemu-tool.
 
 qemu-nbd$(EXESUF):  qemu-nbd.o qemu-tool.o osdep.o $(BLOCK_OBJS)
 
-qemu-img$(EXESUF) qemu-nbd$(EXESUF): LIBS += -lz
+qemu-io$(EXESUF):  qemu-io.o qemu-tool.o osdep.o cmd.o $(BLOCK_OBJS)
+
+qemu-img$(EXESUF) qemu-nbd$(EXESUF) qemu-io$(EXESUF): LIBS += -lz
 
 clean:
 # avoid old build problems by removing potentially incorrect old files
configure +1 -1
Index: qemu/configure
===================================================================
@@ -1541,7 +1541,7 @@ esac
 
 tools=
 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
-  tools="qemu-img\$(EXESUF) $tools"
+  tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
   if [ "$linux" = "yes" ] ; then
       tools="qemu-nbd\$(EXESUF) $tools"
   fi
qemu-io.c new file +924 -0

924 lines not on this page · raw message

cmd.c new file +565 -0

565 lines not on this page · raw message

cmd.h new file +78 -0

78 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Christoph Hellwig

This patch adds a new qemu-io tool that links against the block layer and image formats and allow to exercise them without needing a guest image.

I think this kind of thing can be done using "qemu-nbd" and any I/O tool.

Regards,
Laurent

#2 lore raw
Quoted 6 lines · Laurent Vivier

Le samedi 14 mars 2009 ?? 20:33 +0100, Christoph Hellwig a ??crit :

Quoted 2 lines

This patch adds a new qemu-io tool that links against the block layer and image formats and allow to exercise them without needing a guest image.

I think this kind of thing can be done using "qemu-nbd" and any I/O tool.

No it can't. qemu-nbd is using just one single I/O method while we have three each for read and write. Nevermind all the other bdrv_ methods which can't easily be exposed over nbd.

#3 lore raw
In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

This patch adds a new qemu-io tool that links against the block layer and image formats and allow to exercise them without needing a guest image.

Nice, I hope we find a lot of bugs with this.

Quoted 1 line

+static cmdinfo_t read_cmd = {

I'd add "const" to most cmdinfo_t structures where possible.

#4 lore raw
Quoted 10 lines · Blue Swirl
Quoted 3 lines · Christoph Hellwig

This patch adds a new qemu-io tool that links against the block layer and image formats and allow to exercise them without needing a guest image.

Nice, I hope we find a lot of bugs with this.

Quoted 1 line

+static cmdinfo_t read_cmd = {

I'd add "const" to most cmdinfo_t structures where possible.

Will do.

#5 lore raw
In reply to Christoph Hellwig
Quoted 11 lines · Christoph Hellwig

This patch adds a new qemu-io tool that links against the block layer and image formats and allow to exercise them without needing a guest image.

It is inspired by the xfs_io tool which does the same for plain file I/O. In fact the libxcmd library which is the backend of xfs_io is reused by this tool in a cutdown fashing.

In the future I'll add more commands to exercise the other bdrv methods. This tool is the basis of the I/O path test suite I'm working.

Testing aio cancellations would be a good addition to this. Cancellations are very rare, and in fact are broken right now.

Signature · 1 line
error compiling committee.c: too many arguments to function
#6 lore raw
Quoted 2 lines · Avi Kivity

Testing aio cancellations would be a good addition to this. Cancellations are very rare, and in fact are broken right now.

Yeah, I'll add that to my TODO list.

#7 lore raw
In reply to Christoph Hellwig

New version below. This deals with QEMUIOVector for the vectored APIs, so it doesn't need any previous patches applied. I've also added various additional commands for a better coverage of the block layer. The major missing items are the snapshot management commands and real aio testing.

Makefile +3 -1
Index: qemu/Makefile
===================================================================
@@ -206,7 +206,9 @@ qemu-img$(EXESUF): qemu-img.o qemu-tool.
 
 qemu-nbd$(EXESUF):  qemu-nbd.o qemu-tool.o osdep.o $(BLOCK_OBJS)
 
-qemu-img$(EXESUF) qemu-nbd$(EXESUF): LIBS += -lz
+qemu-io$(EXESUF):  qemu-io.o qemu-tool.o osdep.o cmd.o $(BLOCK_OBJS)
+
+qemu-img$(EXESUF) qemu-nbd$(EXESUF) qemu-io$(EXESUF): LIBS += -lz
 
 clean:
 # avoid old build problems by removing potentially incorrect old files
configure +1 -1
Index: qemu/configure
===================================================================
@@ -1535,7 +1535,7 @@ esac
 
 tools=
 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
-  tools="qemu-img\$(EXESUF) $tools"
+  tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
   if [ "$linux" = "yes" ] ; then
       tools="qemu-nbd\$(EXESUF) $tools"
   fi
qemu-io.c new file +1074 -0

1,074 lines not on this page · raw message

cmd.c new file +565 -0

565 lines not on this page · raw message

cmd.h new file +78 -0

78 lines not on this page · raw message