Tuesday, June 10, 2008

device-mapper and libdevmapper ioctl interface

Sorry for the silence I was busy with my GSOC project, but I have really great news for you today. 

I have switched both NetBSD device-mapper and libdevmapper to new ioctl interface which uses property lists library to send/receive information.  Main motivation was 
that old ioctl interface is really messy and hard to maintain, extend and I have had to include GPL licensed file into my driver {dm-ioct.h} and because of it there can be some licensing issues.

New proplib interface is defined in netbsd/netbsd-dm.h file. I have added compat file which translates new proplib dictionary into struct dm_ioctl which is used in all libdevmapper this file is called libdm_netbsd.c .

I have uploaded my code to www.netbsd.org/~haad/dm20080610.tar.bz2 so everybody can review it.

Monday, May 26, 2008

LVM2tools and libdevmapper update

After two of my university exams I spent this weekend with porting lvm2tools and libdevmapper to NetBSD. If you ask "Why you said that they already work before", 
I have to say that they worked with to many hacks and workarounds such as:

dependency on mounted procfs with -o linux option.

I have rewritten some lvm2tools/lib/filter/filter.c file to use NetBSD sysctl kern.drivers 
knob instead of linux /proc/devices file. I have to say that get data with sysctl is much more easier than parsing text files from procfs .

With all these changes in lvm2tools I can now use pv* and vg* commands to manipulate volume groups, physical volumes. There are some issues with lv* 
commands. Problem is located somewhere in libdevmapper I have to 
investigate this further.

In my local branch I have also propagated changes in versiom  2.02.34-cvs (2008-01-31) of lvm2tools to my org.netbsd.haad.dm.lvm2 branch. I have to fix some conflicts 
and I will push this update to public repo.

In libdevmapper I have changed lib/ioctl/libdm_iface.c: get_proc_major to use sysctl again and not to use procfs. 

All changes can be seen here

Friday, May 9, 2008

Device-mapper driver

I want to explain in what state my driver is currently how to test etc.. 

Actually I have implemented 3 simple targets[1] inside NetBSD device-mapper. I can 
create virtual block device based on linear target(in linux LVM it is Logical volume).  
I can create file-system on it and mount it. 

For now I have to use this command to create file-system on my dm device

newfs -F -s {size} /dev/mapper/{char  device}

DIOWEDGEINFO and DIOCGDINFO ioctls are not implemented now and therefore 
newfs can find size of virtual block device. These ioctls are next on my task list.

Other more sophisticated targets like stripe, mirror, snapshot are not implemented but with help of reinoud@ I have added support for them in to C structures.  Structure layout can be found at [2].

Yesterday I have tried lvm2tools with my current driver and they mostly refuse work on NetBSD.  I will look at this next I want to finish this before coding period for SOC project starts. Because in summer I will have no time to work on device-mapper backend I will be busy with rewriting of interface to functional state.


Thursday, May 8, 2008

Monotone VSC

Monotone is distributed VCS with many interesting features. I use it for my projects daily.

Currently I use Monotone VCS to manage my projects. I have created monotone database where I keep my soc-project sources/history. This database is available at 
mtn:// If you don't have monotone installed but you want to see my 
sources/history I have installed viewmtn for this purpose. viewmtn is available at 

Because I use Monotone to manage my sources and not CVS I had to find way how 
to push sources from monotone directly to sf netbsd-soc CVS repository. Solution for 
this is net.venge.monotone.cvssync branch in monotone repository.  With monotone from this branch I can push, sync, takeover CVS repository. 

Friday, May 2, 2008

Welcome here!

This is my first post on my blog. I will use this blog to show my progress on my SOC project.