yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From 291074de7615878e297df1e821f9a71ce5dd784a Mon Sep 17 00:00:00 2001
9ae3a8
From: Jeff Cody <jcody@redhat.com>
9ae3a8
Date: Thu, 7 Nov 2013 07:33:12 +0100
9ae3a8
Subject: [PATCH 59/81] migration: disable live block migration (-b/-i) for rhel and rhev
9ae3a8
9ae3a8
RH-Author: Jeff Cody <jcody@redhat.com>
9ae3a8
Message-id: <696b8063664491b1d1799450b4498927c2ae9908.1383712781.git.jcody@redhat.com>
9ae3a8
Patchwork-id: 55480
9ae3a8
O-Subject: [RHEL7 qemu-kvm PATCH 3/3] migration: disable live block migration (-b/-i) for rhel and rhev
9ae3a8
Bugzilla: 1022392
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
RH-Acked-by: Eric Blake <eblake@redhat.com>
9ae3a8
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
9ae3a8
This disables live block migration (both -b and -i options) for both
9ae3a8
the RHEL and RHEV versions of qemu-kvm.  Rather than delete the options
9ae3a8
from the QAPI/QMP commands (which would be unfriendly to libvirt), the
9ae3a8
options return a QMP error of unsupported ("this feature or command is
9ae3a8
not currently supported").
9ae3a8
9ae3a8
A configure option to enable/disable this is set, which defaults to the
9ae3a8
command options being disabled.  Just to be safe, the rpm spec template
9ae3a8
explicitly disables it as well.
9ae3a8
9ae3a8
Signed-off-by: Jeff Cody <jcody@redhat.com>
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 configure                     |   12 ++++++++++++
9ae3a8
 migration.c                   |    7 +++++++
9ae3a8
 redhat/qemu-kvm.spec.template |    1 +
9ae3a8
 3 files changed, 20 insertions(+), 0 deletions(-)
9ae3a8
9ae3a8
diff --git a/configure b/configure
9ae3a8
index 9260d3c..d658434 100755
9ae3a8
--- a/configure
9ae3a8
+++ b/configure
9ae3a8
@@ -241,6 +241,7 @@ gtkabi="2.0"
9ae3a8
 tpm="no"
9ae3a8
 libssh2=""
9ae3a8
 live_block_ops="yes"
9ae3a8
+live_block_migration="no"
9ae3a8
 
9ae3a8
 # parse CC options first
9ae3a8
 for opt do
9ae3a8
@@ -932,6 +933,10 @@ for opt do
9ae3a8
   ;;
9ae3a8
   --enable-live-block-ops) live_block_ops="yes"
9ae3a8
   ;;
9ae3a8
+  --disable-live-block-migration) live_block_migration="no"
9ae3a8
+  ;;
9ae3a8
+  --enable-live-block-migration) live_block_migration="yes"
9ae3a8
+  ;;
9ae3a8
 *) echo "ERROR: unknown option $opt"; show_help="yes"
9ae3a8
   ;;
9ae3a8
   esac
9ae3a8
@@ -1202,6 +1207,8 @@ echo "  --disable-libssh2        disable ssh block device support"
9ae3a8
 echo "  --enable-libssh2         enable ssh block device support"
9ae3a8
 echo "  --disable-live-block-ops disable live block operations support"
9ae3a8
 echo "  --enable-live-block-ops  enable live block operations support"
9ae3a8
+echo "  --disable-live-block-migration disable live block migration"
9ae3a8
+echo "  --enable-live-block-migration  enable live block migration"
9ae3a8
 echo ""
9ae3a8
 echo "NOTE: The object files are built at the place where configure is launched"
9ae3a8
 exit 1
9ae3a8
@@ -3564,6 +3571,7 @@ echo "libssh2 support   $libssh2"
9ae3a8
 echo "TPM passthrough   $tpm_passthrough"
9ae3a8
 echo "QOM debugging     $qom_cast_debug"
9ae3a8
 echo "Live block operations $live_block_ops"
9ae3a8
+echo "Live block migration $live_block_migration"
9ae3a8
 
9ae3a8
 if test "$sdl_too_old" = "yes"; then
9ae3a8
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
9ae3a8
@@ -3952,6 +3960,10 @@ if test "$live_block_ops" = "yes" ; then
9ae3a8
   echo "CONFIG_LIVE_BLOCK_OPS=y" >> $config_host_mak
9ae3a8
 fi
9ae3a8
 
9ae3a8
+if test "$live_block_migration" = "yes" ; then
9ae3a8
+  echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak
9ae3a8
+fi
9ae3a8
+
9ae3a8
 # USB host support
9ae3a8
 if test "$libusb" = "yes"; then
9ae3a8
   echo "HOST_USB=libusb legacy" >> $config_host_mak
9ae3a8
diff --git a/migration.c b/migration.c
9ae3a8
index 6b87272..46c633a 100644
9ae3a8
--- a/migration.c
9ae3a8
+++ b/migration.c
9ae3a8
@@ -388,6 +388,13 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
9ae3a8
     params.blk = has_blk && blk;
9ae3a8
     params.shared = has_inc && inc;
9ae3a8
 
9ae3a8
+#ifndef CONFIG_LIVE_BLOCK_MIGRATION
9ae3a8
+    if (params.blk || params.shared) {
9ae3a8
+        error_set(errp, QERR_UNSUPPORTED);
9ae3a8
+        return;
9ae3a8
+    }
9ae3a8
+#endif
9ae3a8
+
9ae3a8
     if (s->state == MIG_STATE_ACTIVE) {
9ae3a8
         error_set(errp, QERR_MIGRATION_ACTIVE);
9ae3a8
         return;
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8