summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/installer-media.vala2
-rw-r--r--src/unattended-installer.vala8
-rw-r--r--src/vm-configurator.vala9
3 files changed, 10 insertions, 9 deletions
diff --git a/src/installer-media.vala b/src/installer-media.vala
index 5b1a4bf..b014bca 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -79,6 +79,8 @@ private class Boxes.InstallerMedia : GLib.Object {
domain.add_device (disk);
}
+ public virtual void setup_spice_config (DomainGraphicsSpice graphics) {}
+
public bool is_architecture_compatible (string architecture) {
return os_media == null || // Unknown media
os_media.architecture == architecture ||
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 1bfdb2b..4c69429 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -32,10 +32,10 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
}
}
- public bool password_mandatory { get; protected set; }
public DataStreamNewlineType newline_type;
public File? disk_file;
+ protected bool password_mandatory;
protected GLib.List<UnattendedFile> unattended_files;
protected Gtk.Table setup_table;
@@ -150,6 +150,12 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
domain.add_device (disk);
}
+ public override void setup_spice_config (DomainGraphicsSpice graphics) {
+ // If guest requires password, we let it take care of authentications and free the user from one
+ // authentication layer.
+ if (express_install && !password_mandatory && password != "")
+ graphics.set_password (password);
+ }
}
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index fb98b62..c4af285 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -64,14 +64,7 @@ private class Boxes.VMConfigurator {
var graphics = new DomainGraphicsSpice ();
graphics.set_autoport (true);
- if (install_media is UnattendedInstaller) {
- var unattended = install_media as UnattendedInstaller;
-
- // If guest requires password, we let it take care of authentications and free the user from one
- // authentication layer.
- if (unattended.express_install && !unattended.password_mandatory && unattended.password != "")
- graphics.set_password (unattended.password);
- }
+ install_media.setup_spice_config (graphics);
domain.add_device (graphics);
// SPICE agent channel. This is needed for features like copy&paste between host and guest etc to work.