* [Qemu-devel] [PATCH v1] spapr_pci: fix the path while fetching loc-code from host DT
@ 2017-11-07 13:18 Seeteena Thoufeek
2017-11-08 2:30 ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
2017-11-08 11:29 ` Greg Kurz
0 siblings, 2 replies; 5+ messages in thread
From: Seeteena Thoufeek @ 2017-11-07 13:18 UTC (permalink / raw)
To: david, agraf, qemu-ppc, qemu-devel; +Cc: s1seetee
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);
Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
---
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;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH v1] spapr_pci: fix the path while fetching loc-code from host DT
2017-11-07 13:18 [Qemu-devel] [PATCH v1] spapr_pci: fix the path while fetching loc-code from host DT Seeteena Thoufeek
@ 2017-11-08 2:30 ` Alexey Kardashevskiy
2017-11-08 6:08 ` David Gibson
2017-11-08 14:34 ` seeteena
2017-11-08 11:29 ` Greg Kurz
1 sibling, 2 replies; 5+ messages in thread
From: Alexey Kardashevskiy @ 2017-11-08 2:30 UTC (permalink / raw)
To: Seeteena Thoufeek, david, agraf, qemu-ppc, qemu-devel
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?
aik@garrison2:~$ cat /sys/bus/pci/devices/0009:03:00.0/devspec && echo -e '\n'
/pciex@3fffe40500000/pci@0/pci@0/pci@1/usb-xhci@0
>
> Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
> ---
> 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;
>
--
Alexey
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH v1] spapr_pci: fix the path while fetching loc-code from host DT
2017-11-08 2:30 ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
@ 2017-11-08 6:08 ` David Gibson
2017-11-08 14:34 ` seeteena
1 sibling, 0 replies; 5+ messages in thread
From: David Gibson @ 2017-11-08 6:08 UTC (permalink / raw)
To: Alexey Kardashevskiy; +Cc: Seeteena Thoufeek, agraf, qemu-ppc, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1773 bytes --]
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?
>
> aik@garrison2:~$ cat /sys/bus/pci/devices/0009:03:00.0/devspec && echo -e '\n'
> /pciex@3fffe40500000/pci@0/pci@0/pci@1/usb-xhci@0
Right, what Alexey said. I see no reason to change this.
>
>
>
>
> >
> > Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
> > ---
> > 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH v1] spapr_pci: fix the path while fetching loc-code from host DT
2017-11-07 13:18 [Qemu-devel] [PATCH v1] spapr_pci: fix the path while fetching loc-code from host DT Seeteena Thoufeek
2017-11-08 2:30 ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
@ 2017-11-08 11:29 ` Greg Kurz
1 sibling, 0 replies; 5+ messages in thread
From: Greg Kurz @ 2017-11-08 11:29 UTC (permalink / raw)
To: Seeteena Thoufeek; +Cc: david, agraf, qemu-ppc, qemu-devel
On Tue, 7 Nov 2017 18:48:58 +0530
Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com> wrote:
> The function spapr_phb_vfio_get_loc_code uses wrong path for
> fetching loc-code from host DT
>
Why is it wrong ? Are you experiencing actual issues ?
> 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);
>
This statement is useless, especially with such a trivial patch.
Have a look at the following page:
https://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message
Cheers,
--
Greg
> Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
> ---
> 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;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH v1] spapr_pci: fix the path while fetching loc-code from host DT
2017-11-08 2:30 ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
2017-11-08 6:08 ` David Gibson
@ 2017-11-08 14:34 ` seeteena
1 sibling, 0 replies; 5+ messages in thread
From: seeteena @ 2017-11-08 14:34 UTC (permalink / raw)
To: Alexey Kardashevskiy, david, agraf, qemu-ppc, qemu-devel
Apologize for the confusion. I thought devspec is not having leading '/'.
I checked devspec in my system and it works as expected.
On 11/08/2017 08:00 AM, 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?
>
> aik@garrison2:~$ cat /sys/bus/pci/devices/0009:03:00.0/devspec && echo -e '\n'
> /pciex@3fffe40500000/pci@0/pci@0/pci@1/usb-xhci@0
>
>
>
>
>> Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
>> ---
>> 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;
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-11-08 14:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07 13:18 [Qemu-devel] [PATCH v1] spapr_pci: fix the path while fetching loc-code from host DT Seeteena Thoufeek
2017-11-08 2:30 ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
2017-11-08 6:08 ` David Gibson
2017-11-08 14:34 ` seeteena
2017-11-08 11:29 ` Greg Kurz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.