| 1930 | } |
| 1931 | |
| 1932 | static int |
| 1933 | zfs_ioc_vdev_attach(zfs_cmd_t *zc) |
| 1934 | { |
| 1935 | spa_t *spa; |
| 1936 | nvlist_t *config; |
| 1937 | int replacing = zc->zc_cookie; |
| 1938 | int rebuild = zc->zc_simple; |
| 1939 | int error; |
| 1940 | |
| 1941 | if ((error = spa_open(zc->zc_name, &spa, FTAG)) != 0) |
| 1942 | return (error); |
| 1943 | |
| 1944 | if ((error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size, |
| 1945 | zc->zc_iflags, &config)) == 0) { |
| 1946 | error = spa_vdev_attach(spa, zc->zc_guid, config, replacing, |
| 1947 | rebuild); |
| 1948 | nvlist_free(config); |
| 1949 | } |
| 1950 | |
| 1951 | spa_close(spa, FTAG); |
| 1952 | return (error); |
| 1953 | } |
| 1954 | |
| 1955 | static int |
| 1956 | zfs_ioc_vdev_detach(zfs_cmd_t *zc) |
nothing calls this directly
no test coverage detected