From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3Re9-0005EB-LY for qemu-devel@nongnu.org; Mon, 30 Nov 2015 11:49:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3Re8-0000e5-M9 for qemu-devel@nongnu.org; Mon, 30 Nov 2015 11:49:49 -0500 References: <5656892E.9020908@redhat.com> <2BF45FF0-31E6-4901-B4B5-90FF3D672C70@gmail.com> <565C7723.5090400@redhat.com> <20151130162639.GI4494@noname.str.redhat.com> From: Eric Blake Message-ID: <565C7E1F.7080503@redhat.com> Date: Mon, 30 Nov 2015 09:49:35 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CTPXnFWDoP9n7ec2mXEt8qSea2Xf06DlL" Subject: Re: [Qemu-devel] [PATCH v9] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Programmingkid , Kevin Wolf Cc: qemu-devel qemu-devel , Qemu-block This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CTPXnFWDoP9n7ec2mXEt8qSea2Xf06DlL Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/30/2015 09:38 AM, Programmingkid wrote: >>>>>> + /* if a working partition on the device was not found */ >>>>>> + if (partition_found =3D=3D false) { >>>>>> + error_setg(errp, "Error: Failed to find a working partiti= on on " >>>>>> + = "disc!\n"); >>>>> >>>>> and I already pointed out on v8 that this is not the correct usage = of >>>>> error_setg(). So, here's hoping v10 addresses the comments here an= d >>>>> elsewhere. >>>> >>>> Kevin Wolf wanted it this way. What would you do instead? >>> >>> Keven and I both want you to use error_setg(), but to use it correctl= y - >>> and the correct way is to NOT supply a trailing \n. >> >> Nor leading "Error:", for that matter. >=20 > I just think that using "Error" does communicate the fact that somethin= g is wrong > a lot better than just printing the message.=20 But error_setg() _already_ provides the context that an error message is being printed. The whole point of using wrapper functions is that the common functionality (like an 'error:' prefix, or '\n' suffix) is done in the wrapper, not at every call site. If you were using raw printf(), then yes, using your own 'Error:' prefix would be appropriate. But we aren't using raw printf(). Your use of an 'Error:' prefix is therefore redundant, and we are trying to convince you that you are using error_setg() incorrectly. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --CTPXnFWDoP9n7ec2mXEt8qSea2Xf06DlL 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/ iQEcBAEBCAAGBQJWXH4fAAoJEKeha0olJ0NqOzYIAKSUtreLifTaUI2Ezwo25HAx fielwbQqTf18yNSmA68MWkPGn2QcAz0EeOcOo3OvXUS0ehI7eyCQpY6+VYh65MMN Q4MycikQ+hVLI3MNmO8kXv8NnQRVCeSyPnOAKGDF2G3hEgYyDJn8zL/8qc47rhXA c8rfg1p7AiccHWw9sJwChEkSqdkxgSwHZUKxmt0+RmOpVZJKSml82SO1fafK7ZtM wCIg5n8/TdOmZVlzGBxYpSf3LOSFH/qVMF1jvtryUyYUq1nOJmbrUZxRrNmUqobE WKIA7DbNldNkCtYg2TBqCFEPXGoEpesgA0h+FSpYL2aHxS8rSNpOTcI702H0uSE= =kU5C -----END PGP SIGNATURE----- --CTPXnFWDoP9n7ec2mXEt8qSea2Xf06DlL--