dom0/qvm-usb: display proper name of vm a device is attached to

This commit is contained in:
Alexandre Bezroutchko 2012-10-10 16:58:20 +02:00
parent c8cb9d00ce
commit b9b2077062

View File

@ -481,7 +481,8 @@ def usb_check_attached(backend_vm, device):
dev = xs.read(xs_trans, '/local/domain/%d/backend/vusb/%s/%s/port/%s' % (backend_vm, vm, frontend_dev, port))
if dev == device:
frontend = "%s-%s" % (frontend_dev, port)
attached_dev = {"xid":int(vm), "frontend": frontend, "devid": device, "vm": "FIXME"}
vm_name = xl_ctx.domid_to_name(int(vm))
attached_dev = {"xid":int(vm), "frontend": frontend, "devid": device, "vm": vm_name}
break
xs.transaction_end(xs_trans)
return attached_dev