dom0/qvm-block: fix error handler

This commit is contained in:
Marek Marczykowski 2012-07-30 20:38:45 +02:00
parent c2d4b0de62
commit 4ffe3e0391

View File

@ -342,7 +342,7 @@ def block_attach(vm, backend_vm, device, frontend=None, mode="w", auto_detach=Fa
elif int(be_state) > 4:
# Error
error = xs.read('', '/local/domain/%d/error/backend/vbd/%d/%d/error' % (backend_vm.xid, vm.xid, block_name_to_devid(frontend)))
if error is None:
if error is not None:
raise QubesException("Error while connecting block device: " + error)
else:
raise QubesException("Unknown error while connecting block device")