blktap2: Add tap_ctl_find_minor

Slack 'tap-ctl find -t <type> -f <path>'.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
This commit is contained in:
Keir Fraser committed 2010-06-10 08:26:42 +01:00
1 parent a7d2464734
commit 486d4e64a0
2 files changed
+31

No files matched your search

+30
View File
@@ -504,3 +504,33 @@ out:
return err;
}
int
tap_ctl_find_minor(const char *type, const char *path)
{
tap_list_t **list, **_entry;
int minor, err;
err = tap_ctl_list(&list);
if (err)
return err;
minor = -1;
for (_entry = list; *_entry != NULL; ++_entry) {
tap_list_t *entry = *_entry;
if (type && (!entry->type || strcmp(entry->type, type)))
continue;
if (path && (!entry->path || strcmp(entry->path, path)))
continue;
minor = entry->minor;
break;
}
tap_ctl_free_list(list);
return minor >= 0 ? minor : -ENOENT;
}
+1
View File
@@ -77,6 +77,7 @@ int tap_ctl_get_driver_id(const char *handle);
int tap_ctl_list(tap_list_t ***list);
void tap_ctl_free_list(tap_list_t **list);
int tap_ctl_find_minor(const char *type, const char *path);
int tap_ctl_allocate(int *minor, char **devname);
int tap_ctl_free(const int minor);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.