Skip to content

Commit

Permalink
qvm-usb: implement usb_detach_all
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Jun 2, 2016
1 parent d5e06bf commit 767d1f0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/qubesutils.py
Expand Up @@ -653,8 +653,11 @@ def usb_detach(qvmc, vm, device):
# TODO: sanitize and include stdout
raise QubesException('Device detach failed')

def usb_detach_all(vm):
raise NotImplementedError("Detaching all devices from a given VM is not implemented yet")
def usb_detach_all(qvmc, vm):
for dev in usb_list(qvmc).values():
connected_to = dev['connected-to']
if connected_to is not None and connected_to.qid == vm.qid:
usb_detach(qvmc, connected_to, dev)

####### QubesWatch ######

Expand Down

0 comments on commit 767d1f0

Please sign in to comment.