Patchwork [24/35] hw: move VFIO and ivshmem to hw/pci/

login
register
mail settings
Submitter Paolo Bonzini
Date April 2, 2013, 2:58 p.m.
Message ID <1364914749-11141-25-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/233053/
State New
Headers show

Comments

Paolo Bonzini - April 2, 2013, 2:58 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/Makefile.objs              | 10 ----------
 hw/pci/Makefile.objs          |  5 +++++
 hw/{ => pci}/ivshmem.c        |  0
 hw/{vfio_pci.c => pci/vfio.c} |  0
 4 files changed, 5 insertions(+), 10 deletions(-)
 rename hw/{ => pci}/ivshmem.c (100%)
 rename hw/{vfio_pci.c => pci/vfio.c} (100%)

diff --git a/hw/ivshmem.c b/hw/pci/ivshmem.c
similarity index 100%
rename from hw/ivshmem.c
rename to hw/pci/ivshmem.c
diff --git a/hw/vfio_pci.c b/hw/pci/vfio.c
similarity index 100%
rename from hw/vfio_pci.c
rename to hw/pci/vfio.c
Michael S. Tsirkin - April 3, 2013, 10:43 a.m.
On Tue, Apr 02, 2013 at 04:58:58PM +0200, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/Makefile.objs              | 10 ----------
>  hw/pci/Makefile.objs          |  5 +++++
>  hw/{ => pci}/ivshmem.c        |  0
>  hw/{vfio_pci.c => pci/vfio.c} |  0
>  4 files changed, 5 insertions(+), 10 deletions(-)
>  rename hw/{ => pci}/ivshmem.c (100%)
>  rename hw/{vfio_pci.c => pci/vfio.c} (100%)


Please don't. pci is just an interconnect.
hw/pci is pci core and let's keep it clear of devices please.
Let's sort devices by their function, not
by an interconnect they happen to have.

> diff --git a/hw/Makefile.objs b/hw/Makefile.objs
> index b2be078..dc30f74 100644
> --- a/hw/Makefile.objs
> +++ b/hw/Makefile.objs
> @@ -28,13 +28,3 @@ devices-dirs-$(CONFIG_SOFTMMU) += xen/
>  common-obj-y += core/
>  common-obj-y += $(devices-dirs-y)
>  obj-y += $(devices-dirs-y)
> -
> -ifeq ($(CONFIG_SOFTMMU),y)
> -
> -# Inter-VM PCI shared memory & VFIO PCI device assignment
> -ifeq ($(CONFIG_PCI), y)
> -obj-$(CONFIG_KVM) += ivshmem.o
> -obj-$(CONFIG_LINUX) += vfio_pci.o
> -endif
> -
> -endif
> diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
> index 8b20135..9086b3b 100644
> --- a/hw/pci/Makefile.objs
> +++ b/hw/pci/Makefile.objs
> @@ -26,6 +26,11 @@ common-obj-$(CONFIG_PPCE500_PCI) += host-ppce500.o
>  # ARM devices
>  common-obj-$(CONFIG_VERSATILE_PCI) += host-versatile.o
>  
> +ifeq ($(CONFIG_PCI), y)
> +obj-$(CONFIG_KVM) += ivshmem.o
> +obj-$(CONFIG_LINUX) += vfio.o
> +endif
> +
>  obj-$(CONFIG_PCI_APB) += host-apb.o
>  obj-$(CONFIG_FULONG) += host-bonito.o
>  obj-$(CONFIG_PCI_PIIX) += host-piix.o
> diff --git a/hw/ivshmem.c b/hw/pci/ivshmem.c
> similarity index 100%
> rename from hw/ivshmem.c
> rename to hw/pci/ivshmem.c
> diff --git a/hw/vfio_pci.c b/hw/pci/vfio.c
> similarity index 100%
> rename from hw/vfio_pci.c
> rename to hw/pci/vfio.c
> -- 
> 1.8.1.4
> 
>
Paolo Bonzini - April 3, 2013, 11:53 a.m.
Il 03/04/2013 12:43, Michael S. Tsirkin ha scritto:
> On Tue, Apr 02, 2013 at 04:58:58PM +0200, Paolo Bonzini wrote:
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>  hw/Makefile.objs              | 10 ----------
>>  hw/pci/Makefile.objs          |  5 +++++
>>  hw/{ => pci}/ivshmem.c        |  0
>>  hw/{vfio_pci.c => pci/vfio.c} |  0
>>  4 files changed, 5 insertions(+), 10 deletions(-)
>>  rename hw/{ => pci}/ivshmem.c (100%)
>>  rename hw/{vfio_pci.c => pci/vfio.c} (100%)
> 
> 
> Please don't. pci is just an interconnect.
> hw/pci is pci core and let's keep it clear of devices please.
> Let's sort devices by their function, not
> by an interconnect they happen to have.

Again, these are the exceptions, not the rule.  Here the interconnect is
really an integral part of the device, so I couldn't think of any other
place than hw/pci.

Paolo

>> diff --git a/hw/Makefile.objs b/hw/Makefile.objs
>> index b2be078..dc30f74 100644
>> --- a/hw/Makefile.objs
>> +++ b/hw/Makefile.objs
>> @@ -28,13 +28,3 @@ devices-dirs-$(CONFIG_SOFTMMU) += xen/
>>  common-obj-y += core/
>>  common-obj-y += $(devices-dirs-y)
>>  obj-y += $(devices-dirs-y)
>> -
>> -ifeq ($(CONFIG_SOFTMMU),y)
>> -
>> -# Inter-VM PCI shared memory & VFIO PCI device assignment
>> -ifeq ($(CONFIG_PCI), y)
>> -obj-$(CONFIG_KVM) += ivshmem.o
>> -obj-$(CONFIG_LINUX) += vfio_pci.o
>> -endif
>> -
>> -endif
>> diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
>> index 8b20135..9086b3b 100644
>> --- a/hw/pci/Makefile.objs
>> +++ b/hw/pci/Makefile.objs
>> @@ -26,6 +26,11 @@ common-obj-$(CONFIG_PPCE500_PCI) += host-ppce500.o
>>  # ARM devices
>>  common-obj-$(CONFIG_VERSATILE_PCI) += host-versatile.o
>>  
>> +ifeq ($(CONFIG_PCI), y)
>> +obj-$(CONFIG_KVM) += ivshmem.o
>> +obj-$(CONFIG_LINUX) += vfio.o
>> +endif
>> +
>>  obj-$(CONFIG_PCI_APB) += host-apb.o
>>  obj-$(CONFIG_FULONG) += host-bonito.o
>>  obj-$(CONFIG_PCI_PIIX) += host-piix.o
>> diff --git a/hw/ivshmem.c b/hw/pci/ivshmem.c
>> similarity index 100%
>> rename from hw/ivshmem.c
>> rename to hw/pci/ivshmem.c
>> diff --git a/hw/vfio_pci.c b/hw/pci/vfio.c
>> similarity index 100%
>> rename from hw/vfio_pci.c
>> rename to hw/pci/vfio.c
>> -- 
>> 1.8.1.4
>>
>>
Michael S. Tsirkin - April 3, 2013, 2:09 p.m.
On Wed, Apr 03, 2013 at 01:53:55PM +0200, Paolo Bonzini wrote:
> Il 03/04/2013 12:43, Michael S. Tsirkin ha scritto:
> > On Tue, Apr 02, 2013 at 04:58:58PM +0200, Paolo Bonzini wrote:
> >> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> >> ---
> >>  hw/Makefile.objs              | 10 ----------
> >>  hw/pci/Makefile.objs          |  5 +++++
> >>  hw/{ => pci}/ivshmem.c        |  0
> >>  hw/{vfio_pci.c => pci/vfio.c} |  0
> >>  4 files changed, 5 insertions(+), 10 deletions(-)
> >>  rename hw/{ => pci}/ivshmem.c (100%)
> >>  rename hw/{vfio_pci.c => pci/vfio.c} (100%)
> > 
> > 
> > Please don't. pci is just an interconnect.
> > hw/pci is pci core and let's keep it clear of devices please.
> > Let's sort devices by their function, not
> > by an interconnect they happen to have.
> 
> Again, these are the exceptions, not the rule.  Here the interconnect is
> really an integral part of the device, so I couldn't think of any other
> place than hw/pci.
> 
> Paolo

ivshmem is a memory device really.

> >> diff --git a/hw/Makefile.objs b/hw/Makefile.objs
> >> index b2be078..dc30f74 100644
> >> --- a/hw/Makefile.objs
> >> +++ b/hw/Makefile.objs
> >> @@ -28,13 +28,3 @@ devices-dirs-$(CONFIG_SOFTMMU) += xen/
> >>  common-obj-y += core/
> >>  common-obj-y += $(devices-dirs-y)
> >>  obj-y += $(devices-dirs-y)
> >> -
> >> -ifeq ($(CONFIG_SOFTMMU),y)
> >> -
> >> -# Inter-VM PCI shared memory & VFIO PCI device assignment
> >> -ifeq ($(CONFIG_PCI), y)
> >> -obj-$(CONFIG_KVM) += ivshmem.o
> >> -obj-$(CONFIG_LINUX) += vfio_pci.o
> >> -endif
> >> -
> >> -endif
> >> diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
> >> index 8b20135..9086b3b 100644
> >> --- a/hw/pci/Makefile.objs
> >> +++ b/hw/pci/Makefile.objs
> >> @@ -26,6 +26,11 @@ common-obj-$(CONFIG_PPCE500_PCI) += host-ppce500.o
> >>  # ARM devices
> >>  common-obj-$(CONFIG_VERSATILE_PCI) += host-versatile.o
> >>  
> >> +ifeq ($(CONFIG_PCI), y)
> >> +obj-$(CONFIG_KVM) += ivshmem.o
> >> +obj-$(CONFIG_LINUX) += vfio.o
> >> +endif
> >> +
> >>  obj-$(CONFIG_PCI_APB) += host-apb.o
> >>  obj-$(CONFIG_FULONG) += host-bonito.o
> >>  obj-$(CONFIG_PCI_PIIX) += host-piix.o
> >> diff --git a/hw/ivshmem.c b/hw/pci/ivshmem.c
> >> similarity index 100%
> >> rename from hw/ivshmem.c
> >> rename to hw/pci/ivshmem.c
> >> diff --git a/hw/vfio_pci.c b/hw/pci/vfio.c
> >> similarity index 100%
> >> rename from hw/vfio_pci.c
> >> rename to hw/pci/vfio.c
> >> -- 
> >> 1.8.1.4
> >>
> >>

Patch

diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index b2be078..dc30f74 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -28,13 +28,3 @@  devices-dirs-$(CONFIG_SOFTMMU) += xen/
 common-obj-y += core/
 common-obj-y += $(devices-dirs-y)
 obj-y += $(devices-dirs-y)
-
-ifeq ($(CONFIG_SOFTMMU),y)
-
-# Inter-VM PCI shared memory & VFIO PCI device assignment
-ifeq ($(CONFIG_PCI), y)
-obj-$(CONFIG_KVM) += ivshmem.o
-obj-$(CONFIG_LINUX) += vfio_pci.o
-endif
-
-endif
diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
index 8b20135..9086b3b 100644
--- a/hw/pci/Makefile.objs
+++ b/hw/pci/Makefile.objs
@@ -26,6 +26,11 @@  common-obj-$(CONFIG_PPCE500_PCI) += host-ppce500.o
 # ARM devices
 common-obj-$(CONFIG_VERSATILE_PCI) += host-versatile.o
 
+ifeq ($(CONFIG_PCI), y)
+obj-$(CONFIG_KVM) += ivshmem.o
+obj-$(CONFIG_LINUX) += vfio.o
+endif
+
 obj-$(CONFIG_PCI_APB) += host-apb.o
 obj-$(CONFIG_FULONG) += host-bonito.o
 obj-$(CONFIG_PCI_PIIX) += host-piix.o