Skip to content
Snippets Groups Projects
Commit b4c67e4a authored by Felipe Borges's avatar Felipe Borges
Browse files

vm-configurator: Always enable boot menu

parent 18dd69d4
No related merge requests found
......@@ -261,7 +261,6 @@ public static async void update_existing_domain (Domain domain,
private static void update_domain_devices (Domain domain) throws GLib.Error {
GLib.List<GVirConfig.DomainDevice> devices = null;
DomainInterface iface = null;
bool supports_alternative_boot_device = false;
foreach (var device in domain.get_devices ()) {
// Let's always re-create the graphics device, so we can switch from SPICE
// to VNC and back according to SPICE's availability in the build.
......@@ -300,8 +299,6 @@ else if (device is DomainDisk) {
if (!FileUtils.test (domain_disk.get_source (), FileTest.EXISTS)) {
debug ("CDROM media '%s' cannot be found", domain_disk.get_source ());
domain_disk.set_source ("");
} else {
supports_alternative_boot_device = true;
}
}
}
......@@ -337,25 +334,12 @@ else if (device is DomainDisk) {
}
}
enable_boot_menu (domain, supports_alternative_boot_device);
devices.reverse ();
domain.set_devices (devices);
debug ("Updating domain devices for %s", domain.name);
}
public static void enable_boot_menu (Domain domain, bool enable) {
try {
var os = new DomainOs.from_xml (domain.get_os ().to_xml ());
os.enable_boot_menu (enable);
domain.set_os (os);
} catch (GLib.Error error) {
warning ("Failed to enable boot menu\n");
}
}
public static void set_target_media_config (Domain domain,
string target_path,
InstallerMedia install_media,
......@@ -401,6 +385,7 @@ private static void set_post_install_os_config (Domain domain) {
var boot_devices = old_os.get_boot_devices ();
boot_devices.remove (DomainOsBootDevice.CDROM);
os.set_boot_devices (boot_devices);
os.enable_boot_menu (true);
os.set_arch (old_os.get_arch ());
os.set_machine (old_os.get_machine ());
......@@ -429,6 +414,8 @@ private static void set_os_config (Domain domain, InstallerMedia install_media,
boot_devices.append (DomainOsBootDevice.HD);
os.set_boot_devices (boot_devices);
os.enable_boot_menu (true);
domain.set_os (os);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment