Blob Blame History Raw
From 4e72a97c81c6fe61fe051bfe41e9b53425bcd7af Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Fri, 7 Nov 2014 17:17:50 +0100
Subject: [PATCH 03/41] dump: const-qualify the buf of WriteCoreDumpFunction

Message-id: <1415380693-16593-4-git-send-email-lersek@redhat.com>
Patchwork-id: 62189
O-Subject: [RHEL-7.1 qemu-kvm PATCH 03/26] dump: const-qualify the buf of WriteCoreDumpFunction
Bugzilla: 1157798
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
RH-Acked-by: dgibson <dgibson@redhat.com>

From: qiaonuohan <qiaonuohan@cn.fujitsu.com>

WriteCoreDumpFunction is a function pointer that points to the function used to
write content in "buf" into core file, so "buf" should be const-qualify.

Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
(cherry picked from commit b5ba1cc6260917926781fb79fbb05d53bf586d53)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 dump.c            | 2 +-
 include/qom/cpu.h | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dump.c b/dump.c
index 8c31386..aa56aba 100644
--- a/dump.c
+++ b/dump.c
@@ -99,7 +99,7 @@ static void dump_error(DumpState *s, const char *reason)
     dump_cleanup(s);
 }
 
-static int fd_write_vmcore(void *buf, size_t size, void *opaque)
+static int fd_write_vmcore(const void *buf, size_t size, void *opaque)
 {
     DumpState *s = opaque;
     size_t written_size;
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index b555c22..a5cc6c3 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -25,7 +25,8 @@
 #include "qemu/thread.h"
 #include "qemu/typedefs.h"
 
-typedef int (*WriteCoreDumpFunction)(void *buf, size_t size, void *opaque);
+typedef int (*WriteCoreDumpFunction)(const void *buf, size_t size,
+                                     void *opaque);
 
 /**
  * SECTION:cpu
-- 
1.8.3.1