[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v1] spapr_pci: fix the path while fetching loc-cod
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [PATCH v1] spapr_pci: fix the path while fetching loc-code from host DT |
Date: |
Wed, 8 Nov 2017 17:08:45 +1100 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Wed, Nov 08, 2017 at 01:30:04PM +1100, Alexey Kardashevskiy wrote:
> On 08/11/17 00:18, Seeteena Thoufeek wrote:
> > The function spapr_phb_vfio_get_loc_code uses wrong path for
> > fetching loc-code from host DT
> >
> > this is the call that needs to be fixed:
> > /* Construct and read from host device tree the loc-code */
> > path = g_strdup_printf("/proc/device-tree%s/ibm,loc-code", buf);
>
>
> I do not see why would extra '/' hurt but where does it really fail?
>
> My machines have leading '/' in devspec, do not yours?
>
> address@hidden:~$ cat /sys/bus/pci/devices/0009:03:00.0/devspec && echo -e
> '\n'
> /address@hidden/address@hidden/address@hidden/address@hidden/address@hidden
Right, what Alexey said. I see no reason to change this.
>
>
>
>
> >
> > Signed-off-by: Seeteena Thoufeek <address@hidden>
> > ---
> > hw/ppc/spapr_pci.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> > index 5a3122a..ae86322 100644
> > --- a/hw/ppc/spapr_pci.c
> > +++ b/hw/ppc/spapr_pci.c
> > @@ -762,7 +762,7 @@ static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState
> > *sphb, PCIDevice *pdev)
> > g_free(path);
> >
> > /* Construct and read from host device tree the loc-code */
> > - path = g_strdup_printf("/proc/device-tree%s/ibm,loc-code", buf);
> > + path = g_strdup_printf("/proc/device-tree/%s/ibm,loc-code", buf);
> > g_free(buf);
> > if (!g_file_get_contents(path, &buf, NULL, NULL)) {
> > goto err_out;
> >
>
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature