]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
libxl: support soundhw for hvm domains
authorJim Fehlig <jfehlig@suse.com>
Mon, 4 May 2015 19:50:10 +0000 (13:50 -0600)
committerJim Fehlig <jfehlig@suse.com>
Tue, 5 May 2015 15:19:37 +0000 (09:19 -0600)
The xend driver and the parsing/formating code in src/xenconfig
have long supported soundhw.  Add support in the libxl driver too.

src/libxl/libxl_conf.c

index 2a09190bcc48488f6662566746db2aa375dc4457..fccada5aec22dab8383cd34e05826eba3112e2c9 100644 (file)
@@ -678,6 +678,19 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
                 libxl_defbool_set(&b_info->u.hvm.hpet, 1);
             }
         }
+
+        if (def->nsounds > 0) {
+            /*
+             * Use first sound device.  man xl.cfg(5) describes soundhw as
+             * a single device.  From the man page: soundhw=DEVICE
+             */
+            virDomainSoundDefPtr snd = def->sounds[0];
+
+            if (VIR_STRDUP(b_info->u.hvm.soundhw,
+                           virDomainSoundModelTypeToString(snd->model)) < 0)
+                return -1;
+        }
+
         for (i = 0; i < def->os.nBootDevs; i++) {
             switch (def->os.bootDevs[i]) {
                 case VIR_DOMAIN_BOOT_FLOPPY: