aboutsummaryrefslogtreecommitdiffstats
path: root/tools/blktap2/control/tap-ctl-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/blktap2/control/tap-ctl-list.c')
-rw-r--r--tools/blktap2/control/tap-ctl-list.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/blktap2/control/tap-ctl-list.c b/tools/blktap2/control/tap-ctl-list.c
index 1497270874..c91f6f48d3 100644
--- a/tools/blktap2/control/tap-ctl-list.c
+++ b/tools/blktap2/control/tap-ctl-list.c
@@ -506,17 +506,15 @@ out:
}
int
-tap_ctl_find_minor(const char *type, const char *path)
+tap_ctl_find(const char *type, const char *path, tap_list_t *tap)
{
tap_list_t **list, **_entry;
- int minor, err;
+ int ret = -ENOENT, err;
err = tap_ctl_list(&list);
if (err)
return err;
- minor = -1;
-
for (_entry = list; *_entry != NULL; ++_entry) {
tap_list_t *entry = *_entry;
@@ -526,11 +524,13 @@ tap_ctl_find_minor(const char *type, const char *path)
if (path && (!entry->path || strcmp(entry->path, path)))
continue;
- minor = entry->minor;
+ *tap = *entry;
+ tap->type = tap->path = NULL;
+ ret = 0;
break;
}
tap_ctl_free_list(list);
- return minor >= 0 ? minor : -ENOENT;
+ return ret;
}