From e21edf117d05e09ca38c5b3869054917a70b95d5 Mon Sep 17 00:00:00 2001
Message-Id: <e21edf117d05e09ca38c5b3869054917a70b95d5.1334850253.git.minovotn@redhat.com>
From: Jeffrey Cody <jcody@redhat.com>
Date: Thu, 19 Apr 2012 14:58:16 +0200
Subject: [PATCH] Block streaming disable for RHEL

RH-Author: Jeffrey Cody <jcody@redhat.com>
Message-id: <c07d7ff9054b0040401b58533e7c2d2454ade19b.1334846211.git.jcody@redhat.com>
Patchwork-id: 39351
O-Subject: [RHEL6.3 qemu-kvm PATCH v4] Block streaming disable for RHEL
Bugzilla: 808805
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>

configure: add option to disable block streaming, and a meta-option to
disable RHEV features.

qemu-kvm.spec.template: use rhev_features to control snapshots & mirroring.

The configure option to enable and disable live snapshots, and mirroring
has changed to both be under -rhev-features.  This updates the spec file,
accordingly.

Downstream only.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 configure                     |   22 ++++++++++++++++++++++
 qemu-monitor.hx               |    2 ++
 redhat/qemu-kvm.spec.template |   18 +++++++++++-------
 3 files changed, 35 insertions(+), 7 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 configure                     |   22 ++++++++++++++++++++++
 qemu-monitor.hx               |    2 ++
 redhat/qemu-kvm.spec.template |   18 +++++++++++-------
 3 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/configure b/configure
index 71de514..9dc2426 100755
--- a/configure
+++ b/configure
@@ -286,6 +286,7 @@ spice=""
 smartcard=""
 smartcard_nss=""
 live_snapshots="yes"
+block_stream="yes"
 usb_redir=""
 
 # OS specific
@@ -686,10 +687,22 @@ for opt do
   ;;
   --enable-live-snapshots) live_snapshots="yes"
   ;;
+  --disable-block-stream) block_stream="no"
+  ;;
+  --enable-block-stream) block_stream="yes"
+  ;;
   --disable-usb-redir) usb_redir="no"
   ;;
   --enable-usb-redir) usb_redir="yes"
   ;;
+  --disable-rhev-features)
+       live_snapshots="no";
+       block_stream="no";
+  ;;
+  --enable-rhev-features)
+       live_snapshots="yes";
+       block_stream="yes";
+  ;;
   *) echo "ERROR: unknown option $opt"; show_help="yes"
   ;;
   esac
@@ -863,8 +876,12 @@ echo "  --disable-smartcard-nss  disable smartcard nss support"
 echo "  --enable-smartcard-nss   enable smartcard nss support"
 echo "  --disable-live-snapshots disable live block device snapshot support"
 echo "  --enable-live-snapshots  enable live block device snapshot support"
+echo "  --disable-block-stream   disable block streaming support"
+echo "  --enable-block-stream    enable block streaming support"
 echo "  --disable-usb-redir      disable usb network redirection support"
 echo "  --enable-usb-redir       enable usb network redirection support"
+echo "  --disable-rhev-features  disable RHEV-only features"
+echo "  --enable-rhev-features   enable RHEV-only features"
 echo ""
 echo "NOTE: The object files are built at the place where configure is launched"
 exit 1
@@ -2271,6 +2288,7 @@ echo "Trace backend     $trace_backend"
 echo "spice support     $spice"
 echo "nss used          $smartcard_nss"
 echo "Live snapshots    $live_snapshots"
+echo "Block streaming   $block_stream"
 echo "xfsctl support    $xfs"
 echo "usb net redir     $usb_redir"
 
@@ -2526,6 +2544,10 @@ if test "$live_snapshots" = "yes" ; then
   echo "CONFIG_LIVE_SNAPSHOTS=y" >> $config_host_mak
 fi
 
+if test "$block_stream" = "yes" ; then
+  echo "CONFIG_BLOCK_STREAM=y" >> $config_host_mak
+fi
+
 if test "$usb_redir" = "yes" ; then
   echo "CONFIG_USB_REDIR=y" >> $config_host_mak
 fi
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 8889e6f..8ee4cb7 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -2150,6 +2150,7 @@ Example:
 
 EQMP
 
+#ifdef CONFIG_BLOCK_STREAM
     {
         .name       = "block-stream",
         .args_type  = "device:B,base:s?",
@@ -2158,6 +2159,7 @@ EQMP
         .user_print = monitor_user_noop,
         .mhandler.cmd_new = do_block_stream,
     },
+#endif
 
 SQMP
 block-stream
-- 
1.7.7.6

