[gnome-boxes/improve-storage-management-ux: 1/5] libvirt-mavhine: Return domain_disk also for external disks




commit e5e422052cbf927694c209220098b204c7a77e83
Author: Felipe Borges <felipeborges gnome org>
Date:   Mon Dec 13 16:01:34 2021 +0100

    libvirt-mavhine: Return domain_disk also for external disks
    
    We used to return a DomainDisk object only when the disk was internal
    to Boxes (created by us).
    
    This returns whatever disk is assigned to the virtual machine, be
    it internal or external.

 src/libvirt-machine.vala | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/libvirt-machine.vala b/src/libvirt-machine.vala
index d07d7cac..26d1fe12 100644
--- a/src/libvirt-machine.vala
+++ b/src/libvirt-machine.vala
@@ -419,14 +419,11 @@ public void try_shutdown () {
             if (device_config is GVirConfig.DomainDisk) {
                 var disk_config = device_config as GVirConfig.DomainDisk;
                 var disk_type = disk_config.get_guest_device_type ();
-                var storage_volume_path = (storage_volume != null)? storage_volume.get_path () : null;
 
-                // Prefer Boxes' managed volume over other disks
-                if (disk_type == GVirConfig.DomainDiskGuestDeviceType.DISK &&
-                    disk_config.get_source () == storage_volume_path) {
+                if (disk_type == GVirConfig.DomainDiskGuestDeviceType.DISK) {
                     disk = Object.new (typeof (GVir.DomainDisk),
                                        "domain", domain,
-                                       "config", device_config) as GVir.DomainDisk;
+                                       "config", disk_config) as GVir.DomainDisk;
 
                     break;
                 }


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