delete: Track kernel/initrd/dtb as well

This commit is contained in:
Cole Robinson 2014-01-14 17:26:29 -05:00
parent 79ce0dcdc5
commit 330bcd9c8b

View File

@ -242,13 +242,16 @@ def populate_storage_list(storage_list, vm, conn):
model = storage_list.get_model()
model.clear()
for disk in vm.get_disk_devices():
vol = None
diskdata = [(disk.target, disk.path, disk.read_only, disk.shareable) for
disk in vm.get_disk_devices()]
target = disk.target
path = disk.path
ro = disk.read_only
shared = disk.shareable
diskdata.append(("kernel", vm.get_xmlobj().os.kernel, True, False))
diskdata.append(("initrd", vm.get_xmlobj().os.initrd, True, False))
diskdata.append(("dtb", vm.get_xmlobj().os.dtb, True, False))
for target, path, ro, shared in diskdata:
if not path:
continue
# There are a few pieces here
# 1) Can we even delete the storage? If not, make the checkbox
@ -260,9 +263,6 @@ def populate_storage_list(storage_list, vm, conn):
# default? Reasons not to, are if the storage is marked
# readonly or sharable, or is in use by another VM.
if not path:
continue
default = False
definfo = None
vol = conn.get_vol_by_path(path)