r558 - in devmapper/trunk/debian: . patches
Bastian Blank
waldi at alioth.debian.org
Mon Mar 10 21:16:45 UTC 2008
Author: waldi
Date: Mon Mar 10 21:16:45 2008
New Revision: 558
Log:
* debian/changelog: Update.
* debian/patches/dmsetup-export.patch: Add.
* debian/patches/series: Add new patch.
Added:
devmapper/trunk/debian/patches/dmsetup-export.patch
Modified:
devmapper/trunk/debian/changelog
devmapper/trunk/debian/patches/series
Modified: devmapper/trunk/debian/changelog
==============================================================================
--- devmapper/trunk/debian/changelog (original)
+++ devmapper/trunk/debian/changelog Mon Mar 10 21:16:45 2008
@@ -2,6 +2,7 @@
* Add symbols file for libdevmapper1.02.
* Add modified version of atomic device creation patch. (closes: #455745)
+ * Add modified version of dmsetup export patch. (closes: #434241)
-- Bastian Blank <waldi at debian.org> Thu, 10 Jan 2008 13:57:41 +0000
Added: devmapper/trunk/debian/patches/dmsetup-export.patch
==============================================================================
--- (empty file)
+++ devmapper/trunk/debian/patches/dmsetup-export.patch Mon Mar 10 21:16:45 2008
@@ -0,0 +1,68 @@
+--- a/dmsetup/dmsetup.c
++++ b/dmsetup/dmsetup.c
+@@ -1073,6 +1073,57 @@
+ return r;
+ }
+
++/*
++ * Export device infos
++ */
++static int _export(int argc, char **argv, void *data)
++{
++ int r = 0;
++ struct dm_task *dmt;
++ const char *name = NULL;
++ const char *uuid;
++ struct dm_info info;
++
++ if (argc == 1 && !_switches[UUID_ARG] && !_switches[MAJOR_ARG])
++ return 0;
++ if (argc == 2)
++ name = argv[1];
++
++ if (!(dmt = dm_task_create(DM_DEVICE_STATUS)))
++ return 0;
++
++ if (!_set_task_device(dmt, name, 0))
++ goto out;
++
++ if (!dm_task_no_open_count(dmt))
++ goto out;
++
++ if (!dm_task_run(dmt))
++ goto out;
++
++ if (!dm_task_get_info(dmt, &info) || !info.exists)
++ goto out;
++
++ printf("DM_NAME=\"%s\"\n", dm_task_get_name(dmt));
++
++ printf("DM_STATE=%s\n", info.suspended ? "SUSPENDED" : "ACTIVE");
++ printf("DM_STATE_RO=%s\n", info.read_only ? "READ-ONLY" : "");
++
++ printf("DM_LAST_EVENT_NR=%" PRIu32 "\n", info.event_nr);
++ printf("DM_MAJOR=%d\n", info.major);
++ printf("DM_MINOR=%d\n", info.minor);
++
++ if (!(uuid = dm_task_get_uuid(dmt)))
++ uuid = "";
++ printf("DM_UUID=\"%s\"\n", uuid);
++
++ r = 1;
++
++ out:
++ dm_task_destroy(dmt);
++ return r;
++}
++
+ /* Show target names and their version numbers */
+ static int _targets(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused)))
+ {
+@@ -2035,6 +2086,7 @@
+ {"targets", "", 0, 0, _targets},
+ {"version", "", 0, 0, _version},
+ {"setgeometry", "<device> <cyl> <head> <sect> <start>", 5, 5, _setgeometry},
++ {"export", "<device> | -j|--major <major> -m|--minor <minor>", 0, 1, _export},
+ {NULL, NULL, 0, 0, NULL}
+ };
+
Modified: devmapper/trunk/debian/patches/series
==============================================================================
--- devmapper/trunk/debian/patches/series (original)
+++ devmapper/trunk/debian/patches/series Mon Mar 10 21:16:45 2008
@@ -4,3 +4,4 @@
pkgconfig.patch
abi.patch
atomic.patch
+dmsetup-export.patch
More information about the pkg-lvm-commits
mailing list