Skip to contentSkip to conversation

Support Archipelago as a QEMU block backend

PATCH Superseded Chrysostomos Nanakos 4 participants 9 messages Jun 2, 2014 – Jun 4, 2014 Block layer

v2 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v2 cover Support Archipelago as a QEMU block backend

v2:
- Implement .bdrv_parse_filename() function to convert the shortuct version with a single string to the individual options.
- Remove global variables and move relevant fields to ArchipelagoAIOCB struct.
- Remove ArchipelagoConf struct and use the relevant fields as individual arguments.
- Remove ArchipelagoCB struct and use ArchipelagoAIOCB instead.
- Remove ArchipelagoThread struct and move relevant fields to ArchipelagoAIOCB instead. Now an I/O thread is spawned for per-device to handle all async I/O requests.
- Remove double data copy, use qemu_iovec_from_buf() and copy data directly to the destination buffer.
- Remove archipelago_aio_bh_cb() function, a full request is completed in qemu_archipelago_complete_aio() instead.
- Resolve proposed changes from Kevin Wolf and miscellaneous style issues.

Chrysostomos Nanakos (1):
block: Support Archipelago as a QEMU block backend

 MAINTAINERS         |    5 +
 block/Makefile.objs |    1 +
 block/archipelago.c | 1174 +++++++++++++++++++++++++++++++++++++++++++++++++++
 configure           |   40 ++
 4 files changed, 1220 insertions(+)
 create mode 100644 block/archipelago.c
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/1 block: Support Archipelago as a QEMU block backend

VM Image on Archipelago volume is specified like this:

file=archipelago:<volumename>[/mport=<mapperd_port>[:vport=<vlmcd_port>]] or

file.driver=archipelago,file.volume=<volumename>[,file.mport=<mapperd_port>[, file.vport=<vlmcd_port>]]

'archipelago' is the protocol.

'mport' is the port number on which mapperd is listening. This is optional and if not specified, QEMU will make Archipelago to use the default port.

'vport' is the port number on which vlmcd is listening. This is optional and if not specified, QEMU will make Archipelago to use the default port.

Examples:

file=archipelago:my_vm_volume file=archipelago:my_vm_volume/mport=123 file=archipelago:my_vm_volume/mport=123:vport=1234

or

file.driver=archipelago,file.volume=my_vm_volume file.driver=archipelago,file.volume=my_vm_volume,file.mport=123 file.driver=archipelago,file.volume=my_vm_volume,file.mport=123, file.vport=1234

---
 MAINTAINERS         |    5 +
 block/Makefile.objs |    1 +
 block/archipelago.c | 1174 +++++++++++++++++++++++++++++++++++++++++++++++++++
 configure           |   40 ++
 4 files changed, 1220 insertions(+)
 create mode 100644 block/archipelago.c
MAINTAINERS +5 -0
index 51a6f51..11f4abf 100644
@@ -984,3 +984,8 @@ SSH
 M: Richard W.M. Jones <[email protected]>
 S: Supported
 F: block/ssh.c
+
+ARCHIPELAGO
+M: Chrysostomos Nanakos <[email protected]>
+S: Maintained
+F: block/archipelago.c
block/Makefile.objs +1 -0
index fd88c03..895c30d 100644
@@ -17,6 +17,7 @@ block-obj-$(CONFIG_LIBNFS) += nfs.o
 block-obj-$(CONFIG_CURL) += curl.o
 block-obj-$(CONFIG_RBD) += rbd.o
 block-obj-$(CONFIG_GLUSTERFS) += gluster.o
+block-obj-$(CONFIG_ARCHIPELAGO) += archipelago.o
 block-obj-$(CONFIG_LIBSSH2) += ssh.o
 endif
 
block/archipelago.c new file +1174 -0

1,174 lines not on this page · raw message

configure +40 -0
index 0e516f9..9c738a0 100755
@@ -317,6 +317,7 @@ seccomp=""
 glusterfs=""
 glusterfs_discard="no"
 glusterfs_zerofill="no"
+archipelago=""
 virtio_blk_data_plane=""
 gtk=""
 gtkabi=""
@@ -1062,6 +1063,10 @@ for opt do
   ;;
   --enable-glusterfs) glusterfs="yes"
   ;;
+  --disable-archipelago) archipelago="no"
+  ;;
+  --enable-archipelago) archipelago="yes"
+  ;;
   --disable-virtio-blk-data-plane) virtio_blk_data_plane="no"
   ;;
   --enable-virtio-blk-data-plane) virtio_blk_data_plane="yes"
@@ -1351,6 +1356,8 @@ Advanced options (experts only):
   --enable-coroutine-pool  enable coroutine freelist (better performance)
   --enable-glusterfs       enable GlusterFS backend
   --disable-glusterfs      disable GlusterFS backend
+  --enable-archipelago     enable Archipelago backend
+  --disable-archipelago    disable Archipelago backend
   --enable-gcov            enable test coverage analysis with gcov
   --gcov=GCOV              use specified gcov [$gcov_tool]
   --enable-tpm             enable TPM support
@@ -3008,6 +3015,33 @@ EOF
   fi
 fi
 
+
+##########################################
+# archipelago probe
+if test "$archipelago" != "no" ; then
+    cat > $TMPC <<EOF
+#include <stdio.h>
+#include <xseg/xseg.h>
+#include <xseg/protocol.h>
+int main(void) {
+    xseg_initialize();
+    return 0;
+}
+EOF
+    archipelago_libs=-lxseg
+    if compile_prog "" "$archipelago_libs"; then
+        archipelago="yes"
+        libs_tools="$archipelago_libs $libs_tools"
+        libs_softmmu="$archipelago_libs $libs_softmmu"
+    else
+      if test "$archipelago" = "yes" ; then
+        feature_not_found "Archipelago backend support" "Install libxseg devel"
+      fi
+      archipelago="no"
+    fi
+fi
+
+
 ##########################################
 # glusterfs probe
 if test "$glusterfs" != "no" ; then
@@ -4197,6 +4231,7 @@ echo "seccomp support   $seccomp"
 echo "coroutine backend $coroutine"
 echo "coroutine pool    $coroutine_pool"
 echo "GlusterFS support $glusterfs"
+echo "Archipelago support $archipelago"
 echo "virtio-blk-data-plane $virtio_blk_data_plane"
 echo "gcov              $gcov_tool"
 echo "gcov enabled      $gcov"
@@ -4631,6 +4666,11 @@ if test "$glusterfs_zerofill" = "yes" ; then
   echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak
 fi
 
+if test "$archipelago" = "yes" ; then
+  echo "CONFIG_ARCHIPELAGO=m" >> $config_host_mak
+  echo "ARCHIPELAGO_LIBS=$archipelago_libs" >> $config_host_mak
+fi
+
 if test "$libssh2" = "yes" ; then
   echo "CONFIG_LIBSSH2=m" >> $config_host_mak
   echo "LIBSSH2_CFLAGS=$libssh2_cflags" >> $config_host_mak
Signature · 1 line
1.7.10.4
#2 lore raw

Re: [Qemu-devel] [PATCH v2 1/1] block: Support Archipelago as a QEMU block backend

Quoted 4 lines · Chrysostomos Nanakos

VM Image on Archipelago volume is specified like this:

file=archipelago:<volumename>[/mport=<mapperd_port>[:vport=<vlmcd_port>]] or

I still think that there is no need to burden the code with this shorthand...

Quoted 3 lines

file.driver=archipelago,file.volume=<volumename>[,file.mport=<mapperd_port>[, file.vport=<vlmcd_port>]]

...when this version is easier to support. Older protocols have file= abuse due to back-compat reasons, but new protocols should not start out with baggage.

Quoted 4 lines
---
 MAINTAINERS         |    5 +
 block/Makefile.objs |    1 +
 block/archipelago.c | 1174 +++++++++++++++++++++++++++++++++++++++++++++++++++

This is a lot to review at once - is there any reasonable way to break it into a series of smaller patches?

I still don't see anything added to the QMP blockdev-add command.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#3 lore raw

Re: [Qemu-devel] [PATCH v2 1/1] block: Support Archipelago as a QEMU block backend

Hi,

Quoted 7 lines · Eric Blake
Quoted 4 lines · Chrysostomos Nanakos

VM Image on Archipelago volume is specified like this:

file=archipelago:<volumename>[/mport=<mapperd_port>[:vport=<vlmcd_port>]] or

I still think that there is no need to burden the code with this shorthand...

If everyone agrees I can totally remove that part.

Quoted 8 lines
Quoted 3 lines

file.driver=archipelago,file.volume=<volumename>[,file.mport=<mapperd_port>[, file.vport=<vlmcd_port>]]

...when this version is easier to support. Older protocols have file= abuse due to back-compat reasons, but new protocols should not start out with baggage.

Quoted 6 lines
Quoted 4 lines
---
  MAINTAINERS         |    5 +
  block/Makefile.objs |    1 +
  block/archipelago.c | 1174 +++++++++++++++++++++++++++++++++++++++++++++++++++

This is a lot to review at once - is there any reasonable way to break it into a series of smaller patches?

It will be really difficult to break it in smaller patches, and I believe it will more difficult for someone to review it.

Quoted 3 lines

I still don't see anything added to the QMP blockdev-add command.

Totally forgot it, sorry for that. I will make the changes in v3, in a different patch!

Regards,
Chrysostomos.

#4 lore raw

Re: [Qemu-devel] [PATCH v2 1/1] block: Support Archipelago as a QEMU block backend

Am 02.06.2014 um 17:04 hat Chrysostomos Nanakos geschrieben:

Quoted 4 lines

Hi,

Quoted 1 line · Eric Blake

On 06/02/2014 08:15 AM, Chrysostomos Nanakos wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

VM Image on Archipelago volume is specified like this:

file=archipelago:<volumename>[/mport=<mapperd_port>[:vport=<vlmcd_port>]] or

I still think that there is no need to burden the code with this shorthand...

If everyone agrees I can totally remove that part.

I don't think it's a bad idea to provide a shortcut for human users. The important point is just that internally it's not the main interface, but mapped to the structured option (which I think your patch achieves now).

Quoted 11 lines
Quoted 11 lines
Quoted 2 lines

file.driver=archipelago,file.volume=<volumename>[,file.mport=<mapperd_port>[, file.vport=<vlmcd_port>]]

...when this version is easier to support. Older protocols have file= abuse due to back-compat reasons, but new protocols should not start out with baggage.

Quoted 4 lines
---
 MAINTAINERS         |    5 +
 block/Makefile.objs |    1 +
 block/archipelago.c | 1174 +++++++++++++++++++++++++++++++++++++++++++++++++++
Quoted 5 lines
Quoted 2 lines

This is a lot to review at once - is there any reasonable way to break it into a series of smaller patches?

It will be really difficult to break it in smaller patches, and I believe it will more difficult for someone to review it.

Not sure how much easier the review would become, but the obvious split that works almost always is to do a read-only driver in patch 1, and then add write and create support in patches 2 and 3.

Kevin

#5 lore raw

Re: [Qemu-devel] [PATCH v2 1/1] block: Support Archipelago as a QEMU block backend

Quoted 27 lines · Kevin Wolf

Am 02.06.2014 um 17:04 hat Chrysostomos Nanakos geschrieben:

Quoted 11 lines

Hi,

Quoted 7 lines · Eric Blake
Quoted 4 lines · Chrysostomos Nanakos

VM Image on Archipelago volume is specified like this:

file=archipelago:<volumename>[/mport=<mapperd_port>[:vport=<vlmcd_port>]] or

I still think that there is no need to burden the code with this shorthand...

If everyone agrees I can totally remove that part.

I don't think it's a bad idea to provide a shortcut for human users. The important point is just that internally it's not the main interface, but mapped to the structured option (which I think your patch achieves now).

Quoted 11 lines
Quoted 11 lines
Quoted 2 lines

file.driver=archipelago,file.volume=<volumename>[,file.mport=<mapperd_port>[, file.vport=<vlmcd_port>]]

...when this version is easier to support. Older protocols have file= abuse due to back-compat reasons, but new protocols should not start out with baggage.

Quoted 4 lines
---
  MAINTAINERS         |    5 +
  block/Makefile.objs |    1 +
  block/archipelago.c | 1174 +++++++++++++++++++++++++++++++++++++++++++++++++++
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

This is a lot to review at once - is there any reasonable way to break it into a series of smaller patches?

It will be really difficult to break it in smaller patches, and I believe it will more difficult for someone to review it.

Not sure how much easier the review would become, but the obvious split that works almost always is to do a read-only driver in patch 1, and then add write and create support in patches 2 and 3.

I can do that. Eric do you think that I should do it now and resend the patches or in the next version in which I will add support for the QMP blockdev-add command?

Quoted 1 line

Kevin

#6 lore raw

Re: [Qemu-devel] [PATCH v2 1/1] block: Support Archipelago as a QEMU block backend

Quoted 6 lines · Chrysostomos Nanakos
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

I still think that there is no need to burden the code with this shorthand...

If everyone agrees I can totally remove that part.

I don't think it's a bad idea to provide a shortcut for human users. The important point is just that internally it's not the main interface, but mapped to the structured option (which I think your patch achieves now).

I'm okay if you go with Kevin's vote for keeping the shorthand in place.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
  block/archipelago.c | 1174

+++++++++++++++++++++++++++++++++++++++++++++++++++

This is a lot to review at once - is there any reasonable way to break it into a series of smaller patches?

It will be really difficult to break it in smaller patches, and I believe it will more difficult for someone to review it.

Quoted 7 lines
Quoted 3 lines

Not sure how much easier the review would become, but the obvious split that works almost always is to do a read-only driver in patch 1, and then add write and create support in patches 2 and 3.

I can do that. Eric do you think that I should do it now and resend the patches or in the next version in which I will add support for the QMP blockdev-add command?

Up to you. I'm fine with waiting for a v3 that has everything (QMP and split along Kevin's proposal of read-only vs. write/create) rather than list churn of an immediate resend.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#7 lore raw

Re: [Qemu-devel] [PATCH v2 1/1] block: Support Archipelago as a QEMU block backend

In reply to Kevin Wolf

Hi,

Quoted 27 lines · Kevin Wolf

Am 02.06.2014 um 17:04 hat Chrysostomos Nanakos geschrieben:

Quoted 11 lines

Hi,

Quoted 7 lines · Eric Blake
Quoted 4 lines · Chrysostomos Nanakos

VM Image on Archipelago volume is specified like this:

file=archipelago:<volumename>[/mport=<mapperd_port>[:vport=<vlmcd_port>]] or

I still think that there is no need to burden the code with this shorthand...

If everyone agrees I can totally remove that part.

I don't think it's a bad idea to provide a shortcut for human users. The important point is just that internally it's not the main interface, but mapped to the structured option (which I think your patch achieves now).

Quoted 11 lines
Quoted 11 lines
Quoted 2 lines

file.driver=archipelago,file.volume=<volumename>[,file.mport=<mapperd_port>[, file.vport=<vlmcd_port>]]

...when this version is easier to support. Older protocols have file= abuse due to back-compat reasons, but new protocols should not start out with baggage.

Quoted 4 lines
---
  MAINTAINERS         |    5 +
  block/Makefile.objs |    1 +
  block/archipelago.c | 1174 +++++++++++++++++++++++++++++++++++++++++++++++++++
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

This is a lot to review at once - is there any reasonable way to break it into a series of smaller patches?

It will be really difficult to break it in smaller patches, and I believe it will more difficult for someone to review it.

Not sure how much easier the review would become, but the obvious split that works almost always is to do a read-only driver in patch 1, and then add write and create support in patches 2 and 3.

I've just send v3 patch series which consists of three parts. The first one implements the read/write functionality, it seemed difficult to break it down to two patches, one for read and the other for write. I hope this is better than before and not very difficult to review it. The second part implements the .bdrv_create() function and adds support for creating Archipelago images. The third and last part adds QMP support by introducing a new enum, BlockdevOptionsArchipelago.

Regards,
Chrysostomos.

#8 lore raw

Re: [Qemu-devel] [PATCH v2 1/1] block: Support Archipelago as a QEMU block backend

In reply to Eric Blake
Quoted 10 lines · Eric Blake
Quoted 4 lines · Chrysostomos Nanakos

VM Image on Archipelago volume is specified like this:

file=archipelago:<volumename>[/mport=<mapperd_port>[:vport=<vlmcd_port>]] or

I still think that there is no need to burden the code with this shorthand...

Quoted 1 line
Quoted 6 lines
Quoted 2 lines

file.driver=archipelago,file.volume=<volumename>[,file.mport=<mapperd_port>[, file.vport=<vlmcd_port>]]

...when this version is easier to support. Older protocols have file= abuse due to back-compat reasons, but new protocols should not start out with baggage.

Seconded.

At the very least, add the syntactic sugar in a separate patch, so it can be more easily evaluated.

[...]