FAQ Search Today's Posts Mark Forums Read

» Linux Archive
Home
New Posts
Search
FAQ


Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 07-09-2008, 03:21 PM
Cole Robinson
 
Default virtinst: add --sound option to virt-install

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@redhat.com>"
# 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@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-09-2008, 03:25 PM
"Daniel P. Berrange"
 
Default virtinst: add --sound option to virt-install

On Wed, Jul 09, 2008 at 11:21:39AM -0400, Cole Robinson wrote:
> 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.

> @@ -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)

You want to skip this unless explicitly 'hvm' - paravirt Xen and
container based virt have no sound support.

Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 01:33 AM.

VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org