Re: [Qemu-devel] [PATCH 01/25] configure: We don't want to clean configuration files

2018-07-17 Thread Juan Quintela
Peter Maydell  wrote:
> On 17 July 2018 at 18:27, Juan Quintela  wrote:
>> On the other hand, sometimes it looks like I am the only user that use
>> this.  The original reason for this was to be able to compile out
>> drivers that downstream don't care about.  There were a couple of
>> intents to integrate with something like kernel kconfig, but I think
>> that we never end integrating anything from there.
>
> I think "be able to compile out stuff you don't want" is
> useful from a "reduce the security boundary" perspective,
> and indeed we have at least one fork of QEMU which is
> basically aimed at chopping stuff out, so there's a group
> of users who'd like to be able to do that

agreed about that.  Some of the bits are just there for historical
reasons, or it was easier to do it that way.  Case in hand, vfio-spapr,
we compile it in always, but my understanding is that it is only used on
ppc.  On the other hand, spliting things complicates things a lot, see
for instance the virtio-pci.c example that I gave on other answer.  You
can split instead of #ifdef, but need yet another registration.

>-- you're not on
> your own in that sense. But it probably does require more
> serious effort if we want to address this use case, so as
> always it comes down to whether anybody wants to do the work,
> I guess.

Completely agree.  I can justify the effort that I put to be able to
"compile less stuff and then compile faster".  Doing it properly takes
more time that I can afford right now.

I care mostly about x86_64-seftmmu with kvm, appart from the bits that I
sent, the other low hanging fruit that I can think of is:

- being able to compile only q35 or i440fx
- split CONFIG_RDMA into CONFIG_RDMA_DEVICES and CONFIG_RDMA_MIGRATION

Thing that could be clearer:
- What is the difference between CONFIG_VIRTIO_VGA and COVFIG_VIRTIO_GPU
- can we really drop/make optional isapc, yes, I know that some things
  still hang from there.
- VHOST_USER_SCSI, VHOST_USER, VIIRTIO_SCSI, VIRTIO_BLK,
  VIRTIO_DATAPLANE, VHOST_BLK and who knows what.  It is not clear to me
  which ones are the ones that I want.

Later, Juan.



Re: [Qemu-devel] [PATCH 01/25] configure: We don't want to clean configuration files

2018-07-17 Thread Peter Maydell
On 17 July 2018 at 18:27, Juan Quintela  wrote:
> On the other hand, sometimes it looks like I am the only user that use
> this.  The original reason for this was to be able to compile out
> drivers that downstream don't care about.  There were a couple of
> intents to integrate with something like kernel kconfig, but I think
> that we never end integrating anything from there.

I think "be able to compile out stuff you don't want" is
useful from a "reduce the security boundary" perspective,
and indeed we have at least one fork of QEMU which is
basically aimed at chopping stuff out, so there's a group
of users who'd like to be able to do that -- you're not on
your own in that sense. But it probably does require more
serious effort if we want to address this use case, so as
always it comes down to whether anybody wants to do the work,
I guess.

thanks
-- PMM



Re: [Qemu-devel] [PATCH 01/25] configure: We don't want to clean configuration files

2018-07-17 Thread Juan Quintela
Peter Maydell  wrote:
> On 17 July 2018 at 18:05, Juan Quintela  wrote:
>> Daniel P. Berrangé  wrote:
>>> On Tue, Jul 17, 2018 at 01:33:38PM +0200, Juan Quintela wrote:
 If you don't want to compile everything, you configure
 config-devices.mak.  And then make clean remove it, and make will
 create a default one without your configuration.  Fix it by not
 removing it.

 Signed-off-by: Juan Quintela 
 ---
  Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/Makefile b/Makefile
 index 2da686be33..2ffbcde323 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -751,7 +751,7 @@ clean:
  if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
  rm -f $$d/qemu-options.def; \
  done
 -rm -f $(SUBDIR_DEVICES_MAK) config-all-devices.mak
 +rm -f config-all-devices.mak

  VERSION ?= $(shell cat VERSION)
>>>
>>> This feels wrong to me.  If 'make' is creating config-devices.mak, then
>>> either 'make clean' or 'make distclean' must remove it. So if you remove
>>> it here, it should be added to distclean instead.
>>
>> I can agree with putting it on distclean.
>>
>> make don't put it there if it is already there.  My use case is that I
>> have several build trees from the same source three:
>>
>> - x86_64-softmmu with minimal set of devices (the ones that I use)
>> - x86_64-softmmu with everything under the sun
>> - everything that can be compiled in in fedora
>>
>> for the 1st case, I am interested that it is fast, so I edit the
>> x86_64-softmmu/config-device.mak.  But if I do a make clean for any
>> reason, I lost my changes.
>
> I think the problem here is that we're confused about whether
> config-devices.mak should be a user-editable file or just
> part of our build process. Personally I think we should go
> for the latter, ie if there are useful use cases that
> currently you need to edit the file to achieve, we should
> provide a better mechanism for doing them.

I agree with the better mechanism, but until them this is the only way
to "choose" what devices to compile in.  It is a very bad mechanism, but
it is the only one that we have right now.

On a general level, for devices that are quite well isolated, it works
quite well.  But for the rest of the things, it is kind of messy.
- No dependencies
  So, if you look at the generated x86_64-softmmu/config-devices,mak,
  you can see that we define CONFIG_SCSI=y at least three times
- No way to show that dependencies at the C level, so we can only
  compile in/out at the file level
- simple things like pc-speaker, msmouse or vmport, you can't compile
  out, because they are created by code, not by
  qom/configuration/whatever.

On the other hand, sometimes it looks like I am the only user that use
this.  The original reason for this was to be able to compile out
drivers that downstream don't care about.  There were a couple of
intents to integrate with something like kernel kconfig, but I think
that we never end integrating anything from there.

Later, Juan.



Re: [Qemu-devel] [PATCH 01/25] configure: We don't want to clean configuration files

2018-07-17 Thread Peter Maydell
On 17 July 2018 at 18:05, Juan Quintela  wrote:
> Daniel P. Berrangé  wrote:
>> On Tue, Jul 17, 2018 at 01:33:38PM +0200, Juan Quintela wrote:
>>> If you don't want to compile everything, you configure
>>> config-devices.mak.  And then make clean remove it, and make will
>>> create a default one without your configuration.  Fix it by not
>>> removing it.
>>>
>>> Signed-off-by: Juan Quintela 
>>> ---
>>>  Makefile | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index 2da686be33..2ffbcde323 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -751,7 +751,7 @@ clean:
>>>  if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
>>>  rm -f $$d/qemu-options.def; \
>>>  done
>>> -rm -f $(SUBDIR_DEVICES_MAK) config-all-devices.mak
>>> +rm -f config-all-devices.mak
>>>
>>>  VERSION ?= $(shell cat VERSION)
>>
>> This feels wrong to me.  If 'make' is creating config-devices.mak, then
>> either 'make clean' or 'make distclean' must remove it. So if you remove
>> it here, it should be added to distclean instead.
>
> I can agree with putting it on distclean.
>
> make don't put it there if it is already there.  My use case is that I
> have several build trees from the same source three:
>
> - x86_64-softmmu with minimal set of devices (the ones that I use)
> - x86_64-softmmu with everything under the sun
> - everything that can be compiled in in fedora
>
> for the 1st case, I am interested that it is fast, so I edit the
> x86_64-softmmu/config-device.mak.  But if I do a make clean for any
> reason, I lost my changes.

I think the problem here is that we're confused about whether
config-devices.mak should be a user-editable file or just
part of our build process. Personally I think we should go
for the latter, ie if there are useful use cases that
currently you need to edit the file to achieve, we should
provide a better mechanism for doing them.

thanks
-- PMM



Re: [Qemu-devel] [PATCH 01/25] configure: We don't want to clean configuration files

2018-07-17 Thread Juan Quintela
Daniel P. Berrangé  wrote:
> On Tue, Jul 17, 2018 at 01:33:38PM +0200, Juan Quintela wrote:
>> If you don't want to compile everything, you configure
>> config-devices.mak.  And then make clean remove it, and make will
>> create a default one without your configuration.  Fix it by not
>> removing it.
>> 
>> Signed-off-by: Juan Quintela 
>> ---
>>  Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/Makefile b/Makefile
>> index 2da686be33..2ffbcde323 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -751,7 +751,7 @@ clean:
>>  if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
>>  rm -f $$d/qemu-options.def; \
>>  done
>> -rm -f $(SUBDIR_DEVICES_MAK) config-all-devices.mak
>> +rm -f config-all-devices.mak
>>  
>>  VERSION ?= $(shell cat VERSION)
>
> This feels wrong to me.  If 'make' is creating config-devices.mak, then
> either 'make clean' or 'make distclean' must remove it. So if you remove
> it here, it should be added to distclean instead.

I can agree with putting it on distclean.

make don't put it there if it is already there.  My use case is that I
have several build trees from the same source three:

- x86_64-softmmu with minimal set of devices (the ones that I use)
- x86_64-softmmu with everything under the sun
- everything that can be compiled in in fedora

for the 1st case, I am interested that it is fast, so I edit the
x86_64-softmmu/config-device.mak.  But if I do a make clean for any
reason, I lost my changes.

But I agree that it is ok to remove it on make distclean.

Thanks, Juan.



Re: [Qemu-devel] [PATCH 01/25] configure: We don't want to clean configuration files

2018-07-17 Thread Daniel P . Berrangé
On Tue, Jul 17, 2018 at 01:33:38PM +0200, Juan Quintela wrote:
> If you don't want to compile everything, you configure
> config-devices.mak.  And then make clean remove it, and make will
> create a default one without your configuration.  Fix it by not
> removing it.
> 
> Signed-off-by: Juan Quintela 
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 2da686be33..2ffbcde323 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -751,7 +751,7 @@ clean:
>   if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
>   rm -f $$d/qemu-options.def; \
>  done
> - rm -f $(SUBDIR_DEVICES_MAK) config-all-devices.mak
> + rm -f config-all-devices.mak
>  
>  VERSION ?= $(shell cat VERSION)

This feels wrong to me.  If 'make' is creating config-devices.mak, then
either 'make clean' or 'make distclean' must remove it. So if you remove
it here, it should be added to distclean instead.


Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|