def create_xrcd(self): """ Initializes self.xrcd with an XRC Domain object. :return: None """ self.temp_file = tempfile.NamedTemporaryFile() self.xrcd_fd = os.open(self.temp_file.name, os.O_RDONLY | os.O_CREAT, stat.S_IRUSR | stat.S_IRGRP) init = XRCDInitAttr( e.IBV_XRCD_INIT_ATTR_FD | e.IBV_XRCD_INIT_ATTR_OFLAGS, os.O_CREAT, self.xrcd_fd) self.xrcd = XRCD(self.ctx, init)
def create_xrcd(self): """ Initializes self.xrcd with an XRC Domain object. :return: None """ self.temp_file = tempfile.NamedTemporaryFile() self.xrcd_fd = os.open(self.temp_file.name, os.O_RDONLY | os.O_CREAT, stat.S_IRUSR | stat.S_IRGRP) init = XRCDInitAttr( e.IBV_XRCD_INIT_ATTR_FD | e.IBV_XRCD_INIT_ATTR_OFLAGS, os.O_CREAT, self.xrcd_fd) try: self.xrcd = XRCD(self.ctx, init) except PyverbsRDMAError as ex: if ex.error_code == errno.EOPNOTSUPP: raise unittest.SkipTest('Create XRCD is not supported') raise ex