diff mbox

[v3,3/9] spapr_pci: Introduce a finish_realize() callback

Message ID 5385FCAA.7040709@suse.de
State New
Headers show

Commit Message

Alexander Graf May 28, 2014, 3:11 p.m. UTC
On 27.05.14 07:36, Alexey Kardashevskiy wrote:
> The spapr-pci PHB initializes IOMMU for emulated devices only.
> The upcoming VFIO support will do it different. However both emulated
> and VFIO PHB types share most of the initialization code.
> For the type specific things a new finish_realize() callback is
> introduced.
>
> This introduces sPAPRPHBClass derived from PCIHostBridgeClass and
> adds the callback pointer.
>
> This implements finish_realize() for emulated devices.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

This patch breaks compilation on some of my test hosts:

05/28 12:41:34 ERROR|     utils:0144| [stderr] In file included from /usr/local/autotest/tmp/virt/src/qemu/hw/ppc/spapr.c:45:
05/28 12:41:34 ERROR|     utils:0144| [stderr] /usr/local/autotest/tmp/virt/src/qemu/include/hw/pci-host/spapr.h:77: error: redefinition of typedef ‘sPAPRPHBState’
05/28 12:41:34 ERROR|     utils:0144| [stderr] /usr/local/autotest/tmp/virt/src/qemu/include/hw/pci-host/spapr.h:43: error: previous declaration of ‘sPAPRPHBState’ was here
05/28 12:41:34 ERROR|     utils:0144| [stderr] make[1]: *** [hw/ppc/spapr.o] Error 1
05/28 12:41:34 ERROR|     utils:0144| [stderr] make: *** [subdir-ppc64-softmmu] Error 2


I've squashed the following patch into this one to make it compile:


Alex

Comments

Alexey Kardashevskiy May 29, 2014, 1:53 a.m. UTC | #1
On 05/29/2014 01:11 AM, Alexander Graf wrote:
> 
> On 27.05.14 07:36, Alexey Kardashevskiy wrote:
>> The spapr-pci PHB initializes IOMMU for emulated devices only.
>> The upcoming VFIO support will do it different. However both emulated
>> and VFIO PHB types share most of the initialization code.
>> For the type specific things a new finish_realize() callback is
>> introduced.
>>
>> This introduces sPAPRPHBClass derived from PCIHostBridgeClass and
>> adds the callback pointer.
>>
>> This implements finish_realize() for emulated devices.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> 
> This patch breaks compilation on some of my test hosts:

Rats... Sorry about that. What is that host? I need to setup one for
myself. I test my stuff to compile on x86_64 (for TCG-ppc, TCG-ppc64 and
cross for ppc64) and do not hit this.


> 
> 05/28 12:41:34 ERROR|     utils:0144| [stderr] In file included from
> /usr/local/autotest/tmp/virt/src/qemu/hw/ppc/spapr.c:45:
> 05/28 12:41:34 ERROR|     utils:0144| [stderr]
> /usr/local/autotest/tmp/virt/src/qemu/include/hw/pci-host/spapr.h:77:
> error: redefinition of typedef ‘sPAPRPHBState’
> 05/28 12:41:34 ERROR|     utils:0144| [stderr]
> /usr/local/autotest/tmp/virt/src/qemu/include/hw/pci-host/spapr.h:43:
> error: previous declaration of ‘sPAPRPHBState’ was here
> 05/28 12:41:34 ERROR|     utils:0144| [stderr] make[1]: ***
> [hw/ppc/spapr.o] Error 1
> 05/28 12:41:34 ERROR|     utils:0144| [stderr] make: ***
> [subdir-ppc64-softmmu] Error 2
> 
> 
> I've squashed the following patch into this one to make it compile:
> 
> diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
> index ab29281..0f428a1 100644
> --- a/include/hw/pci-host/spapr.h
> +++ b/include/hw/pci-host/spapr.h
> @@ -48,7 +48,7 @@ struct sPAPRPHBClass {
> void (*finish_realize)(sPAPRPHBState *sphb, Error **errp);
> };
> 
> -typedef struct sPAPRPHBState {
> +struct sPAPRPHBState {
> PCIHostState parent_obj;
> 
> int32_t index;
> @@ -76,7 +76,7 @@ typedef struct sPAPRPHBState {
> } msi_table[SPAPR_MSIX_MAX_DEVS];
> 
> QLIST_ENTRY(sPAPRPHBState) list;
> -} sPAPRPHBState;
> +};
> 
> #define SPAPR_PCI_BASE_BUID 0x800000020000000ULL
> 
> 
> Alex
>
Alexander Graf May 29, 2014, 9:37 p.m. UTC | #2
On 29.05.14 03:53, Alexey Kardashevskiy wrote:
> On 05/29/2014 01:11 AM, Alexander Graf wrote:
>> On 27.05.14 07:36, Alexey Kardashevskiy wrote:
>>> The spapr-pci PHB initializes IOMMU for emulated devices only.
>>> The upcoming VFIO support will do it different. However both emulated
>>> and VFIO PHB types share most of the initialization code.
>>> For the type specific things a new finish_realize() callback is
>>> introduced.
>>>
>>> This introduces sPAPRPHBClass derived from PCIHostBridgeClass and
>>> adds the callback pointer.
>>>
>>> This implements finish_realize() for emulated devices.
>>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> This patch breaks compilation on some of my test hosts:
> Rats... Sorry about that. What is that host? I need to setup one for
> myself. I test my stuff to compile on x86_64 (for TCG-ppc, TCG-ppc64 and
> cross for ppc64) and do not hit this.

The hosts that spotted this build breakage in particular were

   1) a ppc64 installation of SLES11 SP3
   2) a ppc64 installation of SLES11 SP1
   3) a ppc32 installation of openSUSE 11.1

which at the end of the day are all using the same ancient 4.3 compiler.


Alex
diff mbox

Patch

diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index ab29281..0f428a1 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -48,7 +48,7 @@  struct sPAPRPHBClass {
void (*finish_realize)(sPAPRPHBState *sphb, Error **errp);
};

-typedef struct sPAPRPHBState {
+struct sPAPRPHBState {
PCIHostState parent_obj;

int32_t index;
@@ -76,7 +76,7 @@  typedef struct sPAPRPHBState {
} msi_table[SPAPR_MSIX_MAX_DEVS];

QLIST_ENTRY(sPAPRPHBState) list;
-} sPAPRPHBState;
+};

#define SPAPR_PCI_BASE_BUID 0x800000020000000ULL