From owner-freebsd-current@FreeBSD.ORG Tue Jan 14 16:14:47 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 295A5A0D; Tue, 14 Jan 2014 16:14:47 +0000 (UTC) Received: from SMTP.CITRIX.COM (smtp.citrix.com [66.165.176.89]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 622831597; Tue, 14 Jan 2014 16:14:44 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.95,658,1384300800"; d="scan'208";a="92734889" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 14 Jan 2014 16:14:22 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.2.342.4; Tue, 14 Jan 2014 11:14:21 -0500 Received: from chilopoda.uk.xensource.com ([10.80.2.139]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1W36dB-0007ja-Qb; Tue, 14 Jan 2014 16:14:21 +0000 Message-ID: <52D5625D.7030702@citrix.com> Date: Tue, 14 Jan 2014 16:14:21 +0000 From: Julien Grall User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20131104 Icedove/17.0.10 MIME-Version: 1.0 To: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= Subject: Re: [PATCH v10 14/20] xen: introduce xenpv bus and a dummy pvcpu device References: <1389711582-66908-1-git-send-email-roger.pau@citrix.com> <1389711582-66908-15-git-send-email-roger.pau@citrix.com> <52D55AB4.4010504@linaro.org> <52D560EB.8040108@citrix.com> In-Reply-To: <52D560EB.8040108@citrix.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-DLP: MIA1 X-Mailman-Approved-At: Tue, 14 Jan 2014 16:25:31 +0000 Cc: Julien Grall , xen-devel@lists.xen.org, freebsd-xen@freebsd.org, freebsd-current@freebsd.org, kib@freebsd.org, gibbs@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jan 2014 16:14:47 -0000 On 01/14/2014 04:08 PM, Roger Pau Monné wrote: > On 14/01/14 16:41, Julien Grall wrote: >> On 01/14/2014 02:59 PM, Roger Pau Monne wrote: >>> +static int >>> +xenpv_attach(device_t dev) >>> +{ >>> + device_t child; >>> + >>> + if (xen_hvm_domain()) { >>> + device_t xenpci; >>> + devclass_t dc; >>> + >>> + /* Make sure xenpci has been attached */ >>> + dc = devclass_find("xenpci"); >>> + if (dc == NULL) >>> + panic("unable to find xenpci devclass"); >>> + >>> + xenpci = devclass_get_device(dc, 0); >>> + if (xenpci == NULL) >>> + panic("unable to find xenpci device"); >>> + >>> + if (!device_is_attached(xenpci)) >>> + panic("trying to attach xenpv before xenpci"); >>> + } >> >> Can you use the identify method to add the xenpci device? > > I don't think so, xenpci is a pci device, it is detected and plugged by > the pci bus code. Oups, I though you are trying to add the device. In this case, the check seems pointless. In which case the xenpci couldn't exist? -- Julien Grall