fn = "/dev/%s" %(fn,)
if typ in ("tap", "tap2"):
- (taptype, fn) = fn.split(":", 2)[1:3]
+ (taptype, fn) = fn.split(":", 1)
return (fn, taptype)
def blkdev_uname_to_file(uname):
msg = "Bootloader isn't executable"
log.error(msg)
raise VmError(msg)
- attempt = 0
- while True:
- if not os.access(disk, os.R_OK) and attempt > 3:
- msg = "Disk isn't accessible"
- log.error(msg)
- raise VmError(msg)
- else:
- break
- attempt = attempt + 1
+ if not os.access(disk, os.R_OK):
+ msg = "Disk isn't accessible"
+ log.error(msg)
+ raise VmError(msg)
if os.uname()[0] == "NetBSD" and disk.startswith('/dev/'):
disk = disk.replace("/dev/", "/dev/r")
log.info("Unmounting %s from %s." %
(fn, BOOTLOADER_LOOPBACK_DEVICE))
- dom0.destroyDevice(devtype, BOOTLOADER_LOOPBACK_DEVICE, force = True)
+ dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE)
if blcfg is None:
msg = "Had a bootloader specified, but can't find disk"