9ae3a8
From bf8262fae14e0dd80ad8a9c302bd2317139d18a3 Mon Sep 17 00:00:00 2001
9ae3a8
From: Laszlo Ersek <lersek@redhat.com>
9ae3a8
Date: Fri, 7 Nov 2014 17:18:02 +0100
9ae3a8
Subject: [PATCH 15/41] dump: Drop qmp_dump_guest_memory() stub and build for
9ae3a8
 all targets
9ae3a8
MIME-Version: 1.0
9ae3a8
Content-Type: text/plain; charset=UTF-8
9ae3a8
Content-Transfer-Encoding: 8bit
9ae3a8
9ae3a8
Message-id: <1415380693-16593-16-git-send-email-lersek@redhat.com>
9ae3a8
Patchwork-id: 62201
9ae3a8
O-Subject: [RHEL-7.1 qemu-kvm PATCH 15/26] dump: Drop qmp_dump_guest_memory() stub and build for all targets
9ae3a8
Bugzilla: 1157798
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
9ae3a8
RH-Acked-by: dgibson <dgibson@redhat.com>
9ae3a8
9ae3a8
From: Andreas Färber <afaerber@suse.de>
9ae3a8
9ae3a8
qmp_dump_guest_memory() calls dump_init() and returns an Error when
9ae3a8
cpu_get_dump_info() returns an error, as done by the stub.
9ae3a8
So there is no need to have a stub for qmp_dump_guest_memory().
9ae3a8
9ae3a8
Enable the documentation of the always-present dump-guest-memory command.
9ae3a8
9ae3a8
That way we can drop CONFIG_HAVE_CORE_DUMP and leave configure
9ae3a8
completely out of the picture for target CPU features.
9ae3a8
9ae3a8
Signed-off-by: Andreas Färber <afaerber@suse.de>
9ae3a8
(cherry picked from commit 2a78636bd204e389068d203473ec76558083b44b)
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
9ae3a8
Conflicts:
9ae3a8
	Makefile.target
9ae3a8
	stubs/dump.c
9ae3a8
9ae3a8
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
---
9ae3a8
 Makefile.target | 2 +-
9ae3a8
 configure       | 4 ----
9ae3a8
 hmp-commands.hx | 2 --
9ae3a8
 stubs/dump.c    | 8 --------
9ae3a8
 4 files changed, 1 insertion(+), 15 deletions(-)
9ae3a8
9ae3a8
diff --git a/Makefile.target b/Makefile.target
9ae3a8
index ca407d7..ea874c9 100644
9ae3a8
--- a/Makefile.target
9ae3a8
+++ b/Makefile.target
9ae3a8
@@ -119,7 +119,7 @@ obj-$(CONFIG_FDT) += device_tree.o
9ae3a8
 obj-$(CONFIG_KVM) += kvm-all.o
9ae3a8
 obj-y += memory.o savevm.o cputlb.o
9ae3a8
 obj-$(CONFIG_HAVE_GET_MEMORY_MAPPING) += memory_mapping.o
9ae3a8
-obj-$(CONFIG_HAVE_CORE_DUMP) += dump.o
9ae3a8
+obj-y += dump.o
9ae3a8
 obj-$(CONFIG_NO_GET_MEMORY_MAPPING) += memory_mapping-stub.o
9ae3a8
 LIBS+=$(libs_softmmu)
9ae3a8
 
9ae3a8
diff --git a/configure b/configure
9ae3a8
index 5373237..ca8b107 100755
9ae3a8
--- a/configure
9ae3a8
+++ b/configure
9ae3a8
@@ -4483,10 +4483,6 @@ if test "$target_bigendian" = "yes" ; then
9ae3a8
 fi
9ae3a8
 if test "$target_softmmu" = "yes" ; then
9ae3a8
   echo "CONFIG_SOFTMMU=y" >> $config_target_mak
9ae3a8
-  case "$target_arch2" in
9ae3a8
-    i386|x86_64)
9ae3a8
-      echo "CONFIG_HAVE_CORE_DUMP=y" >> $config_target_mak
9ae3a8
-  esac
9ae3a8
 fi
9ae3a8
 if test "$target_user_only" = "yes" ; then
9ae3a8
   echo "CONFIG_USER_ONLY=y" >> $config_target_mak
9ae3a8
diff --git a/hmp-commands.hx b/hmp-commands.hx
9ae3a8
index 467dd70..58498f7 100644
9ae3a8
--- a/hmp-commands.hx
9ae3a8
+++ b/hmp-commands.hx
9ae3a8
@@ -1013,7 +1013,6 @@ server will ask the spice/vnc client to automatically reconnect using the
9ae3a8
 new parameters (if specified) once the vm migration finished successfully.
9ae3a8
 ETEXI
9ae3a8
 
9ae3a8
-#if defined(CONFIG_HAVE_CORE_DUMP)
9ae3a8
     {
9ae3a8
         .name       = "dump-guest-memory",
9ae3a8
         .args_type  = "paging:-p,filename:F,begin:i?,length:i?",
9ae3a8
@@ -1037,7 +1036,6 @@ gdb.
9ae3a8
     length: the memory size, in bytes. It's optional, and should be specified
9ae3a8
             with begin together.
9ae3a8
 ETEXI
9ae3a8
-#endif
9ae3a8
 
9ae3a8
 #ifdef CONFIG_LIVE_BLOCK_OPS
9ae3a8
     {
9ae3a8
diff --git a/stubs/dump.c b/stubs/dump.c
9ae3a8
index 5749e2c..370cd96 100644
9ae3a8
--- a/stubs/dump.c
9ae3a8
+++ b/stubs/dump.c
9ae3a8
@@ -16,14 +16,6 @@
9ae3a8
 #include "qapi/qmp/qerror.h"
9ae3a8
 #include "qmp-commands.h"
9ae3a8
 
9ae3a8
-/* we need this function in hmp.c */
9ae3a8
-void qmp_dump_guest_memory(bool paging, const char *file, bool has_begin,
9ae3a8
-                           int64_t begin, bool has_length, int64_t length,
9ae3a8
-                           Error **errp)
9ae3a8
-{
9ae3a8
-    error_set(errp, QERR_UNSUPPORTED);
9ae3a8
-}
9ae3a8
-
9ae3a8
 int cpu_get_dump_info(ArchDumpInfo *info,
9ae3a8
                       const struct GuestPhysBlockList *guest_phys_blocks)
9ae3a8
 {
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8