[libvirt] [PATCH 1/1] cpu: Fix one compile error for PPC.

From: Li Zhang <zhlcindy@linux.vnet.ibm.com> CPU data structure is refined, which causes one compile error for PPC. Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/cpu/cpu_powerpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c index 62437d3..55a4153 100644 --- a/src/cpu/cpu_powerpc.c +++ b/src/cpu/cpu_powerpc.c @@ -354,15 +354,15 @@ ppcDataFree(virCPUDataPtr data) static virCPUDataPtr ppcNodeData(void) { - virCPUDataPtr data; + virCPUDataPtr cpuData; - if (VIR_ALLOC(data) < 0) + if (VIR_ALLOC(cpuData) < 0) return NULL; asm("mfpvr %0" - : "=r" (data->ppc.pvr)); + : "=r" (cpuData->data.ppc.pvr)); - return data; + return cpuData; } #endif -- 1.8.1.4

On Mon, Jul 29, 2013 at 03:41:19PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
CPU data structure is refined, which causes one compile error for PPC.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/cpu/cpu_powerpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c index 62437d3..55a4153 100644 --- a/src/cpu/cpu_powerpc.c +++ b/src/cpu/cpu_powerpc.c @@ -354,15 +354,15 @@ ppcDataFree(virCPUDataPtr data) static virCPUDataPtr ppcNodeData(void) { - virCPUDataPtr data; + virCPUDataPtr cpuData;
- if (VIR_ALLOC(data) < 0) + if (VIR_ALLOC(cpuData) < 0) return NULL;
asm("mfpvr %0" - : "=r" (data->ppc.pvr)); + : "=r" (cpuData->data.ppc.pvr));
- return data; + return cpuData; } #endif
Okay, applied and pushed, thanks ! Daniel -- Daniel Veillard | Open Source and Standards, Red Hat veillard@redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | virtualization library http://libvirt.org/

On 2013Е╧╢07Ф°┬29Ф≈╔ 16:29, Daniel Veillard wrote:
On Mon, Jul 29, 2013 at 03:41:19PM +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
CPU data structure is refined, which causes one compile error for PPC.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/cpu/cpu_powerpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c index 62437d3..55a4153 100644 --- a/src/cpu/cpu_powerpc.c +++ b/src/cpu/cpu_powerpc.c @@ -354,15 +354,15 @@ ppcDataFree(virCPUDataPtr data) static virCPUDataPtr ppcNodeData(void) { - virCPUDataPtr data; + virCPUDataPtr cpuData;
- if (VIR_ALLOC(data) < 0) + if (VIR_ALLOC(cpuData) < 0) return NULL;
asm("mfpvr %0" - : "=r" (data->ppc.pvr)); + : "=r" (cpuData->data.ppc.pvr));
- return data; + return cpuData; } #endif Okay, applied and pushed,
Got it, thanks. :)
thanks !
Daniel

On Mon, Jul 29, 2013 at 15:41:19 +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
CPU data structure is refined, which causes one compile error for PPC.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/cpu/cpu_powerpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c index 62437d3..55a4153 100644 --- a/src/cpu/cpu_powerpc.c +++ b/src/cpu/cpu_powerpc.c @@ -354,15 +354,15 @@ ppcDataFree(virCPUDataPtr data) static virCPUDataPtr ppcNodeData(void) { - virCPUDataPtr data; + virCPUDataPtr cpuData;
- if (VIR_ALLOC(data) < 0) + if (VIR_ALLOC(cpuData) < 0) return NULL;
asm("mfpvr %0" - : "=r" (data->ppc.pvr)); + : "=r" (cpuData->data.ppc.pvr));
- return data; + return cpuData; } #endif
I'm fine with this change but what compile error does this fix? The only error I could think of is shadowing a global "data" symbol but I doubt that's the case as the same structure is called "data" in several other functions in cpu_powerpc.c Jirka

On Mon, Jul 29, 2013 at 13:23:23 +0200, Jiri Denemark wrote:
On Mon, Jul 29, 2013 at 15:41:19 +0800, Li Zhang wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
CPU data structure is refined, which causes one compile error for PPC.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/cpu/cpu_powerpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c index 62437d3..55a4153 100644 --- a/src/cpu/cpu_powerpc.c +++ b/src/cpu/cpu_powerpc.c @@ -354,15 +354,15 @@ ppcDataFree(virCPUDataPtr data) static virCPUDataPtr ppcNodeData(void) { - virCPUDataPtr data; + virCPUDataPtr cpuData;
- if (VIR_ALLOC(data) < 0) + if (VIR_ALLOC(cpuData) < 0) return NULL;
asm("mfpvr %0" - : "=r" (data->ppc.pvr)); + : "=r" (cpuData->data.ppc.pvr));
- return data; + return cpuData; } #endif
I'm fine with this change but what compile error does this fix? The only error I could think of is shadowing a global "data" symbol but I doubt that's the case as the same structure is called "data" in several other functions in cpu_powerpc.c
Oh, I see it now. The bug was that data->ppc.pvr should have been data->data.ppc.pvr. This makes more sense now... I blame the hot weather. Jirka

On 2013年07月29日 21:04, Jiri Denemark wrote:
On Mon, Jul 29, 2013 at 13:23:23 +0200, Jiri Denemark wrote:
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
CPU data structure is refined, which causes one compile error for PPC.
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> --- src/cpu/cpu_powerpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c index 62437d3..55a4153 100644 --- a/src/cpu/cpu_powerpc.c +++ b/src/cpu/cpu_powerpc.c @@ -354,15 +354,15 @@ ppcDataFree(virCPUDataPtr data) static virCPUDataPtr ppcNodeData(void) { - virCPUDataPtr data; + virCPUDataPtr cpuData;
- if (VIR_ALLOC(data) < 0) + if (VIR_ALLOC(cpuData) < 0) return NULL;
asm("mfpvr %0" - : "=r" (data->ppc.pvr)); + : "=r" (cpuData->data.ppc.pvr));
- return data; + return cpuData; } #endif I'm fine with this change but what compile error does this fix? The only error I could think of is shadowing a global "data" symbol but I doubt
On Mon, Jul 29, 2013 at 15:41:19 +0800, Li Zhang wrote: that's the case as the same structure is called "data" in several other functions in cpu_powerpc.c Oh, I see it now. The bug was that data->ppc.pvr should have been data->data.ppc.pvr. This makes more sense now... I blame the hot weather.
Yes, that's it. I saw a union is added to virCPUData.
Jirka
participants (3)
-
Daniel Veillard
-
Jiri Denemark
-
Li Zhang