dump: const-qualify the buf of WriteCoreDumpFunction
authorqiaonuohan <qiaonuohan@cn.fujitsu.com>
Tue, 18 Feb 2014 06:11:25 +0000 (14:11 +0800)
committerLuiz Capitulino <lcapitulino@redhat.com>
Fri, 28 Feb 2014 16:49:02 +0000 (11:49 -0500)
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>
dump.c
include/qom/cpu.h

diff --git a/dump.c b/dump.c
index 80a9116..42622de 100644 (file)
--- 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;
index 367eda1..d734be8 100644 (file)
@@ -28,7 +28,8 @@
 #include "qemu/tls.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);
 
 /**
  * vaddr: