From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j8CENKV06089 for ; Mon, 12 Sep 2005 10:23:20 -0400 Received: from conterra.de (vvv.conterra.de [212.124.44.162]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j8CENInK020488 for ; Mon, 12 Sep 2005 10:23:19 -0400 Received: from localhost (unknown [127.0.0.1]) by conterra.de (-) with ESMTP id B7A0C1F41B0 for ; Mon, 12 Sep 2005 16:23:02 +0200 (CEST) Message-ID: <43258F43.2000107@conterra.de> Date: Mon, 12 Sep 2005 16:22:59 +0200 From: =?ISO-8859-1?Q?Dieter_St=FCken?= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [linux-lvm] metadata format processing Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: Content-Type: text/plain; charset="utf-8"; format="flowed" To: LVM general discussion and development I want to develop a tool to get a graphical representation of my LVM configuration. I thought about parsing the output of lvm commands, or even using the C-API directly. Unfortunately I did not found a way to enforce read only access when using the API. All user space tools have to run as root and may modify/destroy my LVM. So I think they are a bad choice to build any CGI-scripts upon. Finally I discovered the external metadata format, which describes any aspects of my LVM in detail. After I even found a parser for this syntax within the LVM libs, I was able to convert the metadata into XML. Once having XML it should be possible to transfer any informations towards HTML or SVG. My very first try looks like this: Text Format Volume Group 1 Created *after* executing 'lvextend /dev/raster/eglv -l 7452 /dev/sdg1' linux2 1124130973 6FmvZu-mLHD-AIQV-jnFu-hMUN-oTwe-X2zCRm 54 RESIZEABLE READ WRITE 65536 255 255 ruo3gO-jHR7-QV3Z-rUa4-jYnF-GyAn-uUR3vA /dev/sde1 ALLOCATABLE 384 7452 ARjpMz-A6iP-8x3t-7aCg-CCSH-kZpo-vt1KPD /dev/sdd1 ALLOCATABLE 384 7452 ylp7ol-r6wT-e2Py-4KZ9-cgjU-6fU0-luciPx READ WRITE VISIBLE 1 0 7452 striped 1 pv0 0 I manually shortened it, just as an example... I used the parser to get it into a "struct config_tree" and developed some procedure to dump it out as XML. There are some aspects that can be discussed (why are all nesting elements simply called whereas arrays are not grouped ...) I'm just about to learn XSLT to get this processed further. Is some one interested to participate? Dieter. -- Dieter St�ken, con terra GmbH, M�nster stueken@conterra.de http://www.conterra.de/ (0)251-7474-501