Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 3160499aacb81f6735941eb4c372d87a > files > 62

kvm-83-164.el5_5.30.src.rpm

From 116012ac721273b74e023269a6cbe45708754ed0 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Fri, 2 Oct 2009 16:51:30 -0300
Subject: [PATCH 6/7] Add option to disable pcspk

RH-Author: Juan Quintela <quintela@redhat.com>
Message-id: <ec903ce9842b6d7fcee2cb77926042edfe0af5e2.1253622110.git.quintela@redhat.com>
Patchwork-id: 3494
O-Subject: [PATCH 1/2] Add option to disable pcspk
Bugzilla: 516672
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>

Disable the use of pcspeaker as a sound card in qemu.  pcspeaker port
still works.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 qemu/configure  |   12 ++++++++++++
 qemu/hw/pcspk.c |    4 +++-
 qemu/vl.c       |    2 ++
 3 files changed, 17 insertions(+), 1 deletions(-)

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 qemu/configure  |   12 ++++++++++++
 qemu/hw/pcspk.c |    4 +++-
 qemu/vl.c       |    2 ++
 3 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/qemu/configure b/qemu/configure
index 12aba39..714d312 100755
--- a/qemu/configure
+++ b/qemu/configure
@@ -185,6 +185,7 @@ usb_bluez="yes"
 vmware="yes"
 nbd="yes"
 x86_only_generic_cpus="no"
+pcspk="yes"
 kvm=""
 kvm_nested="yes"
 kvm_cap_pit=""
@@ -443,6 +444,10 @@ for opt do
   ;;
   --disable-x86-non-generic-cpus) x86_only_generic_cpus="yes"
   ;;
+  --disable-pcspk) pcspk="no"
+  ;;
+  --enable-pcspk) pcspk="yes"
+  ;;
   --disable-kvm) kvm="no"
   ;;
   --enable-kvm) kvm="yes"
@@ -614,6 +619,8 @@ echo "  --disable-usb-wacom      disable usb wacom tablets"
 echo "  --disable-usb-serial     disable usb serial"
 echo "  --disable-vmware         disable vmware drivers"
 echo "  --disable-nbd            disable nbd support"
+echo "  --disable-pcspk          disable pc speaker sound card support"
+echo "  --enable-pcspk           enable pc speaker sound card support"
 echo "  --disable-kvm-nested     disable KVM nested support"
 echo "  --enable-kvm-nested      enable KVM nested support"
 echo "  --disable-kvm            disable KVM acceleration support"
@@ -1398,6 +1405,7 @@ echo "USB net           $usb_net"
 echo "USB bluez         $usb_bluez"
 echo "VMware drivers    $vmware"
 echo "NBD support       $nbd"
+echo "PCSPK support     $pcspk"
 echo "bluetooth support $bluez"
 echo "Only generic cpus $x86_only_generic_cpus"
 
@@ -1730,6 +1738,10 @@ fi
 if test "$x86_only_generic_cpus" = "yes" ; then
   echo "#define CONFIG_X86_ONLY_GENERIC_CPUS 1" >> $config_h
 fi
+if test "$pcspk" = "yes" ; then
+  echo "CONFIG_PCSPK=yes" >> $config_mak
+  echo "#define CONFIG_PCSPK 1" >> $config_h
+fi
 if test "$aio" = "yes" ; then
   echo "#define CONFIG_AIO 1" >> $config_h
   echo "CONFIG_AIO=yes" >> $config_mak
diff --git a/qemu/hw/pcspk.c b/qemu/hw/pcspk.c
index ec1d0c6..c4ae144 100644
--- a/qemu/hw/pcspk.c
+++ b/qemu/hw/pcspk.c
@@ -45,9 +45,10 @@ typedef struct {
     int dummy_refresh_clock;
 } PCSpkState;
 
-static const char *s_spk = "pcspk";
 static PCSpkState pcspk_state;
 
+#ifdef CONFIG_PCSPK
+static const char *s_spk = "pcspk";
 static inline void generate_samples(PCSpkState *s)
 {
     unsigned int i;
@@ -115,6 +116,7 @@ int pcspk_audio_init(AudioState *audio, qemu_irq *pic)
 
     return 0;
 }
+#endif
 
 static uint32_t pcspk_ioport_read(void *opaque, uint32_t addr)
 {
diff --git a/qemu/vl.c b/qemu/vl.c
index ef82b42..e493fc7 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -4745,6 +4745,7 @@ static void read_passwords(void)
 #ifdef HAS_AUDIO
 struct soundhw soundhw[] = {
 #ifdef HAS_AUDIO_CHOICE
+#ifdef CONFIG_PCSPK
 #if defined(TARGET_I386) || defined(TARGET_MIPS)
     {
         "pcspk",
@@ -4754,6 +4755,7 @@ struct soundhw soundhw[] = {
         { .init_isa = pcspk_audio_init }
     },
 #endif
+#endif
 
 #ifdef CONFIG_SB16
     {
-- 
1.6.3.rc4.29.g8146