FreeBSD/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
/*
 * zpool remove  <pool> <vdev> ...
 *
 * Removes the given vdev from the pool.  Currently, this supports removing
 * spares, cache, and log devices from the pool.
 */
zpool remove   
Removes the given vdev from the pool.  Currently, this supports removing
spares, cache, and log devices from the pool.
zpool remove Removes the given vdev from the pool . Currently this supports removing spares cache and log devices from the pool .
int
zpool_do_remove(int argc, char **argv)
{
	char *poolname;
	int i, ret = 0;
	zpool_handle_t *zhp;
	argc--;
	argv++;
	if (argc < 1) {
		(void) fprintf(stderr, gettext("missing pool name argument\n"));
		usage(B_FALSE);
	}
	if (argc < 2) {
		(void) fprintf(stderr, gettext("missing device\n"));
		usage(B_FALSE);
	}
	poolname = argv[0];
	if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
		return (1);
	for (i = 1; i < argc; i++) {
		if (zpool_vdev_remove(zhp, argv[i]) != 0)
			ret = 1;
	}
	return (ret);
}
int zpool_do_remove ( int argc , char * * argv ) { char * poolname ; int i , ret = 0 ; zpool_handle_t * zhp ; argc -- ; argv ++ ; if ( argc < 1 ) { ( void ) fprintf ( stderr , gettext ( " \n " ) ) ; usage ( B_FALSE ) ; } if ( argc < 2 ) { ( void ) fprintf ( stderr , gettext ( " \n " ) ) ; usage ( B_FALSE ) ; } poolname = argv [ 0 ] ; if ( ( zhp = zpool_open ( g_zfs , poolname ) ) == NULL ) return ( 1 ) ; for ( i = 1 ; i < argc ; i ++ ) { if ( zpool_vdev_remove ( zhp , argv [ i ] ) != 0 ) ret = 1 ; } return ( ret ) ; }
zpool remove  <pool> <vdev> ...
 Removes the given vdev from the pool.
zpool remove <pool > <vdev > ... Removes the given vdev from the pool .
/* get pool name and check number of arguments */