From: qiaonuohan Date: Tue, 18 Feb 2014 06:11:25 +0000 (+0800) Subject: dump: const-qualify the buf of WriteCoreDumpFunction X-Git-Tag: v2.0.0-rc0~43^2~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5ba1cc6260917926781fb79fbb05d53bf586d53;p=thirdparty%2Fqemu.git dump: const-qualify the buf of WriteCoreDumpFunction 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 Reviewed-by: Laszlo Ersek Signed-off-by: Luiz Capitulino --- diff --git a/dump.c b/dump.c index 80a9116c778..42622def09c 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 367eda17d11..d734be8a405 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -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: