summaryrefslogtreecommitdiffstats
path: root/0037-RHBZ-768873-fix-rename.patch
blob: 7e05bd07cc3899abf14bcdf80b94ef32cf4f35b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
 libmultipath/devmapper.c |   45 ---------------------------------------------
 libmultipath/devmapper.h |    1 -
 libmultipath/propsel.c   |    2 --
 3 files changed, 48 deletions(-)

Index: multipath-tools-130222/libmultipath/devmapper.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/devmapper.c
+++ multipath-tools-130222/libmultipath/devmapper.c
@@ -917,51 +917,6 @@ out:
 	return r;
 }
 
-extern char *
-dm_get_name(char *uuid)
-{
-	struct dm_task *dmt;
-	struct dm_info info;
-	char *prefixed_uuid, *name = NULL;
-	const char *nametmp;
-
-	dmt = dm_task_create(DM_DEVICE_INFO);
-	if (!dmt)
-		return NULL;
-
-	prefixed_uuid = MALLOC(UUID_PREFIX_LEN + strlen(uuid) + 1);
-	if (!prefixed_uuid) {
-		condlog(0, "cannot create prefixed uuid : %s",
-			strerror(errno));
-		goto freeout;
-	}
-	sprintf(prefixed_uuid, UUID_PREFIX "%s", uuid);
-	if (!dm_task_set_uuid(dmt, prefixed_uuid))
-		goto freeout;
-
-	if (!dm_task_run(dmt))
-		goto freeout;
-
-	if (!dm_task_get_info(dmt, &info) || !info.exists)
-		goto freeout;
-
-	nametmp = dm_task_get_name(dmt);
-	if (nametmp && strlen(nametmp)) {
-		name = MALLOC(strlen(nametmp) + 1);
-		if (name)
-			strcpy(name, nametmp);
-	} else {
-		condlog(2, "%s: no device-mapper name found", uuid);
-	}
-
-freeout:
-	if (prefixed_uuid)
-		FREE(prefixed_uuid);
-	dm_task_destroy(dmt);
-
-	return name;
-}
-
 int
 dm_geteventnr (char *name)
 {
Index: multipath-tools-130222/libmultipath/devmapper.h
===================================================================
--- multipath-tools-130222.orig/libmultipath/devmapper.h
+++ multipath-tools-130222/libmultipath/devmapper.h
@@ -40,7 +40,6 @@ int dm_remove_partmaps (const char * map
 int dm_get_uuid(char *name, char *uuid);
 int dm_get_info (char * mapname, struct dm_info ** dmi);
 int dm_rename (char * old, char * new);
-char * dm_get_name(char * uuid);
 int dm_reassign(const char * mapname);
 int dm_reassign_table(const char *name, char *old, char *new);
 int dm_setgeometry(struct multipath *mpp);
Index: multipath-tools-130222/libmultipath/propsel.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/propsel.c
+++ multipath-tools-130222/libmultipath/propsel.c
@@ -263,8 +263,6 @@ select_alias (struct multipath * mp)
 					conf->bindings_file, mp->alias_prefix, conf->bindings_read_only);
 		}
 		if (mp->alias == NULL)
-			mp->alias = dm_get_name(mp->wwid);
-		if (mp->alias == NULL)
 			mp->alias = STRDUP(mp->wwid);
 	}