def METHOD_NAME(vmId, files, volumeName=None, path=None):
    dirname = isopath = None
    try:
        dirname = tempfile.mkdtemp()
        _decodeFilesIntoDir(files, dirname)
        isopath = path or getFileName(vmId)
        command = [EXT_MKISOFS, '-R', '-J', '-o', isopath]
        if volumeName is not None:
            command.extend(['-V', volumeName])
        command.extend([dirname])
        mode = 0o640
        # pre-create the destination iso path with the right permissions;
        # mkisofs/genisoimage will truncate the content and keep the
        # permissions.
        if os.path.exists(isopath):
            logging.warning("iso file %r exists, removing", isopath)
            rm_file(isopath)
        fd = os.open(isopath, os.O_CREAT | os.O_RDONLY | os.O_EXCL, mode)
        os.close(fd)
        rc, out, err = execCmd(command, raw=True)
        if rc:
            # clean up after ourselves in case of error
            removeFs(isopath)
            # skip _commonCleanFs step for missing iso
            isopath = None
            raise OSError(errno.EIO, "could not create iso file: "
                          "code %s, out %s\nerr %s" % (rc, out, err))
        _check_attributes(isopath, mode)
    finally:
        _commonCleanFs(dirname, isopath)
    return isopath