ia64/xen-unstable

changeset 11694:593b5623a0d2

Merge.
author Steven Smith <ssmith@xensource.com>
date Fri Sep 29 15:40:35 2006 +0100 (2006-09-29)
parents ef8df1e5884f 2835083c9c91
children 9977b8785570
files
line diff
     1.1 --- a/tools/blktap/drivers/Makefile	Fri Sep 29 15:40:19 2006 +0100
     1.2 +++ b/tools/blktap/drivers/Makefile	Fri Sep 29 15:40:35 2006 +0100
     1.3 @@ -28,7 +28,7 @@ DEPS     = .*.d
     1.4  THREADLIB := -lpthread -lz
     1.5  LIBS      := -L. -L.. -L../lib
     1.6  LIBS      += -L$(XEN_LIBXC)
     1.7 -LIBS      += -lblktap
     1.8 +LIBS      += -lblktap -lxenctrl
     1.9  LIBS      += -lcrypto
    1.10  LIBS      += -lz
    1.11  LIBS      += -L$(XEN_XENSTORE) -lxenstore
     2.1 --- a/tools/blktap/drivers/blktapctrl.c	Fri Sep 29 15:40:19 2006 +0100
     2.2 +++ b/tools/blktap/drivers/blktapctrl.c	Fri Sep 29 15:40:35 2006 +0100
     2.3 @@ -636,30 +636,6 @@ static void print_drivers(void)
     2.4  		DPRINTF("Found driver: [%s]\n",dtypes[i]->name);
     2.5  } 
     2.6  
     2.7 -static int find_blktap_major(void)
     2.8 -{
     2.9 -	FILE *fp;
    2.10 -	int major;
    2.11 -	char device[256];
    2.12 -
    2.13 -	if ((fp = fopen("/proc/devices", "r")) == NULL)
    2.14 -		return -1;
    2.15 -
    2.16 -	/* Skip title */
    2.17 -	fscanf(fp,"%*s %*s\n");
    2.18 -	while (fscanf(fp, "%d %255s\n", &major, device) == 2) {
    2.19 -		if (strncmp("blktap", device, 6) == 0)
    2.20 -			break;
    2.21 -	}
    2.22 -
    2.23 -	fclose(fp);
    2.24 -
    2.25 -	if (strncmp("blktap", device, 6) == 0)
    2.26 -		return major;
    2.27 -
    2.28 -	return -1;
    2.29 -}
    2.30 -
    2.31  int main(int argc, char *argv[])
    2.32  {
    2.33  	char *devname;
    2.34 @@ -681,11 +657,11 @@ int main(int argc, char *argv[])
    2.35  	register_new_devmap_hook(map_new_blktapctrl);
    2.36  	register_new_unmap_hook(unmap_blktapctrl);
    2.37  
    2.38 -	/*Attach to blktap0 */	
    2.39 +	/* Attach to blktap0 */
    2.40  	asprintf(&devname,"%s/%s0", BLKTAP_DEV_DIR, BLKTAP_DEV_NAME);
    2.41 -	blktap_major = find_blktap_major();
    2.42 -	if (blktap_major < 0)
    2.43 +	if ((ret = xc_find_device_number("blktap0")) < 0)
    2.44  		goto open_failed;
    2.45 +	blktap_major = major(ret);
    2.46  	make_blktap_dev(devname,blktap_major,0);
    2.47  	ctlfd = open(devname, O_RDWR);
    2.48  	if (ctlfd == -1) {