On Tue, May 13, 2008 at 07:11:50PM +0200, Guido Günther wrote:
> On Sun, May 11, 2008 at 07:14:14PM +0200, Jim Meyering wrote:
> > Sure.
> > Parted already has root-only tests; "grep privileges_required_ tests/*".
> > For portable losetup-using tests, see lvm's tests/.  If you prefer,
> > just write a few stand-alone sequences of commands that exercise the
> > new code and clean up afterward, and I'll convert them into test scripts.
> O.k., seems I overlooked this. Attached are some basic tests as you
> suggested I took some of the code from dmsetup.
The attached code is needed libparted handles DM_DEV_DIR during the
tests as dmsetup does.
 -- Guido
>From 9c5de7398f186b2e56c9ef2fe77d2c4b907954e2 Mon Sep 17 00:00:00 2001
From: Guido Guenther <[EMAIL PROTECTED]>
Date: Tue, 13 May 2008 18:46:20 +0200
Subject: [PATCH] honor DM_DEV_DIR

---
 libparted/arch/linux.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index c98ac77..bec35a7 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -310,6 +310,11 @@ _dm_maptype (PedDevice* dev)
         char *target_type = NULL;
         char *params;
         int r = -1;
+        const char* dev_dir = getenv ("DM_DEV_DIR");
+	
+        if (dev_dir && *dev_dir)
+                if (!dm_set_dev_dir(dev_dir))
+                        return r;
 
         if (!(dmt = dm_task_create(DM_DEVICE_TABLE)))
                 return r;
-- 
1.5.5.1

_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to