From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGqct-0005nU-Go for qemu-devel@nongnu.org; Wed, 06 Jan 2016 11:07:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGqcq-0003yR-BF for qemu-devel@nongnu.org; Wed, 06 Jan 2016 11:07:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGqcq-0003yG-35 for qemu-devel@nongnu.org; Wed, 06 Jan 2016 11:07:52 -0500 References: <1452047951-17429-1-git-send-email-caoj.fnst@cn.fujitsu.com> <1452047951-17429-5-git-send-email-caoj.fnst@cn.fujitsu.com> From: Eric Blake Message-ID: <568D3BD6.1050707@redhat.com> Date: Wed, 6 Jan 2016 09:07:50 -0700 MIME-Version: 1.0 In-Reply-To: <1452047951-17429-5-git-send-email-caoj.fnst@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="k9Wvw0OoXkMCpJxgjC22woq8TlJew3DUX" Subject: Re: [Qemu-devel] [PATCH v3 4/4] Xen PCI passthru: convert to realize() 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) --k9Wvw0OoXkMCpJxgjC22woq8TlJew3DUX Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/05/2016 07:39 PM, Cao jin wrote: > Signed-off-by: Cao jin > Reviewed-by: Stefano Stabellini > --- > hw/xen/xen_pt.c | 53 ++++++++++++++++++++++++++++---------------------= ---- > 1 file changed, 28 insertions(+), 25 deletions(-) >=20 > @@ -801,19 +801,19 @@ static int xen_pt_initfn(PCIDevice *d) > if ((s->real_device.domain =3D=3D 0) && (s->real_device.bus =3D=3D= 0) && > (s->real_device.dev =3D=3D 2) && (s->real_device.func =3D=3D 0= )) { > if (!is_igd_vga_passthrough(&s->real_device)) { > - XEN_PT_ERR(d, "Need to enable igd-passthru if you're tryin= g" > - " to passthrough IGD GFX.\n"); > + error_setg(errp, "Need to enable igd-passthru if you're tr= ying" > + " to passthrough IGD GFX."); No trailing '.' in error_setg() messages. > @@ -827,27 +827,26 @@ static int xen_pt_initfn(PCIDevice *d) > xen_pt_config_init(s, &local_err); > if (local_err) { > error_append_hint(&local_err, "PCI Config space initialisation= failed"); > - rc =3D -1; > + error_propagate(errp, local_err); > goto err_out; > } Looks like this fixes a memory leak in an earlier patch; maybe you need to shuffle hunks around? > =20 > /* Bind interrupt */ > rc =3D xen_host_pci_get_byte(&s->real_device, PCI_INTERRUPT_PIN, &= scratch); > if (rc) { > - XEN_PT_ERR(d, "Failed to read PCI_INTERRUPT_PIN! (rc:%d)\n", r= c); > + error_setg_errno(errp, errno, "Failed to read PCI_INTERRUPT_PI= N!"); No trailing '!' > @@ -891,14 +890,14 @@ out: > =20 > rc =3D xen_host_pci_get_word(&s->real_device, PCI_COMMAND, &va= l); > if (rc) { > - XEN_PT_ERR(d, "Failed to read PCI_COMMAND! (rc: %d)\n", rc= ); > + error_setg_errno(errp, errno, "Failed to read PCI_COMMAND!= "); and again > @@ -911,12 +910,16 @@ out: > "Real physical device %02x:%02x.%d registered successfu= lly!\n", > s->hostaddr.bus, s->hostaddr.slot, s->hostaddr.function= ); > =20 > - return 0; > + return; > =20 > err_out: > + for (i =3D 0; i < PCI_ROM_SLOT; i++) { > + object_unparent(OBJECT(&s->bar[i])); > + } > + object_unparent(OBJECT(&s->rom)); > + > xen_pt_destroy(d); > assert(rc); > - return rc; Is the assertion still needed? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --k9Wvw0OoXkMCpJxgjC22woq8TlJew3DUX 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/ iQEcBAEBCAAGBQJWjTvWAAoJEKeha0olJ0Nq1xQH/iiF92MaQIS998QXVp48gAzo B2atjq/60PY5922Wexk/kOczp7r8Wt8PNqJKcNd8lHIvFo5ha+m6d0HI/NoecoSL xRxJscn+FdFnHqcrRSJXj837aDHF9Jkiptweqb9jr8keAgEl0hc1PzCmAZb7AJv4 siz7G3Qmr5humhouOsJHuhD5IcDqd1/bgPqLRN6k32gi8ANCuLUDVw+VtbFPYSHh T4WMUgtAQbhXYY4R8ZVvU0pQQNMUVSk1cpk5+aKow/tPk+V8BqGCk477OYbkVG6v zwYqbSX2d6qz8wJf4Spf4LFrgRLYlzzC1u6I+cj2IfEB1+QyS4sTITLAQrXbcNI= =UefV -----END PGP SIGNATURE----- --k9Wvw0OoXkMCpJxgjC22woq8TlJew3DUX--