From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDwlB-0005lT-ID for qemu-devel@nongnu.org; Mon, 26 Aug 2013 09:23:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDwl4-00085O-PK for qemu-devel@nongnu.org; Mon, 26 Aug 2013 09:23:09 -0400 Date: Mon, 26 Aug 2013 09:22:42 -0400 From: Luiz Capitulino Message-ID: <20130826092242.0b24d7dc@redhat.com> In-Reply-To: <521B4881.1040105@suse.de> 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> <521A8281.6070401@suse.de> <878uzoej9b.fsf@linux.vnet.ibm.com> <521B4881.1040105@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: Andreas =?UTF-8?B?RsOkcmJlcg==?= Cc: qemu-devel , qemu-ppc , Paul Mackerras , "Aneesh Kumar K.V" , Alexander Graf On Mon, 26 Aug 2013 14:22:25 +0200 Andreas F=C3=A4rber wrote: > Am 26.08.2013 14:20, schrieb Aneesh Kumar K.V: > > Andreas F=C3=A4rber writes: > >=20 > >> Am 25.08.2013 20:32, schrieb Alexander Graf: > >>> > >>> On 23.08.2013, at 06:20, Aneesh Kumar K.V wrote: > >>> > >>>> From: "Aneesh Kumar K.V" > >>>> > >>>> When we translate the virtual address to physical check for error. > >>>> > >>>> Signed-off-by: Aneesh Kumar K.V > >>> > >>> I think this change is sane, but I'd really prefer to see an ack from= (or get this applied by) Luiz. > >>> > >>> > >>> Alex > >>> > >>>> --- > >>>> 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, = const 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 fav= or > >> of error_setg(). :) > >> > >=20 > > Updated to=20 > >=20 > > commit 23aa279e11f54808dd9f0f87b3c85e6303d00d9c > > Author: Aneesh Kumar K.V > > Date: Tue Aug 20 16:14:23 2013 +0530 > >=20 > > target-ppc: Check for error on address translation in memsave comma= nd > > =20 > > When we translate the virtual address to physical check for error. > > =20 > > Signed-off-by: Aneesh Kumar K.V > >=20 > > diff --git a/cpus.c b/cpus.c > > index 0f65e76..51c38a0 100644 > > --- a/cpus.c > > +++ b/cpus.c > > @@ -1309,7 +1309,10 @@ void qmp_memsave(int64_t addr, int64_t size, con= st 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_setg(errp, "Invalid addr 0x%016" PRIx64 "specified\n= ", addr); >=20 > Next trap is no \n please. ;) Otherwise looks good.