All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Move the libssh setup from configure to meson.build
@ 2021-12-09 14:48 Thomas Huth
  2021-12-09 14:55 ` Richard W.M. Jones
  2021-12-15  7:56 ` Petr Vorel
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Huth @ 2021-12-09 14:48 UTC (permalink / raw)
  To: qemu-devel, Paolo Bonzini; +Cc: Richard W . M . Jones

It's easier to do this in meson.build now.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 v2: Added the missing "config_host_data.set('CONFIG_LIBSSH', libssh.found())"

 configure                     | 27 ---------------------------
 meson.build                   | 13 +++++++++----
 meson_options.txt             |  2 ++
 scripts/meson-buildoptions.sh |  3 +++
 4 files changed, 14 insertions(+), 31 deletions(-)

diff --git a/configure b/configure
index 48c21775f3..bb99a40ed0 100755
--- a/configure
+++ b/configure
@@ -344,7 +344,6 @@ debug_stack_usage="no"
 crypto_afalg="no"
 tls_priority="NORMAL"
 tpm="$default_feature"
-libssh="$default_feature"
 live_block_migration=${default_feature:-yes}
 numa="$default_feature"
 replication=${default_feature:-yes}
@@ -1078,10 +1077,6 @@ for opt do
   ;;
   --enable-tpm) tpm="yes"
   ;;
-  --disable-libssh) libssh="no"
-  ;;
-  --enable-libssh) libssh="yes"
-  ;;
   --disable-live-block-migration) live_block_migration="no"
   ;;
   --enable-live-block-migration) live_block_migration="yes"
@@ -1448,7 +1443,6 @@ cat << EOF
   live-block-migration   Block migration in the main migration stream
   coroutine-pool  coroutine freelist (better performance)
   tpm             TPM support
-  libssh          ssh block device support
   numa            libnuma support
   avx2            AVX2 optimization support
   avx512f         AVX512F optimization support
@@ -2561,21 +2555,6 @@ if test "$modules" = yes; then
     fi
 fi
 
-##########################################
-# libssh probe
-if test "$libssh" != "no" ; then
-  if $pkg_config --exists "libssh >= 0.8.7"; then
-    libssh_cflags=$($pkg_config libssh --cflags)
-    libssh_libs=$($pkg_config libssh --libs)
-    libssh=yes
-  else
-    if test "$libssh" = "yes" ; then
-      error_exit "libssh required for --enable-libssh"
-    fi
-    libssh=no
-  fi
-fi
-
 ##########################################
 # TPM emulation is only on POSIX
 
@@ -3636,12 +3615,6 @@ if test "$cmpxchg128" = "yes" ; then
   echo "CONFIG_CMPXCHG128=y" >> $config_host_mak
 fi
 
-if test "$libssh" = "yes" ; then
-  echo "CONFIG_LIBSSH=y" >> $config_host_mak
-  echo "LIBSSH_CFLAGS=$libssh_cflags" >> $config_host_mak
-  echo "LIBSSH_LIBS=$libssh_libs" >> $config_host_mak
-fi
-
 if test "$live_block_migration" = "yes" ; then
   echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak
 fi
diff --git a/meson.build b/meson.build
index 96de1a6ef9..ae67ca28ab 100644
--- a/meson.build
+++ b/meson.build
@@ -874,11 +874,15 @@ if not get_option('glusterfs').auto() or have_block
     ''', dependencies: glusterfs)
   endif
 endif
+
 libssh = not_found
-if 'CONFIG_LIBSSH' in config_host
-  libssh = declare_dependency(compile_args: config_host['LIBSSH_CFLAGS'].split(),
-                              link_args: config_host['LIBSSH_LIBS'].split())
+if not get_option('libssh').auto() or have_block
+  libssh = dependency('libssh', version: '>=0.8.7',
+                    method: 'pkg-config',
+                    required: get_option('libssh'),
+                    kwargs: static_kwargs)
 endif
+
 libbzip2 = not_found
 if not get_option('bzip2').auto() or have_block
   libbzip2 = cc.find_library('bz2', has_headers: ['bzlib.h'],
@@ -1451,6 +1455,7 @@ config_host_data.set('CONFIG_EBPF', libbpf.found())
 config_host_data.set('CONFIG_LIBDAXCTL', libdaxctl.found())
 config_host_data.set('CONFIG_LIBISCSI', libiscsi.found())
 config_host_data.set('CONFIG_LIBNFS', libnfs.found())
+config_host_data.set('CONFIG_LIBSSH', libssh.found())
 config_host_data.set('CONFIG_LINUX_AIO', libaio.found())
 config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found())
 config_host_data.set('CONFIG_LIBPMEM', libpmem.found())
@@ -3430,7 +3435,7 @@ endif
 summary_info += {'seccomp support':   seccomp}
 summary_info += {'GlusterFS support': glusterfs}
 summary_info += {'TPM support':       config_host.has_key('CONFIG_TPM')}
-summary_info += {'libssh support':    config_host.has_key('CONFIG_LIBSSH')}
+summary_info += {'libssh support':    libssh}
 summary_info += {'lzo support':       lzo}
 summary_info += {'snappy support':    snappy}
 summary_info += {'bzip2 support':     libbzip2}
diff --git a/meson_options.txt b/meson_options.txt
index e392323732..4114bfcaa4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -105,6 +105,8 @@ option('libdaxctl', type : 'feature', value : 'auto',
        description: 'libdaxctl support')
 option('libpmem', type : 'feature', value : 'auto',
        description: 'libpmem support')
+option('libssh', type : 'feature', value : 'auto',
+       description: 'ssh block device support')
 option('libudev', type : 'feature', value : 'auto',
        description: 'Use libudev to enumerate host devices')
 option('libusb', type : 'feature', value : 'auto',
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 7a17ff4218..ae8f18edc2 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -53,6 +53,7 @@ meson_options_help() {
   printf "%s\n" '  libiscsi        libiscsi userspace initiator'
   printf "%s\n" '  libnfs          libnfs block device driver'
   printf "%s\n" '  libpmem         libpmem support'
+  printf "%s\n" '  libssh          ssh block device support'
   printf "%s\n" '  libudev         Use libudev to enumerate host devices'
   printf "%s\n" '  libusb          libusb support for USB passthrough'
   printf "%s\n" '  libxml2         libxml2 support for Parallels image format'
@@ -177,6 +178,8 @@ _meson_option_parse() {
     --disable-libnfs) printf "%s" -Dlibnfs=disabled ;;
     --enable-libpmem) printf "%s" -Dlibpmem=enabled ;;
     --disable-libpmem) printf "%s" -Dlibpmem=disabled ;;
+    --enable-libssh) printf "%s" -Dlibssh=enabled ;;
+    --disable-libssh) printf "%s" -Dlibssh=disabled ;;
     --enable-libudev) printf "%s" -Dlibudev=enabled ;;
     --disable-libudev) printf "%s" -Dlibudev=disabled ;;
     --enable-libusb) printf "%s" -Dlibusb=enabled ;;
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] Move the libssh setup from configure to meson.build
  2021-12-09 14:48 [PATCH v2] Move the libssh setup from configure to meson.build Thomas Huth
@ 2021-12-09 14:55 ` Richard W.M. Jones
  2021-12-09 15:08   ` Thomas Huth
  2021-12-15  7:56 ` Petr Vorel
  1 sibling, 1 reply; 7+ messages in thread
From: Richard W.M. Jones @ 2021-12-09 14:55 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Paolo Bonzini, qemu-devel

On Thu, Dec 09, 2021 at 03:48:01PM +0100, Thomas Huth wrote:
> It's easier to do this in meson.build now.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  v2: Added the missing "config_host_data.set('CONFIG_LIBSSH', libssh.found())"
> 
>  configure                     | 27 ---------------------------
>  meson.build                   | 13 +++++++++----
>  meson_options.txt             |  2 ++
>  scripts/meson-buildoptions.sh |  3 +++
>  4 files changed, 14 insertions(+), 31 deletions(-)
> 
> diff --git a/configure b/configure
> index 48c21775f3..bb99a40ed0 100755
> --- a/configure
> +++ b/configure
> @@ -344,7 +344,6 @@ debug_stack_usage="no"
>  crypto_afalg="no"
>  tls_priority="NORMAL"
>  tpm="$default_feature"
> -libssh="$default_feature"
>  live_block_migration=${default_feature:-yes}
>  numa="$default_feature"
>  replication=${default_feature:-yes}
> @@ -1078,10 +1077,6 @@ for opt do
>    ;;
>    --enable-tpm) tpm="yes"
>    ;;
> -  --disable-libssh) libssh="no"
> -  ;;
> -  --enable-libssh) libssh="yes"
> -  ;;
>    --disable-live-block-migration) live_block_migration="no"
>    ;;
>    --enable-live-block-migration) live_block_migration="yes"
> @@ -1448,7 +1443,6 @@ cat << EOF
>    live-block-migration   Block migration in the main migration stream
>    coroutine-pool  coroutine freelist (better performance)
>    tpm             TPM support
> -  libssh          ssh block device support
>    numa            libnuma support
>    avx2            AVX2 optimization support
>    avx512f         AVX512F optimization support
> @@ -2561,21 +2555,6 @@ if test "$modules" = yes; then
>      fi
>  fi
>  
> -##########################################
> -# libssh probe
> -if test "$libssh" != "no" ; then
> -  if $pkg_config --exists "libssh >= 0.8.7"; then
> -    libssh_cflags=$($pkg_config libssh --cflags)
> -    libssh_libs=$($pkg_config libssh --libs)
> -    libssh=yes
> -  else
> -    if test "$libssh" = "yes" ; then
> -      error_exit "libssh required for --enable-libssh"
> -    fi
> -    libssh=no
> -  fi
> -fi
> -
>  ##########################################
>  # TPM emulation is only on POSIX
>  
> @@ -3636,12 +3615,6 @@ if test "$cmpxchg128" = "yes" ; then
>    echo "CONFIG_CMPXCHG128=y" >> $config_host_mak
>  fi
>  
> -if test "$libssh" = "yes" ; then
> -  echo "CONFIG_LIBSSH=y" >> $config_host_mak
> -  echo "LIBSSH_CFLAGS=$libssh_cflags" >> $config_host_mak
> -  echo "LIBSSH_LIBS=$libssh_libs" >> $config_host_mak
> -fi
> -
>  if test "$live_block_migration" = "yes" ; then
>    echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak
>  fi
> diff --git a/meson.build b/meson.build
> index 96de1a6ef9..ae67ca28ab 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -874,11 +874,15 @@ if not get_option('glusterfs').auto() or have_block
>      ''', dependencies: glusterfs)
>    endif
>  endif
> +
>  libssh = not_found
> -if 'CONFIG_LIBSSH' in config_host
> -  libssh = declare_dependency(compile_args: config_host['LIBSSH_CFLAGS'].split(),
> -                              link_args: config_host['LIBSSH_LIBS'].split())
> +if not get_option('libssh').auto() or have_block
> +  libssh = dependency('libssh', version: '>=0.8.7',
> +                    method: 'pkg-config',
> +                    required: get_option('libssh'),
> +                    kwargs: static_kwargs)
>  endif
> +
>  libbzip2 = not_found
>  if not get_option('bzip2').auto() or have_block
>    libbzip2 = cc.find_library('bz2', has_headers: ['bzlib.h'],
> @@ -1451,6 +1455,7 @@ config_host_data.set('CONFIG_EBPF', libbpf.found())
>  config_host_data.set('CONFIG_LIBDAXCTL', libdaxctl.found())
>  config_host_data.set('CONFIG_LIBISCSI', libiscsi.found())
>  config_host_data.set('CONFIG_LIBNFS', libnfs.found())
> +config_host_data.set('CONFIG_LIBSSH', libssh.found())
>  config_host_data.set('CONFIG_LINUX_AIO', libaio.found())
>  config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found())
>  config_host_data.set('CONFIG_LIBPMEM', libpmem.found())
> @@ -3430,7 +3435,7 @@ endif
>  summary_info += {'seccomp support':   seccomp}
>  summary_info += {'GlusterFS support': glusterfs}
>  summary_info += {'TPM support':       config_host.has_key('CONFIG_TPM')}
> -summary_info += {'libssh support':    config_host.has_key('CONFIG_LIBSSH')}
> +summary_info += {'libssh support':    libssh}
>  summary_info += {'lzo support':       lzo}
>  summary_info += {'snappy support':    snappy}
>  summary_info += {'bzip2 support':     libbzip2}
> diff --git a/meson_options.txt b/meson_options.txt
> index e392323732..4114bfcaa4 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -105,6 +105,8 @@ option('libdaxctl', type : 'feature', value : 'auto',
>         description: 'libdaxctl support')
>  option('libpmem', type : 'feature', value : 'auto',
>         description: 'libpmem support')
> +option('libssh', type : 'feature', value : 'auto',
> +       description: 'ssh block device support')
>  option('libudev', type : 'feature', value : 'auto',
>         description: 'Use libudev to enumerate host devices')
>  option('libusb', type : 'feature', value : 'auto',
> diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
> index 7a17ff4218..ae8f18edc2 100644
> --- a/scripts/meson-buildoptions.sh
> +++ b/scripts/meson-buildoptions.sh
> @@ -53,6 +53,7 @@ meson_options_help() {
>    printf "%s\n" '  libiscsi        libiscsi userspace initiator'
>    printf "%s\n" '  libnfs          libnfs block device driver'
>    printf "%s\n" '  libpmem         libpmem support'
> +  printf "%s\n" '  libssh          ssh block device support'
>    printf "%s\n" '  libudev         Use libudev to enumerate host devices'
>    printf "%s\n" '  libusb          libusb support for USB passthrough'
>    printf "%s\n" '  libxml2         libxml2 support for Parallels image format'
> @@ -177,6 +178,8 @@ _meson_option_parse() {
>      --disable-libnfs) printf "%s" -Dlibnfs=disabled ;;
>      --enable-libpmem) printf "%s" -Dlibpmem=enabled ;;
>      --disable-libpmem) printf "%s" -Dlibpmem=disabled ;;
> +    --enable-libssh) printf "%s" -Dlibssh=enabled ;;
> +    --disable-libssh) printf "%s" -Dlibssh=disabled ;;
>      --enable-libudev) printf "%s" -Dlibudev=enabled ;;
>      --disable-libudev) printf "%s" -Dlibudev=disabled ;;
>      --enable-libusb) printf "%s" -Dlibusb=enabled ;;

Seems reasonable, ACK.

I should say that my interest in the ssh driver in qemu is not that
much these days.  I've been telling people to use nbdkit-ssh-plugin
instead.  It's more featureful and running it in a separate process is
probably safer too.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] Move the libssh setup from configure to meson.build
  2021-12-09 14:55 ` Richard W.M. Jones
@ 2021-12-09 15:08   ` Thomas Huth
  2021-12-09 15:22     ` Richard W.M. Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Huth @ 2021-12-09 15:08 UTC (permalink / raw)
  To: Richard W.M. Jones; +Cc: Paolo Bonzini, qemu-devel

On 09/12/2021 15.55, Richard W.M. Jones wrote:
> On Thu, Dec 09, 2021 at 03:48:01PM +0100, Thomas Huth wrote:
>> It's easier to do this in meson.build now.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>   v2: Added the missing "config_host_data.set('CONFIG_LIBSSH', libssh.found())"
>>
>>   configure                     | 27 ---------------------------
>>   meson.build                   | 13 +++++++++----
>>   meson_options.txt             |  2 ++
>>   scripts/meson-buildoptions.sh |  3 +++
>>   4 files changed, 14 insertions(+), 31 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 48c21775f3..bb99a40ed0 100755
>> --- a/configure
>> +++ b/configure
>> @@ -344,7 +344,6 @@ debug_stack_usage="no"
>>   crypto_afalg="no"
>>   tls_priority="NORMAL"
>>   tpm="$default_feature"
>> -libssh="$default_feature"
>>   live_block_migration=${default_feature:-yes}
>>   numa="$default_feature"
>>   replication=${default_feature:-yes}
>> @@ -1078,10 +1077,6 @@ for opt do
>>     ;;
>>     --enable-tpm) tpm="yes"
>>     ;;
>> -  --disable-libssh) libssh="no"
>> -  ;;
>> -  --enable-libssh) libssh="yes"
>> -  ;;
>>     --disable-live-block-migration) live_block_migration="no"
>>     ;;
>>     --enable-live-block-migration) live_block_migration="yes"
>> @@ -1448,7 +1443,6 @@ cat << EOF
>>     live-block-migration   Block migration in the main migration stream
>>     coroutine-pool  coroutine freelist (better performance)
>>     tpm             TPM support
>> -  libssh          ssh block device support
>>     numa            libnuma support
>>     avx2            AVX2 optimization support
>>     avx512f         AVX512F optimization support
>> @@ -2561,21 +2555,6 @@ if test "$modules" = yes; then
>>       fi
>>   fi
>>   
>> -##########################################
>> -# libssh probe
>> -if test "$libssh" != "no" ; then
>> -  if $pkg_config --exists "libssh >= 0.8.7"; then
>> -    libssh_cflags=$($pkg_config libssh --cflags)
>> -    libssh_libs=$($pkg_config libssh --libs)
>> -    libssh=yes
>> -  else
>> -    if test "$libssh" = "yes" ; then
>> -      error_exit "libssh required for --enable-libssh"
>> -    fi
>> -    libssh=no
>> -  fi
>> -fi
>> -
>>   ##########################################
>>   # TPM emulation is only on POSIX
>>   
>> @@ -3636,12 +3615,6 @@ if test "$cmpxchg128" = "yes" ; then
>>     echo "CONFIG_CMPXCHG128=y" >> $config_host_mak
>>   fi
>>   
>> -if test "$libssh" = "yes" ; then
>> -  echo "CONFIG_LIBSSH=y" >> $config_host_mak
>> -  echo "LIBSSH_CFLAGS=$libssh_cflags" >> $config_host_mak
>> -  echo "LIBSSH_LIBS=$libssh_libs" >> $config_host_mak
>> -fi
>> -
>>   if test "$live_block_migration" = "yes" ; then
>>     echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak
>>   fi
>> diff --git a/meson.build b/meson.build
>> index 96de1a6ef9..ae67ca28ab 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -874,11 +874,15 @@ if not get_option('glusterfs').auto() or have_block
>>       ''', dependencies: glusterfs)
>>     endif
>>   endif
>> +
>>   libssh = not_found
>> -if 'CONFIG_LIBSSH' in config_host
>> -  libssh = declare_dependency(compile_args: config_host['LIBSSH_CFLAGS'].split(),
>> -                              link_args: config_host['LIBSSH_LIBS'].split())
>> +if not get_option('libssh').auto() or have_block
>> +  libssh = dependency('libssh', version: '>=0.8.7',
>> +                    method: 'pkg-config',
>> +                    required: get_option('libssh'),
>> +                    kwargs: static_kwargs)
>>   endif
>> +
>>   libbzip2 = not_found
>>   if not get_option('bzip2').auto() or have_block
>>     libbzip2 = cc.find_library('bz2', has_headers: ['bzlib.h'],
>> @@ -1451,6 +1455,7 @@ config_host_data.set('CONFIG_EBPF', libbpf.found())
>>   config_host_data.set('CONFIG_LIBDAXCTL', libdaxctl.found())
>>   config_host_data.set('CONFIG_LIBISCSI', libiscsi.found())
>>   config_host_data.set('CONFIG_LIBNFS', libnfs.found())
>> +config_host_data.set('CONFIG_LIBSSH', libssh.found())
>>   config_host_data.set('CONFIG_LINUX_AIO', libaio.found())
>>   config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found())
>>   config_host_data.set('CONFIG_LIBPMEM', libpmem.found())
>> @@ -3430,7 +3435,7 @@ endif
>>   summary_info += {'seccomp support':   seccomp}
>>   summary_info += {'GlusterFS support': glusterfs}
>>   summary_info += {'TPM support':       config_host.has_key('CONFIG_TPM')}
>> -summary_info += {'libssh support':    config_host.has_key('CONFIG_LIBSSH')}
>> +summary_info += {'libssh support':    libssh}
>>   summary_info += {'lzo support':       lzo}
>>   summary_info += {'snappy support':    snappy}
>>   summary_info += {'bzip2 support':     libbzip2}
>> diff --git a/meson_options.txt b/meson_options.txt
>> index e392323732..4114bfcaa4 100644
>> --- a/meson_options.txt
>> +++ b/meson_options.txt
>> @@ -105,6 +105,8 @@ option('libdaxctl', type : 'feature', value : 'auto',
>>          description: 'libdaxctl support')
>>   option('libpmem', type : 'feature', value : 'auto',
>>          description: 'libpmem support')
>> +option('libssh', type : 'feature', value : 'auto',
>> +       description: 'ssh block device support')
>>   option('libudev', type : 'feature', value : 'auto',
>>          description: 'Use libudev to enumerate host devices')
>>   option('libusb', type : 'feature', value : 'auto',
>> diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
>> index 7a17ff4218..ae8f18edc2 100644
>> --- a/scripts/meson-buildoptions.sh
>> +++ b/scripts/meson-buildoptions.sh
>> @@ -53,6 +53,7 @@ meson_options_help() {
>>     printf "%s\n" '  libiscsi        libiscsi userspace initiator'
>>     printf "%s\n" '  libnfs          libnfs block device driver'
>>     printf "%s\n" '  libpmem         libpmem support'
>> +  printf "%s\n" '  libssh          ssh block device support'
>>     printf "%s\n" '  libudev         Use libudev to enumerate host devices'
>>     printf "%s\n" '  libusb          libusb support for USB passthrough'
>>     printf "%s\n" '  libxml2         libxml2 support for Parallels image format'
>> @@ -177,6 +178,8 @@ _meson_option_parse() {
>>       --disable-libnfs) printf "%s" -Dlibnfs=disabled ;;
>>       --enable-libpmem) printf "%s" -Dlibpmem=enabled ;;
>>       --disable-libpmem) printf "%s" -Dlibpmem=disabled ;;
>> +    --enable-libssh) printf "%s" -Dlibssh=enabled ;;
>> +    --disable-libssh) printf "%s" -Dlibssh=disabled ;;
>>       --enable-libudev) printf "%s" -Dlibudev=enabled ;;
>>       --disable-libudev) printf "%s" -Dlibudev=disabled ;;
>>       --enable-libusb) printf "%s" -Dlibusb=enabled ;;
> 
> Seems reasonable, ACK.

Thanks!

> I should say that my interest in the ssh driver in qemu is not that
> much these days.  I've been telling people to use nbdkit-ssh-plugin
> instead.  It's more featureful and running it in a separate process is
> probably safer too.

Then it's maybe time to deprecate the ssh driver in QEMU?

  Thomas



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] Move the libssh setup from configure to meson.build
  2021-12-09 15:08   ` Thomas Huth
@ 2021-12-09 15:22     ` Richard W.M. Jones
  2021-12-10 13:05       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 7+ messages in thread
From: Richard W.M. Jones @ 2021-12-09 15:22 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Paolo Bonzini, qemu-devel

On Thu, Dec 09, 2021 at 04:08:24PM +0100, Thomas Huth wrote:
> On 09/12/2021 15.55, Richard W.M. Jones wrote:
> >On Thu, Dec 09, 2021 at 03:48:01PM +0100, Thomas Huth wrote:
> >>It's easier to do this in meson.build now.
> >>
> >>Signed-off-by: Thomas Huth <thuth@redhat.com>
> >>---
> >>  v2: Added the missing "config_host_data.set('CONFIG_LIBSSH', libssh.found())"
> >>
> >>  configure                     | 27 ---------------------------
> >>  meson.build                   | 13 +++++++++----
> >>  meson_options.txt             |  2 ++
> >>  scripts/meson-buildoptions.sh |  3 +++
> >>  4 files changed, 14 insertions(+), 31 deletions(-)
> >>
> >>diff --git a/configure b/configure
> >>index 48c21775f3..bb99a40ed0 100755
> >>--- a/configure
> >>+++ b/configure
> >>@@ -344,7 +344,6 @@ debug_stack_usage="no"
> >>  crypto_afalg="no"
> >>  tls_priority="NORMAL"
> >>  tpm="$default_feature"
> >>-libssh="$default_feature"
> >>  live_block_migration=${default_feature:-yes}
> >>  numa="$default_feature"
> >>  replication=${default_feature:-yes}
> >>@@ -1078,10 +1077,6 @@ for opt do
> >>    ;;
> >>    --enable-tpm) tpm="yes"
> >>    ;;
> >>-  --disable-libssh) libssh="no"
> >>-  ;;
> >>-  --enable-libssh) libssh="yes"
> >>-  ;;
> >>    --disable-live-block-migration) live_block_migration="no"
> >>    ;;
> >>    --enable-live-block-migration) live_block_migration="yes"
> >>@@ -1448,7 +1443,6 @@ cat << EOF
> >>    live-block-migration   Block migration in the main migration stream
> >>    coroutine-pool  coroutine freelist (better performance)
> >>    tpm             TPM support
> >>-  libssh          ssh block device support
> >>    numa            libnuma support
> >>    avx2            AVX2 optimization support
> >>    avx512f         AVX512F optimization support
> >>@@ -2561,21 +2555,6 @@ if test "$modules" = yes; then
> >>      fi
> >>  fi
> >>-##########################################
> >>-# libssh probe
> >>-if test "$libssh" != "no" ; then
> >>-  if $pkg_config --exists "libssh >= 0.8.7"; then
> >>-    libssh_cflags=$($pkg_config libssh --cflags)
> >>-    libssh_libs=$($pkg_config libssh --libs)
> >>-    libssh=yes
> >>-  else
> >>-    if test "$libssh" = "yes" ; then
> >>-      error_exit "libssh required for --enable-libssh"
> >>-    fi
> >>-    libssh=no
> >>-  fi
> >>-fi
> >>-
> >>  ##########################################
> >>  # TPM emulation is only on POSIX
> >>@@ -3636,12 +3615,6 @@ if test "$cmpxchg128" = "yes" ; then
> >>    echo "CONFIG_CMPXCHG128=y" >> $config_host_mak
> >>  fi
> >>-if test "$libssh" = "yes" ; then
> >>-  echo "CONFIG_LIBSSH=y" >> $config_host_mak
> >>-  echo "LIBSSH_CFLAGS=$libssh_cflags" >> $config_host_mak
> >>-  echo "LIBSSH_LIBS=$libssh_libs" >> $config_host_mak
> >>-fi
> >>-
> >>  if test "$live_block_migration" = "yes" ; then
> >>    echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak
> >>  fi
> >>diff --git a/meson.build b/meson.build
> >>index 96de1a6ef9..ae67ca28ab 100644
> >>--- a/meson.build
> >>+++ b/meson.build
> >>@@ -874,11 +874,15 @@ if not get_option('glusterfs').auto() or have_block
> >>      ''', dependencies: glusterfs)
> >>    endif
> >>  endif
> >>+
> >>  libssh = not_found
> >>-if 'CONFIG_LIBSSH' in config_host
> >>-  libssh = declare_dependency(compile_args: config_host['LIBSSH_CFLAGS'].split(),
> >>-                              link_args: config_host['LIBSSH_LIBS'].split())
> >>+if not get_option('libssh').auto() or have_block
> >>+  libssh = dependency('libssh', version: '>=0.8.7',
> >>+                    method: 'pkg-config',
> >>+                    required: get_option('libssh'),
> >>+                    kwargs: static_kwargs)
> >>  endif
> >>+
> >>  libbzip2 = not_found
> >>  if not get_option('bzip2').auto() or have_block
> >>    libbzip2 = cc.find_library('bz2', has_headers: ['bzlib.h'],
> >>@@ -1451,6 +1455,7 @@ config_host_data.set('CONFIG_EBPF', libbpf.found())
> >>  config_host_data.set('CONFIG_LIBDAXCTL', libdaxctl.found())
> >>  config_host_data.set('CONFIG_LIBISCSI', libiscsi.found())
> >>  config_host_data.set('CONFIG_LIBNFS', libnfs.found())
> >>+config_host_data.set('CONFIG_LIBSSH', libssh.found())
> >>  config_host_data.set('CONFIG_LINUX_AIO', libaio.found())
> >>  config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found())
> >>  config_host_data.set('CONFIG_LIBPMEM', libpmem.found())
> >>@@ -3430,7 +3435,7 @@ endif
> >>  summary_info += {'seccomp support':   seccomp}
> >>  summary_info += {'GlusterFS support': glusterfs}
> >>  summary_info += {'TPM support':       config_host.has_key('CONFIG_TPM')}
> >>-summary_info += {'libssh support':    config_host.has_key('CONFIG_LIBSSH')}
> >>+summary_info += {'libssh support':    libssh}
> >>  summary_info += {'lzo support':       lzo}
> >>  summary_info += {'snappy support':    snappy}
> >>  summary_info += {'bzip2 support':     libbzip2}
> >>diff --git a/meson_options.txt b/meson_options.txt
> >>index e392323732..4114bfcaa4 100644
> >>--- a/meson_options.txt
> >>+++ b/meson_options.txt
> >>@@ -105,6 +105,8 @@ option('libdaxctl', type : 'feature', value : 'auto',
> >>         description: 'libdaxctl support')
> >>  option('libpmem', type : 'feature', value : 'auto',
> >>         description: 'libpmem support')
> >>+option('libssh', type : 'feature', value : 'auto',
> >>+       description: 'ssh block device support')
> >>  option('libudev', type : 'feature', value : 'auto',
> >>         description: 'Use libudev to enumerate host devices')
> >>  option('libusb', type : 'feature', value : 'auto',
> >>diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
> >>index 7a17ff4218..ae8f18edc2 100644
> >>--- a/scripts/meson-buildoptions.sh
> >>+++ b/scripts/meson-buildoptions.sh
> >>@@ -53,6 +53,7 @@ meson_options_help() {
> >>    printf "%s\n" '  libiscsi        libiscsi userspace initiator'
> >>    printf "%s\n" '  libnfs          libnfs block device driver'
> >>    printf "%s\n" '  libpmem         libpmem support'
> >>+  printf "%s\n" '  libssh          ssh block device support'
> >>    printf "%s\n" '  libudev         Use libudev to enumerate host devices'
> >>    printf "%s\n" '  libusb          libusb support for USB passthrough'
> >>    printf "%s\n" '  libxml2         libxml2 support for Parallels image format'
> >>@@ -177,6 +178,8 @@ _meson_option_parse() {
> >>      --disable-libnfs) printf "%s" -Dlibnfs=disabled ;;
> >>      --enable-libpmem) printf "%s" -Dlibpmem=enabled ;;
> >>      --disable-libpmem) printf "%s" -Dlibpmem=disabled ;;
> >>+    --enable-libssh) printf "%s" -Dlibssh=enabled ;;
> >>+    --disable-libssh) printf "%s" -Dlibssh=disabled ;;
> >>      --enable-libudev) printf "%s" -Dlibudev=enabled ;;
> >>      --disable-libudev) printf "%s" -Dlibudev=disabled ;;
> >>      --enable-libusb) printf "%s" -Dlibusb=enabled ;;
> >
> >Seems reasonable, ACK.
> 
> Thanks!
> 
> >I should say that my interest in the ssh driver in qemu is not that
> >much these days.  I've been telling people to use nbdkit-ssh-plugin
> >instead.  It's more featureful and running it in a separate process is
> >probably safer too.
> 
> Then it's maybe time to deprecate the ssh driver in QEMU?

Weeeellllll ...  I didn't necessarily want to say that.  Others may be
using it, and deprecating working software causes trouble for some.
But I'll let others have their say on this.

I will mention that RHEL 9.1 will replace qemu's curl and ssh drivers
with nbdkit-curl-plugin and nbdkit-ssh-plugin.  For RHEL users this
should happen transparently.  Libvirt will substitute an external
nbdkit process when it sees the appropriate <disk> in the XML (all
RHEL users are required to use libvirt instead of qemu directly).  Of
course qemu doesn't need to care about what RHEL does, this is just
for your information.

https://bugzilla.redhat.com/show_bug.cgi?id=2016527

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] Move the libssh setup from configure to meson.build
  2021-12-09 15:22     ` Richard W.M. Jones
@ 2021-12-10 13:05       ` Philippe Mathieu-Daudé
  2021-12-13  7:15         ` Thomas Huth
  0 siblings, 1 reply; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-12-10 13:05 UTC (permalink / raw)
  To: Richard W.M. Jones, Thomas Huth; +Cc: Paolo Bonzini, qemu-devel

On 12/9/21 16:22, Richard W.M. Jones wrote:
> On Thu, Dec 09, 2021 at 04:08:24PM +0100, Thomas Huth wrote:
>> On 09/12/2021 15.55, Richard W.M. Jones wrote:
>>> On Thu, Dec 09, 2021 at 03:48:01PM +0100, Thomas Huth wrote:
>>>> It's easier to do this in meson.build now.
>>>>
>>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>>> ---
>>>>  v2: Added the missing "config_host_data.set('CONFIG_LIBSSH', libssh.found())"
>>>>
>>>>  configure                     | 27 ---------------------------
>>>>  meson.build                   | 13 +++++++++----
>>>>  meson_options.txt             |  2 ++
>>>>  scripts/meson-buildoptions.sh |  3 +++
>>>>  4 files changed, 14 insertions(+), 31 deletions(-)

>>> I should say that my interest in the ssh driver in qemu is not that
>>> much these days.  I've been telling people to use nbdkit-ssh-plugin
>>> instead.  It's more featureful and running it in a separate process is
>>> probably safer too.
>>
>> Then it's maybe time to deprecate the ssh driver in QEMU?
> 
> Weeeellllll ...  I didn't necessarily want to say that.  Others may be
> using it, and deprecating working software causes trouble for some.
> But I'll let others have their say on this.

The deprecation process is slow, users have 8 months to notice it,
and we might discover contributors willing to maintain it. IOW more
PROs than CONs IMHO.

> I will mention that RHEL 9.1 will replace qemu's curl and ssh drivers
> with nbdkit-curl-plugin and nbdkit-ssh-plugin.  For RHEL users this
> should happen transparently.  Libvirt will substitute an external
> nbdkit process when it sees the appropriate <disk> in the XML (all
> RHEL users are required to use libvirt instead of qemu directly).  Of
> course qemu doesn't need to care about what RHEL does, this is just
> for your information.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=2016527
> 
> Rich.
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] Move the libssh setup from configure to meson.build
  2021-12-10 13:05       ` Philippe Mathieu-Daudé
@ 2021-12-13  7:15         ` Thomas Huth
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Huth @ 2021-12-13  7:15 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Richard W.M. Jones; +Cc: Paolo Bonzini, qemu-devel

On 10/12/2021 14.05, Philippe Mathieu-Daudé wrote:
> On 12/9/21 16:22, Richard W.M. Jones wrote:
>> On Thu, Dec 09, 2021 at 04:08:24PM +0100, Thomas Huth wrote:
>>> On 09/12/2021 15.55, Richard W.M. Jones wrote:
>>>> On Thu, Dec 09, 2021 at 03:48:01PM +0100, Thomas Huth wrote:
>>>>> It's easier to do this in meson.build now.
>>>>>
>>>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>>>> ---
>>>>>   v2: Added the missing "config_host_data.set('CONFIG_LIBSSH', libssh.found())"
>>>>>
>>>>>   configure                     | 27 ---------------------------
>>>>>   meson.build                   | 13 +++++++++----
>>>>>   meson_options.txt             |  2 ++
>>>>>   scripts/meson-buildoptions.sh |  3 +++
>>>>>   4 files changed, 14 insertions(+), 31 deletions(-)
> 
>>>> I should say that my interest in the ssh driver in qemu is not that
>>>> much these days.  I've been telling people to use nbdkit-ssh-plugin
>>>> instead.  It's more featureful and running it in a separate process is
>>>> probably safer too.
>>>
>>> Then it's maybe time to deprecate the ssh driver in QEMU?
>>
>> Weeeellllll ...  I didn't necessarily want to say that.  Others may be
>> using it, and deprecating working software causes trouble for some.
>> But I'll let others have their say on this.
> 
> The deprecation process is slow, users have 8 months to notice it,
> and we might discover contributors willing to maintain it. IOW more
> PROs than CONs IMHO.

Right - one of the ideas of the deprecation process is that this is a way to 
find out if a feature is still used in practice, and whether someone still 
cares about it being maintained. So if you think that there is a better 
alternative these days and don't want to maintain the feature forever 
anymore, just send a patch to docs/about/deprecated.rst to mark it as 
deprecated there (and the status in MAINTAINERS should maybe rather be "Odd 
Fixes" than "Supported", I guess?).

  Thomas



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] Move the libssh setup from configure to meson.build
  2021-12-09 14:48 [PATCH v2] Move the libssh setup from configure to meson.build Thomas Huth
  2021-12-09 14:55 ` Richard W.M. Jones
@ 2021-12-15  7:56 ` Petr Vorel
  1 sibling, 0 replies; 7+ messages in thread
From: Petr Vorel @ 2021-12-15  7:56 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Paolo Bonzini, qemu-devel, Richard W . M . Jones

Hi,

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Although it's probably too late, as I see patch with PULL [1].

Kind regards,
Petr

[1] https://lore.kernel.org/qemu-devel/20211215073402.144286-10-thuth@redhat.com/


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-15  8:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 14:48 [PATCH v2] Move the libssh setup from configure to meson.build Thomas Huth
2021-12-09 14:55 ` Richard W.M. Jones
2021-12-09 15:08   ` Thomas Huth
2021-12-09 15:22     ` Richard W.M. Jones
2021-12-10 13:05       ` Philippe Mathieu-Daudé
2021-12-13  7:15         ` Thomas Huth
2021-12-15  7:56 ` Petr Vorel

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.