[PATCH 2/2] virtinst: add --sound option to virt-install

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In virt-install I added a boolean --sound option which defaults
to adding the es1370 device, which seems to be sufficient for
most modern distros. I'm not sure if this option should be
adjusted to allow the user to specify sound models but it seems
like added complexity for an undetermined use case.

Thanks,
Cole

# HG changeset patch
# User "Cole Robinson <crobinso@xxxxxxxxxx>"
# Date 1215131012 14400
# Node ID 6e23ea53ca5ad81afbf8e2a61c8f40fa63c4f890
# Parent  b19ba2a8a5d7c62b006e6e50830d5651941b8d74
Add --sound option to virt-install, which adds 'es1370' audio model

diff -r b19ba2a8a5d7 -r 6e23ea53ca5a virt-install
--- a/virt-install	Thu Jul 03 22:16:42 2008 -0400
+++ b/virt-install	Thu Jul 03 20:23:32 2008 -0400
@@ -266,7 +266,8 @@
     parser.add_option("", "--arch", type="string", dest="arch",
                       action="callback", callback=cli.check_before_store,
                       help=_("The CPU architecture to simulate"))
-    
+    parser.add_option("", "--sound", action="store_true", dest="sound",
+                      default=False, help=_("Use sound device emulation"))
     # paravirt options
     parser.add_option("-p", "--paravirt", action="store_true", dest="paravirt",
                       help=_("This guest should be a paravirtualized guest"))
@@ -405,6 +406,7 @@
     cli.get_memory(options.memory, guest)
     cli.get_uuid(options.uuid, guest)
     cli.get_vcpus(options.vcpus, options.check_cpu, guest, conn)
+    cli.get_sound(options.sound, guest)
 
     # set up cpuset
     if type == "xen":
diff -r b19ba2a8a5d7 -r 6e23ea53ca5a virtinst/cli.py
--- a/virtinst/cli.py	Thu Jul 03 22:16:42 2008 -0400
+++ b/virtinst/cli.py	Thu Jul 03 20:23:32 2008 -0400
@@ -28,7 +28,7 @@
 import libvirt
 import util
 from virtinst import Guest, CapabilitiesParser, VirtualNetworkInterface, \
-                     VirtualGraphics
+                     VirtualGraphics, VirtualAudio
 from virtinst import _virtinst as _
 
 MIN_RAM = 64
@@ -330,6 +330,14 @@
     if keymap:
         guest.graphics_dev.keymap = keymap
 
+def get_sound(sound, guest):
+
+    # Sound is just a boolean value, so just specify a default of 'es1370'
+    # model since this should provide audio out of the box for most modern
+    # distros
+    if sound:
+        guest.sound_devs.append(VirtualAudio(model="es1370"))
+
 ### Option parsing
 def check_before_store(option, opt_str, value, parser):
     if len(value) == 0:
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux