Received: from eggs.gnu.org ([2001:4830:134:3::10]:47781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aA2Q3-0001I5-9b for qemu-devel@nongnu.org; Fri, 18 Dec 2015 16:18:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aA2Q0-0007OX-3p for qemu-devel@nongnu.org; Fri, 18 Dec 2015 16:18:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aA2Pz-0007OT-Uz for qemu-devel@nongnu.org; Fri, 18 Dec 2015 16:18:28 -0500 From: Markus Armbruster References: <1450436632-23980-1-git-send-email-caoj.fnst@cn.fujitsu.com> <1450436632-23980-3-git-send-email-caoj.fnst@cn.fujitsu.com> <20151218183700.GZ3774@thinpad.lan.raisama.net> Date: Fri, 18 Dec 2015 22:18:25 +0100 In-Reply-To: <20151218183700.GZ3774@thinpad.lan.raisama.net> (Eduardo Habkost's message of "Fri, 18 Dec 2015 16:37:00 -0200") Message-ID: <87poy3wj4u.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 2/5] igd-passthrough-i440FX: convert to realize() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: mst@redhat.com, qemu-devel@nongnu.org, Cao jin , pbonzini@redhat.com, leon.alrae@imgtec.com, aurelien@aurel32.net, rth@twiddle.net One short remark in addition to Eduardo's review. Eduardo Habkost writes: > On Fri, Dec 18, 2015 at 07:03:49PM +0800, Cao jin wrote: >> Signed-off-by: Cao jin >> --- >> hw/pci-host/piix.c | 16 +++++++++------- >> 1 file changed, 9 insertions(+), 7 deletions(-) >> >> diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c >> index 715208b..e3840f0 100644 >> --- a/hw/pci-host/piix.c >> +++ b/hw/pci-host/piix.c >> @@ -761,7 +761,7 @@ static const IGDHostInfo igd_host_bridge_infos[] = { >> {0xa8, 4}, /* SNB: base of GTT stolen memory */ >> }; >> >> -static int host_pci_config_read(int pos, int len, uint32_t val) >> +static int host_pci_config_read(int pos, int len, uint32_t val, Error **errp) > > You don't need the return value anymore, if you report errors > through the errp parameter. The function can be void, now. > >> { >> char path[PATH_MAX]; >> int config_fd; >> @@ -772,15 +772,18 @@ static int host_pci_config_read(int pos, int len, uint32_t val) >> int ret = 0; >> >> if (rc >= size || rc < 0) { >> + error_setg(errp, "No such device"); >> return -ENODEV; >> } >> >> config_fd = open(path, O_RDWR); >> if (config_fd < 0) { >> + error_setg(errp, "No such device"); >> return -ENODEV; >> } Can we come up with nicer error messages? [...]