FreeBSD/sys/xen/xenbus/xenbusb_back.c
/**
 * \brief Determine and store the XenStore path for the other end of
 *        a split device whose local end is represented by ivars.
 *
 * \param dev    NewBus device_t for this XenBus backend bus instance.
 * \param ivars  Instance variables from the XenBus child device for
 *               which to perform this function.
 *
 * \return  On success, 0. Otherwise an errno value indicating the
 *          type of failure.
 *
 * If successful, the xd_otherend_path field of the child's instance
 * variables will be updated.
 *
 */
\brief Determine and store the XenStore path for the other end of
a split device whose local end is represented by ivars.

\param dev    NewBus device_t for this XenBus backend bus instance.
\param ivars  Instance variables from the XenBus child device for
which to perform this function.

\return  On success, 0. Otherwise an errno value indicating the
type of failure.

If successful, the xd_otherend_path field of the child's instance
variables will be updated.
\ brief Determine and store the XenStore path for the other end of a split device whose local end is represented by ivars . \ param dev NewBus device_t for this XenBus backend bus instance . \ param ivars Instance variables from the XenBus child device for which to perform this function . \ return On success 0 . Otherwise an errno value indicating the type of failure . If successful the xd_otherend_path field of the child ' s instance variables will be updated .
static int
xenbusb_back_get_otherend_node(device_t dev, struct xenbus_device_ivars *ivars)
{
	char *otherend_path;
	int error;
	if (ivars->xd_otherend_path != NULL) {
		free(ivars->xd_otherend_path, M_XENBUS);
		ivars->xd_otherend_path = NULL;
	}
	error = xs_gather(XST_NIL, ivars->xd_node,
	    "frontend-id", "%i", &ivars->xd_otherend_id,
	    "frontend", NULL, &otherend_path,
	    NULL);
	if (error == 0) {
		ivars->xd_otherend_path = strdup(otherend_path, M_XENBUS);
		ivars->xd_otherend_path_len = strlen(otherend_path);
		free(otherend_path, M_XENSTORE);
	}
	return (error);
}
static int xenbusb_back_get_otherend_node ( device_t dev , struct xenbus_device_ivars * ivars ) { char * otherend_path ; int error ; if ( ivars -> xd_otherend_path != NULL ) { free ( ivars -> xd_otherend_path , M_XENBUS ) ; ivars -> xd_otherend_path = NULL ; } error = xs_gather ( XST_NIL , ivars -> xd_node , " " , " " , & ivars -> xd_otherend_id , " " , NULL , & otherend_path , NULL ) ; if ( error == 0 ) { ivars -> xd_otherend_path = strdup ( otherend_path , M_XENBUS ) ; ivars -> xd_otherend_path_len = strlen ( otherend_path ) ; free ( otherend_path , M_XENSTORE ) ; } return ( error ) ; }
\brief Determine and store the XenStore path for the other end of
        a split device whose local end is represented by ivars.
\ brief Determine and store the XenStore path for the other end of a split device whose local end is represented by ivars .