[gnome-boxes] unattended-installer: Rely on osinfo-db for set_*_disk()



commit 2e796c5ada462f67e1d9658c46c60399a8ba94c2
Author: Fabiano FidĂȘncio <fidencio redhat com>
Date:   Wed Jun 12 13:15:56 2019 +0200

    unattended-installer: Rely on osinfo-db for set_*_disk()
    
    osinfo-db already implements the logic to select which target, script,
    avatar, pre-install, and post-install disks should be used for each OS.
    
    Let's drop this logic from Boxes and rely more on osinfo-db.
    
    Note: The current logic in Boxes is broken for anything but Linuxes. It,
    by luck, works on Windows but we should *never* *ever* blindly set the
    same device for the install script config and for the (libvirt-glib)
    disk object as the former may need to deal with things like "/dev/vda" &
    "E", while the latter *only* deals with "/dev/vda" kind of paths.
    
    Signed-off-by: Fabiano FidĂȘncio <fidencio redhat com>

 src/unattended-installer.vala | 18 ------------------
 1 file changed, 18 deletions(-)
---
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index e2ac20f4..49dd56d4 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -265,27 +265,9 @@ public void configure_install_script (InstallScript script) {
         config.set_hostname (hostname);
         config.set_hardware_arch (os_media.architecture);
 
-        // FIXME: Ideally, we shouldn't need to check for distro
-        if (os.distro == "win")
-            config.set_target_disk ("C");
-        else
-            config.set_target_disk (supports_virtio_disk || supports_virtio1_disk? "/dev/vda" : "/dev/sda");
-
-        var disk_config = get_unattended_disk_config (script.path_format);
-        var device_path = device_name_to_path (script.path_format, disk_config.get_target_dev ());
-        config.set_script_disk (device_path);
-
         if (avatar_file != null) {
             var location = ((script.path_format == PathFormat.UNIX)? "/" : "\\") + avatar_file.dest_name;
             config.set_avatar_location (location);
-            config.set_avatar_disk (config.get_script_disk ());
-        }
-
-        config.set_pre_install_drivers_disk (config.get_script_disk ());
-        if (secondary_disk_file != null) {
-            disk_config = get_secondary_unattended_disk_config (script.path_format);
-            device_path = device_name_to_path (script.path_format, disk_config.get_target_dev ());
-            config.set_post_install_drivers_disk (device_path);
         }
 
         config.set_driver_signing (driver_signing);


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