diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-06-02 10:54:32 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-06-02 10:54:32 +0100 |
commit | ffd4db9a68a04a3502d9240679a272546d81b95e (patch) | |
tree | edf88034fa0fd07747e76dc1401ba79b3123d129 /tools/blktap | |
parent | c1d7e20205d82fa76ef7a84f0af1e01c63b15eb2 (diff) | |
download | xen-ffd4db9a68a04a3502d9240679a272546d81b95e.tar.gz xen-ffd4db9a68a04a3502d9240679a272546d81b95e.tar.bz2 xen-ffd4db9a68a04a3502d9240679a272546d81b95e.zip |
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 <ian.campbell@citrix.com>
Diffstat (limited to 'tools/blktap')
-rw-r--r-- | tools/blktap/drivers/blktapctrl_linux.c | 24 |
1 files changed, 2 insertions, 22 deletions
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; } |