All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 09/10] scsi: add multipath support to qemu-pr-helper
Date: Wed, 23 Aug 2017 13:01:56 +0800	[thread overview]
Message-ID: <20170823050156.GC21343@lemon> (raw)
In-Reply-To: <20170822131832.20191-10-pbonzini@redhat.com>

On Tue, 08/22 15:18, Paolo Bonzini wrote:
> 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 <pbonzini@redhat.com>
> ---
>  Makefile              |   3 +
>  configure             |  57 ++++++++-
>  docs/pr-manager.rst   |  27 +++++
>  include/scsi/utils.h  |   6 +
>  scsi/qemu-pr-helper.c | 311 +++++++++++++++++++++++++++++++++++++++++++++++++-
>  scsi/utils.c          |  15 +++
>  6 files changed, 414 insertions(+), 5 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index bfd4f69ecd..f1acaad05b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -388,6 +388,9 @@ fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal
>  fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
>  
>  scsi/qemu-pr-helper$(EXESUF): scsi/qemu-pr-helper.o scsi/utils.o $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
> +ifdef CONFIG_MPATH
> +scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist
> +endif
>  
>  qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
>  	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@")
> diff --git a/configure b/configure
> index 772aff18d6..d3c9371f7c 100755
> --- a/configure
> +++ b/configure
> @@ -286,6 +286,7 @@ pixman=""
>  sdl=""
>  sdlabi=""
>  virtfs=""
> +mpath=""

Whole patch: s/\<mpath\>/pr-helper/ ?

>  vnc="yes"
>  sparse="no"
>  vde=""
> @@ -948,6 +949,10 @@ for opt do
>    ;;
>    --enable-virtfs) virtfs="yes"
>    ;;
> +  --disable-mpath) mpath="no"
> +  ;;
> +  --enable-mpath) mpath="yes"
> +  ;;
>    --disable-vnc) vnc="no"
>    ;;
>    --enable-vnc) vnc="yes"
> @@ -1491,6 +1496,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)
> @@ -3336,6 +3342,29 @@ else
>  fi
>  
>  ##########################################
> +# libmpathpersist probe
> +
> +if test "$mpath" != "no" ; then
> +  cat > $TMPC <<EOF
> +#include <libudev.h>
> +#include <mpath_persist.h>
> +unsigned mpath_mx_alloc_len = 1024;
> +int logsink;
> +int main(void) {
> +    struct udev *udev = udev_new();
> +    mpath_lib_init(udev);
> +}
> +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
> @@ -5070,16 +5099,34 @@ if test "$want_tools" = "yes" ; then
>    fi
>  fi
>  if test "$softmmu" = yes ; then
> -  if test "$virtfs" != no ; then
> -    if test "$cap" = yes && test "$linux" = yes && test "$attr" = yes ; then
> +  if test "$linux" = yes; then
> +    if test "$virtfs" != no && test "$cap" = yes && test "$attr" = yes ; then
>        virtfs=yes
>        tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
>      else
>        if test "$virtfs" = yes; then
> -        error_exit "VirtFS is supported only on Linux and requires libcap devel and libattr devel"
> +        error_exit "VirtFS requires libcap devel and libattr devel"
>        fi
>        virtfs=no
>      fi
> +    if test "$mpath" != no && test "$mpathpersist" = yes ; then
> +      mpath=yes
> +      tools="$tools mpath/qemu-mpath-helper\$(EXESUF)"

scsi/qemu-pr-helper?

> +    else
> +      if test "$mpath" = yes; then
> +        error_exit "Multipath requires libmpathpersist devel"
> +      fi
> +      mpath=no
> +    fi
> +  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
>  
> @@ -5326,6 +5373,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"
> @@ -5773,6 +5821,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

Fam

  reply	other threads:[~2017-08-23  5:02 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 13:18 [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers Paolo Bonzini
2017-08-22 13:18 ` [Qemu-devel] [PATCH 01/10] scsi: rename scsi_convert_sense Paolo Bonzini
2017-08-22 13:38   ` Philippe Mathieu-Daudé
2017-08-22 13:18 ` [Qemu-devel] [PATCH 02/10] scsi: move non-emulation specific code to scsi/ Paolo Bonzini
2017-08-22 13:34   ` Philippe Mathieu-Daudé
2017-08-22 13:18 ` [Qemu-devel] [PATCH 03/10] scsi: introduce scsi_build_sense Paolo Bonzini
2017-08-22 13:35   ` Philippe Mathieu-Daudé
2017-08-30 13:39   ` Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 04/10] scsi: introduce sg_io_sense_from_errno Paolo Bonzini
2017-08-22 13:45   ` Philippe Mathieu-Daudé
2017-08-22 13:53     ` Paolo Bonzini
2017-08-30 13:41   ` Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 05/10] scsi: move block/scsi.h to include/scsi/constants.h Paolo Bonzini
2017-08-22 13:37   ` Philippe Mathieu-Daudé
2017-08-30 13:41   ` Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 06/10] scsi, file-posix: add support for persistent reservation management Paolo Bonzini
2017-08-23  4:13   ` Fam Zheng
2017-08-23  6:56     ` Paolo Bonzini
2017-08-24 15:37   ` Eric Blake
2017-08-24 15:47     ` Paolo Bonzini
2017-08-30 12:59   ` Daniel P. Berrange
2017-08-30 14:26   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 07/10] io: add qio_channel_read/write_all Paolo Bonzini
2017-08-23  5:08   ` Fam Zheng
2017-08-23  6:54     ` Paolo Bonzini
2017-08-30 12:52   ` Daniel P. Berrange
2017-08-30 14:33   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 08/10] scsi: build qemu-pr-helper Paolo Bonzini
2017-08-22 14:34   ` Marc-André Lureau
2017-08-22 16:04     ` Paolo Bonzini
2017-08-24 15:45   ` Eric Blake
2017-08-30 15:44   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-30 16:06   ` Stefan Hajnoczi
2017-08-22 13:18 ` [Qemu-devel] [PATCH 09/10] scsi: add multipath support to qemu-pr-helper Paolo Bonzini
2017-08-23  5:01   ` Fam Zheng [this message]
2017-08-23  6:50     ` Paolo Bonzini
2017-08-30 16:06   ` Stefan Hajnoczi
2017-08-30 16:37   ` Stefan Hajnoczi
2017-09-11  9:14     ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
2017-08-22 13:18 ` [Qemu-devel] [PATCH 10/10] scsi: add persistent reservation manager using qemu-pr-helper Paolo Bonzini
2017-08-23  4:49   ` Fam Zheng
2017-08-23  6:55     ` Paolo Bonzini
2017-08-23  7:48     ` Paolo Bonzini
2017-08-30 16:58   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-08-22 13:48 ` [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers no-reply
2017-08-22 13:50 ` no-reply
2017-08-22 13:50 ` no-reply
2017-08-22 13:51 ` no-reply

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=20170823050156.GC21343@lemon \
    --to=famz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.