]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Support ac97 soundcard model
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 20 Jan 2009 22:15:55 +0000 (22:15 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 20 Jan 2009 22:15:55 +0000 (22:15 +0000)
ChangeLog
src/domain_conf.c
src/domain_conf.h
src/xend_internal.c
tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml

index a4fe397cbcf27f1cb670893d9d4abdd8553ddde3..a912ebbb8a70c5269773c97641de3fcddc959069 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Tue Jan 20 22:12:53 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
+
+       * src/domain_conf.c, src/domain_conf.h: Support ac97 soundcard
+       model
+       * src/xend_internal.c: Remove unused APis and restrict the
+       'all' device conversion to just sb16 + es1370
+       * tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml: Revert earlier
+       mistaken change which added pcspk device
+
 Tue Jan 20 22:06:53 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
 
        * python/libvir.c, python/libvir.py: Use global thread
index 8d1cf949173ed332ed94d07bd8f73056e7e6df60..6e3b317ee124b12143e1cc90e0f220456e1e6110 100644 (file)
@@ -121,7 +121,8 @@ VIR_ENUM_IMPL(virDomainChr, VIR_DOMAIN_CHR_TYPE_LAST,
 VIR_ENUM_IMPL(virDomainSoundModel, VIR_DOMAIN_SOUND_MODEL_LAST,
               "sb16",
               "es1370",
-              "pcspk")
+              "pcspk",
+              "ac97")
 
 VIR_ENUM_IMPL(virDomainInput, VIR_DOMAIN_INPUT_TYPE_LAST,
               "mouse",
index 44b5169baca7e808332002ae7e40289a2cd2214a..4b9dcb3344eabaf42fd9dc3c6c22de72905d8bb1 100644 (file)
@@ -236,6 +236,7 @@ enum virDomainSoundModel {
     VIR_DOMAIN_SOUND_MODEL_SB16,
     VIR_DOMAIN_SOUND_MODEL_ES1370,
     VIR_DOMAIN_SOUND_MODEL_PCSPK,
+    VIR_DOMAIN_SOUND_MODEL_ES97,
 
     VIR_DOMAIN_SOUND_MODEL_LAST
 };
index a141adc0d81c990eddaaac5761671ac6e710597c..7bf7658dbf8ce86a85903f9f5e0603d196e2a5dc 100644 (file)
@@ -746,52 +746,6 @@ urlencode(const char *string)
 }
 #endif /* ! PROXY */
 
-/* Applicable sound models */
-static const char *const sound_models[] = { "sb16", "es1370" };
-
-/**
- * is_sound_model_valid:
- * @model : model string to check against whitelist
- *
- * checks passed model string against whitelist of acceptable models
- *
- * Returns 0 if invalid, 1 otherwise
- */
-int is_sound_model_valid(const char *model) {
-    int i;
-
-    for (i = 0; i < sizeof(sound_models)/sizeof(*sound_models); ++i) {
-        if (STREQ(model, sound_models[i])) {
-            return 1;
-        }
-    }
-    return 0;
-}
-
-/**
- * is_sound_model_conflict:
- * @model : model string to look for duplicates of
- * @soundstr : soundhw string for the form m1,m2,m3 ...
- *
- * Returns 0 if no conflict, 1 otherwise
- */
-int is_sound_model_conflict(const char *model, const char *soundstr) {
-
-    char *dupe;
-    char *cur = (char *) soundstr;
-    while ((dupe = strstr(cur, model))) {
-        if (( (dupe == cur) ||                     // (Start of line |
-              (*(dupe - 1) == ',') ) &&            //  Preceded by comma) &
-            ( (dupe[strlen(model)] == ',') ||      // (Ends with comma |
-               (dupe[strlen(model)] == '\0') ))    //  Ends whole string)
-            return 1;
-        else
-            cur = dupe + strlen(model);
-    }
-    return 0;
-}
-
-
 /* PUBLIC FUNCTIONS */
 
 /**
@@ -1866,11 +1820,25 @@ xenDaemonParseSxprSound(virConnectPtr conn,
     if (STREQ(str, "all")) {
         int i;
 
+        /*
+         * Special compatability code for Xen with a bogus
+         * sound=all in config.
+         *
+         * NB delibrately, don't include all possible
+         * sound models anymore, just the 2 that were
+         * historically present in Xen's QEMU.
+         *
+         * ie just es1370 + sb16.
+         *
+         * Hence use of MODEL_ES1370 + 1, instead of MODEL_LAST
+         */
+
         if (VIR_ALLOC_N(def->sounds,
-                        VIR_DOMAIN_SOUND_MODEL_LAST) < 0)
+                        VIR_DOMAIN_SOUND_MODEL_ES1370 + 1) < 0)
             goto no_memory;
 
-        for (i = 0 ; i < VIR_DOMAIN_SOUND_MODEL_LAST ; i++) {
+
+        for (i = 0 ; i < (VIR_DOMAIN_SOUND_MODEL_ES1370 + 1) ; i++) {
             virDomainSoundDefPtr sound;
             if (VIR_ALLOC(sound) < 0)
                 goto no_memory;
index 487e32562fe3a3723c76fd4ed026c43d0f99d710..6a4e9beb580f925166c10be409e60baa8e7f5ac2 100644 (file)
@@ -38,6 +38,5 @@
     <graphics type='vnc' port='5903' autoport='no' keymap='ja'/>
     <sound model='sb16'/>
     <sound model='es1370'/>
-    <sound model='pcspk'/>
   </devices>
 </domain>