From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byfAU-0002I7-8y for qemu-devel@nongnu.org; Mon, 24 Oct 2016 09:19:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byfAP-0005eW-86 for qemu-devel@nongnu.org; Mon, 24 Oct 2016 09:19:58 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33606 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1byfAP-0005eO-1t for qemu-devel@nongnu.org; Mon, 24 Oct 2016 09:19:53 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9ODIwfE061559 for ; Mon, 24 Oct 2016 09:19:52 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0b-001b2d01.pphosted.com with ESMTP id 269esx4yyk-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 24 Oct 2016 09:19:51 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 24 Oct 2016 14:19:50 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 6516B17D805D for ; Mon, 24 Oct 2016 14:22:02 +0100 (BST) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9ODJmou21954766 for ; Mon, 24 Oct 2016 13:19:48 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u9ODJmfs005266 for ; Mon, 24 Oct 2016 07:19:48 -0600 References: <1477301639-386-1-git-send-email-pbonzini@redhat.com> <20161024103400.GA4014@work-vm> <37942764-b3c8-1ac1-5121-894ada7300f2@redhat.com> From: Halil Pasic Date: Mon, 24 Oct 2016 15:19:19 +0200 MIME-Version: 1.0 In-Reply-To: <37942764-b3c8-1ac1-5121-894ada7300f2@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ifcu6LICNN0CuARk0IHsnUAs3qfMcKujN" Message-Id: <8d349810-cd7c-7fae-13e6-ab6beb8dc058@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH] qemu-error: remove dependency of stubs on monitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , "Dr. David Alan Gilbert" Cc: qemu-devel@nongnu.org, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ifcu6LICNN0CuARk0IHsnUAs3qfMcKujN From: Halil Pasic To: Paolo Bonzini , "Dr. David Alan Gilbert" Cc: qemu-devel@nongnu.org, armbru@redhat.com Message-ID: <8d349810-cd7c-7fae-13e6-ab6beb8dc058@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH] qemu-error: remove dependency of stubs on monitor References: <1477301639-386-1-git-send-email-pbonzini@redhat.com> <20161024103400.GA4014@work-vm> <37942764-b3c8-1ac1-5121-894ada7300f2@redhat.com> In-Reply-To: <37942764-b3c8-1ac1-5121-894ada7300f2@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 10/24/2016 01:52 PM, Paolo Bonzini wrote: >=20 > On 24/10/2016 12:34, Dr. David Alan Gilbert wrote: >> > * Paolo Bonzini (pbonzini@redhat.com) wrote: >>> >> Leave the implementation of error_printf, error_printf_unless_qmp >>> >> and error_vprintf to libqemustub.a and monitor.c, so that we can >>> >> remove the monitor_printf and monitor_vprintf stubs. >>> >> >>> >> Signed-off-by: Paolo Bonzini >>> >> --- >>> >> This should help shutting up the vmstate unit tests. >> >=20 >> > Why does this make it any easier than my patch? >> > You're still going to need to add something stub specific to turn >> > the output on and off. > It makes it possible to override the functions independent of the rest > of util/qemu-error.c. You can implement the functions in the test, simp= ly as >=20 > had_stderr_output =3D true; >=20 > and then assert that had_stderr_output is false or true depending on th= e > test. >=20 > (It's also a useful starting point to fix the cur_mon race). >=20 > Consider this an RFC. error_printf probably should stay in qemu-error.= c > since it can always call error_vprintf. >=20 > Paolo >=20 Agree with Paolo that the ability to provide a custom (test specific) implementation is generally beneficial testing and IMHO superior compared to the solution previously proposed by Dave. Unfortunately I do not see how is this accomplished by the patch. I still consider using Error objects in the code under test and not reporting errors directly the cleanest approach. Halil --ifcu6LICNN0CuARk0IHsnUAs3qfMcKujN 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.0.14 (GNU/Linux) iQIcBAEBAgAGBQJYDgpzAAoJEA0vhuyXGx0Ato4P+wbvAHAW4eJ1Txh96D7xrSRv kxf5Ct6FM+XS6Qj5OixH0K2KPSgGtcPUreisoLfZQ9U8N2TRPVc4cJUyiuxDvBXp Br9p8Hxl2eZaNOX5P/L/Qm292ohn2/gUGHybZDPvvX9e5v6CrK6KlD4WqgNeEIbo I8I//lmeIVQS3l7uThrCxzrL//O8KDCT4XmR3NMyfsLS6rh4zWy4xG4n2m34i1pv JFUTxQYRQyZZOjoNkoAAlpCFnR5n1tWHfbMNiMdaEsSEpgv23piZPI/yfCD8cDm7 R67hlX2cOZVi72h7QpGB4IfQCm+i/qH8M69ONFpGnRIQw7G2rEVZ1xEiXHM3bUNQ alOEFBlgRB6aQgEaI76wb3S63Fv62gOg3jAmdQkxpVTllgTcO7OgvLWBz+E4ZZRZ iyk7+zw1gTvpFHFAnuHNpbvyMqeW3RYKu9rzUljSjNTtBSib3kWfSW2d38csEr1L ggEvP0Y3dMFJJlsnkBjDjg4hEPeMwMl/KZ0tD0LAHRrExIGRz9DyLDA19zCtuLui LimwD72KJDZc7LHZAJJxdsupQt80/mVThp7raDPehHjpFQXRlfOfVr0A0ujLHLKG sxhBmXTphsu/devEJ+2BcHR2wooNpOX6bsyKOFTKi1TttSCwQi/HgBqhABK0N5ve 2FXGQRcoFFgD40OuAV8l =dxzT -----END PGP SIGNATURE----- --ifcu6LICNN0CuARk0IHsnUAs3qfMcKujN--