From patchwork Mon Sep 17 08:47:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peter A. G. Crosthwaite" X-Patchwork-Id: 184326 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C21F72C0086 for ; Mon, 17 Sep 2012 18:59:39 +1000 (EST) Received: from localhost ([::1]:53709 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDX0r-0007cS-2V for incoming@patchwork.ozlabs.org; Mon, 17 Sep 2012 04:49:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDX0H-00060v-P4 for qemu-devel@nongnu.org; Mon, 17 Sep 2012 04:48:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDX0C-00045m-0y for qemu-devel@nongnu.org; Mon, 17 Sep 2012 04:48:29 -0400 Received: from mail-iy0-f173.google.com ([209.85.210.173]:64764) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDX0B-0003sv-SE for qemu-devel@nongnu.org; Mon, 17 Sep 2012 04:48:23 -0400 Received: by mail-iy0-f173.google.com with SMTP id x26so4924724iak.4 for ; Mon, 17 Sep 2012 01:48:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=16yIYC0e6iVD1E0NNNWJbUW8lkKAOB0DgXe8A2lhmXo=; b=UVGj4F07CVFO3u6KSzB+01fOaT/3DVmhAlCVxbp1+EeHOROYYxI81Y0I+vPHKoQceS 7gxKouNi81Ck63nZUw1sUdxA2r9cQiDzunIeZ5rDnInMOWB+AKCFyyza4DvZlQfksFIV N7cvEwl82BhwGCYGyWcj4zCsV5xC/QeKKXjswmLMBdJFP3yos7l0TStTEcZt5DDbpboe Rfh6NhyWSYuueQ6eQ6z7sPrgiQ8WfO9CbjcEhcyxqFGpsnvQf53x9Wog/qfYiVxwvXlL r8fs8zjfezH39/l1S2UE0SzVPiuaarixgm6SqVnQDc/7j01msa3Dyp116WskzqEKi6wf Q9Yw== Received: by 10.50.185.132 with SMTP id fc4mr5993402igc.55.1347871703580; Mon, 17 Sep 2012 01:48:23 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id 10sm16494718igf.11.2012.09.17.01.48.21 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 01:48:23 -0700 (PDT) From: "Peter A. G. Crosthwaite" To: qemu-devel@nongnu.org, edgar.iglesias@gmail.com Date: Mon, 17 Sep 2012 18:47:34 +1000 Message-Id: <21007ed239d53e2578ee739f3bee12301b00173f.1347871393.git.peter.crosthwaite@petalogix.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQk9BHwbxLdf8CTWKrbsEB+15yyRdcD9SbWdG3cgN6LISFyKXZuFFnsghr1pUZb+JyOuVKwo X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.173 Cc: peter.crosthwaite@petalogix.com, crwulff@gmail.com Subject: [Qemu-devel] [PATCH v1 4/6] xilinx.h: Error check when setting links X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Assert that the ethernet and dma controller are sucessfully linked to their peers. Signed-off-by: Peter A. G. Crosthwaite --- hw/xilinx.h | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/xilinx.h b/hw/xilinx.h index 45a6bdc..4d29265 100644 --- a/hw/xilinx.h +++ b/hw/xilinx.h @@ -55,13 +55,16 @@ xilinx_axiethernet_create(NICInfo *nd, StreamSlave *peer, int txmem, int rxmem) { DeviceState *dev; + Error *errp = NULL; + qemu_check_nic_model(nd, "xlnx.axi-ethernet"); dev = qdev_create(NULL, "xlnx.axi-ethernet"); qdev_set_nic_properties(dev, nd); qdev_prop_set_uint32(dev, "rxmem", rxmem); qdev_prop_set_uint32(dev, "txmem", txmem); - object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", NULL); + object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp); + assert_no_error(errp); qdev_init_nofail(dev); sysbus_mmio_map(sysbus_from_qdev(dev), 0, base); sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq); @@ -74,8 +77,11 @@ xilinx_axiethernetdma_init(DeviceState *dev, StreamSlave *peer, target_phys_addr_t base, qemu_irq irq, qemu_irq irq2, int freqhz) { + Error *errp = NULL; + qdev_prop_set_uint32(dev, "freqhz", freqhz); - object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", NULL); + object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp); + assert_no_error(errp); qdev_init_nofail(dev); sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);