backups: make released block device visible to the block manager
Devices used as part of other device (e.g. LUKS) are marked as unavailable. So after releasing the device it need to be discovered again. Unfortunately udev event isn't triggered on such occasion (only "remove" event for device-mapper dev). This patch triggers this event manually.
This commit is contained in:
parent
02ac37c316
commit
c5ed749c22
@ -81,6 +81,15 @@ def detach_device(dialog, dev_name):
|
|||||||
with dialog.blk_manager.blk_lock:
|
with dialog.blk_manager.blk_lock:
|
||||||
dialog.blk_manager.detach_device(dialog.vm, dev_name)
|
dialog.blk_manager.detach_device(dialog.vm, dev_name)
|
||||||
dialog.blk_manager.update()
|
dialog.blk_manager.update()
|
||||||
|
else:
|
||||||
|
# umount/LUKS remove do not trigger udev event on underlying device,
|
||||||
|
# so trigger it manually - to publish back as available device
|
||||||
|
subprocess.call(["sudo", "udevadm", "trigger", "--action=change",
|
||||||
|
"--subsystem-match=block",
|
||||||
|
"--sysname-match=%s" % dev_name.split(":")[1]])
|
||||||
|
with dialog.blk_manager.blk_lock:
|
||||||
|
dialog.blk_manager.update()
|
||||||
|
|
||||||
|
|
||||||
def fill_appvms_list(dialog):
|
def fill_appvms_list(dialog):
|
||||||
dialog.appvm_combobox.clear()
|
dialog.appvm_combobox.clear()
|
||||||
|
Loading…
Reference in New Issue
Block a user