# HG changeset patch
# User Steven Smith <ssmith@xxxxxxxxxxxxx>
# Node ID 593b5623a0d2ac66576baeb275a3b93cad606c9f
# Parent ef8df1e5884ff55b68c24fae44deaa8507a00425
# Parent 2835083c9c916fdad11110c4810ee271943c1cf6
Merge.
---
tools/blktap/drivers/Makefile | 2 +-
tools/blktap/drivers/blktapctrl.c | 30 +++---------------------------
2 files changed, 4 insertions(+), 28 deletions(-)
diff -r ef8df1e5884f -r 593b5623a0d2 tools/blktap/drivers/Makefile
--- a/tools/blktap/drivers/Makefile Fri Sep 29 15:40:19 2006 +0100
+++ b/tools/blktap/drivers/Makefile Fri Sep 29 15:40:35 2006 +0100
@@ -28,7 +28,7 @@ THREADLIB := -lpthread -lz
THREADLIB := -lpthread -lz
LIBS := -L. -L.. -L../lib
LIBS += -L$(XEN_LIBXC)
-LIBS += -lblktap
+LIBS += -lblktap -lxenctrl
LIBS += -lcrypto
LIBS += -lz
LIBS += -L$(XEN_XENSTORE) -lxenstore
diff -r ef8df1e5884f -r 593b5623a0d2 tools/blktap/drivers/blktapctrl.c
--- a/tools/blktap/drivers/blktapctrl.c Fri Sep 29 15:40:19 2006 +0100
+++ b/tools/blktap/drivers/blktapctrl.c Fri Sep 29 15:40:35 2006 +0100
@@ -636,30 +636,6 @@ static void print_drivers(void)
DPRINTF("Found driver: [%s]\n",dtypes[i]->name);
}
-static int find_blktap_major(void)
-{
- FILE *fp;
- int major;
- char device[256];
-
- if ((fp = fopen("/proc/devices", "r")) == NULL)
- return -1;
-
- /* Skip title */
- fscanf(fp,"%*s %*s\n");
- while (fscanf(fp, "%d %255s\n", &major, device) == 2) {
- if (strncmp("blktap", device, 6) == 0)
- break;
- }
-
- fclose(fp);
-
- if (strncmp("blktap", device, 6) == 0)
- return major;
-
- return -1;
-}
-
int main(int argc, char *argv[])
{
char *devname;
@@ -681,11 +657,11 @@ int main(int argc, char *argv[])
register_new_devmap_hook(map_new_blktapctrl);
register_new_unmap_hook(unmap_blktapctrl);
- /*Attach to blktap0 */
+ /* Attach to blktap0 */
asprintf(&devname,"%s/%s0", BLKTAP_DEV_DIR, BLKTAP_DEV_NAME);
- blktap_major = find_blktap_major();
- if (blktap_major < 0)
+ if ((ret = xc_find_device_number("blktap0")) < 0)
goto open_failed;
+ blktap_major = major(ret);
make_blktap_dev(devname,blktap_major,0);
ctlfd = open(devname, O_RDWR);
if (ctlfd == -1) {
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|