[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] blktap2: human readable output for tapdisk2 creation problems
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1244023807 -3600 # Node ID e7b63b30ae3da2c3184dfa6fc00a816f90a158d5 # Parent 18c8270da77cbb970b3b0498b09ad10481c1e6fb blktap2: human readable output for tapdisk2 creation problems This patch fixes the "file object has no attribute find" failure we've been seeing when starting blktap2 devices and adds more meaningful error output to conditions where the tapdisk2 process is unable to create a blktap2 device. Signed-off-by: Dutch Meyer <dmeyer@xxxxxxxxx> --- tools/python/xen/xend/server/BlktapController.py | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff -r 18c8270da77c -r e7b63b30ae3d tools/python/xen/xend/server/BlktapController.py --- a/tools/python/xen/xend/server/BlktapController.py Wed Jun 03 11:09:14 2009 +0100 +++ b/tools/python/xen/xend/server/BlktapController.py Wed Jun 03 11:10:07 2009 +0100 @@ -32,7 +32,7 @@ def doexec(args, inputtext=None): proc.tochild.write(inputtext) stdout = proc.fromchild stderr = proc.childerr - rc = proc.poll() + rc = proc.wait() return (rc,stdout,stderr) def parseDeviceString(device): @@ -131,7 +131,16 @@ class BlktapController(BlkifController): cmd = [ TAPDISK_BINARY, '-n', '%s:%s' % (params, file) ] (rc,stdout,stderr) = doexec(cmd) - minor, device, control = parseDeviceString(stdout) + if rc != 0: + err = stderr.read(); + out = stdout.read(); + stdout.close(); + stderr.close(); + raise Exception, 'Failed to create device.\n stdout: %s\n stderr: %s\nCheck that target \"%s\" exists and that blktap2 driver installed in dom0.' % (out.rstrip(), err.rstrip(), file); + + minor, device, control = parseDeviceString(stdout.readline()) + stdout.close(); + stderr.close(); #modify the configuration to attach as a vbd, now that the #device is configured. Then continue to create the device _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |