From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2gCu-0007Qs-9N for qemu-devel@nongnu.org; Thu, 03 Jul 2014 08:33:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2gCp-0004yL-FO for qemu-devel@nongnu.org; Thu, 03 Jul 2014 08:33:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2gCp-0004y7-78 for qemu-devel@nongnu.org; Thu, 03 Jul 2014 08:33:39 -0400 Message-ID: <53B54D98.2060800@redhat.com> Date: Thu, 03 Jul 2014 06:33:28 -0600 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="w476xpMbusFwjdWNBALFStJOSm7WtxD9r" Subject: Re: [Qemu-devel] [PATCH for 2.1 2/2] memory-backend-file: improve error handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao , qemu-devel@nongnu.org Cc: Yasunori Goto , Igor Mammedov , Paolo Bonzini , "Michael S. Tsirkin" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --w476xpMbusFwjdWNBALFStJOSm7WtxD9r Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/03/2014 12:10 AM, Hu Tao wrote: > This patch fixes two problems of memory-backend-file: >=20 > 1. If user adds a memory-backend-file object using object_add command, > specifying a non-existing directory for property mem-path, qemu > will core dump with message: >=20 > /nonexistingdir: No such file or directory > Bad ram offset fffffffffffff000 > Aborted (core dumped) >=20 > 2. If user adds a memory-backend-file object using object_add command, > specifying a size that is less than huge page size, qemu > will core dump with message: >=20 > Bad ram offset fffffffffffff000 > Aborted (core dumped) >=20 Might be nice if the commit message also shows the new message issued for the same cases after the patch is applied. > Signed-off-by: Hu Tao > --- > exec.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) >=20 > =20 > if (memory < hpagesize) { > - return NULL; > + error_setg(errp, "memory size 0x" RAM_ADDR_FMT " should be lar= ger " > + "than huge page size 0x%" PRIx64, memory, hpagesize= ); > + goto error; Isn't exactly equal also allowed? Maybe a better wording is "should be a multiple of the huge page size" --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --w476xpMbusFwjdWNBALFStJOSm7WtxD9r Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTtU2YAAoJEKeha0olJ0NqCeMH/j7VanQL6jsLwypfLw7UQBVd HuEdms4E08XtJzDQ8bAmIv7k5iPPV/Wt4lXJR0g2Xbu0Efu6DBM+RCbXnD9XS7GY KNsVR8XCFYD7+GDcXRcEzNk3lbv+1QeD7gDt+WnwCVnL6u4N1PRFz7bzyC+SBPw9 wpWj4fsqiuvXRHDOKeglf41Ykq/DLfuLw/XDdSIx9IINXfVK2BZjntD79AB9p5tR GqMjSVzVR5rySZVpnKnTUCZskXYCiANQUdR8r7q8GPczSMbvHojcJ4u1w3VGnSGQ KGdNcKSJ327Z95gbAzftulggt7C2QU77np6kv9h01s43QwK0SfAPGm2P7bilw4Y= =UOz9 -----END PGP SIGNATURE----- --w476xpMbusFwjdWNBALFStJOSm7WtxD9r--