From mboxrd@z Thu Jan 1 00:00:00 1970 From: lhh@sourceware.org Date: 23 Jun 2006 16:05:35 -0000 Subject: [Cluster-devel] cluster/cman/qdisk Makefile README disk.c disk ... Message-ID: <20060623160535.10487.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Changes by: lhh at sourceware.org 2006-06-23 16:05:34 Modified files: cman/qdisk : Makefile README disk.c disk.h main.c Added files: cman/qdisk : mkqdisk.c proc.c Log message: Implements 'label' support for qdisk. Uses /proc/partitions for device info & scans devices for signatures. Useful in environments where a device is present but maybe numbered differently on different nodes depending on the host/SAN configuration. Also adds initialization utility which must be run before qdiskd will use a given partition. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/mkqdisk.c.diff?cvsroot=cluster&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/proc.c.diff?cvsroot=cluster&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/Makefile.diff?cvsroot=cluster&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/README.diff?cvsroot=cluster&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/disk.c.diff?cvsroot=cluster&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/disk.h.diff?cvsroot=cluster&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/qdisk/main.c.diff?cvsroot=cluster&r1=1.2&r2=1.3 --- cluster/cman/qdisk/mkqdisk.c 2006/06/23 16:01:02 1.1 +++ cluster/cman/qdisk/mkqdisk.c 2006/06/23 16:05:33 1.2 @@ -0,0 +1,92 @@ +/** + Copyright Red Hat, Inc. 2006 + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 675 Mass Ave, Cambridge, + MA 02139, USA. + + Author: Lon Hohberger + */ +/** + @file Quorum disk utility + */ +#include +#include +#include +#include +#include +#include +#include +#include + + +int +main(int argc, char **argv) +{ + char device[128]; + char *newdev = NULL, *newlabel = NULL; + int rv; + + printf("mkqdisk v0.5\n"); + + while ((rv = getopt(argc, argv, "Lfc:l:h")) != EOF) { + switch (rv) { + case 'L': + /* List */ + close(2); + return find_partitions("/proc/partitions", + NULL, NULL, 0, 1); + break; + case 'f': + close(2); + return find_partitions("/proc/partitions", + optarg, device, + sizeof(device), 0); + case 'c': + newdev = optarg; + break; + case 'l': + newlabel = optarg; + break; + case 'h': + printf("usage: mkqdisk -L | -f