if (mountAs == null) {
throw new CannotTranslateException("a disk is missing mountAs");
}
file.setMountAs(mountAs);
final DiskPermissions_Type perms = bd.getPermissions();
if (perms == null) {
file.setDiskPerms(VMFile.DISKPERMS_ReadWrite);
} else if (perms.equals(DiskPermissions_Type.ReadOnly)) {
file.setDiskPerms(VMFile.DISKPERMS_ReadOnly);
} else if (perms.equals(DiskPermissions_Type.ReadWrite)) {
file.setDiskPerms(VMFile.DISKPERMS_ReadWrite);
} else {
throw new CannotTranslateException(
"unknown disk permission: '" + perms + "'");
}