yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
958e1b
From 4e72a97c81c6fe61fe051bfe41e9b53425bcd7af Mon Sep 17 00:00:00 2001
958e1b
From: Laszlo Ersek <lersek@redhat.com>
958e1b
Date: Fri, 7 Nov 2014 17:17:50 +0100
958e1b
Subject: [PATCH 03/41] dump: const-qualify the buf of WriteCoreDumpFunction
958e1b
958e1b
Message-id: <1415380693-16593-4-git-send-email-lersek@redhat.com>
958e1b
Patchwork-id: 62189
958e1b
O-Subject: [RHEL-7.1 qemu-kvm PATCH 03/26] dump: const-qualify the buf of WriteCoreDumpFunction
958e1b
Bugzilla: 1157798
958e1b
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
958e1b
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
958e1b
RH-Acked-by: dgibson <dgibson@redhat.com>
958e1b
958e1b
From: qiaonuohan <qiaonuohan@cn.fujitsu.com>
958e1b
958e1b
WriteCoreDumpFunction is a function pointer that points to the function used to
958e1b
write content in "buf" into core file, so "buf" should be const-qualify.
958e1b
958e1b
Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
958e1b
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
958e1b
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
958e1b
(cherry picked from commit b5ba1cc6260917926781fb79fbb05d53bf586d53)
958e1b
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
958e1b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
958e1b
---
958e1b
 dump.c            | 2 +-
958e1b
 include/qom/cpu.h | 3 ++-
958e1b
 2 files changed, 3 insertions(+), 2 deletions(-)
958e1b
958e1b
diff --git a/dump.c b/dump.c
958e1b
index 8c31386..aa56aba 100644
958e1b
--- a/dump.c
958e1b
+++ b/dump.c
958e1b
@@ -99,7 +99,7 @@ static void dump_error(DumpState *s, const char *reason)
958e1b
     dump_cleanup(s);
958e1b
 }
958e1b
 
958e1b
-static int fd_write_vmcore(void *buf, size_t size, void *opaque)
958e1b
+static int fd_write_vmcore(const void *buf, size_t size, void *opaque)
958e1b
 {
958e1b
     DumpState *s = opaque;
958e1b
     size_t written_size;
958e1b
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
958e1b
index b555c22..a5cc6c3 100644
958e1b
--- a/include/qom/cpu.h
958e1b
+++ b/include/qom/cpu.h
958e1b
@@ -25,7 +25,8 @@
958e1b
 #include "qemu/thread.h"
958e1b
 #include "qemu/typedefs.h"
958e1b
 
958e1b
-typedef int (*WriteCoreDumpFunction)(void *buf, size_t size, void *opaque);
958e1b
+typedef int (*WriteCoreDumpFunction)(const void *buf, size_t size,
958e1b
+                                     void *opaque);
958e1b
 
958e1b
 /**
958e1b
  * SECTION:cpu
958e1b
-- 
958e1b
1.8.3.1
958e1b