plugins/nbd/nbd.c
/* Called for each key=value passed on the command line.  This plugin
 * accepts socket=<sockname> (required for now) and export=<name> (optional).
 */
Called for each key=value passed on the command line.  This plugin
accepts socket= (required for now) and export= (optional).
Called for each key = value passed on the command line . This plugin accepts socket = ( required for now ) and export = ( optional ) .
static int
nbd_config (const char *key, const char *value)
{
  if (strcmp (key, "socket") == 0) {
    free (sockname);
    sockname = nbdkit_absolute_path (value);
    if (!sockname)
      return -1;
  }
  else if (strcmp (key, "export") == 0) {
    free (export);
    export = strdup (value);
    if (!export) {
      nbdkit_error ("memory failure: %m");
      return -1;
    }
  }
  else {
    nbdkit_error ("unknown parameter '%s'", key);
    return -1;
  }
  return 0;
}
static int nbd_config ( const char * key , const char * value ) { if ( strcmp ( key , " " ) == 0 ) { free ( sockname ) ; sockname = nbdkit_absolute_path ( value ) ; if ( ! sockname ) return -1 ; } else if ( strcmp ( key , " " ) == 0 ) { free ( export ) ; export = strdup ( value ) ; if ( ! export ) { nbdkit_error ( " " ) ; return -1 ; } } else { nbdkit_error ( " " , key ) ; return -1 ; } return 0 ; }
Called for each key=value passed on the command line.
Called for each key = value passed on the command line .
/* See FILENAMES AND PATHS in nbdkit-plugin(3) */