From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHZuS-0005tp-TW for qemu-devel@nongnu.org; Tue, 21 Jul 2015 11:56:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHZuJ-0007bw-M8 for qemu-devel@nongnu.org; Tue, 21 Jul 2015 11:56:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHZuJ-0007bL-HU for qemu-devel@nongnu.org; Tue, 21 Jul 2015 11:56:39 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 9482E3CEF5A for ; Tue, 21 Jul 2015 15:56:38 +0000 (UTC) References: <1435001200-20610-1-git-send-email-armbru@redhat.com> <1435001200-20610-5-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55AE6BB1.3010402@redhat.com> Date: Tue, 21 Jul 2015 09:56:33 -0600 MIME-Version: 1.0 In-Reply-To: <1435001200-20610-5-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="27SxblRLXf7HS4e9JQ1MXCv0QuG6e6mKw" Subject: Re: [Qemu-devel] [PATCH 4/7] qga/vss-win32: Document the DLL requires non-null errp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, dgilbert@redhat.com, mst@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --27SxblRLXf7HS4e9JQ1MXCv0QuG6e6mKw Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/22/2015 01:26 PM, Markus Armbruster wrote: > requester.cpp uses this pattern to receive an error and pass it on to > the caller (err_is_set() macro peeled off for clarity): >=20 > ... code that may set errset->errp ... > if (errset->errp && *errset->errp) { > ... handle error ... > } >=20 > This breaks when errset->errp is null. As far as I can tell, it > currently isn't, so this is merely fragile, not actually broken. >=20 > The robust way to do this is to receive the error in a local variable, > then propagate it up, like this: >=20 > Error *err =3D NULL; >=20 > ... code that may set err ... > if (err) > ... handle error ... > error_propagate(errset->errp, err); > } >=20 > See also commit 5e54769, 0f230bf, a903f40. >=20 > Signed-off-by: Markus Armbruster > --- > qga/vss-win32.c | 1 + > qga/vss-win32/requester.cpp | 3 ++- > qga/vss-win32/requester.h | 2 +- > 3 files changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --27SxblRLXf7HS4e9JQ1MXCv0QuG6e6mKw 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/ iQEcBAEBCAAGBQJVrmuxAAoJEKeha0olJ0NqBzQH/0IvnA9fi0X/WR0TV/puRgoP HXIzwuTyvy8Av0o+j2dQkCf4m3sL6PljfS6mMO663R0MSKq+XIzECGFYHCVCyXaM JST8OH2BXxwdfA8YESSnq6yF53CLe6h7tzdE08MfKKRsOYGD6TKAxl/x3zSu/nHP +Tgx7cyMVDjTghQ4RrnvMVNp2J+BxOcSw95J3Pm1dtCHvObJaktA90XROlQCnYhu oFG33vjRIBMU6fnL4qwmRWUxrq6j/OBXdNO4gWkAkFuv8XK0vjAT/5dZMLDoCS2l QLJH5m966uSfEvCPmRWys/tNe6cHTHg4zu5LCSXu+fnlyLicPVGl0jzboECVmSw= =qTRf -----END PGP SIGNATURE----- --27SxblRLXf7HS4e9JQ1MXCv0QuG6e6mKw--