From fe8fc5ae5c808e037fa4746cbfeb3c07ffe0af81 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 22 Aug 2017 06:50:55 +0200 Subject: scsi: add multipath support to qemu-pr-helper Proper support of persistent reservation for multipath devices requires communication with the multipath daemon, so that the reservation is registered and applied when a path comes up. The device mapper utilities provide a library to do so; this patch makes qemu-pr-helper.c detect multipath devices and, when one is found, delegate the operation to libmpathpersist. Signed-off-by: Paolo Bonzini --- configure | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'configure') diff --git a/configure b/configure index becc21a..f6edc2a 100755 --- a/configure +++ b/configure @@ -290,6 +290,7 @@ netmap="no" sdl="" sdlabi="" virtfs="" +mpath="" vnc="yes" sparse="no" vde="" @@ -936,6 +937,10 @@ for opt do ;; --enable-virtfs) virtfs="yes" ;; + --disable-mpath) mpath="no" + ;; + --enable-mpath) mpath="yes" + ;; --disable-vnc) vnc="no" ;; --enable-vnc) vnc="yes" @@ -1479,6 +1484,7 @@ disabled with --disable-FEATURE, default is enabled if available: vnc-png PNG compression for VNC server cocoa Cocoa UI (Mac OS X only) virtfs VirtFS + mpath Multipath persistent reservation passthrough xen xen backend driver support xen-pci-passthrough brlapi BrlAPI (Braile) @@ -3300,6 +3306,30 @@ else fi ########################################## +# libmpathpersist probe + +if test "$mpath" != "no" ; then + cat > $TMPC < +#include +unsigned mpath_mx_alloc_len = 1024; +int logsink; +int main(void) { + struct udev *udev = udev_new(); + mpath_lib_init(udev); + return 0; +} +EOF + if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then + mpathpersist=yes + else + mpathpersist=no + fi +else + mpathpersist=no +fi + +########################################## # libcap probe if test "$cap" != "no" ; then @@ -5044,12 +5074,24 @@ if test "$softmmu" = yes ; then fi virtfs=no fi + if test "$mpath" != no && test "$mpathpersist" = yes ; then + mpath=yes + else + if test "$mpath" = yes; then + error_exit "Multipath requires libmpathpersist devel" + fi + mpath=no + fi tools="$tools scsi/qemu-pr-helper\$(EXESUF)" else if test "$virtfs" = yes; then error_exit "VirtFS is supported only on Linux" fi virtfs=no + if test "$mpath" = yes; then + error_exit "Multipath is supported only on Linux" + fi + mpath=no fi fi @@ -5295,6 +5337,7 @@ echo "Audio drivers $audio_drv_list" echo "Block whitelist (rw) $block_drv_rw_whitelist" echo "Block whitelist (ro) $block_drv_ro_whitelist" echo "VirtFS support $virtfs" +echo "Multipath support $mpath" echo "VNC support $vnc" if test "$vnc" = "yes" ; then echo "VNC SASL support $vnc_sasl" @@ -5738,6 +5781,9 @@ fi if test "$virtfs" = "yes" ; then echo "CONFIG_VIRTFS=y" >> $config_host_mak fi +if test "$mpath" = "yes" ; then + echo "CONFIG_MPATH=y" >> $config_host_mak +fi if test "$vhost_scsi" = "yes" ; then echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak fi -- cgit v1.1