[gnome-boxes/gnome-3-20] vm-configurator: Don't expose SPICE in existing VMs



commit 77ae49773a6241a73ae81ad4ce84c5c2bb6da91d
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Apr 21 16:49:18 2016 +0100

    vm-configurator: Don't expose SPICE in existing VMs
    
    Update configuration of existing local VMs on launch to not expose SPICE
    connection on TCP so other users can't connect to the display.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738573

 src/vm-configurator.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index e646b59..9548e63 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -245,9 +245,12 @@ private class Boxes.VMConfigurator {
         // First remove existing network interface device
         GLib.List<GVirConfig.DomainDevice> devices = null;
         DomainInterface iface = null;
+        DomainGraphicsSpice graphics = null;
         foreach (var device in domain.get_devices ()) {
             if (device is DomainInterface)
                 iface = device as DomainInterface;
+            else if (device is DomainGraphicsSpice)
+                graphics = device as DomainGraphicsSpice;
             else
                 devices.prepend (device);
         }
@@ -261,6 +264,9 @@ private class Boxes.VMConfigurator {
 
             add_network_interface (domain, bridge, virtio);
         }
+
+        if (graphics != null)
+            add_graphics_device (domain);
     }
 
     public static void set_target_media_config (Domain         domain,


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