From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6yWy-0005Dn-0N for qemu-devel@nongnu.org; Thu, 10 Dec 2015 05:33:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6yWt-0008CE-1Q for qemu-devel@nongnu.org; Thu, 10 Dec 2015 05:32:59 -0500 Received: from mail-pf0-x231.google.com ([2607:f8b0:400e:c00::231]:35408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6yWs-0008Bi-Qs for qemu-devel@nongnu.org; Thu, 10 Dec 2015 05:32:54 -0500 Received: by pfu207 with SMTP id 207so46152145pfu.2 for ; Thu, 10 Dec 2015 02:32:54 -0800 (PST) Date: Thu, 10 Dec 2015 11:32:50 +0100 From: "Edgar E. Iglesias" Message-ID: <20151210103250.GA17020@toto> References: <1449743372-17169-1-git-send-email-armbru@redhat.com> <1449743372-17169-5-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1449743372-17169-5-git-send-email-armbru@redhat.com> Subject: Re: [Qemu-devel] [PATCH 04/12] etraxfs_eth: Don't use hw_error() in init() method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org On Thu, Dec 10, 2015 at 11:29:24AM +0100, Markus Armbruster wrote: > Device init() methods aren't supposed to call hw_error(), they should > report the error and fail cleanly. Do that. > > Cc: "Edgar E. Iglesias" > Signed-off-by: Markus Armbruster Reviewed-by: Edgar E. Iglesias > --- > hw/net/etraxfs_eth.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c > index d600275..b562ac9 100644 > --- a/hw/net/etraxfs_eth.c > +++ b/hw/net/etraxfs_eth.c > @@ -26,6 +26,7 @@ > #include "hw/sysbus.h" > #include "net/net.h" > #include "hw/cris/etraxfs.h" > +#include "qemu/error-report.h" > > #define D(x) > > @@ -589,7 +590,8 @@ static int fs_eth_init(SysBusDevice *sbd) > ETRAXFSEthState *s = ETRAX_FS_ETH(dev); > > if (!s->dma_out || !s->dma_in) { > - hw_error("Unconnected ETRAX-FS Ethernet MAC.\n"); > + error_report("Unconnected ETRAX-FS Ethernet MAC"); > + return -1; > } > > s->dma_out->client.push = eth_tx_push; > -- > 2.4.3 >