thebeanogamer / rpms / qemu-kvm

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