Patchwork [1/4] Add config-devices.h again

login
register
mail settings
Submitter Eduardo Habkost
Date Feb. 1, 2011, 4:53 p.m.
Message ID <1296579203-21083-2-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/81366/
State New
Headers show

Comments

Eduardo Habkost - Feb. 1, 2011, 4:53 p.m.
This reverts part of commit a992fe3d0fc185112677286f7a02204d8245b61e.

We do have code that needs #ifdefs depending on the list of enabled devices,
but currently that code breaks when we try to disable a feature that is enabled
by default.

For example, if we try to disable CONFIG_VMWARE_VGA, we get the following:

   LINK  x86_64-softmmu/qemu-system-x86_64
  pc.o: In function `pc_vga_init':
  /home/ehabkost/pessoal/proj/virt/qemu/qemu/hw/pc.c:991: undefined reference to `pci_vmsvga_init'
  collect2: ld returned 1 exit status
  make[1]: *** [qemu-system-x86_64] Error 1
  rm config-devices.h-timestamp
  make: *** [subdir-x86_64-softmmu] Error 2

config-devices.h will allow us to add an #ifdef to fix the above error, and
other similar cases.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 Makefile        |    7 +++++--
 Makefile.target |    2 +-
 config.h        |   11 +++++++++++
 3 files changed, 17 insertions(+), 3 deletions(-)
Stefan Weil - Feb. 1, 2011, 6:14 p.m.
Am 01.02.2011 17:53, schrieb Eduardo Habkost:
> This reverts part of commit a992fe3d0fc185112677286f7a02204d8245b61e.
>
> We do have code that needs #ifdefs depending on the list of enabled devices,
> but currently that code breaks when we try to disable a feature that is enabled
> by default.
>
> For example, if we try to disable CONFIG_VMWARE_VGA, we get the following:
>
>     LINK  x86_64-softmmu/qemu-system-x86_64
>    pc.o: In function `pc_vga_init':
>    /home/ehabkost/pessoal/proj/virt/qemu/qemu/hw/pc.c:991: undefined reference to `pci_vmsvga_init'
>    collect2: ld returned 1 exit status
>    make[1]: *** [qemu-system-x86_64] Error 1
>    rm config-devices.h-timestamp
>    make: *** [subdir-x86_64-softmmu] Error 2
>
> config-devices.h will allow us to add an #ifdef to fix the above error, and
> other similar cases.
>
> Signed-off-by: Eduardo Habkost<ehabkost@redhat.com>
> ---
>   Makefile        |    7 +++++--
>   Makefile.target |    2 +-
>   config.h        |   11 +++++++++++
>   3 files changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 4e120a2..22b53f6 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,6 +1,6 @@
>   # Makefile for QEMU.
>
> -GENERATED_HEADERS = config-host.h trace.h qemu-options.def
> +GENERATED_HEADERS = config-host.h trace.h qemu-options.def config-all-devices.h
>   ifeq ($(TRACE_BACKEND),dtrace)
>   GENERATED_HEADERS += trace-dtrace.h
>   endif
> @@ -77,6 +77,9 @@ config-host.h-timestamp: config-host.mak
>   qemu-options.def: $(SRC_PATH)/qemu-options.hx
>   	$(call quiet-command,sh $(SRC_PATH)/hxtool -h<  $<  >  $@,"  GEN   $@")
>
> +config-all-devices.h: config-all-devices.h-timestamp
> +config-all-devices.h-timestamp: config-all-devices.mak
> +
>   SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
>
>   subdir-%: $(GENERATED_HEADERS)
> @@ -190,7 +193,7 @@ clean:
>
>   distclean: clean
>   	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
> -	rm -f config-all-devices.mak
> +	rm -f config-all-devices.mak config-all-devices.h*
>   	rm -f roms/seabios/config.mak roms/vgabios/config.mak
>   	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.dvi qemu-doc.fn qemu-doc.info qemu-doc.ky qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp qemu-doc.vr
>   	rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi qemu-tech.fn qemu-tech.info qemu-tech.ky qemu-tech.log qemu-tech.pdf qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr
> diff --git a/Makefile.target b/Makefile.target
> index 2800f47..03fc486 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -1,6 +1,6 @@
>   # -*- Mode: makefile -*-
>
> -GENERATED_HEADERS = config-target.h
> +GENERATED_HEADERS = config-target.h config-devices.h
>   CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
>
>   include ../config-host.mak
> diff --git a/config.h b/config.h
> index e20f786..07d79d4 100644
> --- a/config.h
> +++ b/config.h
> @@ -1,2 +1,13 @@
> +
>   #include "config-host.h"
>   #include "config-target.h"
> +
> +/* We want to include different config files for specific targets
> +   And for the common library.  They need a different name because
> +   we don't want to rely in paths */
>    

on paths?

> +
> +#if defined(NEED_CPU_H)
> +#include "config-devices.h"
> +#else
> +#include "config-all-devices.h"
> +#endif
>
Eduardo Habkost - Feb. 2, 2011, 6:09 p.m.
On Tue, Feb 01, 2011 at 07:14:00PM +0100, Stefan Weil wrote:
> >+
> >  #include "config-host.h"
> >  #include "config-target.h"
> >+
> >+/* We want to include different config files for specific targets
> >+   And for the common library.  They need a different name because
> >+   we don't want to rely in paths */
> 
> on paths?

Is this a grammar question (english is not my native language, sorry),
or you didn't understand what the message above meant?

BTW, this comes from the original patch by Juan (I just restored it), so
he may have a better explanation for this comment.
Juan Quintela - Feb. 4, 2011, 2:48 p.m.
Stefan Weil <weil@mail.berlios.de> wrote:
> Am 01.02.2011 17:53, schrieb Eduardo Habkost:
>> This reverts part of commit a992fe3d0fc185112677286f7a02204d8245b61e.
>>
>> We do have code that needs #ifdefs depending on the list of enabled devices,
>> but currently that code breaks when we try to disable a feature that is enabled
>> by default.
>>
>> For example, if we try to disable CONFIG_VMWARE_VGA, we get the following:
>>
>>     LINK  x86_64-softmmu/qemu-system-x86_64
>>    pc.o: In function `pc_vga_init':
>>    /home/ehabkost/pessoal/proj/virt/qemu/qemu/hw/pc.c:991: undefined reference to `pci_vmsvga_init'
>>    collect2: ld returned 1 exit status
>>    make[1]: *** [qemu-system-x86_64] Error 1
>>    rm config-devices.h-timestamp
>>    make: *** [subdir-x86_64-softmmu] Error 2
>>
>> config-devices.h will allow us to add an #ifdef to fix the above error, and
>> other similar cases.
>>
>> Signed-off-by: Eduardo Habkost<ehabkost@redhat.com>
>> ---
>>   Makefile        |    7 +++++--
>>   Makefile.target |    2 +-
>>   config.h        |   11 +++++++++++
>>   3 files changed, 17 insertions(+), 3 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 4e120a2..22b53f6 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1,6 +1,6 @@
>>   # Makefile for QEMU.
>>
>> -GENERATED_HEADERS = config-host.h trace.h qemu-options.def
>> +GENERATED_HEADERS = config-host.h trace.h qemu-options.def config-all-devices.h
>>   ifeq ($(TRACE_BACKEND),dtrace)
>>   GENERATED_HEADERS += trace-dtrace.h
>>   endif
>> @@ -77,6 +77,9 @@ config-host.h-timestamp: config-host.mak
>>   qemu-options.def: $(SRC_PATH)/qemu-options.hx
>>   	$(call quiet-command,sh $(SRC_PATH)/hxtool -h<  $<  >  $@,"  GEN   $@")
>>
>> +config-all-devices.h: config-all-devices.h-timestamp
>> +config-all-devices.h-timestamp: config-all-devices.mak
>> +
>>   SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
>>
>>   subdir-%: $(GENERATED_HEADERS)
>> @@ -190,7 +193,7 @@ clean:
>>
>>   distclean: clean
>>   	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
>> -	rm -f config-all-devices.mak
>> +	rm -f config-all-devices.mak config-all-devices.h*
>>   	rm -f roms/seabios/config.mak roms/vgabios/config.mak
>>   	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.dvi qemu-doc.fn qemu-doc.info qemu-doc.ky qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp qemu-doc.vr
>>   	rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi qemu-tech.fn qemu-tech.info qemu-tech.ky qemu-tech.log qemu-tech.pdf qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr
>> diff --git a/Makefile.target b/Makefile.target
>> index 2800f47..03fc486 100644
>> --- a/Makefile.target
>> +++ b/Makefile.target
>> @@ -1,6 +1,6 @@
>>   # -*- Mode: makefile -*-
>>
>> -GENERATED_HEADERS = config-target.h
>> +GENERATED_HEADERS = config-target.h config-devices.h
>>   CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
>>
>>   include ../config-host.mak
>> diff --git a/config.h b/config.h
>> index e20f786..07d79d4 100644
>> --- a/config.h
>> +++ b/config.h
>> @@ -1,2 +1,13 @@
>> +
>>   #include "config-host.h"
>>   #include "config-target.h"
>> +
>> +/* We want to include different config files for specific targets
>> +   And for the common library.  They need a different name because
>> +   we don't want to rely in paths */
>>    
>
> on paths?

yeap, sorry.

Patch

diff --git a/Makefile b/Makefile
index 4e120a2..22b53f6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@ 
 # Makefile for QEMU.
 
-GENERATED_HEADERS = config-host.h trace.h qemu-options.def
+GENERATED_HEADERS = config-host.h trace.h qemu-options.def config-all-devices.h
 ifeq ($(TRACE_BACKEND),dtrace)
 GENERATED_HEADERS += trace-dtrace.h
 endif
@@ -77,6 +77,9 @@  config-host.h-timestamp: config-host.mak
 qemu-options.def: $(SRC_PATH)/qemu-options.hx
 	$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $@")
 
+config-all-devices.h: config-all-devices.h-timestamp
+config-all-devices.h-timestamp: config-all-devices.mak
+
 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
 
 subdir-%: $(GENERATED_HEADERS)
@@ -190,7 +193,7 @@  clean:
 
 distclean: clean
 	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
-	rm -f config-all-devices.mak
+	rm -f config-all-devices.mak config-all-devices.h*
 	rm -f roms/seabios/config.mak roms/vgabios/config.mak
 	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.dvi qemu-doc.fn qemu-doc.info qemu-doc.ky qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp qemu-doc.vr
 	rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi qemu-tech.fn qemu-tech.info qemu-tech.ky qemu-tech.log qemu-tech.pdf qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr
diff --git a/Makefile.target b/Makefile.target
index 2800f47..03fc486 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -1,6 +1,6 @@ 
 # -*- Mode: makefile -*-
 
-GENERATED_HEADERS = config-target.h
+GENERATED_HEADERS = config-target.h config-devices.h
 CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
 
 include ../config-host.mak
diff --git a/config.h b/config.h
index e20f786..07d79d4 100644
--- a/config.h
+++ b/config.h
@@ -1,2 +1,13 @@ 
+
 #include "config-host.h"
 #include "config-target.h"
+
+/* We want to include different config files for specific targets
+   And for the common library.  They need a different name because
+   we don't want to rely in paths */
+
+#if defined(NEED_CPU_H)
+#include "config-devices.h"
+#else
+#include "config-all-devices.h"
+#endif