9ae3a8
From fe80e7d53fa6cb0e8f26b76cf6c73acd7010290e Mon Sep 17 00:00:00 2001
9ae3a8
From: Laszlo Ersek <lersek@redhat.com>
9ae3a8
Date: Mon, 12 Aug 2013 15:59:31 +0200
9ae3a8
Subject: dump: Move stubs into libqemustub.a
9ae3a8
9ae3a8
RH-Author: Laszlo Ersek <lersek@redhat.com>
9ae3a8
Message-id: <1376323180-12863-2-git-send-email-lersek@redhat.com>
9ae3a8
Patchwork-id: 53160
9ae3a8
O-Subject: [RHEL-7 qemu-kvm PATCH 01/10] dump: Move stubs into libqemustub.a
9ae3a8
Bugzilla: 981582
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Radim Krcmar <rkrcmar@redhat.com>
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
9ae3a8
From: Andreas Färber <afaerber@suse.de>
9ae3a8
9ae3a8
This allows us to drop CONFIG_NO_CORE_DUMP with its indirect dependency
9ae3a8
on CONFIG_HAVE_CORE_DUMP.
9ae3a8
9ae3a8
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
Signed-off-by: Andreas Färber <afaerber@suse.de>
9ae3a8
(cherry picked from commit 88f62c2b1deb466749e340a8a241975c509bd9b6)
9ae3a8
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
9ae3a8
diff --git a/Makefile.target b/Makefile.target
9ae3a8
index ce4391f..1cafb17 100644
9ae3a8
--- a/Makefile.target
9ae3a8
+++ b/Makefile.target
9ae3a8
@@ -64,7 +64,6 @@ CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
9ae3a8
 CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
9ae3a8
 CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
9ae3a8
 CONFIG_NO_GET_MEMORY_MAPPING = $(if $(subst n,,$(CONFIG_HAVE_GET_MEMORY_MAPPING)),n,y)
9ae3a8
-CONFIG_NO_CORE_DUMP = $(if $(subst n,,$(CONFIG_HAVE_CORE_DUMP)),n,y)
9ae3a8
 
9ae3a8
 #########################################################
9ae3a8
 # cpu emulator library
9ae3a8
@@ -114,7 +113,6 @@ 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-$(CONFIG_NO_GET_MEMORY_MAPPING) += memory_mapping-stub.o
9ae3a8
-obj-$(CONFIG_NO_CORE_DUMP) += dump-stub.o
9ae3a8
 LIBS+=$(libs_softmmu)
9ae3a8
 
9ae3a8
 # xen support
9ae3a8
diff --git a/dump-stub.c b/dump-stub.c
9ae3a8
deleted file mode 100644
9ae3a8
index b3f42cb..0000000
9ae3a8
--- a/dump-stub.c
9ae3a8
+++ /dev/null
9ae3a8
@@ -1,36 +0,0 @@
9ae3a8
-/*
9ae3a8
- * QEMU dump
9ae3a8
- *
9ae3a8
- * Copyright Fujitsu, Corp. 2011, 2012
9ae3a8
- *
9ae3a8
- * Authors:
9ae3a8
- *     Wen Congyang <wency@cn.fujitsu.com>
9ae3a8
- *
9ae3a8
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
9ae3a8
- * See the COPYING file in the top-level directory.
9ae3a8
- *
9ae3a8
- */
9ae3a8
-
9ae3a8
-#include "qemu-common.h"
9ae3a8
-#include "sysemu/dump.h"
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
-{
9ae3a8
-    return -1;
9ae3a8
-}
9ae3a8
-
9ae3a8
-ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
9ae3a8
-{
9ae3a8
-    return -1;
9ae3a8
-}
9ae3a8
-
9ae3a8
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
9ae3a8
index 03dff20..9b701b4 100644
9ae3a8
--- a/stubs/Makefile.objs
9ae3a8
+++ b/stubs/Makefile.objs
9ae3a8
@@ -2,6 +2,7 @@ stub-obj-y += arch-query-cpu-def.o
9ae3a8
 stub-obj-y += clock-warp.o
9ae3a8
 stub-obj-y += cpu-get-clock.o
9ae3a8
 stub-obj-y += cpu-get-icount.o
9ae3a8
+stub-obj-y += dump.o
9ae3a8
 stub-obj-y += fdset-add-fd.o
9ae3a8
 stub-obj-y += fdset-find-fd.o
9ae3a8
 stub-obj-y += fdset-get-fd.o
9ae3a8
diff --git a/stubs/dump.c b/stubs/dump.c
9ae3a8
new file mode 100644
9ae3a8
index 0000000..b3f42cb
9ae3a8
--- /dev/null
9ae3a8
+++ b/stubs/dump.c
9ae3a8
@@ -0,0 +1,36 @@
9ae3a8
+/*
9ae3a8
+ * QEMU dump
9ae3a8
+ *
9ae3a8
+ * Copyright Fujitsu, Corp. 2011, 2012
9ae3a8
+ *
9ae3a8
+ * Authors:
9ae3a8
+ *     Wen Congyang <wency@cn.fujitsu.com>
9ae3a8
+ *
9ae3a8
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
9ae3a8
+ * See the COPYING file in the top-level directory.
9ae3a8
+ *
9ae3a8
+ */
9ae3a8
+
9ae3a8
+#include "qemu-common.h"
9ae3a8
+#include "sysemu/dump.h"
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
+{
9ae3a8
+    return -1;
9ae3a8
+}
9ae3a8
+
9ae3a8
+ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
9ae3a8
+{
9ae3a8
+    return -1;
9ae3a8
+}
9ae3a8
+