[gnome-boxes] vm-configurator: Use 'virtio-net' when supported



commit e41bcffac79e8a9ca53cb74b4ba70cba2a71c778
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Sep 10 04:06:17 2013 +0300

    vm-configurator: Use 'virtio-net' when supported
    
    Lets make networking fast when possible. Also this is the first step
    towards fixing network in gnome ostree images.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706012

 src/installer-media.vala |    6 ++++++
 src/vm-configurator.vala |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/installer-media.vala b/src/installer-media.vala
index 6f9da76..86a8421 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -32,6 +32,12 @@ private class Boxes.InstallerMedia : GLib.Object {
         }
     }
 
+    public bool supports_virtio_net {
+        get {
+            return (find_device_by_prop (supported_devices, DEVICE_PROP_NAME, "virtio-net") != null);
+        }
+    }
+
     public virtual bool live { get { return os_media == null || os_media.live; } }
 
     protected virtual string? architecture {
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index 8c9dd02..491a2ec 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -104,6 +104,8 @@ private class Boxes.VMConfigurator {
         domain.add_device (console);
 
         var iface = new DomainInterfaceUser ();
+        if (install_media.supports_virtio_net)
+            iface.set_model ("virtio");
         domain.add_device (iface);
 
         return domain;


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