From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCHv4 08/15] Add get_fw_dev_path callback for pci bus. Date: Sun, 14 Nov 2010 20:42:37 +0200 Message-ID: <20101114184237.GH6798@redhat.com> References: <1289749181-12070-1-git-send-email-gleb@redhat.com> <1289749181-12070-9-git-send-email-gleb@redhat.com> <20101114182720.GA12570@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, blauwirbel@gmail.com, armbru@redhat.com, alex.williamson@redhat.com, kevin@koconnor.net To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:33232 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756487Ab0KNSml (ORCPT ); Sun, 14 Nov 2010 13:42:41 -0500 Content-Disposition: inline In-Reply-To: <20101114182720.GA12570@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Nov 14, 2010 at 08:27:20PM +0200, Michael S. Tsirkin wrote: > On Sun, Nov 14, 2010 at 05:39:34PM +0200, Gleb Natapov wrote: > > +static char *pcibus_get_fw_dev_path(DeviceState *dev) > > +{ > > + PCIDevice *d = (PCIDevice *)dev; > > + char path[50], name[33]; > > + int off; > > + > > + off = snprintf(path, sizeof(path), "%s@%x", > > + pci_dev_fw_name(dev, name, sizeof name), > > + PCI_SLOT(d->devfn)); > > + if (PCI_FUNC(d->devfn)) > > + snprintf(path + off, sizeof(path) + off, ",%x", PCI_FUNC(d->devfn)); > > Can we *always* specify a slot number in the name? > If yes I think we should, because I think we saw that the short form is > ambiguous: if there's a device at a slot != 0, openfirmware will > to match that against the name. You accidentally something here. > Right? > I do not see what is ambiguous here. Can you explain? -- Gleb.