Search
j0ke.net Open Build Service
>
Projects
>
GFS
>
multipath-tools
> multipath-tools-sles10-discard-devmapper-update
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File multipath-tools-sles10-discard-devmapper-update of Package multipath-tools
From: Hannes Reinecke <hare@suse.de> Subject: Discard devicemapper update patches This patch reverses the patches d0d111d16e8af297111dc05ec84ddf06e9a109f1 f6cde3c09ce368f51ae64ad23dc780f3671ef4ff as the device-mapper enhancements are not part of SLES10. Signed-off-by: Hannes Reinecke <hare@suse.de> diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index ff4a416..b8571ad 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -27,6 +27,7 @@ #define LOOPS_PER_SEC 5 #define UUID_PREFIX "mpath-" #define UUID_PREFIX_LEN 6 + static void dm_dummy_log (int level, const char *file, int line, const char *f, ...) { @@ -45,35 +46,13 @@ dm_shut_log (void) dm_log_init(&dm_dummy_log); } -static int -dm_libprereq (void) -{ - char version[64]; - int v[3]; - int minv[3] = {1, 2, 11}; - - dm_get_library_version(version, sizeof(version)); - condlog(3, "libdevmapper version %s", version); - sscanf(version, "%d.%d.%d ", &v[0], &v[1], &v[2]); - - if ((v[0] > minv[0]) || - ((v[0] == minv[0]) && (v[1] > minv[1])) || - ((v[0] == minv[0]) && (v[1] == minv[1]) && (v[2] >= minv[2]))) - return 0; - condlog(0, "libdevmapper version must be >= %d.%.2d.%.2d", - minv[0], minv[1], minv[2]); - return 1; -} - -static int -dm_drvprereq (char * str) +extern int +dm_prereq (char * str, int x, int y, int z) { int r = 2; struct dm_task *dmt; struct dm_versions *target; struct dm_versions *last_target; - int minv[3] = {1, 0, 3}; - unsigned int *v; if (!(dmt = dm_task_create(DM_DEVICE_LIST_VERSIONS))) return 3; @@ -84,44 +63,37 @@ dm_drvprereq (char * str) condlog(0, "Can not communicate with kernel DM"); goto out; } + target = dm_task_get_versions(dmt); do { last_target = target; + if (!strncmp(str, target->name, strlen(str))) { - r = 1; + r--; + + if (target->version[0] >= x && + target->version[1] >= y && + target->version[2] >= z) + r--; + break; } + target = (void *) target + target->next; } while (last_target != target); - if (r == 2) { + if (r == 2) condlog(0, "DM multipath kernel driver not loaded"); - goto out; - } - v = target->version; - if ((v[0] > minv[0]) || - ((v[0] == minv[0]) && (v[1] > minv[1])) || - ((v[0] == minv[0]) && (v[1] == minv[1]) && (v[2] >= minv[2]))) { - r = 0; - goto out; - } - condlog(0, "DM multipath kernel driver must be >= %u.%.2u.%.2u", - minv[0], minv[1], minv[2]); + else if (r == 1) + condlog(0, "DM multipath kernel driver version too old"); + out: dm_task_destroy(dmt); return r; } extern int -dm_prereq (char * str) -{ - if (dm_libprereq()) - return 1; - return dm_drvprereq(str); -} - -extern int dm_simplecmd (int task, const char *name) { int r = 0; struct dm_task *dmt; @@ -134,7 +106,6 @@ dm_simplecmd (int task, const char *name dm_task_no_open_count(dmt); dm_task_skip_lockfs(dmt); /* for DM_DEVICE_RESUME */ - dm_task_no_flush(dmt); /* for DM_DEVICE_SUSPEND/RESUME */ r = dm_task_run (dmt); diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h index c023cd4..c7879a7 100644 --- a/libmultipath/devmapper.h +++ b/libmultipath/devmapper.h @@ -1,6 +1,6 @@ void dm_shut_log(void); void dm_restore_log(void); -int dm_prereq (char *); +int dm_prereq (char *, int, int, int); int dm_simplecmd (int, const char *); int dm_addmap (int, const char *, const char *, const char *, unsigned long long, const char *uuid); diff --git a/multipath/main.c b/multipath/main.c index faccdbb..e77a742 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -316,7 +316,7 @@ main (int argc, char *argv[]) exit(1); } - if (dm_prereq(DEFAULT_TARGET)) + if (dm_prereq(DEFAULT_TARGET, 1, 0, 3)) exit(1); if (sysfs_get_mnt_path(sysfs_path, FILE_NAME_SIZE)) {