Lines Matching refs:sh
51 suri_getsvcstate(struct suri_handle *sh, int *status, char *svcname)
59 suri_err_set_desc(sh, "%s: \"%s\"",
77 suri_enable_service(struct suri_handle *sh, char *svcname)
83 if ((ret = suri_getsvcstate(sh, &status, svcname)) != ESURI_OK)
93 return (suri_err_set_static_desc(sh, ESURI_NOMEM));
98 suri_err_set_desc(sh, "%s \"%s\": %s",
109 suri_err_set_desc(sh, "%s \"%s\"",
119 suri_err_set_desc(sh, "%s \"%s\": %s %d",
128 if ((ret = suri_getsvcstate(sh, &status, svcname)) != ESURI_OK)
132 suri_err_set_desc(sh, "%s: \"%s\"",
140 suri_err_set_desc(sh, "%s: \"%s\"", ERR_SURI_SVC_ENABLE,
167 suri_enforce_real_devpath(struct suri_handle *sh, const char *path,
174 assert(suri_enforce_block_dev(sh, path, B_FALSE) == ESURI_OK);
176 return (suri_err_set_static_desc(sh, ESURI_NAMETOOLONG));
179 return (suri_err_set_static_desc(sh, ESURI_NOMEM));
184 suri_err_set_desc(sh, "%s: %s",
187 suri_err_set_desc(sh, "%s: %s: \"%s\"",
196 return (suri_err_set_static_desc(sh, ESURI_NOMEM));
203 ret = suri_err_set_static_desc(sh, ESURI_NOMEM);
207 ret = suri_err_set_static_desc(sh, ESURI_NAMETOOLONG);
212 suri_err_set_desc(sh, "%s", SURI_NON_CANON);
214 suri_err_set_desc(sh, "%s: \"%s\"",
257 suri_enforce_reg_file(struct suri_handle *sh, const char *path)
267 suri_err_set_desc(sh, "%s: \"%s\"",
271 suri_err_set_desc(sh, "%s: %s: \"%s\"",
276 suri_err_set_desc(sh, "%s: \"%s\"",
290 suri_enforce_block_dev(struct suri_handle *sh, const char *path,
298 suri_err_set_desc(sh, "%s", ERR_SURI_NOT_IN_SLASH_DEV);
300 suri_err_set_desc(sh, "%s: \"%s\"",
308 suri_err_set_desc(sh, "%s", SURI_NO_SUCH_DEV);
310 suri_err_set_desc(sh, "%s: \"%s\"",
316 suri_err_set_desc(sh, "%s: %s",
319 suri_err_set_desc(sh, "%s: %s: \"%s\"",
326 suri_err_set_desc(sh, "%s:", SURI_NOT_BLOCK_DEVICE);
328 suri_err_set_desc(sh, "%s: \"%s\"",
340 suri_open_lofictl(struct suri_handle *sh, int *lfd, major_t *major)
345 suri_err_set_desc(sh, "%s: %s: \"%s\"",
353 suri_err_set_desc(sh, "%s: %s: \"%s\"",
375 suri_wait_until_dev_complete(struct suri_handle *sh, int minor)
412 suri_err_set_desc(sh, "%s: \"%s\"",
417 suri_err_set_desc(sh, "%s: \"%s\"",
429 suri_lofi_map(struct suri_handle *sh, boolean_t lookup_only)
434 suri_file_t *suri_file = SURIH2FILE(sh);
436 if ((ret = suri_open_lofictl(sh, &lfd, NULL)) != ESURI_OK)
446 suri_err_set_desc(sh, "%s: \"%s\"",
453 suri_err_set_desc(sh, "%s: %s: \"%s\"",
459 ret = suri_wait_until_dev_complete(sh, li.li_minor);
463 (void) snprintf(sh->sh_mdev, sizeof (sh->sh_mdev),
473 devname_to_major_minor(struct suri_handle *sh, major_t *major, minor_t *minor)
477 assert(sh->sh_mdev[0] != '\0');
478 if (stat64(sh->sh_mdev, &st) == -1) {
479 suri_err_set_desc(sh, "%s: %s: \"%s\"",
481 strerror(errno), sh->sh_mdev);
495 suri_lofi_lookup_uri(struct suri_handle *sh)
501 suri_file_t *suri_file = SURIH2FILE(sh);
504 if ((ret = devname_to_major_minor(sh, &dev_major,
508 if ((ret = suri_open_lofictl(sh, &fd, &lofi_major)) != ESURI_OK)
511 suri_err_set_desc(sh, "%s: \"%s\"",
512 SURIGTEXT("Not a lofi device"), sh->sh_mdev);
517 suri_err_set_desc(sh, "%s: %s: \"%s\"",
519 strerror(errno), sh->sh_mdev);
536 suri_lofi_unmap(struct suri_handle *sh)
541 suri_file_t *suri_file = SURIH2FILE(sh);
543 if ((ret = suri_open_lofictl(sh, &fd, NULL)) != ESURI_OK)
562 suri_err_set_desc(sh, "%s: \"%s\"",
568 suri_err_set_desc(sh, "%s: \"%s\"",
574 suri_err_set_desc(sh, "%s: %s: \"%s\"",
719 suri_resolve_hostname(struct suri_handle *sh, struct addrinfo **res)
727 assert(sh->sh_uri_type == SURI_TYPE_ISCSI);
728 suri_iscsi = SURIH2ISCSI(sh);
732 return (suri_err_set_static_desc(sh, ESURI_NOMEM));
747 suri_err_set_desc(sh, "%s: %s: \"%s\"",