From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDid8-0004Cy-Iu for qemu-devel@nongnu.org; Sun, 25 Aug 2013 18:18:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDid0-00023U-8D for qemu-devel@nongnu.org; Sun, 25 Aug 2013 18:17:54 -0400 Message-ID: <521A8281.6070401@suse.de> Date: Mon, 26 Aug 2013 00:17:37 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1377235210-27093-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1377235210-27093-4-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <02FA64AE-6862-4306-8E8E-919C253F7028@suse.de> In-Reply-To: <02FA64AE-6862-4306-8E8E-919C253F7028@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH -V3 3/4] target-ppc: Check for error on address translation in memsave command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , "Aneesh Kumar K.V" Cc: Paul Mackerras , qemu-ppc , qemu-devel , Luiz Capitulino Am 25.08.2013 20:32, schrieb Alexander Graf: >=20 > On 23.08.2013, at 06:20, Aneesh Kumar K.V wrote: >=20 >> From: "Aneesh Kumar K.V" >> >> When we translate the virtual address to physical check for error. >> >> Signed-off-by: Aneesh Kumar K.V >=20 > I think this change is sane, but I'd really prefer to see an ack from (= or get this applied by) Luiz. >=20 >=20 > Alex >=20 >> --- >> cpus.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/cpus.c b/cpus.c >> index 0f65e76..658366d 100644 >> --- a/cpus.c >> +++ b/cpus.c >> @@ -1309,7 +1309,10 @@ void qmp_memsave(int64_t addr, int64_t size, co= nst char *filename, >> l =3D sizeof(buf); >> if (l > size) >> l =3D size; >> - cpu_memory_rw_debug(cpu, addr, buf, l, 0); >> + if (cpu_memory_rw_debug(cpu, addr, buf, l, 0) !=3D 0) { >> + error_set(errp, QERR_INVALID_PARAMETER, "addr"); I've been repeatedly told error_set() should no longer be used, in favor of error_setg(). :) Andreas >> + goto exit; >> + } >> if (fwrite(buf, 1, l, f) !=3D l) { >> error_set(errp, QERR_IO_ERROR); >> goto exit; >> --=20 >> 1.8.1.2 >> >=20 >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg