diff mbox

[1/1] 9pfs: fix and simplify dependencies

Message ID 20170808121701.18353-2-cohuck@redhat.com
State New
Headers show

Commit Message

Cornelia Huck Aug. 8, 2017, 12:17 p.m. UTC
We want to compile the 9pfs code iff virtfs is enabled and a virtio
transport is available (not only pci!).

Let's make the generated CONFIG_VIRTFS statement depend on either
CONFIG_VIRTIO_PCI or (new) CONFIG_VIRTIO_CCW. The Makefiles for fsdev/
and hw/9pfs/ can then depend on CONFIG_VIRTFS directly.

Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 configure                         | 2 +-
 default-configs/s390x-softmmu.mak | 1 +
 fsdev/Makefile.objs               | 2 +-
 hw/Makefile.objs                  | 2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

Comments

Greg Kurz Aug. 8, 2017, 12:50 p.m. UTC | #1
On Tue,  8 Aug 2017 14:17:01 +0200
Cornelia Huck <cohuck@redhat.com> wrote:

> We want to compile the 9pfs code iff virtfs is enabled and a virtio
> transport is available (not only pci!).
> 
> Let's make the generated CONFIG_VIRTFS statement depend on either
> CONFIG_VIRTIO_PCI or (new) CONFIG_VIRTIO_CCW. The Makefiles for fsdev/
> and hw/9pfs/ can then depend on CONFIG_VIRTFS directly.
> 
> Suggested-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---

It looks good to me.

Acked-by: Greg Kurz <groug@kaod.org>

>  configure                         | 2 +-
>  default-configs/s390x-softmmu.mak | 1 +
>  fsdev/Makefile.objs               | 2 +-
>  hw/Makefile.objs                  | 2 +-
>  4 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/configure b/configure
> index dd73cce62f..709884dff1 100755
> --- a/configure
> +++ b/configure
> @@ -5771,7 +5771,7 @@ if test "$libattr" = "yes" ; then
>    echo "CONFIG_LIBATTR=y" >> $config_host_mak
>  fi
>  if test "$virtfs" = "yes" ; then
> -  echo "CONFIG_VIRTFS=y" >> $config_host_mak
> +  echo 'CONFIG_VIRTFS=$(call lor, $(CONFIG_VIRTIO_PCI),$(CONFIG_VIRTIO_CCW))' >> $config_host_mak
>  fi
>  if test "$vhost_scsi" = "yes" ; then
>    echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
> diff --git a/default-configs/s390x-softmmu.mak b/default-configs/s390x-softmmu.mak
> index 51191b77df..e4c5236ceb 100644
> --- a/default-configs/s390x-softmmu.mak
> +++ b/default-configs/s390x-softmmu.mak
> @@ -8,3 +8,4 @@ CONFIG_S390_FLIC=y
>  CONFIG_S390_FLIC_KVM=$(CONFIG_KVM)
>  CONFIG_VFIO_CCW=$(CONFIG_LINUX)
>  CONFIG_WDT_DIAG288=y
> +CONFIG_VIRTIO_CCW=y
> diff --git a/fsdev/Makefile.objs b/fsdev/Makefile.objs
> index 659df6e187..604cc8b6c4 100644
> --- a/fsdev/Makefile.objs
> +++ b/fsdev/Makefile.objs
> @@ -1,4 +1,4 @@
> -ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
> +ifeq ($(CONFIG_VIRTFS),y)
>  # Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
>  # only pull in the actual virtio-9p device if we also enabled virtio.
>  common-obj-y = qemu-fsdev.o 9p-marshal.o 9p-iov-marshal.o
> diff --git a/hw/Makefile.objs b/hw/Makefile.objs
> index a2c61f6b09..147d1dc9fb 100644
> --- a/hw/Makefile.objs
> +++ b/hw/Makefile.objs
> @@ -1,4 +1,4 @@
> -devices-dirs-$(call land, $(CONFIG_VIRTIO),$(call land,$(CONFIG_VIRTFS),$(CONFIG_PCI))) += 9pfs/
> +devices-dirs-$(CONFIG_VIRTFS) += 9pfs/
>  devices-dirs-$(CONFIG_SOFTMMU) += acpi/
>  devices-dirs-$(CONFIG_SOFTMMU) += adc/
>  devices-dirs-$(CONFIG_SOFTMMU) += audio/
Cornelia Huck Aug. 8, 2017, 1 p.m. UTC | #2
On Tue, 8 Aug 2017 14:50:00 +0200
Greg Kurz <groug@kaod.org> wrote:

> On Tue,  8 Aug 2017 14:17:01 +0200
> Cornelia Huck <cohuck@redhat.com> wrote:
> 
> > We want to compile the 9pfs code iff virtfs is enabled and a virtio
> > transport is available (not only pci!).
> > 
> > Let's make the generated CONFIG_VIRTFS statement depend on either
> > CONFIG_VIRTIO_PCI or (new) CONFIG_VIRTIO_CCW. The Makefiles for fsdev/
> > and hw/9pfs/ can then depend on CONFIG_VIRTFS directly.
> > 
> > Suggested-by: Thomas Huth <thuth@redhat.com>
> > Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> > ---  
> 
> It looks good to me.
> 
> Acked-by: Greg Kurz <groug@kaod.org>
> 
> >  configure                         | 2 +-
> >  default-configs/s390x-softmmu.mak | 1 +
> >  fsdev/Makefile.objs               | 2 +-
> >  hw/Makefile.objs                  | 2 +-
> >  4 files changed, 4 insertions(+), 3 deletions(-)

Thanks!

Will you queue this yourself, or should I send it together with the
zpci cleanup patches?
Greg Kurz Aug. 8, 2017, 2:15 p.m. UTC | #3
On Tue, 8 Aug 2017 14:50:00 +0200
Greg Kurz <groug@kaod.org> wrote:

> On Tue,  8 Aug 2017 14:17:01 +0200
> Cornelia Huck <cohuck@redhat.com> wrote:
> 
> > We want to compile the 9pfs code iff virtfs is enabled and a virtio
> > transport is available (not only pci!).
> > 
> > Let's make the generated CONFIG_VIRTFS statement depend on either
> > CONFIG_VIRTIO_PCI or (new) CONFIG_VIRTIO_CCW. The Makefiles for fsdev/
> > and hw/9pfs/ can then depend on CONFIG_VIRTFS directly.
> > 
> > Suggested-by: Thomas Huth <thuth@redhat.com>
> > Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> > ---  
> 
> It looks good to me.
> 

Oops, reading Thomas's other mail, I now realize that with this patch we
end up with the following in config-host.mak:

CONFIG_VIRTFS=$(call lor, $(CONFIG_VIRTIO_PCI),$(CONFIG_VIRTIO_CCW))

which looks wrong even if it may "work"... but we also get the
following in config-host.h:

#define CONFIG_VIRTFS $(call lor, $(CONFIG_VIRTIO_PCI),$(CONFIG_VIRTIO_CCW))

which is clearly wrong.

Maybe post the changes from your other mail instead ?

Message-ID: <20170808111542.16422571@gondolin>

The patch isn't that ugly, given the ugliness of the current makefiles :)

And we can come up with some cleanup patch later.

> Acked-by: Greg Kurz <groug@kaod.org>
> 

NAcked-by: in fact :)

> >  configure                         | 2 +-
> >  default-configs/s390x-softmmu.mak | 1 +
> >  fsdev/Makefile.objs               | 2 +-
> >  hw/Makefile.objs                  | 2 +-
> >  4 files changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/configure b/configure
> > index dd73cce62f..709884dff1 100755
> > --- a/configure
> > +++ b/configure
> > @@ -5771,7 +5771,7 @@ if test "$libattr" = "yes" ; then
> >    echo "CONFIG_LIBATTR=y" >> $config_host_mak
> >  fi
> >  if test "$virtfs" = "yes" ; then
> > -  echo "CONFIG_VIRTFS=y" >> $config_host_mak
> > +  echo 'CONFIG_VIRTFS=$(call lor, $(CONFIG_VIRTIO_PCI),$(CONFIG_VIRTIO_CCW))' >> $config_host_mak
> >  fi
> >  if test "$vhost_scsi" = "yes" ; then
> >    echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
> > diff --git a/default-configs/s390x-softmmu.mak b/default-configs/s390x-softmmu.mak
> > index 51191b77df..e4c5236ceb 100644
> > --- a/default-configs/s390x-softmmu.mak
> > +++ b/default-configs/s390x-softmmu.mak
> > @@ -8,3 +8,4 @@ CONFIG_S390_FLIC=y
> >  CONFIG_S390_FLIC_KVM=$(CONFIG_KVM)
> >  CONFIG_VFIO_CCW=$(CONFIG_LINUX)
> >  CONFIG_WDT_DIAG288=y
> > +CONFIG_VIRTIO_CCW=y
> > diff --git a/fsdev/Makefile.objs b/fsdev/Makefile.objs
> > index 659df6e187..604cc8b6c4 100644
> > --- a/fsdev/Makefile.objs
> > +++ b/fsdev/Makefile.objs
> > @@ -1,4 +1,4 @@
> > -ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
> > +ifeq ($(CONFIG_VIRTFS),y)
> >  # Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
> >  # only pull in the actual virtio-9p device if we also enabled virtio.
> >  common-obj-y = qemu-fsdev.o 9p-marshal.o 9p-iov-marshal.o
> > diff --git a/hw/Makefile.objs b/hw/Makefile.objs
> > index a2c61f6b09..147d1dc9fb 100644
> > --- a/hw/Makefile.objs
> > +++ b/hw/Makefile.objs
> > @@ -1,4 +1,4 @@
> > -devices-dirs-$(call land, $(CONFIG_VIRTIO),$(call land,$(CONFIG_VIRTFS),$(CONFIG_PCI))) += 9pfs/
> > +devices-dirs-$(CONFIG_VIRTFS) += 9pfs/
> >  devices-dirs-$(CONFIG_SOFTMMU) += acpi/
> >  devices-dirs-$(CONFIG_SOFTMMU) += adc/
> >  devices-dirs-$(CONFIG_SOFTMMU) += audio/  
>
Cornelia Huck Aug. 8, 2017, 3:21 p.m. UTC | #4
On Tue, 8 Aug 2017 16:15:59 +0200
Greg Kurz <groug@kaod.org> wrote:

> On Tue, 8 Aug 2017 14:50:00 +0200
> Greg Kurz <groug@kaod.org> wrote:
> 
> > On Tue,  8 Aug 2017 14:17:01 +0200
> > Cornelia Huck <cohuck@redhat.com> wrote:
> >   
> > > We want to compile the 9pfs code iff virtfs is enabled and a virtio
> > > transport is available (not only pci!).
> > > 
> > > Let's make the generated CONFIG_VIRTFS statement depend on either
> > > CONFIG_VIRTIO_PCI or (new) CONFIG_VIRTIO_CCW. The Makefiles for fsdev/
> > > and hw/9pfs/ can then depend on CONFIG_VIRTFS directly.
> > > 
> > > Suggested-by: Thomas Huth <thuth@redhat.com>
> > > Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> > > ---    
> > 
> > It looks good to me.
> >   
> 
> Oops, reading Thomas's other mail, I now realize that with this patch we
> end up with the following in config-host.mak:
> 
> CONFIG_VIRTFS=$(call lor, $(CONFIG_VIRTIO_PCI),$(CONFIG_VIRTIO_CCW))
> 
> which looks wrong even if it may "work"... but we also get the
> following in config-host.h:
> 
> #define CONFIG_VIRTFS $(call lor, $(CONFIG_VIRTIO_PCI),$(CONFIG_VIRTIO_CCW))
> 
> which is clearly wrong.

Eek. Oh well, it would have been nice...

> 
> Maybe post the changes from your other mail instead ?
> 
> Message-ID: <20170808111542.16422571@gondolin>
> 
> The patch isn't that ugly, given the ugliness of the current makefiles :)

It is slightly differently ugly :)

> 
> And we can come up with some cleanup patch later.

Nod.

> 
> > Acked-by: Greg Kurz <groug@kaod.org>
> >   
> 
> NAcked-by: in fact :)

Heh :)

I'll post the other patch properly.
diff mbox

Patch

diff --git a/configure b/configure
index dd73cce62f..709884dff1 100755
--- a/configure
+++ b/configure
@@ -5771,7 +5771,7 @@  if test "$libattr" = "yes" ; then
   echo "CONFIG_LIBATTR=y" >> $config_host_mak
 fi
 if test "$virtfs" = "yes" ; then
-  echo "CONFIG_VIRTFS=y" >> $config_host_mak
+  echo 'CONFIG_VIRTFS=$(call lor, $(CONFIG_VIRTIO_PCI),$(CONFIG_VIRTIO_CCW))' >> $config_host_mak
 fi
 if test "$vhost_scsi" = "yes" ; then
   echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
diff --git a/default-configs/s390x-softmmu.mak b/default-configs/s390x-softmmu.mak
index 51191b77df..e4c5236ceb 100644
--- a/default-configs/s390x-softmmu.mak
+++ b/default-configs/s390x-softmmu.mak
@@ -8,3 +8,4 @@  CONFIG_S390_FLIC=y
 CONFIG_S390_FLIC_KVM=$(CONFIG_KVM)
 CONFIG_VFIO_CCW=$(CONFIG_LINUX)
 CONFIG_WDT_DIAG288=y
+CONFIG_VIRTIO_CCW=y
diff --git a/fsdev/Makefile.objs b/fsdev/Makefile.objs
index 659df6e187..604cc8b6c4 100644
--- a/fsdev/Makefile.objs
+++ b/fsdev/Makefile.objs
@@ -1,4 +1,4 @@ 
-ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
+ifeq ($(CONFIG_VIRTFS),y)
 # Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
 # only pull in the actual virtio-9p device if we also enabled virtio.
 common-obj-y = qemu-fsdev.o 9p-marshal.o 9p-iov-marshal.o
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index a2c61f6b09..147d1dc9fb 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -1,4 +1,4 @@ 
-devices-dirs-$(call land, $(CONFIG_VIRTIO),$(call land,$(CONFIG_VIRTFS),$(CONFIG_PCI))) += 9pfs/
+devices-dirs-$(CONFIG_VIRTFS) += 9pfs/
 devices-dirs-$(CONFIG_SOFTMMU) += acpi/
 devices-dirs-$(CONFIG_SOFTMMU) += adc/
 devices-dirs-$(CONFIG_SOFTMMU) += audio/