From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9gT1-0001mu-Sm for qemu-devel@nongnu.org; Thu, 17 Dec 2015 16:52:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9gSx-0001DK-Se for qemu-devel@nongnu.org; Thu, 17 Dec 2015 16:52:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9gSx-0001DD-N3 for qemu-devel@nongnu.org; Thu, 17 Dec 2015 16:52:03 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id EB0CE38AB6C for ; Thu, 17 Dec 2015 21:52:02 +0000 (UTC) References: <1450371004-26866-1-git-send-email-armbru@redhat.com> <1450371004-26866-21-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <56732E81.7050806@redhat.com> Date: Thu, 17 Dec 2015 14:52:01 -0700 MIME-Version: 1.0 In-Reply-To: <1450371004-26866-21-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dvuNQlmKeQ7MjhEUTfPruvOQNBvSHXw2i" Subject: Re: [Qemu-devel] [PATCH v2 20/23] vhdx: Fix "log that needs to be replayed" error message List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dvuNQlmKeQ7MjhEUTfPruvOQNBvSHXw2i Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/17/2015 09:50 AM, Markus Armbruster wrote: > The arguments of error_setg_errno() should yield a short error string > without newlines. >=20 > Here, we try to append additional help to the error message by > embedding newlines in the error string. That's nice, but it's doesn't > play nicely with the errno part. tests/qemu-iotests/070.out shows the > resulting mess: >=20 > can't open device TEST_DIR/iotest-dirtylog-10G-4M.vhdx: VHDX image = file 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx' opened read-only, but contain= s a log that needs to be replayed. To replay the log, execute: > qemu-img check -r all 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx': Oper= ation not permitted >=20 > Switch to error_setg() and error_append_hint(). Result: >=20 > can't open device TEST_DIR/iotest-dirtylog-10G-4M.vhdx: VHDX image = file 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx' opened read-only, but contain= s a log that needs to be replayed > To replay the log, run: > qemu-img check -r all 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx' The loss of the strerror() text isn't too bad; particularly since it is probably always going to be 'Operation not permitted' and redundant with the text about being read-only with a replay that requires write access. >=20 > Signed-off-by: Markus Armbruster > --- > block/vhdx-log.c | 13 +++++++------ > tests/qemu-iotests/070.out | 5 +++-- > 2 files changed, 10 insertions(+), 8 deletions(-) >=20 Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --dvuNQlmKeQ7MjhEUTfPruvOQNBvSHXw2i Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWcy6BAAoJEKeha0olJ0Nqp3EH/RAw5rBADloHrcG+v7Lvjgxg k0PvhiYWawKmdwyyGyiUfpAVRqI5Bt/hj6F1A4pZbaBE9LtOengnCp5AZFp7kKDA 2bqnKjcJr0L3tzptm3MwkOR7uJsEhjLmYUrTP4TL+SW3nT2eCajQvk5L667gd1wa M7rYtGKuilKGkpOu5RelvH7OgkCyO37rn7UAjI01Zv7MZCcOaIPQJXFVIcYa8hmY O1LI02Uab3z7pedrHOwsnGwnws+EOdHp8WVddpAa5tU6x5z0HKAUsqKjKPCMzB7G Z11pGntGBBspZNz5nNgfyv/LAVpyNyk5MgFQ9sLua5ll3MIwwH8gwo4LxAPC7Us= =T1n1 -----END PGP SIGNATURE----- --dvuNQlmKeQ7MjhEUTfPruvOQNBvSHXw2i--