diff --git a/core/qubesutils.py b/core/qubesutils.py index ce15dc10..bd080559 100644 --- a/core/qubesutils.py +++ b/core/qubesutils.py @@ -372,7 +372,9 @@ def block_check_attached(qvmc, device): "VM '%s'" % (source.get('type'), vm.name) continue - if backend_name == device['vm'] and path == device['device']: + if backend_name == device['vm'] and (path == device['device'] + or not path.startswith('/dev/') and path == device[ + 'desc']): return { "frontend": disk.find('target').get('dev'), "vm": vm} diff --git a/qvm-tools/qvm-block b/qvm-tools/qvm-block index 3d7a6df8..2a1e9578 100755 --- a/qvm-tools/qvm-block +++ b/qvm-tools/qvm-block @@ -87,6 +87,7 @@ def main(): if options.do_file_attach: dev = {} (dev['vm'], dev['device']) = args[1].split(":") + dev['desc'] = dev['device'] dev['mode'] = 'w' else: dev_list = block_list(qvm_collection)