dom0/qvm-usb: implemented automatic frontend/backend initialization on attach
This commit is contained in:
parent
c0441f19a2
commit
4bb1182228
@ -73,6 +73,8 @@ Known issues
|
|||||||
* System keyboard / mouse are listed and can be detached away
|
* System keyboard / mouse are listed and can be detached away
|
||||||
* Virtual USB devices (ones created by PVUSB frontend) may be listed
|
* Virtual USB devices (ones created by PVUSB frontend) may be listed
|
||||||
* The installation/configuration is not persistent, not retained between reboots
|
* The installation/configuration is not persistent, not retained between reboots
|
||||||
* The name of the default usbvm is hardcoded in qubesutils.py
|
|
||||||
* No logging / audit trail?
|
* No logging / audit trail?
|
||||||
|
* When an attached device is physically unplugged, USB port remains mapped but not displayed in the list
|
||||||
|
* We are not attaching actual devices, but USB ports (different behavior from VMWare, might be confusing)
|
||||||
|
* After device is detached from the frontend and returned back to the backend it is not usable there
|
||||||
|
|
||||||
|
@ -413,9 +413,10 @@ def usb_setup(backend_vm_xid, vm_xid, devid):
|
|||||||
vm_xid - id of the frontend domain
|
vm_xid - id of the frontend domain
|
||||||
devid - id of the pvusb controller
|
devid - id of the pvusb controller
|
||||||
"""
|
"""
|
||||||
|
num_ports = 8
|
||||||
trans = xs.transaction_start()
|
trans = xs.transaction_start()
|
||||||
|
|
||||||
be_path = "/local/domain/%d/backend/vsub/%d/%d" % (backend_vm_xid, vm_xid, devid)
|
be_path = "/local/domain/%d/backend/vusb/%d/%d" % (backend_vm_xid, vm_xid, devid)
|
||||||
fe_path = "/local/domain/%d/device/vusb/%d" % (vm_xid, devid)
|
fe_path = "/local/domain/%d/device/vusb/%d" % (vm_xid, devid)
|
||||||
|
|
||||||
be_perm = [{'dom': backend_vm_xid}, {'dom': vm_xid, 'read': True} ]
|
be_perm = [{'dom': backend_vm_xid}, {'dom': vm_xid, 'read': True} ]
|
||||||
@ -580,8 +581,10 @@ def usb_find_unused_frontend(backend_vm_xid, vm_xid):
|
|||||||
return '%d-%d' % (frontend_dev, port)
|
return '%d-%d' % (frontend_dev, port)
|
||||||
last_frontend_dev = frontend_dev
|
last_frontend_dev = frontend_dev
|
||||||
|
|
||||||
# FIXME: create a new frontend_dev and link it to the backend
|
# create a new frontend_dev and link it to the backend
|
||||||
raise QubesException("No unused frontends in VM %d found" % vm_xid)
|
frontend_dev = last_frontend_dev + 1
|
||||||
|
usb_setup(backend_vm_xid, vm_xid, frontend_dev)
|
||||||
|
return '%d-%d' % (frontend_dev, 1)
|
||||||
|
|
||||||
def usb_attach(vm, backend_vm, device, frontend=None, auto_detach=False, wait=True):
|
def usb_attach(vm, backend_vm, device, frontend=None, auto_detach=False, wait=True):
|
||||||
device_attach_check(vm, backend_vm, device, frontend)
|
device_attach_check(vm, backend_vm, device, frontend)
|
||||||
|
Loading…
Reference in New Issue
Block a user