mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-13 13:17:57 +03:00
details: Disallow removing the scsi controller if disks attached to it
Through virt-manager, After we removed a virtio-scsi controller which virtual disks still attach to it, Libvirt will add a LSI scsi controller for this guest automatically and trigger a lifecycle event, virt-manager updates and shows this new scsi controller in details panel once it got the lifecycle event. It may confuse user that a LSI scsi controller occurs while one removes the virtio-scsi controller. This patch prevents removing a scsi controller if any disks attaching to it. Signed-off-by: Lin Ma <lma@suse.com>
This commit is contained in:
parent
066b91b2a0
commit
12c5945be0
@ -3003,6 +3003,11 @@ class vmmDetails(vmmGObjectUI):
|
||||
can_remove = False
|
||||
if controller.type == "pci":
|
||||
can_remove = False
|
||||
if controller.type == "scsi":
|
||||
for disk in self.vm.get_disk_devices():
|
||||
if disk.address.compare_controller(controller, disk.bus):
|
||||
can_remove = False
|
||||
break
|
||||
self.widget("config-remove").set_sensitive(can_remove)
|
||||
|
||||
type_label = controller.pretty_desc()
|
||||
|
Loading…
Reference in New Issue
Block a user