]> TLD Linux GIT Repositories - packages/lvm2.git/blob - device-mapper-dmsetup-deps-export.patch
1144b26b8f9753ba17344966cf577b66b2cf13f7
[packages/lvm2.git] / device-mapper-dmsetup-deps-export.patch
1 diff -urp LVM2.2.03.00.orig/libdm/dm-tools/dmsetup.c LVM2.2.03.00/libdm/dm-tools/dmsetup.c
2 --- LVM2.2.03.00.orig/libdm/dm-tools/dmsetup.c  2018-10-21 14:36:09.255416609 +0000
3 +++ LVM2.2.03.00/libdm/dm-tools/dmsetup.c       2018-10-21 14:37:55.506416609 +0000
4 @@ -2568,6 +2568,7 @@ static int _export(CMD_ARGS)
5         const char *name = NULL;
6         const char *uuid = NULL;
7         struct dm_info info;
8 +       struct dm_deps *deps;
9  
10         if (names)
11                 name = names->name;
12 @@ -2637,6 +2638,28 @@ static int _export(CMD_ARGS)
13                 printf("\n");
14         }
15  
16 +       dm_task_destroy(dmt);
17 +
18 +       if (!(dmt = dm_task_create(DM_DEVICE_DEPS)))
19 +               goto out;
20 +
21 +       name = NULL;
22 +       if (names)
23 +               name = names->name;
24 +       else if (argc == 2)
25 +               name = argv[1];
26 +
27 +       if (!_set_task_device(dmt, name, 0))
28 +               goto out;
29 +
30 +       if (!dm_task_run(dmt))
31 +               goto out;
32 +
33 +       if (!(deps = dm_task_get_deps(dmt)))
34 +               goto out;
35 +
36 +       printf("DM_DEPS=%d\n", deps->count);
37 +
38         r = 1;
39        out:
40         if (dmt)