WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] blktap2: Add tap_ctl_find_minor

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] blktap2: Add tap_ctl_find_minor
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 10 Jun 2010 02:25:25 -0700
Delivery-date: Thu, 10 Jun 2010 02:27:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1276154802 -3600
# Node ID 9abf7f50fdc42a80c677c2773b16e1b180033f89
# Parent  a34358c64b63c803fcf51c8b31718946d172eccd
blktap2: Add tap_ctl_find_minor

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

Signed-off-by: Daniel Stodden <daniel.stodden@xxxxxxxxxx>
---
 tools/blktap2/control/tap-ctl-list.c |   30 ++++++++++++++++++++++++++++++
 tools/blktap2/control/tap-ctl.h      |    1 +
 2 files changed, 31 insertions(+)

diff -r a34358c64b63 -r 9abf7f50fdc4 tools/blktap2/control/tap-ctl-list.c
--- a/tools/blktap2/control/tap-ctl-list.c      Thu Jun 10 08:25:55 2010 +0100
+++ b/tools/blktap2/control/tap-ctl-list.c      Thu Jun 10 08:26:42 2010 +0100
@@ -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;
+}
diff -r a34358c64b63 -r 9abf7f50fdc4 tools/blktap2/control/tap-ctl.h
--- a/tools/blktap2/control/tap-ctl.h   Thu Jun 10 08:25:55 2010 +0100
+++ b/tools/blktap2/control/tap-ctl.h   Thu Jun 10 08:26:42 2010 +0100
@@ -77,6 +77,7 @@ int tap_ctl_get_driver_id(const char *ha
 
 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);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] blktap2: Add tap_ctl_find_minor, Xen patchbot-unstable <=