[gnome-boxes/wip/clone: 10/16] vm-importer: Add protected virtual post_import_setup()



commit 7e09fd3e335ac6fcb2013ce8a1876233baa46501
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue May 3 21:45:56 2016 +0100

    vm-importer: Add protected virtual post_import_setup()
    
    Put all post import setup into a separate virtual protected method.
    We'll use this in a following patch when we add a new subclass of
    VMImporter to implement cloning of existing VMs.

 src/vm-importer.vala |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/vm-importer.vala b/src/vm-importer.vala
index f8e4901..2eb8c9a 100644
--- a/src/vm-importer.vala
+++ b/src/vm-importer.vala
@@ -30,6 +30,10 @@ private class Boxes.VMImporter : Boxes.VMCreator {
         yield import_vm (machine);
     }
 
+    protected virtual async void post_import_setup (LibvirtMachine machine) {
+        set_post_install_config (machine);
+    }
+
     private async void import_vm (LibvirtMachine machine) {
         try {
             var destination_path = machine.storage_volume.get_path ();
@@ -50,7 +54,7 @@ private class Boxes.VMImporter : Boxes.VMCreator {
             return;
         }
 
-        set_post_install_config (machine);
+        yield post_import_setup (machine);
         if (start_after_import) {
             try {
                 machine.domain.start (0);


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