Skip to contentSkip to conversation

misc cleanups for use of config settings

PATCH NAK David Ahern 4 participants 27 messages Jan 14, 2011 – Jan 15, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

cover misc cleanups for use of config settings

Start point for use of CONFIG options. This series addresses compiling out unwanted devices.

v1 --> v2
- use Markus' solution for make_device_config
- address comments from Paolo regarding CONFIG_FDC and CONFIG_VGA_ISA
- add patch to actually use CONFIG options in C-code
- add CONFIG_APPLESMC option
- add option for disabling all sound cards

David Ahern (11):
fix 'no such file' error from make_device_config.sh
config: settings from default-configs need to be included in header
files
config: fix compile for CONFIG_VMWARE_VGA=n
config: fix compile for CONFIG_PARALLEL=n
remove unused parallel_* variables from pc.c
config: fix compile for CONFIG_NE2000_ISA=n
config: handle CONFIG_VGA_ISA=n
config: fix compile for CONFIG_IDE_ISA=n
config: fix compile for CONFIG_FDC=n
config: add CONFIG_APPLESMC
config: allow none as a configure option to disable all sound cards

 Makefile                           |   16 ++++++++--------
 Makefile.hw                        |    2 +-
 Makefile.target                    |    7 ++++---
 configure                          |    2 +-
 default-configs/i386-softmmu.mak   |    1 +
 default-configs/x86_64-softmmu.mak |    1 +
 hw/pc.c                            |   23 ++++++++++++++++++++---
 hw/pc_piix.c                       |   17 +++++++++++++++++
 make_device_config.sh              |    2 +-
 rules.mak                          |    4 ++--
 10 files changed, 56 insertions(+), 19 deletions(-)
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/11 fix 'no such file' error from make_device_config.sh

make_device_config currently emits an error:

make config-all-devices.mak
GEN x86_64-softmmu/config-devices.mak
/home/dsa/kvm/releases/qemu.git/make_device_config.sh: line 21: /home/dsa/kvm/releases/qe

Root cause is a space in the filename (determined by Markus Armbruster). Change from Markus Armbruster <[email protected]>.

---
 make_device_config.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
make_device_config.sh +1 -1
index 596fc5b..711829c 100644
@@ -18,7 +18,7 @@ process_includes () {
 
 f=$src
 while [ -n "$f" ] ; do
-  f=`tr -d '\r' < $f | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
+  f=`tr -d '\r' <"$f" | awk '/^include / {print "'$src_dir'/" $2}'`
   [ $? = 0 ] || exit 1
   all_includes="$all_includes $f"
 done
Signature · 1 line
1.7.3.4
#2 lore raw

Re: [Qemu-devel] [PATCH 01/11] fix 'no such file' error from make_device_config.sh

Am 14.01.2011 20:12, schrieb David Ahern:

Quoted 19 lines

make_device_config currently emits an error:

make config-all-devices.mak
GEN x86_64-softmmu/config-devices.mak
/home/dsa/kvm/releases/qemu.git/make_device_config.sh: line 21: /home/dsa/kvm/releases/qe

Root cause is a space in the filename (determined by Markus Armbruster). Change from Markus Armbruster<[email protected]>.

---
  make_device_config.sh |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
make_device_config.sh +0 -0
index 596fc5b..711829c 100644

make_device_config.sh process_includes () { · line 24

Quoted 8 lines
make_device_config.sh +1 -1
@@ -18,7 +18,7 @@ process_includes () {
 
  f=$src
  while [ -n "$f" ] ; do
-  f=`tr -d '\r'<  $f | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
+  f=`tr -d '\r'<"$f" | awk '/^include / {print "'$src_dir'/" $2}'`
    [ $? = 0 ] || exit 1
    all_includes="$all_includes $f"
  done

See http://patchwork.ozlabs.org/patch/77021/

#3 lore raw

Re: [Qemu-devel] [PATCH 01/11] fix 'no such file' error from make_device_config.sh

Quoted 22 lines · Stefan Weil

Am 14.01.2011 20:12, schrieb David Ahern:

Quoted 21 lines

make_device_config currently emits an error:

make config-all-devices.mak
GEN x86_64-softmmu/config-devices.mak
/home/dsa/kvm/releases/qemu.git/make_device_config.sh: line 21:
/home/dsa/kvm/releases/qe

Root cause is a space in the filename (determined by Markus Armbruster). Change from Markus Armbruster<[email protected]>.

---
  make_device_config.sh |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
make_device_config.sh +0 -0
index 596fc5b..711829c 100644
@@ -18,7 +18,7 @@ process_includes () {
 
Quoted 13 lines
Quoted 9 lines
make_device_config.sh +0 -1
  f=$src
  while [ -n "$f" ] ; do
-  f=`tr -d '\r'<  $f | awk '/^include / {ORS=" "; print "'$src_dir'/"

$2}'`
+ f=tr -d '\r'<"$f" | awk '/^include / {print "'$src_dir'/" $2}'

    [ $? = 0 ] || exit 1
    all_includes="$all_includes $f"

done

See http://patchwork.ozlabs.org/patch/77021/

Yet another patch lost to the black hole....

#4 lore raw

[Qemu-devel] Re: [PATCH 01/11] fix 'no such file' error from make_device_config.sh

In reply to David Ahern
Quoted 18 lines · David Ahern

make_device_config currently emits an error:

make config-all-devices.mak
GEN x86_64-softmmu/config-devices.mak
/home/dsa/kvm/releases/qemu.git/make_device_config.sh: line 21: /home/dsa/kvm/releases/qe

Root cause is a space in the filename (determined by Markus Armbruster). Change from Markus Armbruster<[email protected]>.

---
  make_device_config.sh |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
make_device_config.sh +0 -0
index 596fc5b..711829c 100644

make_device_config.sh process_includes () { · line 21

Quoted 5 lines
make_device_config.sh +1 -1
@@ -18,7 +18,7 @@ process_includes () {
 
  f=$src
  while [ -n "$f" ] ; do
-  f=`tr -d '\r'<  $f | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
+  f=`tr -d '\r'<"$f" | awk '/^include / {print "'$src_dir'/" $2}'`

Can anybody with Windows test this to make sure there are no CR woes? That was IIRC the reason for the strange ORS setting.

If there are, we can just change it to this:

f=tr -d '\r'<"$f" | awk '/^include / {printf "'$src_dir'/%s", $2}'

Sorry for not noticing this in the previous thread.

Paolo

#5 lore raw

PATCH 2/11 config: settings from default-configs need to be included in header files

In reply to David Ahern

Currently, device config settings in the default-configs file are not propogated into the config*.h files. While the Makefile rules observe them through the *.mak files, the CONFIG options are not usable within the .c files.

This patch adds the settings to the header files. To do that the host devices make file is renamed to config-host-devices.mak and the target devices mak file to config-target-devices.mak.

---
 Makefile        |   16 ++++++++--------
 Makefile.hw     |    2 +-
 Makefile.target |    4 ++--
 rules.mak       |    4 ++--
 4 files changed, 13 insertions(+), 13 deletions(-)
Makefile +8 -8
index 6d601ee..bce5188 100644
@@ -38,15 +38,15 @@ DOCS=
 endif
 
 SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
-SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
-SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
+SUBDIR_DEVICES_MAK=$(patsubst %, %/config-target-devices.mak, $(TARGET_DIRS))
+SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-target-devices.mak.d, $(TARGET_DIRS))
 
-config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
+config-host-devices.mak: $(SUBDIR_DEVICES_MAK)
 	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
 
 -include $(SUBDIR_DEVICES_MAK_DEP)
 
-%/config-devices.mak: default-configs/%.mak
+%/config-target-devices.mak: default-configs/%.mak
 	$(call quiet-command,$(SHELL) $(SRC_PATH)/make_device_config.sh $@ $<, "  GEN   $@")
 	@if test -f $@; then \
 	  if cmp -s [email protected] $@; then \
@@ -67,14 +67,14 @@ config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
 	 fi
 
 defconfig:
-	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
+	rm -f config-host-devices.mak $(SUBDIR_DEVICES_MAK)
 
--include config-all-devices.mak
+-include config-host-devices.mak
 
 build-all: $(DOCS) $(TOOLS) recurse-all
 
 config-host.h: config-host.h-timestamp
-config-host.h-timestamp: config-host.mak
+config-host.h-timestamp: config-host.mak config-host-devices.mak
 qemu-options.def: $(SRC_PATH)/qemu-options.hx
 	$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   $@")
 
@@ -191,7 +191,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-host-devices.mak
 	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
Makefile.hw +1 -1
index b9181ab..3e97b0b 100644
@@ -1,7 +1,7 @@
 # Makefile for qemu target independent devices.
 
 include ../config-host.mak
-include ../config-all-devices.mak
+include ../config-host-devices.mak
 include config.mak
 include $(SRC_PATH)/rules.mak
 
Makefile.target +2 -2
index e15b1c4..f3ed066 100644
@@ -5,7 +5,7 @@ CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
 CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
 
 include ../config-host.mak
-include config-devices.mak
+include config-target-devices.mak
 include config-target.mak
 include $(SRC_PATH)/rules.mak
 ifneq ($(HWDIR),)
@@ -40,7 +40,7 @@ endif
 kvm.o kvm-all.o vhost.o vhost_net.o: QEMU_CFLAGS+=$(KVM_CFLAGS)
 
 config-target.h: config-target.h-timestamp
-config-target.h-timestamp: config-target.mak
+config-target.h-timestamp: config-target.mak config-target-devices.mak
 
 ifdef CONFIG_SYSTEMTAP_TRACE
 stap: $(QEMU_PROG).stp
rules.mak +2 -2
index 6dac777..4425850 100644
@@ -56,8 +56,8 @@ find-in-path = $(if $(find-string /, $1), \
 %.h: %.h-timestamp
 	@test -f $@ || cp $< $@
 
-%.h-timestamp: %.mak
-	$(call quiet-command, sh $(SRC_PATH)/create_config < $< > $@, "  GEN   $*.h")
+%.h-timestamp: %.mak %-devices.mak
+	$(call quiet-command, cat $^ | $(SRC_PATH)/create_config > $@, "  GEN   $*.h")
 	@cmp $@ $*.h >/dev/null 2>&1 || cp $@ $*.h
 
 # will delete the target of a rule if commands exit with a nonzero exit status
Signature · 1 line
1.7.3.4
#6 lore raw

Re: [Qemu-devel] [PATCH 02/11] config: settings from default-configs need to be included in header files

Quoted 3 lines · David Ahern

Currently, device config settings in the default-configs file are not propogated into the config*.h files. While the Makefile rules observe them through the *.mak files, the CONFIG options are not usable within the .c files.

This patch adds the settings to the header files. To do that the host devices make file is renamed to config-host-devices.mak and the target devices mak file to config-target-devices.mak.

NACK, see this thread for the previous discussion:
http://lists.nongnu.org/archive/html/qemu-devel/2010-05/msg02268.html

#7 lore raw

Re: [Qemu-devel] [PATCH 02/11] config: settings from default-configs need to be included in header files

Quoted 7 lines · Blue Swirl
Quoted 3 lines · David Ahern

Currently, device config settings in the default-configs file are not propogated into the config*.h files. While the Makefile rules observe them through the *.mak files, the CONFIG options are not usable within the .c files.

This patch adds the settings to the header files. To do that the host devices make file is renamed to config-host-devices.mak and the target devices mak file to config-target-devices.mak.

NACK, see this thread for the previous discussion:
http://lists.nongnu.org/archive/html/qemu-devel/2010-05/msg02268.html

hmm.... so there is no interest in making the existing design actually work? It's reinvent the config design or nothing?

I'm looking to compile out all device models not relevant to my use case.

David

#8 lore raw

Re: [Qemu-devel] [PATCH 02/11] config: settings from default-configs need to be included in header files

Quoted 8 lines · David Ahern
Quoted 5 lines · Blue Swirl
Quoted 3 lines · David Ahern

Currently, device config settings in the default-configs file are not propogated into the config*.h files. While the Makefile rules observe them through the *.mak files, the CONFIG options are not usable within the .c files.

This patch adds the settings to the header files. To do that the host devices make file is renamed to config-host-devices.mak and the target devices mak file to config-target-devices.mak.

Quoted 7 lines
Quoted 2 lines

NACK, see this thread for the previous discussion:
http://lists.nongnu.org/archive/html/qemu-devel/2010-05/msg02268.html

hmm.... so there is no interest in making the existing design actually work? It's reinvent the config design or nothing?

I'm looking to compile out all device models not relevant to my use case.

That's OK, but the correct fix is to change the design of the machine model to something more advanced where the unwanted objects are simply not linked in, without any changes to board code. This is not so trivial and also many devices are not architecturally clean yet.

#9 lore raw

Re: [Qemu-devel] [PATCH 02/11] config: settings from default-configs need to be included in header files

Quoted 15 lines · Blue Swirl
Quoted 14 lines · David Ahern
Quoted 7 lines · Blue Swirl
Quoted 3 lines · David Ahern

Currently, device config settings in the default-configs file are not propogated into the config*.h files. While the Makefile rules observe them through the *.mak files, the CONFIG options are not usable within the .c files.

This patch adds the settings to the header files. To do that the host devices make file is renamed to config-host-devices.mak and the target devices mak file to config-target-devices.mak.

NACK, see this thread for the previous discussion:
http://lists.nongnu.org/archive/html/qemu-devel/2010-05/msg02268.html

hmm.... so there is no interest in making the existing design actually work? It's reinvent the config design or nothing?

Quoted 6 lines
Quoted 1 line

I'm looking to compile out all device models not relevant to my use case.

That's OK, but the correct fix is to change the design of the machine model to something more advanced where the unwanted objects are simply not linked in, without any changes to board code. This is not so trivial and also many devices are not architecturally clean yet.

A lot of changes are need to obtain that goal, and I am not the right person to do them. Until that ideal design can be developed and implemented why not take a small patch that fixes the existing design? It's not a major change -- a very small one actually (4 files, 13 lines modified).

David

#10 lore raw

Re: [Qemu-devel] [PATCH 02/11] config: settings from default-configs need to be included in header files

Quoted 25 lines · David Ahern
Quoted 15 lines · Blue Swirl
Quoted 14 lines · David Ahern
Quoted 7 lines · Blue Swirl
Quoted 3 lines · David Ahern

Currently, device config settings in the default-configs file are not propogated into the config*.h files. While the Makefile rules observe them through the *.mak files, the CONFIG options are not usable within the .c files.

This patch adds the settings to the header files. To do that the host devices make file is renamed to config-host-devices.mak and the target devices mak file to config-target-devices.mak.

NACK, see this thread for the previous discussion:
http://lists.nongnu.org/archive/html/qemu-devel/2010-05/msg02268.html

hmm.... so there is no interest in making the existing design actually work? It's reinvent the config design or nothing?

Quoted 6 lines
Quoted 1 line

I'm looking to compile out all device models not relevant to my use case.

That's OK, but the correct fix is to change the design of the machine model to something more advanced where the unwanted objects are simply not linked in, without any changes to board code. This is not so trivial and also many devices are not architecturally clean yet.

Quoted 5 lines

A lot of changes are need to obtain that goal, and I am not the right person to do them. Until that ideal design can be developed and implemented why not take a small patch that fixes the existing design? It's not a major change -- a very small one actually (4 files, 13 lines modified).

So far the approach has been to make changes only in line with that goal.

#11 lore raw

Re: [Qemu-devel] [PATCH 02/11] config: settings from default-configs need to be included in header files

Quoted 5 lines · Blue Swirl
Quoted 5 lines
Quoted 4 lines

That's OK, but the correct fix is to change the design of the machine model to something more advanced where the unwanted objects are simply not linked in, without any changes to board code. This is not so trivial and also many devices are not architecturally clean yet.

Quoted 7 lines
Quoted 5 lines

A lot of changes are need to obtain that goal, and I am not the right person to do them. Until that ideal design can be developed and implemented why not take a small patch that fixes the existing design? It's not a major change -- a very small one actually (4 files, 13 lines modified).

So far the approach has been to make changes only in line with that goal.

That's a shame.

I'll collapse the patch series and maintain it locally then.

#12 lore raw

Re: [Qemu-devel] [PATCH 02/11] config: settings from default-configs need to be included in header files

Quoted 14 lines · David Ahern
Quoted 11 lines · Blue Swirl
Quoted 10 lines
Quoted 4 lines

That's OK, but the correct fix is to change the design of the machine model to something more advanced where the unwanted objects are simply not linked in, without any changes to board code. This is not so trivial and also many devices are not architecturally clean yet.

A lot of changes are need to obtain that goal, and I am not the right person to do them. Until that ideal design can be developed and implemented why not take a small patch that fixes the existing design? It's not a major change -- a very small one actually (4 files, 13 lines modified).

Quoted 5 lines
Quoted 1 line

So far the approach has been to make changes only in line with that goal.

That's a shame.

I'll collapse the patch series and maintain it locally then.

Patches 1, 5, 10, and 11 still look fine to me.

#13 lore raw

Re: [Qemu-devel] [PATCH 02/11] config: settings from default-configs need to be included in header files

Quoted 15 lines · Blue Swirl
Quoted 14 lines · David Ahern
Quoted 11 lines · Blue Swirl
Quoted 10 lines
Quoted 4 lines

That's OK, but the correct fix is to change the design of the machine model to something more advanced where the unwanted objects are simply not linked in, without any changes to board code. This is not so trivial and also many devices are not architecturally clean yet.

A lot of changes are need to obtain that goal, and I am not the right person to do them. Until that ideal design can be developed and implemented why not take a small patch that fixes the existing design? It's not a major change -- a very small one actually (4 files, 13 lines modified).

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

So far the approach has been to make changes only in line with that goal.

That's a shame.

I'll collapse the patch series and maintain it locally then.

Patches 1, 5, 10, and 11 still look fine to me.

Fine by me. The more you take, the less I have to carry locally.

Sounds like patch 1 should be Stefan's patch since it pre-dates what I sent.

David

#14 lore raw

[Qemu-devel] Re: [PATCH 02/11] config: settings from default-configs need to be included in header files

In reply to Blue Swirl
Quoted 15 lines · Blue Swirl
Quoted 14 lines · David Ahern
Quoted 11 lines · Blue Swirl
Quoted 10 lines
Quoted 4 lines

That's OK, but the correct fix is to change the design of the machine model to something more advanced where the unwanted objects are simply not linked in, without any changes to board code. This is not so trivial and also many devices are not architecturally clean yet.

A lot of changes are need to obtain that goal, and I am not the right person to do them. Until that ideal design can be developed and implemented why not take a small patch that fixes the existing design? It's not a major change -- a very small one actually (4 files, 13 lines modified).

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

So far the approach has been to make changes only in line with that goal.

That's a shame.

I'll collapse the patch series and maintain it locally then.

Patches 1, 5, 10, and 11 still look fine to me.

Patch 1 is wrong, please apply http://patchwork.ozlabs.org/patch/77021/ instead.

Paolo

#15 lore raw

[Qemu-devel] Re: [PATCH 02/11] config: settings from default-configs need to be included in header files

Quoted 21 lines · Paolo Bonzini
Quoted 20 lines · Blue Swirl
Quoted 18 lines · David Ahern
Quoted 14 lines · Blue Swirl
Quoted 11 lines
Quoted 5 lines

That's OK, but the correct fix is to change the design of the machine model to something more advanced where the unwanted objects are simply not linked in, without any changes to board code. This is not so trivial and also many devices are not architecturally clean yet.

A lot of changes are need to obtain that goal, and I am not the right person to do them. Until that ideal design can be developed and implemented why not take a small patch that fixes the existing design? It's not a major change -- a very small one actually (4 files, 13 lines modified).

So far the approach has been to make changes only in line with that goal.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

That's a shame.

I'll collapse the patch series and maintain it locally then.

Patches 1, 5, 10, and 11 still look fine to me.

Patch 1 is wrong, please apply http://patchwork.ozlabs.org/patch/77021/
instead.

It's in: 0601740a5db12ea7ae0f2f7826f0cfb05854500a.

#16 lore raw

PATCH 3/11 config: fix compile for CONFIG_VMWARE_VGA=n

In reply to David Ahern
---
 hw/pc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
hw/pc.c +2 -0
index fface7d..50795e8 100644
@@ -1069,11 +1069,13 @@ void pc_vga_init(PCIBus *pci_bus)
         } else {
             isa_cirrus_vga_init();
         }
+#ifdef CONFIG_VMWARE_VGA
     } else if (vmsvga_enabled) {
         if (pci_bus)
             pci_vmsvga_init(pci_bus);
         else
             fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
+#endif
 #ifdef CONFIG_SPICE
     } else if (qxl_enabled) {
         if (pci_bus)
Signature · 1 line
1.7.3.4
#17 lore raw

PATCH 4/11 config: fix compile for CONFIG_PARALLEL=n

In reply to David Ahern
---
 hw/pc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
hw/pc.c +2 -0
index 50795e8..18ec0df 100644
@@ -1138,11 +1138,13 @@ void pc_basic_device_init(qemu_irq *isa_irq,
         }
     }
 
+#ifdef CONFIG_PARALLEL
     for(i = 0; i < MAX_PARALLEL_PORTS; i++) {
         if (parallel_hds[i]) {
             parallel_init(i, parallel_hds[i]);
         }
     }
+#endif
 
     a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2);
     i8042 = isa_create_simple("i8042");
Signature · 1 line
1.7.3.4
#18 lore raw

PATCH 5/11 remove unused parallel_* variables from pc.c

In reply to David Ahern
---
 hw/pc.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
hw/pc.c +0 -3
index 18ec0df..6a55d2f 100644
@@ -826,9 +826,6 @@ static const int ne2000_io[NE2000_NB_MAX] = { 0x300, 0x320, 0x340, 0x360,
                                               0x280, 0x380 };
 static const int ne2000_irq[NE2000_NB_MAX] = { 9, 10, 11, 3, 4, 5 };
 
-static const int parallel_io[MAX_PARALLEL_PORTS] = { 0x378, 0x278, 0x3bc };
-static const int parallel_irq[MAX_PARALLEL_PORTS] = { 7, 7, 7 };
-
 void pc_audio_init (PCIBus *pci_bus, qemu_irq *pic)
 {
     struct soundhw *c;
Signature · 1 line
1.7.3.4
#19 lore raw

PATCH 6/11 config: fix compile for CONFIG_NE2000_ISA=n

In reply to David Ahern
---
 hw/pc.c      |    4 ++++
 hw/pc_piix.c |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)
hw/pc.c +4 -0
index 6a55d2f..e7514fd 100644
@@ -822,9 +822,11 @@ static void load_linux(void *fw_cfg,
 
 #define NE2000_NB_MAX 6
 
+#ifdef CONFIG_NE2000_ISA
 static const int ne2000_io[NE2000_NB_MAX] = { 0x300, 0x320, 0x340, 0x360,
                                               0x280, 0x380 };
 static const int ne2000_irq[NE2000_NB_MAX] = { 9, 10, 11, 3, 4, 5 };
+#endif
 
 void pc_audio_init (PCIBus *pci_bus, qemu_irq *pic)
 {
@@ -843,6 +845,7 @@ void pc_audio_init (PCIBus *pci_bus, qemu_irq *pic)
     }
 }
 
+#ifdef CONFIG_NE2000_ISA
 void pc_init_ne2k_isa(NICInfo *nd)
 {
     static int nb_ne2k = 0;
@@ -853,6 +856,7 @@ void pc_init_ne2k_isa(NICInfo *nd)
                     ne2000_irq[nb_ne2k], nd);
     nb_ne2k++;
 }
+#endif
 
 int cpu_is_bsp(CPUState *env)
 {
hw/pc_piix.c +2 -0
index f82508d..5046947 100644
@@ -119,9 +119,11 @@ static void pc_init1(ram_addr_t ram_size,
     for(i = 0; i < nb_nics; i++) {
         NICInfo *nd = &nd_table[i];
 
+#ifdef CONFIG_NE2000_ISA
         if (!pci_enabled || (nd->model && strcmp(nd->model, "ne2k_isa") == 0))
             pc_init_ne2k_isa(nd);
         else
+#endif
             pci_nic_init_nofail(nd, "e1000", NULL);
     }
 
Signature · 1 line
1.7.3.4
#20 lore raw

PATCH 7/11 config: handle CONFIG_VGA_ISA=n

In reply to David Ahern

Fix compile errors and remove -M isapc option for CONFIG_VGA_ISA=n.

---
 hw/pc.c      |    2 ++
 hw/pc_piix.c |    6 ++++++
 2 files changed, 8 insertions(+), 0 deletions(-)
hw/pc.c +2 -0
index e7514fd..11b570f 100644
@@ -1087,8 +1087,10 @@ void pc_vga_init(PCIBus *pci_bus)
     } else if (std_vga_enabled) {
         if (pci_bus) {
             pci_vga_init(pci_bus);
+#ifdef CONFIG_VGA_ISA
         } else {
             isa_vga_init();
+#endif
         }
     }
 }
hw/pc_piix.c +6 -0
index 5046947..7d65e37 100644
@@ -199,6 +199,7 @@ static void pc_init_pci(ram_addr_t ram_size,
              initrd_filename, cpu_model, 1);
 }
 
+#ifdef CONFIG_VGA_ISA
 static void pc_init_isa(ram_addr_t ram_size,
                         const char *boot_device,
                         const char *kernel_filename,
@@ -212,6 +213,7 @@ static void pc_init_isa(ram_addr_t ram_size,
              kernel_filename, kernel_cmdline,
              initrd_filename, cpu_model, 0);
 }
+#endif
 
 static QEMUMachine pc_machine = {
     .name = "pc-0.14",
@@ -370,12 +372,14 @@ static QEMUMachine pc_machine_v0_10 = {
     },
 };
 
+#ifdef CONFIG_VGA_ISA
 static QEMUMachine isapc_machine = {
     .name = "isapc",
     .desc = "ISA-only PC",
     .init = pc_init_isa,
     .max_cpus = 1,
 };
+#endif
 
 static void pc_machine_init(void)
 {
@@ -384,7 +388,9 @@ static void pc_machine_init(void)
     qemu_register_machine(&pc_machine_v0_12);
     qemu_register_machine(&pc_machine_v0_11);
     qemu_register_machine(&pc_machine_v0_10);
+#ifdef CONFIG_VGA_ISA
     qemu_register_machine(&isapc_machine);
+#endif
 }
 
 machine_init(pc_machine_init);
Signature · 1 line
1.7.3.4
#22 lore raw

PATCH 8/11 config: fix compile for CONFIG_IDE_ISA=n

In reply to David Ahern
---
 hw/pc_piix.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
hw/pc_piix.c +9 -0
index 7d65e37..68f602f 100644
@@ -38,9 +38,11 @@
 
 #define MAX_IDE_BUS 2
 
+#ifdef CONFIG_IDE_ISA
 static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
 static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
 static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
+#endif
 
 static void ioapic_init(IsaIrqState *isa_irq_state)
 {
@@ -141,6 +143,7 @@ static void pc_init1(ram_addr_t ram_size,
         dev = pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1);
         idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0");
         idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1");
+#ifdef CONFIG_IDE_ISA
     } else {
         for(i = 0; i < MAX_IDE_BUS; i++) {
             ISADevice *dev;
@@ -149,6 +152,12 @@ static void pc_init1(ram_addr_t ram_size,
             idebus[i] = qdev_get_child_bus(&dev->qdev, "ide.0");
         }
     }
+#else
+    } else {
+        idebus[0] = NULL;
+        idebus[1] = NULL;
+    }
+#endif
 
     pc_audio_init(pci_enabled ? pci_bus : NULL, isa_irq);
 
Signature · 1 line
1.7.3.4
#23 lore raw

PATCH 9/11 config: fix compile for CONFIG_FDC=n

In reply to David Ahern
---
 hw/pc.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
hw/pc.c +10 -0
index 11b570f..b50bbc4 100644
@@ -191,6 +191,7 @@ static void pic_irq_request(void *opaque, int irq, int level)
 
 #define REG_EQUIPMENT_BYTE          0x14
 
+#ifdef CONFIG_FDC
 static int cmos_get_fd_drive_type(int fd0)
 {
     int val;
@@ -214,6 +215,7 @@ static int cmos_get_fd_drive_type(int fd0)
     }
     return val;
 }
+#endif
 
 static void cmos_init_hd(int type_ofs, int info_ofs, BlockDriverState *hd,
                          ISADevice *s)
@@ -335,7 +337,9 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
                   FDCtrl *floppy_controller, ISADevice *s)
 {
     int val;
+#ifdef CONFIG_FDC
     int fd0, fd1, nb;
+#endif
     static pc_cmos_init_late_arg arg;
 
     /* various important CMOS locations needed by PC/Bochs bios */
@@ -376,6 +380,7 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
         exit(1);
     }
 
+#ifdef CONFIG_FDC
     /* floppy type */
 
     fd0 = fdctrl_get_drive_type(floppy_controller, 0);
@@ -400,6 +405,9 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
         val |= 0x41; /* 2 drives, ready for boot */
         break;
     }
+#else
+    val = 0;
+#endif
     val |= 0x02; /* FPU is there */
     val |= 0x04; /* PS/2 mouse installed */
     rtc_set_memory(s, REG_EQUIPMENT_BYTE, val);
@@ -1162,7 +1170,9 @@ void pc_basic_device_init(qemu_irq *isa_irq,
     for(i = 0; i < MAX_FD; i++) {
         fd[i] = drive_get(IF_FLOPPY, 0, i);
     }
+#ifdef CONFIG_FDC
     *floppy_controller = fdctrl_init_isa(fd);
+#endif
 }
 
 void pc_pci_device_init(PCIBus *pci_bus)
Signature · 1 line
1.7.3.4
#24 lore raw

PATCH 10/11 config: add CONFIG_APPLESMC

In reply to David Ahern
---
 Makefile.target                    |    3 ++-
 default-configs/i386-softmmu.mak   |    1 +
 default-configs/x86_64-softmmu.mak |    1 +
 3 files changed, 4 insertions(+), 1 deletions(-)
Makefile.target +2 -1
index f3ed066..24899ea 100644
@@ -215,7 +215,8 @@ obj-$(CONFIG_KVM) += ivshmem.o
 obj-i386-y += vga.o
 obj-i386-y += mc146818rtc.o i8259.o pc.o
 obj-i386-y += cirrus_vga.o apic.o ioapic.o piix_pci.o
-obj-i386-y += vmmouse.o vmport.o hpet.o applesmc.o
+obj-i386-y += vmmouse.o vmport.o hpet.o
+obj-i386-$(CONFIG_APPLESMC) += applesmc.o
 obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o wdt_ib700.o
 obj-i386-y += debugcon.o multiboot.o
 obj-i386-y += pc_piix.o
default-configs/i386-softmmu.mak +1 -0
index 323fafb..a972fdd 100644
@@ -18,3 +18,4 @@ CONFIG_IDE_PIIX=y
 CONFIG_NE2000_ISA=y
 CONFIG_PIIX_PCI=y
 CONFIG_SOUND=y
+CONFIG_APPLESMC=y
default-configs/x86_64-softmmu.mak +1 -0
index eff26d2..499d0e0 100644
@@ -18,3 +18,4 @@ CONFIG_IDE_PIIX=y
 CONFIG_NE2000_ISA=y
 CONFIG_PIIX_PCI=y
 CONFIG_SOUND=y
+CONFIG_APPLESMC=y
Signature · 1 line
1.7.3.4
Acked-by on v1 10/11
#25 lore raw

[Qemu-devel] Re: [PATCH 10/11] config: add CONFIG_APPLESMC

Quoted 35 lines · David Ahern
---
  Makefile.target                    |    3 ++-
  default-configs/i386-softmmu.mak   |    1 +
  default-configs/x86_64-softmmu.mak |    1 +
  3 files changed, 4 insertions(+), 1 deletions(-)
Makefile.target +2 -1
index f3ed066..24899ea 100644
@@ -215,7 +215,8 @@ obj-$(CONFIG_KVM) += ivshmem.o
  obj-i386-y += vga.o
  obj-i386-y += mc146818rtc.o i8259.o pc.o
  obj-i386-y += cirrus_vga.o apic.o ioapic.o piix_pci.o
-obj-i386-y += vmmouse.o vmport.o hpet.o applesmc.o
+obj-i386-y += vmmouse.o vmport.o hpet.o
+obj-i386-$(CONFIG_APPLESMC) += applesmc.o
  obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o wdt_ib700.o
  obj-i386-y += debugcon.o multiboot.o
  obj-i386-y += pc_piix.o
default-configs/i386-softmmu.mak +1 -0
index 323fafb..a972fdd 100644
@@ -18,3 +18,4 @@ CONFIG_IDE_PIIX=y
  CONFIG_NE2000_ISA=y
  CONFIG_PIIX_PCI=y
  CONFIG_SOUND=y
+CONFIG_APPLESMC=y
default-configs/x86_64-softmmu.mak +0 -0
index eff26d2..499d0e0 100644

default-configs/x86_64-softmmu.mak CONFIG_IDE_PIIX=y · line 21

Quoted 4 lines
default-configs/x86_64-softmmu.mak +1 -0
@@ -18,3 +18,4 @@ CONFIG_IDE_PIIX=y
  CONFIG_NE2000_ISA=y
  CONFIG_PIIX_PCI=y
  CONFIG_SOUND=y
+CONFIG_APPLESMC=y

Paolo

#26 lore raw

PATCH 11/11 config: allow none as a configure option to disable all sound cards

In reply to David Ahern
---
 configure |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
configure +1 -1
index 438219b..8ae997c 100755
@@ -77,7 +77,7 @@ cross_prefix=""
 cc="gcc"
 audio_drv_list=""
 audio_card_list="ac97 es1370 sb16 hda"
-audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus hda"
+audio_possible_cards="none ac97 es1370 sb16 cs4231a adlib gus hda"
 block_drv_whitelist=""
 host_cc="gcc"
 ar="ar"
Signature · 1 line
1.7.3.4