Lines Matching +defs:error +defs:target
65 struct target *
68 struct target *targ;
79 struct target *
82 struct target *targ;
98 target_delete(struct target *targ)
110 int error;
118 error = gethostname(name + strlen(DEFAULT_IQN),
120 if (error != 0)
146 struct target *targ;
154 xo_errx(1, "missing TargetName for target \"%s\"",
159 "sessions for target \"%s\"", targ->t_nickname);
162 xo_errx(1, "invalid target name \"%s\"",
168 xo_errx(1, "missing TargetAddress for target \"%s\"",
191 xo_errx(1, "missing chapIName for target \"%s\"",
195 xo_errx(1, "missing chapSecret for target \"%s\"",
201 "target \"%s\"", targ->t_nickname);
204 "target \"%s\"", targ->t_nickname);
212 const struct target *targ)
217 * XXX: Check bounds and return error instead of silently truncating.
270 kernel_add(int iscsi_fd, const struct target *targ)
273 int error;
277 error = ioctl(iscsi_fd, ISCSISADD, &isa);
278 if (error != 0)
280 return (error);
284 kernel_modify(int iscsi_fd, unsigned int session_id, const struct target *targ)
287 int error;
292 error = ioctl(iscsi_fd, ISCSISMODIFY, &ism);
293 if (error != 0)
295 return (error);
299 kernel_modify_some(int iscsi_fd, unsigned int session_id, const char *target,
308 int error;
320 error = ioctl(iscsi_fd, ISCSISLIST, &isl);
321 if (error != 0 && errno == EMSGSIZE) {
327 if (error != 0)
341 if (target != NULL)
342 strlcpy(conf->isc_target, target, sizeof(conf->isc_target));
358 error = ioctl(iscsi_fd, ISCSISMODIFY, &ism);
359 if (error != 0)
364 kernel_remove(int iscsi_fd, const struct target *targ)
367 int error;
371 error = ioctl(iscsi_fd, ISCSISREMOVE, &isr);
372 if (error != 0)
374 return (error);
381 kernel_list(int iscsi_fd, const struct target *targ __unused,
389 int error;
401 error = ioctl(iscsi_fd, ISCSISLIST, &isl);
402 if (error != 0 && errno == EMSGSIZE) {
408 if (error != 0) {
410 return (error);
437 xo_open_container("target");
458 xo_close_container("target");
561 int error;
574 error = ioctl(iscsi_fd, ISCSISLIST, &isl);
575 if (error != 0 && errno == EMSGSIZE) {
581 if (error != 0) {
583 return (error);
613 xo_error("usage: iscsictl -A -p portal -t target "
620 "[-t target] [-u user] [-s secret] [-e on | off]\n");
623 xo_error(" iscsictl -R [-p portal] [-t target]\n");
637 *target = NULL, *user = NULL, *secret = NULL;
641 int ch, error, iscsi_fd, retval, saved_errno;
644 struct target *targ;
703 target = optarg;
746 if (target != NULL)
763 if (target != NULL)
776 if (target != NULL)
779 if (target == NULL && portal == NULL)
782 if (target != NULL && portal == NULL)
784 if (portal != NULL && target == NULL)
807 if (target != NULL)
830 if (target != NULL)
837 if (target != NULL)
839 } else if (target == NULL && portal == NULL) {
873 if (target != NULL)
902 xo_errx(1, "target %s not found in %s",
914 kernel_modify_some(iscsi_fd, session_id, target, portal,
917 if (Aflag != 0 && target != NULL) {
918 if (valid_iscsi_name(target, xo_warnx) == false)
919 xo_errx(1, "invalid target name \"%s\"", target);
926 targ->t_name = target;
951 error = close(iscsi_fd);
952 if (error != 0)