summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2013-04-09 15:30:53 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-04-15 10:18:05 +0200
commit0a12ec87a513b31eb3b6e035d30649e483322270 (patch)
treefdd89881c08b7f7aa3e0c3cfda13f18d29fcdd91 /configure
parentaad64f3193cbdc3741d10afa0237b6833e46e94e (diff)
downloadqemu-0a12ec87a513b31eb3b6e035d30649e483322270.tar.gz
block: Add support for Secure Shell (ssh) block device.
qemu-system-x86_64 -drive file=ssh://hostname/some/image QEMU will ssh into 'hostname' and open '/some/image' which is made available as a standard block device. You can specify a username (ssh://user@host/...) and/or a port number (ssh://host:port/...). You can also use an alternate syntax using properties (file.user, file.host, file.port, file.path). Current limitations: - Authentication must be done without passwords or passphrases, using ssh-agent. Other authentication methods are not supported. - Uses a single connection, instead of concurrent AIO with multiple SSH connections. This is implemented using libssh2 on the client side. The server just requires a regular ssh daemon with sftp-server support. Most ssh daemons on Unix/Linux systems will work out of the box. Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Cc: Stefan Hajnoczi <stefanha@gmail.com> Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure48
1 files changed, 48 insertions, 0 deletions
diff --git a/configure b/configure
index 73df181406..e6c5d2c3f6 100755
--- a/configure
+++ b/configure
@@ -239,6 +239,7 @@ virtio_blk_data_plane=""
gtk=""
gtkabi="2.0"
tpm="no"
+libssh2=""
# parse CC options first
for opt do
@@ -922,6 +923,10 @@ for opt do
;;
--enable-tpm) tpm="yes"
;;
+ --disable-libssh2) libssh2="no"
+ ;;
+ --enable-libssh2) libssh2="yes"
+ ;;
*) echo "ERROR: unknown option $opt"; show_help="yes"
;;
esac
@@ -1182,6 +1187,8 @@ echo " --disable-glusterfs disable GlusterFS backend"
echo " --enable-gcov enable test coverage analysis with gcov"
echo " --gcov=GCOV use specified gcov [$gcov_tool]"
echo " --enable-tpm enable TPM support"
+echo " --disable-libssh2 disable ssh block device support"
+echo " --enable-libssh2 enable ssh block device support"
echo ""
echo "NOTE: The object files are built at the place where configure is launched"
exit 1
@@ -2314,6 +2321,42 @@ EOF
fi
##########################################
+# libssh2 probe
+if test "$libssh2" != "no" ; then
+ cat > $TMPC <<EOF
+#include <stdio.h>
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+int main(void) {
+ LIBSSH2_SESSION *session;
+ session = libssh2_session_init ();
+ (void) libssh2_sftp_init (session);
+ return 0;
+}
+EOF
+
+ if $pkg_config libssh2 --modversion >/dev/null 2>&1; then
+ libssh2_cflags=`$pkg_config libssh2 --cflags`
+ libssh2_libs=`$pkg_config libssh2 --libs`
+ else
+ libssh2_cflags=
+ libssh2_libs="-lssh2"
+ fi
+
+ if compile_prog "$libssh2_cflags" "$libssh2_libs" ; then
+ libssh2=yes
+ libs_tools="$libssh2_libs $libs_tools"
+ libs_softmmu="$libssh2_libs $libs_softmmu"
+ QEMU_CFLAGS="$QEMU_CFLAGS $libssh2_cflags"
+ else
+ if test "$libssh2" = "yes" ; then
+ feature_not_found "libssh2"
+ fi
+ libssh2=no
+ fi
+fi
+
+##########################################
# linux-aio probe
if test "$linux_aio" != "no" ; then
@@ -3435,6 +3478,7 @@ echo "virtio-blk-data-plane $virtio_blk_data_plane"
echo "gcov $gcov_tool"
echo "gcov enabled $gcov"
echo "TPM support $tpm"
+echo "libssh2 support $libssh2"
if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -3793,6 +3837,10 @@ if test "$glusterfs" = "yes" ; then
echo "CONFIG_GLUSTERFS=y" >> $config_host_mak
fi
+if test "$libssh2" = "yes" ; then
+ echo "CONFIG_LIBSSH2=y" >> $config_host_mak
+fi
+
if test "$virtio_blk_data_plane" = "yes" ; then
echo 'CONFIG_VIRTIO_BLK_DATA_PLANE=$(CONFIG_VIRTIO)' >> $config_host_mak
fi