[gnome-boxes] vm-configurator: Use ICH9 when q35 machine type is supported
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] vm-configurator: Use ICH9 when q35 machine type is supported
- Date: Fri, 12 Oct 2018 14:17:56 +0000 (UTC)
commit 22089787055342b2a310955288556ef395a121c9
Author: Fabiano FidĂȘncio <fidencio redhat com>
Date: Fri Oct 12 09:24:55 2018 +0200
vm-configurator: Use ICH9 when q35 machine type is supported
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1581422
Signed-off-by: Fabiano FidĂȘncio <fidencio redhat com>
src/vm-configurator.vala | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index b97ce820..bf41f03c 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -368,13 +368,22 @@ private static void set_video_config (Domain domain, InstallerMedia install_medi
domain.add_device (video);
}
- private static void set_sound_config (Domain domain, InstallerMedia install_media) {
- var sound = new DomainSound ();
+ private static DomainSoundModel get_sound_model (InstallerMedia install_media) {
+ if (install_media.prefers_ich9)
+ return (DomainSoundModel) DomainSoundModel.ICH9;
+
var device = find_device_by_prop (install_media.supported_devices, DEVICE_PROP_CLASS, "audio");
- var model = (device != null)? get_enum_value (device.get_name (), typeof (DomainSoundModel)) :
- DomainSoundModel.ICH6;
+ if (device == null)
+ return (DomainSoundModel) DomainSoundModel.ICH6;
+
+ var model = get_enum_value (device.get_name (), typeof (DomainSoundModel));
return_if_fail (model != -1);
- sound.set_model ((DomainSoundModel) model);
+ return (DomainSoundModel) model;
+ }
+
+ private static void set_sound_config (Domain domain, InstallerMedia install_media) {
+ var sound = new DomainSound ();
+ sound.set_model (get_sound_model (install_media));
domain.add_device (sound);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]