CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2019-12-14 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Dec 14 09:05:30 UTC 2019

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm_netbsd.c

Log Message:
Handle NULL params, fix error paths.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.7 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.8
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.7	Tue Feb  8 03:26:12 2011
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c	Sat Dec 14 09:05:30 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm_netbsd.c,v 1.7 2011/02/08 03:26:12 haad Exp $*/
+/*  $NetBSD: libdm_netbsd.c,v 1.8 2019/12/14 09:05:30 mlelstv Exp $*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -345,9 +345,10 @@ dm_table_status(libdm_task_t task, struc
 		type = libdm_table_get_target(table);
 		params = libdm_table_get_params(table);
 
-		if (params != NULL)
-			plen = strlen(params) + 1;
+		if (params == NULL)
+			params = "";
 
+		plen = strlen(params) + 1;
 		rec_size = sizeof(struct dm_target_spec) + plen;
 
 		/*
@@ -357,17 +358,17 @@ dm_table_status(libdm_task_t task, struc
 		 */
 		next += rec_size;
 
-		if (rec_size > dmi->data_size)
+		if (rec_size > dmi->data_size) {
+			libdm_table_destroy(table);
+			libdm_iter_destroy(iter);
 			return -ENOMEM;
+		}
 
 		dmts->next = next;
 		strlcpy(dmts->target_type, type, DM_MAX_TYPE_NAME);
 		params_start = (char *)dmts + sizeof(struct dm_target_spec);
 
-		if (params != NULL)
-			strlcpy(params_start, params, plen);
-		else
-			params_start = "\0";
+		strlcpy(params_start, params, plen);
 
 		odmts = dmts;
 		dmts = (struct dm_target_spec *)((uint8_t *)dmts + rec_size);



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2018-11-24 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Nov 24 11:27:37 UTC 2018

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c

Log Message:
Support device nodes that have no entry in /dev, identify them by major:minor
numbers like the original Linux code.

While here, fix a memory leak.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.11 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.12
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.11	Tue Feb  8 03:26:12 2011
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Sat Nov 24 11:27:37 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.11 2011/02/08 03:26:12 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.12 2018/11/24 11:27:37 mlelstv Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -25,7 +25,9 @@
 #include 
 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 #include 
@@ -367,40 +369,31 @@ static int _unmarshal_status(struct dm_t
 }
 
 static char *
-get_dev_name(char *d_name, uint32_t d_major, uint32_t d_minor)
+get_dev_name(dev_t dev)
 {
+	static char * const dirs[2] = { _PATH_DEV, NULL };
 	static char d_buf[MAXPATHLEN];
-	struct dirent *dire;
-	struct stat st;
-	DIR *dev_dir;
-
-	int err;
+	FTS *ftsp;
+	FTSENT *fe;
 	char *name;
 
-	dev_dir = opendir("/dev");
-
-	while ((dire = readdir(dev_dir)) != NULL) {
+	if ((ftsp = fts_open(dirs, FTS_NOCHDIR | FTS_PHYSICAL, NULL)) == NULL)
+		return NULL;
 
-		if (strstr(dire->d_name, d_name) == NULL)
+	name = NULL;
+	while ((fe = fts_read(ftsp)) != NULL) {
+		if (fe->fts_info != FTS_DEFAULT)
 			continue;
-
-		snprintf(d_buf, MAXPATHLEN, "/dev/%s", dire->d_name);
-
-		if ((err = stat(d_buf, &st)) < 0)
-			printf("stat failed with %d", err);
-
-		if (st.st_mode & S_IFBLK){
-			if ((major(st.st_rdev) == d_major) && (minor(st.st_rdev) == d_minor)) {
-strncpy(d_buf, dire->d_name, strlen(dire->d_name) + 1);
+		if (S_ISBLK(fe->fts_statp->st_mode)) {
+			if (fe->fts_statp->st_rdev == dev) {
+strlcpy(d_buf, fe->fts_path, sizeof(d_buf));
 name = d_buf;
 break;
 			}
 		}
-
-		memset(d_buf, '0', sizeof(d_buf));
 	}
 
-	(void)closedir(dev_dir);
+	fts_close(ftsp);
 
 	return name;
 }
@@ -417,13 +410,15 @@ int dm_format_dev(char *buf, int bufsize
 		  uint32_t dev_minor)
 {
 	int r;
-	uint32_t major, dm_major;
+	uint32_t dm_major;
+	int major;
 	char *name;
 	mode_t mode;
 	dev_t dev;
 	size_t val_len,i;
 	struct kinfo_drivers *kd;
 
+	major = -1;
 	mode = 0;
 
 	nbsd_get_dm_major(&dm_major, DM_BLOCK_MAJOR);
@@ -432,7 +427,7 @@ int dm_format_dev(char *buf, int bufsize
 		return 0;
 
 	if (sysctlbyname("kern.drivers",NULL,&val_len,NULL,0) < 0) {
-		printf("sysctlbyname failed");
+		printf("sysctlbyname failed\n");
 		return 0;
 	}
 
@@ -442,7 +437,8 @@ int dm_format_dev(char *buf, int bufsize
 	}
 
 	if (sysctlbyname("kern.drivers", kd, &val_len, NULL, 0) < 0) {
-		printf("sysctlbyname failed kd");
+		free(kd);
+		printf("sysctlbyname failed kd\n");
 		return 0;
 	}
 
@@ -453,18 +449,22 @@ int dm_format_dev(char *buf, int bufsize
 		}
 	}
 
-	dev = MKDEV(major,dev_minor);
-
-	mode |= S_IFBLK;
-
-	if ((name = devname(dev,mode)) == NULL)
-		name = get_dev_name(kd[i].d_name, major, dev_minor);
-
-	r = snprintf(buf, (size_t) bufsize, "/dev/%s",name);
+	if (major != -1) {
+		dev = MKDEV(major,dev_minor);
+		mode |= S_IFBLK;
+		if ((name = devname(dev,mode)) == NULL)
+			name = get_dev_name(dev);
+	} else
+		name = NULL;
 
 	free(kd);
 
-	if (r < 0 || r > bufsize - 1 || name == NULL)
+	if (name == NULL)
+		r = snprintf(buf, (size_t) bufsize, "%d:%d", dev_major, dev_minor);
+	else
+		r = snprintf(buf, (size_t) bufsize, _PATH_DEV "%s", name);
+
+	if (r < 0 || r > bufsize - 1)
 		return 0;
 
 	return 1;



CVS commit: src/external/gpl2/lvm2/dist/man

2016-06-09 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Thu Jun  9 09:01:21 UTC 2016

Modified Files:
src/external/gpl2/lvm2/dist/man: dmsetup.8

Log Message:
Fix typo: processess -> processes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/dist/man/dmsetup.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/man/dmsetup.8
diff -u src/external/gpl2/lvm2/dist/man/dmsetup.8:1.2 src/external/gpl2/lvm2/dist/man/dmsetup.8:1.3
--- src/external/gpl2/lvm2/dist/man/dmsetup.8:1.2	Wed Feb 18 12:16:13 2009
+++ src/external/gpl2/lvm2/dist/man/dmsetup.8	Thu Jun  9 09:01:21 2016
@@ -1,4 +1,4 @@
-.\"$NetBSD: dmsetup.8,v 1.2 2009/02/18 12:16:13 haad Exp $
+.\"$NetBSD: dmsetup.8,v 1.3 2016/06/09 09:01:21 abhinav Exp $
 .\"
 .TH DMSETUP 8 "Apr 06 2006" "Linux" "MAINTENANCE COMMANDS"
 .SH NAME
@@ -234,7 +234,7 @@ process to be killed.
 .br
 Attempts to remove all device definitions i.e. reset the driver.
 Use with care!  From version 4.8.0 onwards, if devices can't
-be removed because uninterruptible processess are waiting for
+be removed because uninterruptible processes are waiting for
 I/O to return from them, adding --force will replace the table 
 with one that fails all I/O, which might allow the 
 process to be killed.  This also runs \fBmknodes\fP afterwards.



CVS commit: src/external/gpl2/lvm2/dist/daemons/clvmd

2015-11-08 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Nov  9 00:53:57 UTC 2015

Modified Files:
src/external/gpl2/lvm2/dist/daemons/clvmd: clvmd.c

Log Message:
Don't use %m in format strings sent to printf.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/gpl2/lvm2/dist/daemons/clvmd/clvmd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/daemons/clvmd/clvmd.c
diff -u src/external/gpl2/lvm2/dist/daemons/clvmd/clvmd.c:1.1.1.3 src/external/gpl2/lvm2/dist/daemons/clvmd/clvmd.c:1.2
--- src/external/gpl2/lvm2/dist/daemons/clvmd/clvmd.c:1.1.1.3	Wed Dec  2 00:27:05 2009
+++ src/external/gpl2/lvm2/dist/daemons/clvmd/clvmd.c	Mon Nov  9 00:53:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: clvmd.c,v 1.1.1.3 2009/12/02 00:27:05 haad Exp $	*/
+/*	$NetBSD: clvmd.c,v 1.2 2015/11/09 00:53:57 dholland Exp $	*/
 
 /*
  * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
@@ -924,12 +924,13 @@ static void be_daemon(int timeout)
 
 	if (dup2(devnull, 0) < 0 || dup2(devnull, 1) < 0
 	|| dup2(devnull, 2) < 0) {
+		int e = errno;
 		perror("Error setting terminal FDs to /dev/null");
-		log_error("Error setting terminal FDs to /dev/null: %m");
+		log_error("Error setting terminal FDs to /dev/null: %s", strerror(e));
 		exit(5);
 	}
 	if (chdir("/")) {
-		log_error("Error setting current directory to /: %m");
+		log_error("Error setting current directory to /: %s", strerror(e));
 		exit(6);
 	}
 
@@ -1492,7 +1493,7 @@ static __attribute__ ((noreturn)) void *
 			if (write_status < 0 &&
 			(errno == EINTR || errno == EAGAIN))
 continue;
-			log_error("Error sending to pipe: %m\n");
+			log_error("Error sending to pipe: %s\n", strerror(errno));
 			break;
 		} while(1);
 
@@ -1525,7 +1526,7 @@ static __attribute__ ((noreturn)) void *
 			if (write_status < 0 &&
 			(errno == EINTR || errno == EAGAIN))
 continue;
-			log_error("Error sending to pipe: %m\n");
+			log_error("Error sending to pipe: %s\n", strerror(errno));
 			break;
 		} while(1);
 next_pre:
@@ -1934,7 +1935,7 @@ static int open_local_sock()
 		unlink(CLVMD_SOCKNAME);
 	local_socket = socket(PF_UNIX, SOCK_STREAM, 0);
 	if (local_socket < 0) {
-		log_error("Can't create local socket: %m");
+		log_error("Can't create local socket: %s", strerror(errno));
 		return -1;
 	}
 	/* Set Close-on-exec & non-blocking */
@@ -1945,12 +1946,12 @@ static int open_local_sock()
 	memcpy(sockaddr.sun_path, CLVMD_SOCKNAME, sizeof(CLVMD_SOCKNAME));
 	sockaddr.sun_family = AF_UNIX;
 	if (bind(local_socket, (struct sockaddr *) &sockaddr, sizeof(sockaddr))) {
-		log_error("can't bind local socket: %m");
+		log_error("can't bind local socket: %s", strerror(errno));
 		close(local_socket);
 		return -1;
 	}
 	if (listen(local_socket, 1) != 0) {
-		log_error("listen local: %m");
+		log_error("listen local: %s", strerror(errno));
 		close(local_socket);
 		return -1;
 	}



CVS commit: src/external/gpl2/lvm2/dist/lib/commands

2014-11-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Nov 15 01:24:38 UTC 2014

Modified Files:
src/external/gpl2/lvm2/dist/lib/commands: toolcontext.c

Log Message:
Comment out impossible code.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c
diff -u src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.7 src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.8
--- src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.7	Sat Dec  5 01:52:44 2009
+++ src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c	Sat Nov 15 01:24:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: toolcontext.c,v 1.7 2009/12/05 01:52:44 haad Exp $	*/
+/*	$NetBSD: toolcontext.c,v 1.8 2014/11/15 01:24:38 joerg Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -992,12 +992,14 @@ static int _init_backup(struct cmd_conte
 	char default_dir[PATH_MAX];
 	const char *dir;
 
+#if 0
 	if (!cmd->system_dir) {
 		log_warn("WARNING: Metadata changes will NOT be backed up");
 		backup_init(cmd, "", 0);
 		archive_init(cmd, "", 0, 0, 0);
 		return 1;
 	}
+#endif
 
 	/* set up archiving */
 	cmd->default_settings.archive =



CVS commit: src/external/gpl2/lvm2/dist/lib/format1

2014-11-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Nov 15 01:24:53 UTC 2014

Modified Files:
src/external/gpl2/lvm2/dist/lib/format1: import-export.c

Log Message:
Remove tautologic check.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/gpl2/lvm2/dist/lib/format1/import-export.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/format1/import-export.c
diff -u src/external/gpl2/lvm2/dist/lib/format1/import-export.c:1.1.1.2 src/external/gpl2/lvm2/dist/lib/format1/import-export.c:1.2
--- src/external/gpl2/lvm2/dist/lib/format1/import-export.c:1.1.1.2	Wed Dec  2 00:26:49 2009
+++ src/external/gpl2/lvm2/dist/lib/format1/import-export.c	Sat Nov 15 01:24:53 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: import-export.c,v 1.1.1.2 2009/12/02 00:26:49 haad Exp $	*/
+/*	$NetBSD: import-export.c,v 1.2 2014/11/15 01:24:53 joerg Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -187,7 +187,7 @@ int export_pv(struct cmd_context *cmd, s
 	}
 
 	/* Generate system_id if PV is in VG */
-	if (!pvd->system_id || !*pvd->system_id)
+	if (!pvd->system_id[0])
 		if (!_system_id(cmd, (char *)pvd->system_id, ""))
 			return_0;
 



CVS commit: src/external/gpl2/lvm2/dist

2014-02-19 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb 20 02:09:58 UTC 2014

Modified Files:
src/external/gpl2/lvm2/dist/include: xlate.h
src/external/gpl2/lvm2/dist/lib/mm: xlate.h

Log Message:
Use sys/endian.h for bswapXX.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/lvm2/dist/include/xlate.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/lvm2/dist/lib/mm/xlate.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/include/xlate.h
diff -u src/external/gpl2/lvm2/dist/include/xlate.h:1.1.1.1 src/external/gpl2/lvm2/dist/include/xlate.h:1.2
--- src/external/gpl2/lvm2/dist/include/xlate.h:1.1.1.1	Mon Dec 22 00:18:44 2008
+++ src/external/gpl2/lvm2/dist/include/xlate.h	Thu Feb 20 02:09:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: xlate.h,v 1.1.1.1 2008/12/22 00:18:44 haad Exp $	*/
+/*	$NetBSD: xlate.h,v 1.2 2014/02/20 02:09:58 joerg Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
@@ -21,6 +21,11 @@
 #ifdef linux
 #  include 
 #  include 
+#elif defined(__NetBSD__)
+#  include 
+#  define bswap_16(x) bswap16(x)
+#  define bswap_32(x) bswap32(x)
+#  define bswap_64(x) bswap64(x)
 #else
 #  include 
 #  define bswap_16(x) (((x) & 0x00ffU) << 8 | \

Index: src/external/gpl2/lvm2/dist/lib/mm/xlate.h
diff -u src/external/gpl2/lvm2/dist/lib/mm/xlate.h:1.1.1.1 src/external/gpl2/lvm2/dist/lib/mm/xlate.h:1.2
--- src/external/gpl2/lvm2/dist/lib/mm/xlate.h:1.1.1.1	Mon Dec 22 00:18:13 2008
+++ src/external/gpl2/lvm2/dist/lib/mm/xlate.h	Thu Feb 20 02:09:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: xlate.h,v 1.1.1.1 2008/12/22 00:18:13 haad Exp $	*/
+/*	$NetBSD: xlate.h,v 1.2 2014/02/20 02:09:58 joerg Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
@@ -21,6 +21,11 @@
 #ifdef linux
 #  include 
 #  include 
+#elif defined(__NetBSD__)
+#  include 
+#  define bswap_16(x) bswap16(x)
+#  define bswap_32(x) bswap32(x)
+#  define bswap_64(x) bswap64(x)
 #else
 #  include 
 #  define bswap_16(x) (((x) & 0x00ffU) << 8 | \



CVS commit: src/external/gpl2/lvm2/dist/lib/filters

2012-01-04 Thread Michael L. Hitch
Module Name:src
Committed By:   mhitch
Date:   Wed Jan  4 16:37:45 UTC 2012

Modified Files:
src/external/gpl2/lvm2/dist/lib/filters: filter_netbsd.c

Log Message:
Add logical drive device ld - a number of raid controllers provide these.
Also fix a typo/pasto when checking devices against devices/types in the
configuration file:  use value from configuration, not the end of the
device_info table.  Devices which aren't explicitly specified in the
device_info table can now be used by adding a type entry in the config
file.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c
diff -u src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c:1.3 src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c:1.4
--- src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c:1.3	Wed Dec  2 01:53:25 2009
+++ src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c	Wed Jan  4 16:37:45 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: filter_netbsd.c,v 1.3 2009/12/02 01:53:25 haad Exp $*/
+/*  $NetBSD: filter_netbsd.c,v 1.4 2012/01/04 16:37:45 mhitch Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -82,6 +82,7 @@ static const device_info_t device_info[]
 	{"cgd", 1},
 	{"ccd", 1},	
 	{"xbd", 64},
+	{"ld", 64},
 	{NULL, -1}
 };
 
@@ -221,9 +222,9 @@ static int _scan_dev(const struct config
 			
 			if (!strncmp(name, kd[i].d_name, strlen(name))){
 	_char_device_major[kd[i].d_cmajor] =
-	device_info[j].max_partitions;
+	cv->v.i;
 	_block_device_major[kd[i].d_bmajor] =
-	device_info[j].max_partitions;
+	cv->v.i;
 	break;
 			}
 		}



CVS commit: src/external/gpl2/lvm2/dist/lib/report

2011-05-30 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May 30 16:03:02 UTC 2011

Modified Files:
src/external/gpl2/lvm2/dist/lib/report: report.c

Log Message:
Pull in report.c, 1.107 from upstream:
Use offsetof() macro and avoid defining dummy static union for FIELD()
macro.  Makes it compilable by clang compiler.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/gpl2/lvm2/dist/lib/report/report.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/report/report.c
diff -u src/external/gpl2/lvm2/dist/lib/report/report.c:1.1.1.3 src/external/gpl2/lvm2/dist/lib/report/report.c:1.2
--- src/external/gpl2/lvm2/dist/lib/report/report.c:1.1.1.3	Wed Dec  2 00:26:46 2009
+++ src/external/gpl2/lvm2/dist/lib/report/report.c	Mon May 30 16:03:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: report.c,v 1.1.1.3 2009/12/02 00:26:46 haad Exp $	*/
+/*	$NetBSD: report.c,v 1.2 2011/05/30 16:03:02 joerg Exp $	*/
 
 /*
  * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
@@ -26,6 +26,8 @@
 #include "str_list.h"
 #include "lvmcache.h"
 
+#include  /* offsetof() */
+
 struct lvm_report_object {
 	struct volume_group *vg;
 	struct logical_volume *lv;
@@ -34,17 +36,6 @@
 	struct pv_segment *pvseg;
 };
 
-/*
- * For macro use
- */
-static union {
-	struct physical_volume _pv;
-	struct logical_volume _lv;
-	struct volume_group _vg;
-	struct lv_segment _seg;
-	struct pv_segment _pvseg;
-} _dummy;
-
 static char _alloc_policy_char(alloc_policy_t alloc)
 {
 	switch (alloc) {
@@ -1158,9 +1149,17 @@
 
 #define STR DM_REPORT_FIELD_TYPE_STRING
 #define NUM DM_REPORT_FIELD_TYPE_NUMBER
-#define FIELD(type, strct, sorttype, head, field, width, func, id, desc) {type, sorttype, (off_t)((uintptr_t)&_dummy._ ## strct.field - (uintptr_t)&_dummy._ ## strct), width, id, head, &_ ## func ## _disp, desc},
+#define FIELD(type, strct, sorttype, head, field, width, func, id, desc) \
+	{type, sorttype, offsetof(type_ ## strct, field), width, \
+	 id, head, &_ ## func ## _disp, desc},
+
+typedef struct physical_volume type_pv;
+typedef struct logical_volume type_lv;
+typedef struct volume_group type_vg;
+typedef struct lv_segment type_seg;
+typedef struct pv_segment type_pvseg;
 
-static struct dm_report_field_type _fields[] = {
+static const struct dm_report_field_type _fields[] = {
 #include "columns.h"
 {0, 0, 0, 0, "", "", NULL, NULL},
 };



CVS commit: src/external/gpl2/lvm2/dist/lib/format_text

2011-05-24 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue May 24 15:51:00 UTC 2011

Modified Files:
src/external/gpl2/lvm2/dist/lib/format_text: export.c

Log Message:
Fix printing of time_t


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/gpl2/lvm2/dist/lib/format_text/export.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/format_text/export.c
diff -u src/external/gpl2/lvm2/dist/lib/format_text/export.c:1.1.1.3 src/external/gpl2/lvm2/dist/lib/format_text/export.c:1.2
--- src/external/gpl2/lvm2/dist/lib/format_text/export.c:1.1.1.3	Wed Dec  2 00:26:29 2009
+++ src/external/gpl2/lvm2/dist/lib/format_text/export.c	Tue May 24 15:51:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: export.c,v 1.1.1.3 2009/12/02 00:26:29 haad Exp $	*/
+/*	$NetBSD: export.c,v 1.2 2011/05/24 15:51:00 joerg Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -346,7 +346,7 @@
 	outf(f, "creation_host = \"%s\"\t# %s %s %s %s %s", _utsname.nodename,
 	 _utsname.sysname, _utsname.nodename, _utsname.release,
 	 _utsname.version, _utsname.machine);
-	outf(f, "creation_time = %lu\t# %s", t, ctime(&t));
+	outf(f, "creation_time = %jd\t# %s", (intmax_t)t, ctime(&t));
 
 	return 1;
 }



CVS commit: src/external/gpl2/lvm2/dist/lib/netbsd

2011-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 15 01:16:29 UTC 2011

Modified Files:
src/external/gpl2/lvm2/dist/lib/netbsd: dev.c

Log Message:
missing string.h


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/dist/lib/netbsd/dev.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/netbsd/dev.c
diff -u src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.2 src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.3
--- src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.2	Fri Oct 16 17:00:41 2009
+++ src/external/gpl2/lvm2/dist/lib/netbsd/dev.c	Sat May 14 21:16:29 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: dev.c,v 1.2 2009/10/16 21:00:41 joerg Exp $*/
+/*  $NetBSD: dev.c,v 1.3 2011/05/15 01:16:29 christos Exp $*/
 
 /*
  * NetBSD specific device routines are added to this file.
@@ -11,6 +11,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/external/gpl2/lvm2/dist/include

2011-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 15 01:13:30 UTC 2011

Modified Files:
src/external/gpl2/lvm2/dist/include: lvm-globals.h

Log Message:
copy from misc directory


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/gpl2/lvm2/dist/include/lvm-globals.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/include/lvm-globals.h
diff -u src/external/gpl2/lvm2/dist/include/lvm-globals.h:1.1.1.2 src/external/gpl2/lvm2/dist/include/lvm-globals.h:1.2
--- src/external/gpl2/lvm2/dist/include/lvm-globals.h:1.1.1.2	Wed Feb 18 06:16:46 2009
+++ src/external/gpl2/lvm2/dist/include/lvm-globals.h	Sat May 14 21:13:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: lvm-globals.h,v 1.1.1.2 2009/02/18 11:16:46 haad Exp $	*/
+/*	$NetBSD: lvm-globals.h,v 1.2 2011/05/15 01:13:29 christos Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
@@ -21,6 +21,11 @@
 #define VERBOSE_BASE_LEVEL _LOG_WARN
 #define SECURITY_LEVEL 0
 
+#ifdef __NetBSD__
+void init_operator(int operator);
+int  is_operator(void);
+#endif
+
 void init_verbose(int level);
 void init_test(int level);
 void init_md_filtering(int level);



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2011-01-12 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Jan 12 08:16:23 UTC 2011

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c

Log Message:
Use DM_DEVICE_CONTROL_MODE, because mapper/control device should have 660
and not 640 permissions.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.9 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.10
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.9	Sun Dec 26 14:48:34 2010
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Wed Jan 12 08:16:23 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.9 2010/12/26 14:48:34 christos Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.10 2011/01/12 08:16:23 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -163,7 +163,7 @@
 	log_verbose("Creating device %s (%u, %u)", control, major, minor);
 
 	old_umask = umask(0);
-	if (mknod(control, S_IFCHR | DM_DEVICE_MODE,
+	if (mknod(control, S_IFCHR | DM_CONTROL_DEVICE_MODE,
 		  MKDEV(major, minor)) < 0)  {
 		umask(old_umask);
 		log_sys_error("mknod", control);



CVS commit: src/external/gpl2/lvm2/dist/lib/device

2010-12-29 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec 29 23:14:21 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/lib/device: dev-io.c

Log Message:
Fix my yesterday fix and finally make _get_dev_size recognise partition size
for device without DIOWEDGEINFO, where DIOCGDINFO is used. Patch tested by
Martin Mersberger.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl2/lvm2/dist/lib/device/dev-io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/device/dev-io.c
diff -u src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.9 src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.10
--- src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.9	Wed Dec 29 00:14:04 2010
+++ src/external/gpl2/lvm2/dist/lib/device/dev-io.c	Wed Dec 29 23:14:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev-io.c,v 1.9 2010/12/29 00:14:04 haad Exp $	*/
+/*	$NetBSD: dev-io.c,v 1.10 2010/12/29 23:14:21 haad Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -268,6 +268,7 @@
 #ifdef __NetBSD__
 	struct disklabel	lab;
 	struct dkwedge_info dkw;
+	struct stat stat;
 #endif
 
 	if ((fd = open(name, O_RDONLY)) < 0) {
@@ -285,8 +286,12 @@
 			"DIOCGDINFO for disk device %s", name);
 			close(fd);
 			return 0;
-		} else
-			*size = lab.d_nsectors;
+		} else {
+			if (fstat(fd, &stat) < 0)
+log_debug("fstat on device %s failure", name);
+			
+			*size = lab.d_partitions[DISKPART(stat.st_rdev)].p_size;
+		}
 	} else
 		*size = dkw.dkw_size;
 #else



CVS commit: src/external/gpl2/lvm2/dist/libdm

2010-12-29 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec 29 10:39:28 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/libdm: libdm-common.c

Log Message:
Fix problem where chown was used on normal device in time when only
raw device was created. While here do some cleanup.

Problem find and reported by Martin Mersberger on current-us...@.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/lvm2/dist/libdm/libdm-common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/libdm-common.c
diff -u src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.6 src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.7
--- src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.6	Sun Dec 26 14:48:34 2010
+++ src/external/gpl2/lvm2/dist/libdm/libdm-common.c	Wed Dec 29 10:39:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: libdm-common.c,v 1.6 2010/12/26 14:48:34 christos Exp $	*/
+/*	$NetBSD: libdm-common.c,v 1.7 2010/12/29 10:39:27 haad Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -418,16 +418,16 @@
 	dev_t dev = MKDEV(major, minor);
 	mode_t old_mask;
 
-	#ifdef __NetBSD__
+#ifdef __NetBSD__
 	char rpath[PATH_MAX];
 	uint32_t raw_major;
 	dev_t rdev;
 	char raw_devname[DM_NAME_LEN+1]; /* r + other device name */
 
-	nbsd_get_dm_major(&raw_major,DM_CHAR_MAJOR);
-	rdev = MKDEV(raw_major,minor);
+	nbsd_get_dm_major(&raw_major, DM_CHAR_MAJOR);
+	rdev = MKDEV(raw_major, minor);
 
-	snprintf(raw_devname,sizeof(raw_devname),"r%s",dev_name);
+	snprintf(raw_devname, sizeof(raw_devname), "r%s", dev_name);
 
 	_build_dev_path(rpath, sizeof(rpath), raw_devname);
 
@@ -457,8 +457,8 @@
 	}
 	umask(old_mask);
 
-	if (chown(path, uid, gid) < 0) {
-		log_sys_error("chown", rpath);
+	if (chown(rpath, uid, gid) < 0) {
+		log_sys_error("Raw device chown", rpath);
 		return 0;
 	}
 #endif



CVS commit: src/external/gpl2/lvm2/dist/lib/device

2010-12-28 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec 29 00:14:05 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/lib/device: dev-io.c

Log Message:
Fix bug added by my last commit. This should fix

PR: bin/44286

Reported by: mlelstv@ and Martin Mersberger.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl2/lvm2/dist/lib/device/dev-io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/device/dev-io.c
diff -u src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.8 src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.9
--- src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.8	Thu Dec 23 21:39:08 2010
+++ src/external/gpl2/lvm2/dist/lib/device/dev-io.c	Wed Dec 29 00:14:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev-io.c,v 1.8 2010/12/23 21:39:08 haad Exp $	*/
+/*	$NetBSD: dev-io.c,v 1.9 2010/12/29 00:14:04 haad Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -286,7 +286,7 @@
 			close(fd);
 			return 0;
 		} else
-			*size /= lab.d_secsize;
+			*size = lab.d_nsectors;
 	} else
 		*size = dkw.dkw_size;
 #else



CVS commit: src/external/gpl2/lvm2/dist

2010-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 26 14:48:34 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/daemons/cmirrord: functions.c
src/external/gpl2/lvm2/dist/libdm: libdm-common.c
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-iface.c
libdm-nbsd-iface.c

Log Message:
- don't forget to restore the umask on error.
- save and restore umask for control
- chown/chgrp for raw devices


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/lvm2/dist/libdm/libdm-common.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c
diff -u src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c:1.2 src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c:1.3
--- src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c:1.2	Thu Dec 23 12:46:54 2010
+++ src/external/gpl2/lvm2/dist/daemons/cmirrord/functions.c	Sun Dec 26 09:48:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: functions.c,v 1.2 2010/12/23 17:46:54 christos Exp $	*/
+/*	$NetBSD: functions.c,v 1.3 2010/12/26 14:48:34 christos Exp $	*/
 
 /*
  * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
@@ -303,6 +303,7 @@
 	struct dirent *dep;
 	struct stat statbuf;
 	int major, minor;
+	mode_t old_umask;
 
 	if (!strstr(major_minor_str, ":")) {
 		r = stat(major_minor_str, &statbuf);
@@ -350,7 +351,9 @@
 	LOG_DBG("Path not found for %d/%d", major, minor);
 	LOG_DBG("Creating /dev/mapper/%d-%d", major, minor);
 	sprintf(path_rtn, "/dev/mapper/%d-%d", major, minor);
+	old_umask = umask(0);
 	r = mknod(path_rtn, S_IFBLK | DM_DEVICE_MODE, MKDEV(major, minor));
+	umask(old_umask);
 
 	if (r != -1)
 		r = chown(path_rtn, DM_DEVICE_UID, DM_DEVICE_GID);

Index: src/external/gpl2/lvm2/dist/libdm/libdm-common.c
diff -u src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.5 src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.6
--- src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.5	Sat Dec  5 06:42:24 2009
+++ src/external/gpl2/lvm2/dist/libdm/libdm-common.c	Sun Dec 26 09:48:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: libdm-common.c,v 1.5 2009/12/05 11:42:24 haad Exp $	*/
+/*	$NetBSD: libdm-common.c,v 1.6 2010/12/26 14:48:34 christos Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -450,11 +450,17 @@
 	}
 
 	old_mask = umask(0);
-
 	if (mknod(rpath, S_IFCHR | mode, rdev) < 0) {
+		umask(old_mask);
 		log_error("Unable to make device node for '%s'", raw_devname);
 		return 0;
 	}
+	umask(old_mask);
+
+	if (chown(path, uid, gid) < 0) {
+		log_sys_error("chown", rpath);
+		return 0;
+	}
 #endif
 	
 	_build_dev_path(path, sizeof(path), dev_name);
@@ -505,7 +511,7 @@
 	char path[PATH_MAX];
 	struct stat info;
 
-	#ifdef __NetBSD__
+#ifdef __NetBSD__
 	char rpath[PATH_MAX];
 	char raw_devname[DM_NAME_LEN+1]; /* r + other device name */
 

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c:1.2 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c:1.3
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c:1.2	Thu Dec 23 12:46:54 2010
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-iface.c	Sun Dec 26 09:48:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: libdm-iface.c,v 1.2 2010/12/23 17:46:54 christos Exp $	*/
+/*	$NetBSD: libdm-iface.c,v 1.3 2010/12/26 14:48:34 christos Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -245,11 +245,14 @@
 
 	log_verbose("Creating device %s (%u, %u)", control, major, minor);
 
+	old_umask = umask(0);
 	if (mknod(control, S_IFCHR | DM_DEVICE_MODE,
 		  MKDEV(major, minor)) < 0)  {
+		umask(old_umask);
 		log_sys_error("mknod", control);
 		return 0;
 	}
+	umask(old_umask);
 	if (chown(control, DM_DEVICE_UID, DM_DEVICE_GID) == -1) {
 		log_sys_error("cbown", control);
 		return 0;

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.8 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.9
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.8	Thu Dec 23 12:46:54 2010
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Sun Dec 26 09:48:34 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.8 2010/12/23 17:46:54 christos Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.9 2010/12/26 14:48:34 christos Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -153,7 +153,7 @@
 	if (!major)
 		return 0;
 
-	old_umask = umask(0022);
+	old_umask = umask(DM_DEV_DIR_UMASK);
 	ret

CVS commit: src/external/gpl2/lvm2/dist/lib/device

2010-12-23 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Thu Dec 23 21:39:09 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/lib/device: dev-io.c

Log Message:
Change way how we get device size from device. Do not use LSEEK but
DIOCGWEDGEINFO and DIOCGDINFO. This should fix problem with raidframe + lvm
reported by

Toby Karyadi on current-us...@.

Thanks for reporting this issue.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl2/lvm2/dist/lib/device/dev-io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/device/dev-io.c
diff -u src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.7 src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.8
--- src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.7	Thu Dec 23 14:46:25 2010
+++ src/external/gpl2/lvm2/dist/lib/device/dev-io.c	Thu Dec 23 21:39:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev-io.c,v 1.7 2010/12/23 14:46:25 mlelstv Exp $	*/
+/*	$NetBSD: dev-io.c,v 1.8 2010/12/23 21:39:08 haad Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -275,26 +275,20 @@
 		log_sys_error("open", name);
 #endif		
 		return 0;
-		}
-
-#ifdef __NetBSD__
-	if ((*size = lseek (fd, 0, SEEK_END)) < 0) {
-		log_sys_error("lseek SEEK_END", name);
-		close(fd);
-		return 0;
 	}
 
-	if (ioctl(fd, DIOCGDINFO, &lab) < 0) {
-		if (ioctl(fd, DIOCGWEDGEINFO, &dkw) < 0) {
-			log_debug("ioctl DIOCGWEDGEINFO", name);
+#ifdef __NetBSD__
+/* Get info about partition/wedge */
+	if (ioctl(fd, DIOCGWEDGEINFO, &dkw) == -1) {
+		if (ioctl(fd, DIOCGDINFO, &lab) == -1) {
+			log_debug("Please implement DIOCGWEDGEINFO or "
+			"DIOCGDINFO for disk device %s", name);
 			close(fd);
 			return 0;
 		} else
-			if (dkw.dkw_size)
-*size = dkw.dkw_size;
-	} else 
-		if (lab.d_secsize)
 			*size /= lab.d_secsize;
+	} else
+		*size = dkw.dkw_size;
 #else
 	if (ioctl(fd, BLKGETSIZE64, size) < 0) {
 		log_sys_error("ioctl BLKGETSIZE64", name);



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2010-12-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 23 17:44:33 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm_netbsd.c

Log Message:
false needs stdbool.h


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.5 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.6
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.5	Sat Dec  5 06:42:24 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c	Thu Dec 23 12:44:33 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm_netbsd.c,v 1.5 2009/12/05 11:42:24 haad Exp $*/
+/*  $NetBSD: libdm_netbsd.c,v 1.6 2010/12/23 17:44:33 christos Exp $*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 



CVS commit: src/external/gpl2/lvm2/dist/lib/device

2010-12-23 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Dec 23 14:46:25 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/lib/device: dev-io.c

Log Message:
Get sector size from device properties using DIOCGDISKINFO and
use the disklabel (DIOCGDINFO) only as a fallback. This works
with wedges.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/lvm2/dist/lib/device/dev-io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/device/dev-io.c
diff -u src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.6 src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.7
--- src/external/gpl2/lvm2/dist/lib/device/dev-io.c:1.6	Wed Dec  2 01:53:25 2009
+++ src/external/gpl2/lvm2/dist/lib/device/dev-io.c	Thu Dec 23 14:46:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev-io.c,v 1.6 2009/12/02 01:53:25 haad Exp $	*/
+/*	$NetBSD: dev-io.c,v 1.7 2010/12/23 14:46:25 mlelstv Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -41,6 +41,7 @@
 #elif __NetBSD__
 #  include 
 #  include 
+#  include 
 #  include 
 #else
 #  include 
@@ -133,14 +134,22 @@
 	const char *name = dev_name(dev);
 #ifdef __NetBSD__
 	struct disklabel	lab;
+	prop_dictionary_t	disk_dict, geom_dict;
+	uint32_t		secsize;
 #endif
 
 	if ((dev->block_size == -1)) {
 #ifdef __NetBSD__
-		if (ioctl(dev_fd(dev), DIOCGDINFO, &lab) < 0) {
-			dev->block_size = DEV_BSIZE;
-		} else
-			dev->block_size = lab.d_secsize;
+		if (prop_dictionary_recv_ioctl(dev_fd(dev), DIOCGDISKINFO, &disk_dict)) {
+			if (ioctl(dev_fd(dev), DIOCGDINFO, &lab) < 0) {
+dev->block_size = DEV_BSIZE;
+			} else
+dev->block_size = lab.d_secsize;
+		} else {
+			geom_dict = prop_dictionary_get(disk_dict, "geometry");
+			prop_dictionary_get_uint32(geom_dict, "sector-size", &secsize);
+			dev->block_size = secsize;
+		}
 #else
 		if (ioctl(dev_fd(dev), BLKBSZGET, &dev->block_size) < 0) {
 			log_sys_error("ioctl BLKBSZGET", name);



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2010-03-12 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Fri Mar 12 16:24:40 UTC 2010

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c

Log Message:
Fix /var/run/dev.db dependency by adding new get_dev_name routine which
converts raw device major:minor number to block device path. By reading
/dev and using stat to find block device major:minor numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.6 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.7
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.6	Wed Dec  9 00:15:51 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Fri Mar 12 16:24:40 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.6 2009/12/09 00:15:51 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.7 2010/03/12 16:24:40 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -358,6 +358,45 @@
 	return 1;
 }
 
+static char *
+get_dev_name(char *d_name, uint32_t d_major, uint32_t d_minor)
+{
+	static char d_buf[MAXPATHLEN];
+	struct dirent *dire;
+	struct stat st;
+	DIR *dev_dir;
+
+	int err;
+	char *name;
+
+	dev_dir = opendir("/dev");
+
+	while ((dire = readdir(dev_dir)) != NULL) {
+
+		if (strstr(dire->d_name, d_name) == NULL)
+			continue;
+
+		snprintf(d_buf, MAXPATHLEN, "/dev/%s", dire->d_name);
+
+		if ((err = stat(d_buf, &st)) < 0)
+			printf("stat failed with %d", err);
+
+		if (st.st_mode & S_IFBLK){
+			if ((major(st.st_rdev) == d_major) && (minor(st.st_rdev) == d_minor)) {
+strncpy(d_buf, dire->d_name, strlen(dire->d_name) + 1);
+name = d_buf;
+break;
+			}
+		}
+
+		memset(d_buf, '0', sizeof(d_buf));
+	}
+
+	(void)closedir(dev_dir);
+
+	return name;
+}
+
 /*
  * @dev_major is major number of char device
  *
@@ -409,16 +448,17 @@
 	dev = MKDEV(major,dev_minor);
 
 	mode |= S_IFBLK;
-	
-	name = devname(dev,mode);
+
+	if ((name = devname(dev,mode)) == NULL)
+		name = get_dev_name(kd[i].d_name, major, dev_minor);
 
 	r = snprintf(buf, (size_t) bufsize, "/dev/%s",name);
 
 	free(kd);
-	
+
 	if (r < 0 || r > bufsize - 1 || name == NULL)
 		return 0;
-	
+
 	return 1;
 }
 



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2009-12-08 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec  9 00:15:51 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c

Log Message:
Add support for building RUMP_ACTION libdevmapper which will build and link
libdevmapper with RUMP kernel and libdm(RUMP based device-mapper library).
This enables testing of dmsetup and libdevmapper with RUMP.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.5 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.6
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.5	Sat Dec  5 11:42:24 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Wed Dec  9 00:15:51 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.5 2009/12/05 11:42:24 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.6 2009/12/09 00:15:51 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -32,6 +32,11 @@
 
 #include 
 
+#ifdef RUMP_ACTION
+#include 
+#include 
+#endif
+
 /*
  * Ensure build compatibility.  
  * The hard-coded versions here are the highest present 
@@ -189,6 +194,9 @@
 	if (_control_fd != -1)
 		return 1;
 
+#ifdef RUMP_ACTION	
+	rump_init();
+#endif
 	snprintf(control, sizeof(control), "%s/control", dm_dir());
 
 	if (!_control_device_number(&major, &minor))
@@ -1018,9 +1026,18 @@
 	//printf("name %s, major %d minor %d\n uuid %s\n", 
 //dm_task_get_name(dmt), dmt->minor, dmt->major, dm_task_get_uuid(dmt));
 	/* Send dictionary to kernel and wait for reply. */
+#ifdef RUMP_ACTION
+	struct plistref prefp;
+	int err;
+	prop_dictionary_externalize_to_pref(dm_dict_in, &prefp);
+
+	if (rump_sys_ioctl(_control_fd, NETBSD_DM_IOCTL, &prefp) != 0) {
+
+		dm_dict_out = prop_dictionary_internalize(prefp.pref_plist);
+#else	
 	if (prop_dictionary_sendrecv_ioctl(dm_dict_in,_control_fd,
 		NETBSD_DM_IOCTL,&dm_dict_out) != 0) {
-
+#endif
 		if (errno == ENOENT &&
 		((dmt->type == DM_DEVICE_INFO) ||
 			(dmt->type == DM_DEVICE_MKNODES) ||
@@ -1051,6 +1068,9 @@
 		}
 	}
 
+#ifdef RUMP_ACTION
+	dm_dict_out = prop_dictionary_internalize(prefp.pref_plist);
+#endif	
 	prop_dictionary_externalize_to_file(dm_dict_out,"/tmp/test_out");
 
 	/* Parse kernel dictionary to dmi structure and return it to libdevmapper. */



CVS commit: src/external/gpl2/lvm2/dist/libdm

2009-12-05 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Sat Dec  5 11:42:24 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/libdm: libdm-common.c
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c
libdm_netbsd.c

Log Message:
Addapt libdevmapper library to new header file changes.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/lvm2/dist/libdm/libdm-common.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/libdm-common.c
diff -u src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.4 src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.5
--- src/external/gpl2/lvm2/dist/libdm/libdm-common.c:1.4	Wed Dec  2 00:58:03 2009
+++ src/external/gpl2/lvm2/dist/libdm/libdm-common.c	Sat Dec  5 11:42:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: libdm-common.c,v 1.4 2009/12/02 00:58:03 haad Exp $	*/
+/*	$NetBSD: libdm-common.c,v 1.5 2009/12/05 11:42:24 haad Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -48,7 +48,7 @@
 #endif
 
 #ifdef __NetBSD__
-#include 
+#include "libdm-netbsd.h"
 #endif
 
 #define DEV_DIR "/dev/"

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.4 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.5
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.4	Wed Dec  2 01:53:25 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Sat Dec  5 11:42:24 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.4 2009/12/02 01:53:25 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.5 2009/12/05 11:42:24 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -19,6 +19,7 @@
 #include "dmlib.h"
 #include "libdm-targets.h"
 #include "libdm-common.h"
+#include "libdm-netbsd.h"
 
 #include 
 #include 
@@ -27,7 +28,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 #include 
 
Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.4 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.5
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.4	Tue Dec  1 23:11:17 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c	Sat Dec  5 11:42:24 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm_netbsd.c,v 1.4 2009/12/01 23:11:17 haad Exp $*/
+/*  $NetBSD: libdm_netbsd.c,v 1.5 2009/12/05 11:42:24 haad Exp $*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -41,11 +41,12 @@
 #include 
 #include 
 
-#include 
+#include 
 
 #include 
 
 #include "lib.h"
+#include "libdm-netbsd.h"
 
 #define DMI_SIZE 16 * 1024
 



CVS commit: src/external/gpl2/lvm2/dist/lib/commands

2009-12-04 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Sat Dec  5 01:52:44 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/lib/commands: toolcontext.c

Log Message:
Try to fix amd64 build.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c
diff -u src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.6 src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.7
--- src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c:1.6	Wed Dec  2 01:53:25 2009
+++ src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c	Sat Dec  5 01:52:44 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: toolcontext.c,v 1.6 2009/12/02 01:53:25 haad Exp $	*/
+/*	$NetBSD: toolcontext.c,v 1.7 2009/12/05 01:52:44 haad Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -845,13 +845,17 @@
 	return 1;
 }
 
+#ifdef __NetBSD__
+#include 
+#endif
+
 static int _init_single_segtype(struct cmd_context *cmd,
 struct segtype_library *seglib)
 {
 	struct segment_type *(*init_segtype_fn) (struct cmd_context *);
 	struct segment_type *segtype;
 
-	if (!(init_segtype_fn = (void *) dlsym(seglib->lib, "init_segtype"))) {
+	if (!(init_segtype_fn = dlsym(seglib->lib, "init_segtype"))) {
 		log_error("Shared library %s does not contain segment type "
 			  "functions", seglib->libname);
 		return 0;



CVS commit: src/external/gpl2/lvm2/dist

2009-12-01 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec  2 01:53:25 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/include: configure.h dm-ioctl.h
src/external/gpl2/lvm2/dist/lib/commands: toolcontext.c
src/external/gpl2/lvm2/dist/lib/device: dev-io.c dev-swap.c
src/external/gpl2/lvm2/dist/lib/filters: filter_netbsd.c
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c

Log Message:
Fix build, add missing symbols, remove unknown ioctls etc.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/lvm2/dist/include/configure.h
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/lvm2/dist/include/dm-ioctl.h
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl2/lvm2/dist/lib/commands/toolcontext.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/lvm2/dist/lib/device/dev-io.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl2/lvm2/dist/lib/device/dev-swap.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl2/lvm2/dist/lib/filters/filter_netbsd.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/include/configure.h
diff -u src/external/gpl2/lvm2/dist/include/configure.h:1.3 src/external/gpl2/lvm2/dist/include/configure.h:1.4
--- src/external/gpl2/lvm2/dist/include/configure.h:1.3	Wed Feb 18 12:16:13 2009
+++ src/external/gpl2/lvm2/dist/include/configure.h	Wed Dec  2 01:53:25 2009
@@ -1,3 +1,5 @@
+/*	$NetBSD: configure.h,v 1.4 2009/12/02 01:53:25 haad Exp $	*/
+
 /* lib/misc/configure.h.  Generated from configure.h.in by configure.  */
 /* lib/misc/configure.h.in.  Generated from configure.in by autoheader.  */
 
@@ -7,6 +9,9 @@
 /* Define to 1 to include built-in support for clustered LVM locking. */
 /* #undef CLUSTER_LOCKING_INTERNAL */
 
+/* Path to cmirrord pidfile. */
+/* #undef CMIRRORD_PIDFILE */
+
 /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
@@ -15,6 +20,9 @@
 /* Define to 1 if using `alloca.c'. */
 /* #undef C_ALLOCA */
 
+/* Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes. */
+/* #undef DEFAULT_SI_UNIT_CONSISTENCY */
+
 /* Define to 1 to enable LVM2 device-mapper interaction. */
 #define DEVMAPPER_SUPPORT 1
 
@@ -28,7 +36,7 @@
 /* #undef DMEVENTD_PIDFILE */
 
 /* Library version */
-#define DM_LIB_VERSION "1.02.30 (2009-01-26)"
+#define DM_LIB_VERSION "1.02.40 (2009-11-24)"
 
 /* Define to 1 if you have `alloca', as a function or macro. */
 #define HAVE_ALLOCA 1
@@ -46,6 +54,12 @@
 /* Define to 1 if canonicalize_file_name is available. */
 /* #undef HAVE_CANONICALIZE_FILE_NAME */
 
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_CCS_H */
+
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_COROSYNC_CONFDB_H */
+
 /* Define to 1 if you have the  header file. */
 #define HAVE_CTYPE_H 1
 
@@ -91,12 +105,21 @@
 /* Define to 1 if you have the  header file. */
 #define HAVE_INTTYPES_H 1
 
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_LIBCMAN_H */
+
 /* Define to 1 if dynamic libraries are available. */
 /* #undef HAVE_LIBDL */
 
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_LIBDLM_H */
+
 /* Define to 1 if you have the  header file. */
 #define HAVE_LIBGEN_H 1
 
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_LIBGULM_H */
+
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_LIBINTL_H */
 
@@ -192,6 +215,9 @@
 /* Define to 1 if you have the `setlocale' function. */
 #define HAVE_SETLOCALE 1
 
+/* Define to 1 if you have the `siginterrupt' function. */
+#define HAVE_SIGINTERRUPT 1
+
 /* Define to 1 if you have the  header file. */
 #define HAVE_SIGNAL_H 1
 
@@ -269,6 +295,9 @@
 /* Define to 1 if you have the  header file. */
 #define HAVE_SYS_IOCTL_H 1
 
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_SYS_IPC_H */
+
 /* Define to 1 if you have the  header file. */
 #define HAVE_SYS_MMAN_H 1
 
@@ -288,6 +317,9 @@
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_SYS_SELECT_H */
 
+/* Define to 1 if you have the  header file. */
+/* #undef HAVE_SYS_SEM_H */
+
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_SYS_SOCKET_H */
 
@@ -321,6 +353,10 @@
 /* Define to 1 if you have the  header file. */
 #define HAVE_TIME_H 1
 
+/* Define to 1 if libudev's udev_queue_get_udev_is_active function is
+   available. */
+/* #undef HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE */
+
 /* Define to 1 if you have the `uname' function. */
 #define HAVE_UNAME 1
 
@@ -418,6 +454,9 @@
 /* Define to 1 if your  declares `struct tm'. */
 /* #undef TM_IN_SYS_TIME */
 
+/* Define to 1 to enable synchronisation with udev processing. */
+/* #undef UDEV_SYNC_SUPPORT */
+
 /* Define to empty if `const' does no

CVS commit: src/external/gpl2/lvm2/dist

2009-12-01 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec  2 00:59:19 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist: lvm2netbsd

Log Message:
Fix comment about running ./configure script.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/gpl2/lvm2/dist/lvm2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lvm2netbsd
diff -u src/external/gpl2/lvm2/dist/lvm2netbsd:1.1.1.3 src/external/gpl2/lvm2/dist/lvm2netbsd:1.2
--- src/external/gpl2/lvm2/dist/lvm2netbsd:1.1.1.3	Wed Dec  2 00:25:39 2009
+++ src/external/gpl2/lvm2/dist/lvm2netbsd	Wed Dec  2 00:59:19 2009
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: lvm2netbsd,v 1.1.1.3 2009/12/02 00:25:39 haad Exp $
+#	$NetBSD: lvm2netbsd,v 1.2 2009/12/02 00:59:19 haad Exp $
 #
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -34,7 +34,7 @@
 #
 # ./configure --with-cluster=none --with-snapshots=internal --with-clvmd=none 
 #   --with-lvm1=none --with-cluster=none --disable-readline --enable-o_direct 
-#   --enable-devmapper
+#   --disable-udev_sync --enable-devmapper
 #
 # based on texinfo2netbsd
 #



CVS commit: src/external/gpl2/lvm2/dist

2009-12-01 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Dec  2 00:27:24 UTC 2009

Update of /cvsroot/src/external/gpl2/lvm2/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv14786

Log Message:
Import of new version of lvm2tools LVM2-2-02-56.

Status:

Vendor Tag: REDHAT
Release Tags:   LVM2-02-56

U src/external/gpl2/lvm2/dist/COPYING
N src/external/gpl2/lvm2/dist/make.tmpl
U src/external/gpl2/lvm2/dist/configure.in
U src/external/gpl2/lvm2/dist/configure
U src/external/gpl2/lvm2/dist/make.tmpl.in
U src/external/gpl2/lvm2/dist/WHATS_NEW_DM
U src/external/gpl2/lvm2/dist/WHATS_NEW
U src/external/gpl2/lvm2/dist/VERSION_DM
U src/external/gpl2/lvm2/dist/VERSION
U src/external/gpl2/lvm2/dist/README
U src/external/gpl2/lvm2/dist/Makefile.in
N src/external/gpl2/lvm2/dist/Makefile
U src/external/gpl2/lvm2/dist/INSTALL
U src/external/gpl2/lvm2/dist/COPYING.LIB
U src/external/gpl2/lvm2/dist/lvm2netbsd
U src/external/gpl2/lvm2/dist/include/version.h
N src/external/gpl2/lvm2/dist/include/.symlinks.in
U src/external/gpl2/lvm2/dist/include/Makefile.in
N src/external/gpl2/lvm2/dist/include/Makefile
U src/external/gpl2/lvm2/dist/include/clvm.h
U src/external/gpl2/lvm2/dist/include/kdev_t.h
U src/external/gpl2/lvm2/dist/include/dmlib.h
N src/external/gpl2/lvm2/dist/include/dm-log-userspace.h
U src/external/gpl2/lvm2/dist/include/dm-logging.h
C src/external/gpl2/lvm2/dist/include/dm-ioctl.h
U src/external/gpl2/lvm2/dist/include/libdevmapper.h
U src/external/gpl2/lvm2/dist/include/uuid.h
U src/external/gpl2/lvm2/dist/include/report.h
U src/external/gpl2/lvm2/dist/include/sharedlib.h
U src/external/gpl2/lvm2/dist/include/lvm-wrappers.h
N src/external/gpl2/lvm2/dist/include/lvm-version.h
U src/external/gpl2/lvm2/dist/include/lvm-string.h
U src/external/gpl2/lvm2/dist/include/lvm-globals.h
U src/external/gpl2/lvm2/dist/include/lvm-file.h
U src/external/gpl2/lvm2/dist/include/lvm-exec.h
U src/external/gpl2/lvm2/dist/include/lib.h
U src/external/gpl2/lvm2/dist/include/last-path-component.h
U src/external/gpl2/lvm2/dist/include/util.h
U src/external/gpl2/lvm2/dist/include/intl.h
U src/external/gpl2/lvm2/dist/include/crc.h
C src/external/gpl2/lvm2/dist/include/configure.h
U src/external/gpl2/lvm2/dist/include/xlate.h
U src/external/gpl2/lvm2/dist/include/memlock.h
U src/external/gpl2/lvm2/dist/include/segtype.h
U src/external/gpl2/lvm2/dist/include/pv_alloc.h
U src/external/gpl2/lvm2/dist/include/metadata-exported.h
U src/external/gpl2/lvm2/dist/include/metadata.h
U src/external/gpl2/lvm2/dist/include/lv_alloc.h
U src/external/gpl2/lvm2/dist/include/lvm-logging.h
U src/external/gpl2/lvm2/dist/include/log.h
U src/external/gpl2/lvm2/dist/include/locking.h
U src/external/gpl2/lvm2/dist/include/label.h
U src/external/gpl2/lvm2/dist/include/text_import.h
U src/external/gpl2/lvm2/dist/include/text_export.h
U src/external/gpl2/lvm2/dist/include/format-text.h
U src/external/gpl2/lvm2/dist/include/archiver.h
U src/external/gpl2/lvm2/dist/include/format_pool.h
U src/external/gpl2/lvm2/dist/include/format1.h
U src/external/gpl2/lvm2/dist/include/filter.h
U src/external/gpl2/lvm2/dist/include/filter-sysfs.h
U src/external/gpl2/lvm2/dist/include/filter-regex.h
U src/external/gpl2/lvm2/dist/include/filter-md.h
U src/external/gpl2/lvm2/dist/include/filter-persistent.h
U src/external/gpl2/lvm2/dist/include/filter-composite.h
U src/external/gpl2/lvm2/dist/include/display.h
U src/external/gpl2/lvm2/dist/include/device.h
U src/external/gpl2/lvm2/dist/include/dev-cache.h
U src/external/gpl2/lvm2/dist/include/str_list.h
U src/external/gpl2/lvm2/dist/include/lvm-types.h
U src/external/gpl2/lvm2/dist/include/btree.h
U src/external/gpl2/lvm2/dist/include/defaults.h
U src/external/gpl2/lvm2/dist/include/config.h
U src/external/gpl2/lvm2/dist/include/toolcontext.h
U src/external/gpl2/lvm2/dist/include/errors.h
U src/external/gpl2/lvm2/dist/include/lvmcache.h
U src/external/gpl2/lvm2/dist/include/targets.h
U src/external/gpl2/lvm2/dist/include/activate.h
N src/external/gpl2/lvm2/dist/include/lvm2app.h
U src/external/gpl2/lvm2/dist/include/libdevmapper-event.h
U src/external/gpl2/lvm2/dist/include/pogen.h
U src/external/gpl2/lvm2/dist/include/.symlinks
U src/external/gpl2/lvm2/dist/tools/vgsplit.c
U src/external/gpl2/lvm2/dist/tools/.exported_symbols
U src/external/gpl2/lvm2/dist/tools/Makefile.in
U src/external/gpl2/lvm2/dist/tools/args.h
U src/external/gpl2/lvm2/dist/tools/cmdnames.h
U src/external/gpl2/lvm2/dist/tools/commands.h
U src/external/gpl2/lvm2/dist/tools/dmsetup.c
U src/external/gpl2/lvm2/dist/tools/dumpconfig.c
U src/external/gpl2/lvm2/dist/tools/formats.c
U src/external/gpl2/lvm2/dist/tools/lvchange.c
U src/external/gpl2/lvm2/dist/tools/lvconvert.c
U src/external/gpl2/lvm2/dist/tools/lvcreate.c
U src/external/gpl2/lvm2/dist/tools/lvdisplay.c
U src/external/gpl2/lvm2/dist/tools/lvextend.c
U src/external/gpl2/lvm2/dist/tools/lvm-static.c
U src/external/gpl2/lvm2/dist/tools/lvm.c
U src/external/gpl2/lvm2/dist/tools/lvm2cmd

CVS commit: src/external/gpl2/lvm2/dist

2009-12-01 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Tue Dec  1 23:11:17 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/include: dm-ioctl.h
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c
libdm_netbsd.c

Log Message:
Revert my commit which added knowledge about dm targets to libdevmapper,
this breaks abstraction. Because only lvmtools/lvmlib and device-mapper can
have knowledge about target mapping and libdevmapper only passes requests
from lvmtools to kernel and back. Bump major library and driver version.

Requested by: yamt@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/dist/include/dm-ioctl.h
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/include/dm-ioctl.h
diff -u src/external/gpl2/lvm2/dist/include/dm-ioctl.h:1.2 src/external/gpl2/lvm2/dist/include/dm-ioctl.h:1.3
--- src/external/gpl2/lvm2/dist/include/dm-ioctl.h:1.2	Fri Jun  5 20:11:21 2009
+++ src/external/gpl2/lvm2/dist/include/dm-ioctl.h	Tue Dec  1 23:11:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm-ioctl.h,v 1.2 2009/06/05 20:11:21 haad Exp $	*/
+/*	$NetBSD: dm-ioctl.h,v 1.3 2009/12/01 23:11:17 haad Exp $	*/
 
 /*
  * Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
@@ -259,7 +259,7 @@
 #define DM_TARGET_MSG	 _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
 #define DM_DEV_SET_GEOMETRY	_IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
 
-#define DM_VERSION_MAJOR	4
+#define DM_VERSION_MAJOR	6
 #define DM_VERSION_MINOR	15
 #define DM_VERSION_PATCHLEVEL	0
 #define DM_VERSION_EXTRA	"-ioctl (2008-04-23)"

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.2 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.3
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.2	Fri Jun  5 19:57:25 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Tue Dec  1 23:11:17 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.2 2009/06/05 19:57:25 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.3 2009/12/01 23:11:17 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -367,8 +367,6 @@
 	
 	nbsd_get_dm_major(&dm_major, DM_BLOCK_MAJOR);
 
-	log_error("format_dev %d--%d %d", dev_major, dev_minor, bufsize);
-
 	if (bufsize < 8)
 		return 0;
 	
@@ -595,7 +593,6 @@
 {
 	prop_array_t cmd_array;
 	prop_dictionary_t target_spec;
-	prop_dictionary_t target_param;
 	
 	struct target *t;
 	
@@ -620,10 +617,7 @@
 		strlcpy(type,t->type,DM_MAX_TYPE_NAME);
 
 		prop_dictionary_set_cstring(target_spec,DM_TABLE_TYPE,type);
-		
-		target_param = nbsd_dm_parse_param(type, t->params);
-		prop_dictionary_set(target_spec, DM_TABLE_PARAMS, target_param);
-		prop_object_release(target_param);
+		prop_dictionary_set_cstring(target_spec,DM_TABLE_PARAMS,t->params);
 
 		prop_array_set(cmd_array,count,target_spec);
 

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.3 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.4
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.3	Tue Jun  9 18:29:09 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c	Tue Dec  1 23:11:17 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm_netbsd.c,v 1.3 2009/06/09 18:29:09 haad Exp $*/
+/*  $NetBSD: libdm_netbsd.c,v 1.4 2009/12/01 23:11:17 haad Exp $*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -39,7 +39,6 @@
 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -48,11 +47,6 @@
 
 #include "lib.h"
 
-struct nbsd_dm_target_param {
-	char *name;
-	prop_dictionary_t (*parse)(char *);
-};
-
 #define DMI_SIZE 16 * 1024
 
 static int dm_list_versions(prop_dictionary_t, struct dm_ioctl *);
@@ -60,206 +54,6 @@
 static int dm_dev_deps(prop_dictionary_t, struct dm_ioctl *);
 static int dm_table_status(prop_dictionary_t, struct dm_ioctl *);
 
-static prop_dictionary_t dm_parse_linear(char *);
-static prop_dictionary_t dm_parse_stripe(char *);
-static prop_dictionary_t dm_parse_mirror(char *);
-static prop_dictionary_t dm_parse_snapshot(char *);
-static prop_dictionary_t dm_parse_snapshot_origin(char *);
-static prop_dictionary_t dm_parse_default(char *);
-
-static struct nbsd_dm_target_param dmt_parse[] = {
-	{"linear", dm_parse_linear},
-	{"striped", dm_parse_stripe},
-	{"mirror", dm_parse_mirror},
-	{"snapshot", dm_parse_snapshot},
-	{"snapshot-origin", dm_parse_snapshot_origin},
-	{NULL, NULL},
-};
-
-/*
- * Parse params string to target specific proplib dictionary.
- *
- * params
- * 
-

CVS commit: src/external/gpl2/lvm2/dist/lib

2009-10-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Oct 16 21:00:41 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/lib/device: dev-cache.c
src/external/gpl2/lvm2/dist/lib/netbsd: dev.c

Log Message:
Only match raw devices. Only match against the char major as extracted
from the kernel. Prevents aliasing nwt0 and rwd0e. OK haad@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/dist/lib/device/dev-cache.c
cvs rdiff -u -r1.1 -r1.2 src/external/gpl2/lvm2/dist/lib/netbsd/dev.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/lib/device/dev-cache.c
diff -u src/external/gpl2/lvm2/dist/lib/device/dev-cache.c:1.2 src/external/gpl2/lvm2/dist/lib/device/dev-cache.c:1.3
--- src/external/gpl2/lvm2/dist/lib/device/dev-cache.c:1.2	Mon Dec 22 00:56:58 2008
+++ src/external/gpl2/lvm2/dist/lib/device/dev-cache.c	Fri Oct 16 21:00:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev-cache.c,v 1.2 2008/12/22 00:56:58 haad Exp $	*/
+/*	$NetBSD: dev-cache.c,v 1.3 2009/10/16 21:00:41 joerg Exp $	*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -435,11 +435,14 @@
 		 * raw and block. I can insert only  existing
 		 * raw and block device.
 		 */
+		if (S_ISBLK(info.st_mode)) {
+			log_debug("%s: Not a raw device", path);
+			return_0;
+		}
 		if (nbsd_check_dev(MAJOR(info.st_rdev),path) < 0) {
-			log_debug("%s: Not a block device.", path);
+			log_debug("%s: Not a known raw device", path);
 			return_0;
 		}
-
 #else
 		if (!S_ISBLK(info.st_mode))
 			log_debug("%s: Not a block device", path);

Index: src/external/gpl2/lvm2/dist/lib/netbsd/dev.c
diff -u src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.1 src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.2
--- src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.1	Mon Dec 22 00:56:59 2008
+++ src/external/gpl2/lvm2/dist/lib/netbsd/dev.c	Fri Oct 16 21:00:41 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: dev.c,v 1.1 2008/12/22 00:56:59 haad Exp $*/
+/*  $NetBSD: dev.c,v 1.2 2009/10/16 21:00:41 joerg Exp $*/
 
 /*
  * NetBSD specific device routines are added to this file.
@@ -61,11 +61,7 @@
 		if (kd[i].d_cmajor != -1 && kd[i].d_bmajor != -1) {
 			
 			if (kd[i].d_cmajor == major)
-return kd[i].d_bmajor;
-			
-			if (kd[i].d_bmajor == major)
-return kd[i].d_cmajor;
-			
+return 0;
 		}
 	
 	return LVM_FAILURE;



CVS commit: src/external/gpl2/lvm2/dist/man

2009-10-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Oct 15 00:59:01 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/man: vgrename.8

Log Message:
Fix markup.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/dist/man/vgrename.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/man/vgrename.8
diff -u src/external/gpl2/lvm2/dist/man/vgrename.8:1.2 src/external/gpl2/lvm2/dist/man/vgrename.8:1.3
--- src/external/gpl2/lvm2/dist/man/vgrename.8:1.2	Wed Feb 18 12:16:13 2009
+++ src/external/gpl2/lvm2/dist/man/vgrename.8	Thu Oct 15 00:59:01 2009
@@ -1,4 +1,4 @@
-.\"$NetBSD: vgrename.8,v 1.2 2009/02/18 12:16:13 haad Exp $
+.\"$NetBSD: vgrename.8,v 1.3 2009/10/15 00:59:01 joerg Exp $
 .\"
 .TH VGRENAME 8 "LVM TOOLS 2.02.44-cvs (02-17-09)" "Sistina Software UK" \" -*- nroff -*-
 .SH NAME
@@ -24,18 +24,18 @@
 .SH Examples
 "vgrename /dev/vg02 /dev/my_volume_group" renames existing
 volume group "vg02" to "my_volume_group".
-.TP
+.PP
 "vgrename vg02 my_volume_group" does the same.
-.TP
+.PP
 "vgrename Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 VolGroup00_tmp"
 changes the name of the Volume Group with UUID
 Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 to 
 "VolGroup00_tmp".
-
+.PP
 All the Volume Groups visible to a system need to have different
 names.  Otherwise many LVM2 commands will refuse to run or give
 warning messages.
-
+.PP
 This situation could arise when disks are moved between machines.  If
 a disk is connected and it contains a Volume Group with the same name
 as the Volume Group containing your root filesystem the machine might
@@ -43,7 +43,6 @@
 different UUIDs (unless the disk was cloned) so you can rename
 one of the conflicting Volume Groups with
 \fBvgrename\fP.
-.TP
 .SH SEE ALSO
 .BR lvm (8),
 .BR vgchange (8),



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2009-06-09 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Tue Jun  9 18:29:09 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm_netbsd.c

Log Message:
Create default target_params parse routine which is called when we doesn't
find name of a target in known target list. This routine will pass whole param
string in a dictionary with key called params.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.2 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.3
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.2	Fri Jun  5 19:57:25 2009
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c	Tue Jun  9 18:29:09 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm_netbsd.c,v 1.2 2009/06/05 19:57:25 haad Exp $*/
+/*  $NetBSD: libdm_netbsd.c,v 1.3 2009/06/09 18:29:09 haad Exp $*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -65,6 +65,7 @@
 static prop_dictionary_t dm_parse_mirror(char *);
 static prop_dictionary_t dm_parse_snapshot(char *);
 static prop_dictionary_t dm_parse_snapshot_origin(char *);
+static prop_dictionary_t dm_parse_default(char *);
 
 static struct nbsd_dm_target_param dmt_parse[] = {
 	{"linear", dm_parse_linear},
@@ -104,8 +105,6 @@
 	dict = NULL;
 	slen = strlen(target);
 
-	printf("Parsing target %s, string %s\n", target, params);
-
 	/* copy parameter string to new buffer */
 	param = dm_malloc(strlen(params) * sizeof(char));
 	strlcpy(param, params, strlen(params)+1);
@@ -119,11 +118,10 @@
 		if (strncmp(target, dmt_parse[i].name, slen) == 0)
 			break;
 	}
-	
-if (dmt_parse[i].name == NULL)
-return NULL;
 
-	printf("target found %s, params %s\n", dmt_parse[i].name, params);
+	/* Create default dictionary with key params and with string as a value */
+if (dmt_parse[i].name == NULL)
+		dm_parse_default(param);
 	
 	dict = dmt_parse[i].parse(param);
 	
@@ -157,9 +155,7 @@
 		if (**ap != '\0')
 		ap++;
 	}
-	printf("Linear target params parsing routine called %s -- %d \n", 
-		argv[1], strtol(argv[1], (char **)NULL, 10));
-	
+		
 	prop_dictionary_set_cstring(dict, DM_TARGET_LINEAR_DEVICE, argv[0]);
 	prop_dictionary_set_uint64(dict, DM_TARGET_LINEAR_OFFSET, strtoll(argv[1], (char **)NULL, 10));
 		
@@ -192,7 +188,6 @@
 		if (**ap != '\0')
 		ap++;
 	}
-	printf("Stripe target params parsing routine called\n");
 	
 	prop_dictionary_set_uint64(dict, DM_TARGET_STRIPE_STRIPES, 
 		strtol(argv[0], (char **)NULL, 10));
@@ -253,6 +248,18 @@
 	return dict;
 }
 
+static prop_dictionary_t 
+dm_parse_default(char *params)
+{
+	prop_dictionary_t dict;
+	
+	dict = prop_dictionary_create();
+
+	prop_dictionary_set_cstring(dict, DM_TABLE_PARAMS, params);
+	
+	return dict;
+}
+
 int
 nbsd_get_dm_major(uint32_t *major,  int type)
 {



CVS commit: src/external/gpl2/lvm2/dist/include

2009-06-05 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Fri Jun  5 20:11:21 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/include: dm-ioctl.h

Log Message:
Bump libdevmapper minor number, because of ioctl protocol change.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/lvm2/dist/include/dm-ioctl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/include/dm-ioctl.h
diff -u src/external/gpl2/lvm2/dist/include/dm-ioctl.h:1.1.1.1 src/external/gpl2/lvm2/dist/include/dm-ioctl.h:1.2
--- src/external/gpl2/lvm2/dist/include/dm-ioctl.h:1.1.1.1	Mon Dec 22 00:18:43 2008
+++ src/external/gpl2/lvm2/dist/include/dm-ioctl.h	Fri Jun  5 20:11:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm-ioctl.h,v 1.1.1.1 2008/12/22 00:18:43 haad Exp $	*/
+/*	$NetBSD: dm-ioctl.h,v 1.2 2009/06/05 20:11:21 haad Exp $	*/
 
 /*
  * Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
@@ -260,7 +260,7 @@
 #define DM_DEV_SET_GEOMETRY	_IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
 
 #define DM_VERSION_MAJOR	4
-#define DM_VERSION_MINOR	14
+#define DM_VERSION_MINOR	15
 #define DM_VERSION_PATCHLEVEL	0
 #define DM_VERSION_EXTRA	"-ioctl (2008-04-23)"
 



CVS commit: src/external/gpl2/lvm2/dist/libdm/ioctl

2009-06-05 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Fri Jun  5 19:57:25 UTC 2009

Modified Files:
src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c
libdm_netbsd.c

Log Message:
Parse dm param string in libdevmapper and not in a dm target init function.
Create proplib param dictionary entry in libdevmapper and pass it to dm in
dm_ioctl dict.
Param target is then passed to target init function, where is parse. I like
this aproach much better than passing char **argv and trusting to user input.

XXX. Add more sanity checks in kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c \
src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.1 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.2
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.1	Mon Dec 22 00:56:59 2008
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c	Fri Jun  5 19:57:25 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm-nbsd-iface.c,v 1.1 2008/12/22 00:56:59 haad Exp $*/
+/*  $NetBSD: libdm-nbsd-iface.c,v 1.2 2009/06/05 19:57:25 haad Exp $*/
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -595,6 +595,7 @@
 {
 	prop_array_t cmd_array;
 	prop_dictionary_t target_spec;
+	prop_dictionary_t target_param;
 	
 	struct target *t;
 	
@@ -619,7 +620,10 @@
 		strlcpy(type,t->type,DM_MAX_TYPE_NAME);
 
 		prop_dictionary_set_cstring(target_spec,DM_TABLE_TYPE,type);
-		prop_dictionary_set_cstring(target_spec,DM_TABLE_PARAMS,t->params);
+		
+		target_param = nbsd_dm_parse_param(type, t->params);
+		prop_dictionary_set(target_spec, DM_TABLE_PARAMS, target_param);
+		prop_object_release(target_param);
 
 		prop_array_set(cmd_array,count,target_spec);
 
Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c
diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.1 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.2
--- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c:1.1	Mon Dec 22 00:56:59 2008
+++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c	Fri Jun  5 19:57:25 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: libdm_netbsd.c,v 1.1 2008/12/22 00:56:59 haad Exp $*/
+/*  $NetBSD: libdm_netbsd.c,v 1.2 2009/06/05 19:57:25 haad Exp $*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -39,6 +39,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -47,6 +48,11 @@
 
 #include "lib.h"
 
+struct nbsd_dm_target_param {
+	char *name;
+	prop_dictionary_t (*parse)(char *);
+};
+
 #define DMI_SIZE 16 * 1024
 
 static int dm_list_versions(prop_dictionary_t, struct dm_ioctl *);
@@ -54,6 +60,199 @@
 static int dm_dev_deps(prop_dictionary_t, struct dm_ioctl *);
 static int dm_table_status(prop_dictionary_t, struct dm_ioctl *);
 
+static prop_dictionary_t dm_parse_linear(char *);
+static prop_dictionary_t dm_parse_stripe(char *);
+static prop_dictionary_t dm_parse_mirror(char *);
+static prop_dictionary_t dm_parse_snapshot(char *);
+static prop_dictionary_t dm_parse_snapshot_origin(char *);
+
+static struct nbsd_dm_target_param dmt_parse[] = {
+	{"linear", dm_parse_linear},
+	{"striped", dm_parse_stripe},
+	{"mirror", dm_parse_mirror},
+	{"snapshot", dm_parse_snapshot},
+	{"snapshot-origin", dm_parse_snapshot_origin},
+	{NULL, NULL},
+};
+
+/*
+ * Parse params string to target specific proplib dictionary.
+ *
+ * params
+ * 
+ * device
+ * 
+ *  
+ *  device
+ *  /dev/wd1a
+ *  offset
+ *  0x384
+ *  
+ * 
+ * 
+ * 
+ *
+ */
+prop_dictionary_t 
+nbsd_dm_parse_param(const char *target, const char *params)
+{
+	int i;
+	size_t slen, dlen;
+	prop_dictionary_t dict;
+	char *param;
+	
+	dict = NULL;
+	slen = strlen(target);
+
+	printf("Parsing target %s, string %s\n", target, params);
+
+	/* copy parameter string to new buffer */
+	param = dm_malloc(strlen(params) * sizeof(char));
+	strlcpy(param, params, strlen(params)+1);
+
+for(i = 0; dmt_parse[i].name != NULL; i++) {
+		dlen = strlen(dmt_parse[i].name);
+		
+		if (slen != dlen)
+			continue;
+			
+		if (strncmp(target, dmt_parse[i].name, slen) == 0)
+			break;
+	}
+	
+if (dmt_parse[i].name == NULL)
+return NULL;
+
+	printf("target found %s, params %s\n", dmt_parse[i].name, params);
+	
+	dict = dmt_parse[i].parse(param);
+	
+	dm_free(param);
+	
+	return dict;
+}
+
+/*
+ * Example line sent to dm from lvm tools when using linear target.  
+ * start length linear device1 offset1
+ * 0 65536 linear /d