From ffd4db9a68a04a3502d9240679a272546d81b95e Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 2 Jun 2010 10:54:32 +0100 Subject: tools: assume that special Xen devices have been created by the platform Remove all the magic surrounding the special Xen devices in Linux specific code whereby we attempt to figure out what the correct major:minor number is and check the the existing device has these numbers etc. In 2010 we really should be able to trust that the platform has created the devices correctly or provide correct configuration settings such that they are without resorting to tearing down the platform configured state and rebuilding it. tools/hotplug/Linux/xen-backend.rules already contains the necessary udev rules to create /dev/xen/evtchn and friends in the correct place. Signed-off-by: Ian Campbell --- tools/blktap/drivers/blktapctrl_linux.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'tools/blktap') diff --git a/tools/blktap/drivers/blktapctrl_linux.c b/tools/blktap/drivers/blktapctrl_linux.c index 7977873577..6282fa681a 100644 --- a/tools/blktap/drivers/blktapctrl_linux.c +++ b/tools/blktap/drivers/blktapctrl_linux.c @@ -79,31 +79,11 @@ int blktap_interface_create(int ctlfd, int *major, int *minor, blkif_t *blkif) int blktap_interface_open(void) { - char *devname; - int ret; int ctlfd; - /* Attach to blktap0 */ - if (asprintf(&devname,"%s/%s0", BLKTAP_DEV_DIR, BLKTAP_DEV_NAME) == -1) - goto open_failed; - - ret = xc_find_device_number("blktap0"); - if (ret < 0) { - DPRINTF("couldn't find device number for 'blktap0'\n"); - goto open_failed; - } - - blktap_major = major(ret); - make_blktap_dev(devname,blktap_major, 0); - - ctlfd = open(devname, O_RDWR); - if (ctlfd == -1) { + ctlfd = open(BLKTAP_DEV_DIR "/" BLKTAP_DEV_NAME "0", O_RDWR); + if (ctlfd == -1) DPRINTF("blktap0 open failed\n"); - goto open_failed; - } return ctlfd; - -open_failed: - return -1; } -- cgit v1.2.3