[gnome-boxes/drop-system-importer: 5/5] vm-importer: Don't copy the VM storage automatically
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/drop-system-importer: 5/5] vm-importer: Don't copy the VM storage automatically
- Date: Wed, 15 Jan 2020 15:00:08 +0000 (UTC)
commit 2e2ba88edb3c1d2588a4a1d44ab7e3c6eeb56a99
Author: Felipe Borges <felipeborges gnome org>
Date: Wed Apr 24 17:12:27 2019 +0200
vm-importer: Don't copy the VM storage automatically
Users want to connect to VMs wherever they are, instead of working
in local copies of them. For those that want the old behavior, we
will offer an option to "Import" the VM that will actually copy the
storage backend.
src/vm-configurator.vala | 3 +++
src/vm-importer.vala | 23 +++++++++++------------
2 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index 7dba8c49..26aabfe6 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -79,6 +79,9 @@ public static Domain create_domain_config (InstallerMedia install_media, string
clock.add_timer (timer);
domain.set_clock (clock);
+ if (install_media is InstalledMedia)
+ target_path = install_media.device_file;
+
set_target_media_config (domain, target_path, install_media);
install_media.setup_domain_config (domain);
diff --git a/src/vm-importer.vala b/src/vm-importer.vala
index b51d3a5b..8f1c2d57 100644
--- a/src/vm-importer.vala
+++ b/src/vm-importer.vala
@@ -20,18 +20,27 @@ public override void launch_vm (LibvirtMachine machine, int64 access_last_time =
machine.vm_creator = this;
machine.config.access_last_time = (access_last_time > 0)? access_last_time : get_real_time ();
- import_vm.begin (machine);
+ post_import_setup.begin (machine);
}
protected override async void continue_installation (LibvirtMachine machine) {
install_media = yield MediaManager.get_instance ().create_installer_media_from_config
(machine.domain_config);
machine.vm_creator = this;
- yield import_vm (machine);
+ yield post_import_setup (machine);
}
protected virtual async void post_import_setup (LibvirtMachine machine) {
set_post_install_config (machine);
+
+ if (start_after_import) {
+ try {
+ machine.domain.start (0);
+ } catch (GLib.Error error) {
+ warning ("Failed to start domain '%s': %s", machine.domain.get_name (), error.message);
+ }
+ }
+ machine.vm_creator = null;
}
private async void import_vm (LibvirtMachine machine) {
@@ -53,15 +62,5 @@ private async void import_vm (LibvirtMachine machine) {
return;
}
-
- yield post_import_setup (machine);
- if (start_after_import) {
- try {
- machine.domain.start (0);
- } catch (GLib.Error error) {
- warning ("Failed to start domain '%s': %s", machine.domain.get_name (), error.message);
- }
- }
- machine.vm_creator = null;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]