[gnome-boxes] vm-configurator: Only update config of our VMs



commit 63f73ea92d091fac311519498f21498ddb591085
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Fri Jun 24 18:36:10 2016 +0100

    vm-configurator: Only update config of our VMs
    
    Only update domain config if the domain in question was created and
    managed by us.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767613

 src/vm-configurator.vala |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index 13cb0d2..affb090 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -236,6 +236,9 @@ private class Boxes.VMConfigurator {
 
     public static async void update_existing_domain (Domain          domain,
                                                      GVir.Connection connection) {
+        if (!boxes_created_domain (domain))
+            return;
+
         try {
             var cpu = domain.get_cpu ();
             if (cpu != null &&
@@ -422,6 +425,14 @@ private class Boxes.VMConfigurator {
         return null;
     }
 
+    private static bool boxes_created_domain (Domain domain) {
+        var xml = domain.get_custom_xml (BOXES_NS_URI);
+        if (xml == null)
+            xml = domain.get_custom_xml (BOXES_OLD_NS_URI);
+
+        return (xml != null);
+    }
+
     private static void update_custom_xml (Domain domain,
                                            InstallerMedia? install_media,
                                            uint num_reboots = 0,


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