From patchwork Thu Feb 13 15:30:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 320101 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DE91E2C0082 for ; Fri, 14 Feb 2014 02:36:17 +1100 (EST) Received: from localhost ([::1]:47134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDyKl-0007pc-L4 for incoming@patchwork.ozlabs.org; Thu, 13 Feb 2014 10:36:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDyG3-0001aO-Om for qemu-devel@nongnu.org; Thu, 13 Feb 2014 10:31:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDyFz-0008Vx-5A for qemu-devel@nongnu.org; Thu, 13 Feb 2014 10:31:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDyFy-0008Vm-U2 for qemu-devel@nongnu.org; Thu, 13 Feb 2014 10:31:19 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1DFVCSZ023116 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 Feb 2014 10:31:13 -0500 Received: from localhost (ovpn-113-138.phx2.redhat.com [10.3.113.138]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s1DFV8dI032404; Thu, 13 Feb 2014 10:31:08 -0500 From: Luiz Capitulino To: peter.maydell@linaro.org Date: Thu, 13 Feb 2014 10:30:23 -0500 Message-Id: <1392305440-30465-6-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1392305440-30465-1-git-send-email-lcapitulino@redhat.com> References: <1392305440-30465-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws Subject: [Qemu-devel] [PULL 05/22] dump: const-qualify the buf of WriteCoreDumpFunction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: qiaonuohan 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 --- dump.c | 2 +- include/qom/cpu.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dump.c b/dump.c index 80a9116..42622de 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 367eda1..d734be8 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: