From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGqOu-0006e0-NF for qemu-devel@nongnu.org; Wed, 06 Jan 2016 10:53:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGqOt-0008Mk-L9 for qemu-devel@nongnu.org; Wed, 06 Jan 2016 10:53:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGqOt-0008Mb-Db for qemu-devel@nongnu.org; Wed, 06 Jan 2016 10:53:27 -0500 References: <1452047951-17429-1-git-send-email-caoj.fnst@cn.fujitsu.com> <1452047951-17429-3-git-send-email-caoj.fnst@cn.fujitsu.com> From: Eric Blake Message-ID: <568D3874.1060806@redhat.com> Date: Wed, 6 Jan 2016 08:53:24 -0700 MIME-Version: 1.0 In-Reply-To: <1452047951-17429-3-git-send-email-caoj.fnst@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RoUHjuh8OCwHPbOG06GblSNWjCCmJUcAu" Subject: Re: [Qemu-devel] [PATCH v3 2/4] Add Error **errp for xen_pt_setup_vga() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cao jin , qemu-devel@nongnu.org Cc: stefano.stabellini@eu.citrix.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RoUHjuh8OCwHPbOG06GblSNWjCCmJUcAu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/05/2016 07:39 PM, Cao jin wrote: > To catch the error msg. Also modify the caller >=20 > Signed-off-by: Cao jin > Reviewed-by: Stefano Stabellini > --- > hw/xen/xen_pt.c | 5 ++++- > hw/xen/xen_pt.h | 3 ++- > hw/xen/xen_pt_graphics.c | 11 ++++++----- > 3 files changed, 12 insertions(+), 7 deletions(-) >=20 > diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c > index 1bd4109..fbce55c 100644 > --- a/hw/xen/xen_pt.c > +++ b/hw/xen/xen_pt.c > @@ -807,7 +807,10 @@ static int xen_pt_initfn(PCIDevice *d) > return -1; > } > =20 > - if (xen_pt_setup_vga(s, &s->real_device) < 0) { > + xen_pt_setup_vga(s, &s->real_device, &local_err); > + if (local_err) { > + error_append_hint(&local_err, "Setup VGA BIOS of passthrou= gh" > + " GFX failed!"); Please no '!' in error messages. We aren't shouting at the user. > XEN_PT_ERR(d, "Setup VGA BIOS of passthrough GFX failed!\n= "); Do we still need the XEN_PT_ERR() alongside setting the local error? > xen_host_pci_device_put(&s->real_device); > return -1; This leaks local_err. > @@ -172,13 +173,14 @@ int xen_pt_setup_vga(XenPCIPassthroughState *s, X= enHostPCIDevice *dev) > struct pci_data *pd =3D NULL; > =20 > if (!is_igd_vga_passthrough(dev)) { > - return -1; > + error_setg(errp, "Need to enable igd-passthrough"); > + return; > } > =20 > bios =3D get_vgabios(s, &bios_size, dev); > if (!bios) { > - XEN_PT_ERR(&s->dev, "VGA: Can't getting VBIOS!\n"); > - return -1; > + error_setg(errp, "VGA: Can't getting VBIOS!"); > + return; Please drop the trailing '!' while touching this --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --RoUHjuh8OCwHPbOG06GblSNWjCCmJUcAu 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/ iQEcBAEBCAAGBQJWjTh0AAoJEKeha0olJ0Nq5kcH/0qHGmoMrLN5WwJC6HCBmy1f NY4PEP1FW/VXW6Dj8bJv1zK+Yxgd6QiI+/jVy+pJEFRvPrE2KYcYZ2R8mkcNRsZm J3JVBCgN5lD666bTkNyb9rqpAbjVWIBsTnMt4PXkS2px6+yvjREBfDKt6QIY/LUk gR5GUAlxoR+WBm7Dv2HGsVzNvJ1wEWgCUolIbusrE3gbss1mbffLuHJ/zrAjY8+S bjpIxZivjjQyRF3aukjKV+kDf2OR2kIsEsgCZwIFO8/bit62UQQ6ahM4lfLLM6Fd EGn+s4AsRfFzxjTWxxPTZWtN15/o+IskDgfoE0b2q+jqQeLCiKKq8pMEC4JHbpM= =vSJ8 -----END PGP SIGNATURE----- --RoUHjuh8OCwHPbOG06GblSNWjCCmJUcAu--