Hello community,
here is the log from the commit of package lvm2
checked in at Mon Aug 21 16:35:10 CEST 2006.
--------
--- lvm2/lvm2.changes 2006-08-16 11:31:05.000000000 +0200
+++ lvm2/lvm2.changes 2006-08-21 12:26:22.000000000 +0200
@@ -1,0 +2,9 @@
+Mon Aug 21 12:26:17 CEST 2006 - fehr@suse.de
+
+- update to new version 2.02.09
+ Fix PE_ALIGN for pagesize over 32KB.
+ Separate out LVM1_PE_ALIGN and pe_align().
+ Add lvm_getpagesize wrapper.
+ Add --maxphysicalvolumes to vgchange.
+
+-------------------------------------------------------------------
Old:
----
LVM2.2.02.08.tar.bz2
New:
----
LVM2.2.02.09.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ lvm2.spec ++++++
--- /var/tmp/diff_new_pack.j12ahN/_old 2006-08-21 16:35:01.000000000 +0200
+++ /var/tmp/diff_new_pack.j12ahN/_new 2006-08-21 16:35:01.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package lvm2 (Version 2.02.08)
+# spec file for package lvm2 (Version 2.02.09)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -20,7 +20,7 @@
PreReq: %fillup_prereq %insserv_prereq
%endif
Autoreqprov: on
-Version: 2.02.08
+Version: 2.02.09
Release: 1
Summary: LVM2 Tools
Source: LVM2.%{version}.tar.bz2
@@ -175,6 +175,12 @@
%{_mandir}/man8/vgsplit.8.gz
%changelog -n lvm2
+* Mon Aug 21 2006 - fehr@suse.de
+- update to new version 2.02.09
+ Fix PE_ALIGN for pagesize over 32KB.
+ Separate out LVM1_PE_ALIGN and pe_align().
+ Add lvm_getpagesize wrapper.
+ Add --maxphysicalvolumes to vgchange.
* Wed Aug 16 2006 - fehr@suse.de
- update to new version 2.02.08
Add checks for duplicate LV name, lvid and PV id before writing metadata.
++++++ LVM2.2.02.08.tar.bz2 -> LVM2.2.02.09.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/VERSION new/LVM2.2.02.09/VERSION
--- old/LVM2.2.02.08/VERSION 2006-08-15 21:07:03.000000000 +0200
+++ new/LVM2.2.02.09/VERSION 2006-08-17 21:56:59.000000000 +0200
@@ -1 +1 @@
-2.02.08 (2006-08-15)
+2.02.09 (2006-08-17)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/WHATS_NEW new/LVM2.2.02.09/WHATS_NEW
--- old/LVM2.2.02.08/WHATS_NEW 2006-08-15 21:06:09.000000000 +0200
+++ new/LVM2.2.02.09/WHATS_NEW 2006-08-17 21:55:50.000000000 +0200
@@ -1,3 +1,10 @@
+Version 2.02.09 - 17th August 2006
+==================================
+ Fix PE_ALIGN for pagesize over 32KB.
+ Separate out LVM1_PE_ALIGN and pe_align().
+ Add lvm_getpagesize wrapper.
+ Add --maxphysicalvolumes to vgchange.
+
Version 2.02.08 - 15th August 2006
==================================
Add checks for duplicate LV name, lvid and PV id before writing metadata.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/include/.symlinks new/LVM2.2.02.09/include/.symlinks
--- old/LVM2.2.02.08/include/.symlinks 2006-05-09 23:23:49.000000000 +0200
+++ new/LVM2.2.02.09/include/.symlinks 2006-08-17 20:23:42.000000000 +0200
@@ -41,6 +41,7 @@
../lib/misc/lvm-exec.h
../lib/misc/lvm-file.h
../lib/misc/lvm-string.h
+../lib/misc/lvm-wrappers.h
../lib/misc/sharedlib.h
../lib/regex/matcher.h
../lib/report/report.h
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/Makefile.in new/LVM2.2.02.09/lib/Makefile.in
--- old/LVM2.2.02.08/lib/Makefile.in 2006-04-19 17:33:05.000000000 +0200
+++ new/LVM2.2.02.09/lib/Makefile.in 2006-08-17 20:23:42.000000000 +0200
@@ -78,6 +78,7 @@
misc/lvm-exec.c \
misc/lvm-file.c \
misc/lvm-string.c \
+ misc/lvm-wrappers.c \
mm/memlock.c \
regex/matcher.c \
regex/parse_rx.c \
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/config/config.c new/LVM2.2.02.09/lib/config/config.c
--- old/LVM2.2.02.08/lib/config/config.c 2006-05-16 18:48:30.000000000 +0200
+++ new/LVM2.2.02.09/lib/config/config.c 2006-08-17 20:23:43.000000000 +0200
@@ -187,7 +187,7 @@
use_mmap = 0;
if (use_mmap) {
- mmap_offset = offset % getpagesize();
+ mmap_offset = offset % lvm_getpagesize();
/* memory map the file */
p->fb = mmap((caddr_t) 0, size + mmap_offset, PROT_READ,
MAP_PRIVATE, dev_fd(dev), offset - mmap_offset);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/device/dev-io.c new/LVM2.2.02.09/lib/device/dev-io.c
--- old/LVM2.2.02.08/lib/device/dev-io.c 2006-05-11 20:39:24.000000000 +0200
+++ new/LVM2.2.02.09/lib/device/dev-io.c 2006-08-17 20:23:43.000000000 +0200
@@ -176,7 +176,7 @@
}
if (!block_size)
- block_size = getpagesize();
+ block_size = lvm_getpagesize();
_widen_region(block_size, where, &widened);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/format1/disk-rep.h new/LVM2.2.02.09/lib/format1/disk-rep.h
--- old/LVM2.2.02.08/lib/format1/disk-rep.h 2006-05-09 23:23:50.000000000 +0200
+++ new/LVM2.2.02.09/lib/format1/disk-rep.h 2006-08-17 21:15:27.000000000 +0200
@@ -172,6 +172,7 @@
* Layout constants.
*/
#define METADATA_ALIGN 4096UL
+#define LVM1_PE_ALIGN (65536UL >> SECTOR_SHIFT) /* PE alignment */
#define METADATA_BASE 0UL
#define PV_SIZE 1024UL
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/format1/format1.c new/LVM2.2.02.09/lib/format1/format1.c
--- old/LVM2.2.02.08/lib/format1/format1.c 2006-05-09 23:23:50.000000000 +0200
+++ new/LVM2.2.02.09/lib/format1/format1.c 2006-08-17 21:15:27.000000000 +0200
@@ -408,7 +408,7 @@
/* Ensure any residual PE structure is gone */
pv->pe_size = pv->pe_count = 0;
- pv->pe_start = PE_ALIGN;
+ pv->pe_start = LVM1_PE_ALIGN;
if (!(mem = dm_pool_create("lvm1 pv_write", 1024))) {
stack;
@@ -431,7 +431,7 @@
dev_write in order to make other disk tools happy */
dl->pvd.pv_on_disk.base = METADATA_BASE;
dl->pvd.pv_on_disk.size = PV_SIZE;
- dl->pvd.pe_on_disk.base = PE_ALIGN << SECTOR_SHIFT;
+ dl->pvd.pe_on_disk.base = LVM1_PE_ALIGN << SECTOR_SHIFT;
list_add(&pvs, &dl->list);
if (!write_disks(fmt, &pvs)) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/format1/layout.c new/LVM2.2.02.09/lib/format1/layout.c
--- old/LVM2.2.02.08/lib/format1/layout.c 2006-04-19 17:33:06.000000000 +0200
+++ new/LVM2.2.02.09/lib/format1/layout.c 2006-08-17 21:15:27.000000000 +0200
@@ -153,7 +153,7 @@
if (pe_start && end < pe_start)
end = pe_start;
- pvd->pe_start = _round_up(end, PE_ALIGN);
+ pvd->pe_start = _round_up(end, LVM1_PE_ALIGN);
} while ((pvd->pe_start + (pvd->pe_total * extent_size))
> pv->size);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/format_text/format-text.c new/LVM2.2.02.09/lib/format_text/format-text.c
--- old/LVM2.2.02.08/lib/format_text/format-text.c 2006-05-16 18:48:30.000000000 +0200
+++ new/LVM2.2.02.09/lib/format_text/format-text.c 2006-08-17 21:53:35.000000000 +0200
@@ -994,7 +994,7 @@
}
/* For orphan, creates new mdas according to policy.
- Always have an mda between end-of-label and PE_ALIGN boundary */
+ Always have an mda between end-of-label and pe_align() boundary */
static int _mda_setup(const struct format_type *fmt,
uint64_t pe_start, uint64_t pe_end,
int pvmetadatacopies,
@@ -1005,15 +1005,15 @@
uint64_t start1, mda_size1; /* First area - start of disk */
uint64_t start2, mda_size2; /* Second area - end of disk */
uint64_t wipe_size = 8 << SECTOR_SHIFT;
- size_t pagesize = getpagesize();
+ size_t pagesize = lvm_getpagesize();
if (!pvmetadatacopies) {
/* Space available for PEs */
- pv->size -= PE_ALIGN;
+ pv->size -= pe_align();
return 1;
}
- alignment = PE_ALIGN << SECTOR_SHIFT;
+ alignment = pe_align() << SECTOR_SHIFT;
disk_size = pv->size << SECTOR_SHIFT;
pe_start <<= SECTOR_SHIFT;
pe_end <<= SECTOR_SHIFT;
@@ -1055,7 +1055,7 @@
pvmetadatacopies = 1;
}
- /* Round up to PE_ALIGN boundary */
+ /* Round up to pe_align() boundary */
mda_adjustment = (mda_size1 + start1) % alignment;
if (mda_adjustment)
mda_size1 += (alignment - mda_adjustment);
@@ -1189,18 +1189,18 @@
/* Set pe_start to first aligned sector after any metadata
* areas that begin before pe_start */
- pv->pe_start = PE_ALIGN;
+ pv->pe_start = pe_align();
list_iterate_items(mda, &info->mdas) {
mdac = (struct mda_context *) mda->metadata_locn;
if (pv->dev == mdac->area.dev &&
- (mdac->area.start < (pv->pe_start << SECTOR_SHIFT)) &&
+ (mdac->area.start <= (pv->pe_start << SECTOR_SHIFT)) &&
(mdac->area.start + mdac->area.size >
(pv->pe_start << SECTOR_SHIFT))) {
pv->pe_start = (mdac->area.start + mdac->area.size)
>> SECTOR_SHIFT;
- adjustment = pv->pe_start % PE_ALIGN;
+ adjustment = pv->pe_start % pe_align();
if (adjustment)
- pv->pe_start += (PE_ALIGN - adjustment);
+ pv->pe_start += (pe_align() - adjustment);
}
}
if (!add_da
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/format_text/layout.h new/LVM2.2.02.09/lib/format_text/layout.h
--- old/LVM2.2.02.08/lib/format_text/layout.h 2006-05-09 23:23:50.000000000 +0200
+++ new/LVM2.2.02.09/lib/format_text/layout.h 2006-08-17 20:23:43.000000000 +0200
@@ -83,6 +83,6 @@
#define FMTT_VERSION 1
#define MDA_HEADER_SIZE 512
#define LVM2_LABEL "LVM2 001"
-#define MDA_SIZE_MIN (8 * (unsigned) getpagesize())
+#define MDA_SIZE_MIN (8 * (unsigned) lvm_getpagesize())
#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/metadata/metadata.c new/LVM2.2.02.09/lib/metadata/metadata.c
--- old/LVM2.2.02.08/lib/metadata/metadata.c 2006-08-09 21:33:25.000000000 +0200
+++ new/LVM2.2.02.09/lib/metadata/metadata.c 2006-08-17 21:53:36.000000000 +0200
@@ -24,6 +24,13 @@
#include "pv_alloc.h"
#include "activate.h"
+#include
+
+unsigned long pe_align(void)
+{
+ return MAX(65536UL, lvm_getpagesize()) >> SECTOR_SHIFT;
+}
+
static int _add_pv_to_vg(struct format_instance *fid, struct volume_group *vg,
const char *pv_name)
{
@@ -78,8 +85,8 @@
/* FIXME Do proper rounding-up alignment? */
/* Reserved space for label; this holds 0 for PVs created by LVM1 */
- if (pv->pe_start < PE_ALIGN)
- pv->pe_start = PE_ALIGN;
+ if (pv->pe_start < pe_align())
+ pv->pe_start = pe_align();
/*
* The next two fields should be corrected
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/metadata/metadata.h new/LVM2.2.02.09/lib/metadata/metadata.h
--- old/LVM2.2.02.08/lib/metadata/metadata.h 2006-05-11 22:03:40.000000000 +0200
+++ new/LVM2.2.02.09/lib/metadata/metadata.h 2006-08-17 21:30:59.000000000 +0200
@@ -29,11 +29,10 @@
#define MAX_STRIPES 128U
#define SECTOR_SHIFT 9L
#define SECTOR_SIZE ( 1L << SECTOR_SHIFT )
-#define STRIPE_SIZE_MIN ( (unsigned) getpagesize() >> SECTOR_SHIFT) /* PAGESIZE in sectors */
+#define STRIPE_SIZE_MIN ( (unsigned) lvm_getpagesize() >> SECTOR_SHIFT) /* PAGESIZE in sectors */
#define STRIPE_SIZE_MAX ( 512L * 1024L >> SECTOR_SHIFT) /* 512 KB in sectors */
#define STRIPE_SIZE_LIMIT ((UINT_MAX >> 2) + 1)
#define PV_MIN_SIZE ( 512L * 1024L >> SECTOR_SHIFT) /* 512 KB in sectors */
-#define PE_ALIGN (65536UL >> SECTOR_SHIFT) /* PE alignment */
#define MAX_RESTRICTED_LVS 255 /* Used by FMT_RESTRICTED_LVIDS */
/* Various flags */
@@ -403,6 +402,7 @@
/*
* Utility functions
*/
+unsigned long pe_align(void);
int vg_validate(struct volume_group *vg);
int vg_write(struct volume_group *vg);
int vg_commit(struct volume_group *vg);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/misc/lib.h new/LVM2.2.02.09/lib/misc/lib.h
--- old/LVM2.2.02.08/lib/misc/lib.h 2006-05-09 23:23:50.000000000 +0200
+++ new/LVM2.2.02.09/lib/misc/lib.h 2006-08-17 20:23:44.000000000 +0200
@@ -28,6 +28,7 @@
#include "log.h"
#include "intl.h"
#include "lvm-types.h"
+#include "lvm-wrappers.h"
#include
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/misc/lvm-wrappers.c new/LVM2.2.02.09/lib/misc/lvm-wrappers.c
--- old/LVM2.2.02.08/lib/misc/lvm-wrappers.c 1970-01-01 01:00:00.000000000 +0100
+++ new/LVM2.2.02.09/lib/misc/lvm-wrappers.c 2006-08-17 21:56:28.000000000 +0200
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "lib.h"
+
+#include
+
+int lvm_getpagesize(void)
+{
+ return getpagesize();
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/misc/lvm-wrappers.h new/LVM2.2.02.09/lib/misc/lvm-wrappers.h
--- old/LVM2.2.02.08/lib/misc/lvm-wrappers.h 1970-01-01 01:00:00.000000000 +0100
+++ new/LVM2.2.02.09/lib/misc/lvm-wrappers.h 2006-08-17 21:56:28.000000000 +0200
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
+ * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _LVM_WRAPPERS_H
+#define _LVM_WRAPPERS_H
+
+int lvm_getpagesize(void);
+
+#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/lib/mm/memlock.c new/LVM2.2.02.09/lib/mm/memlock.c
--- old/LVM2.2.02.08/lib/mm/memlock.c 2006-05-16 18:48:30.000000000 +0200
+++ new/LVM2.2.02.09/lib/mm/memlock.c 2006-08-17 20:23:44.000000000 +0200
@@ -58,7 +58,7 @@
static void _touch_memory(void *mem, size_t size)
{
- size_t pagesize = getpagesize();
+ size_t pagesize = lvm_getpagesize();
void *pos = mem;
void *end = mem + size - sizeof(long);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/man/vgchange.8 new/LVM2.2.02.09/man/vgchange.8
--- old/LVM2.2.02.08/man/vgchange.8 2006-04-06 23:15:14.000000000 +0200
+++ new/LVM2.2.02.09/man/vgchange.8 2006-08-16 16:41:41.000000000 +0200
@@ -16,6 +16,8 @@
.RB [ \-\-ignorelockingfailure]
.RB [ \-l | \-\-logicalvolume
.IR MaxLogicalVolumes ]
+.RB [ -p | \-\-maxphysicalvolumes
+.IR MaxPhysicalVolumes ]
.RB [ \-P | \-\-partial]
.RB [ \-s | \-\-physicalextentsize
.IR PhysicalExtentSize [ \fBkKmMgGtT\fR ]]
@@ -61,6 +63,18 @@
Changes the maximum logical volume number of an existing inactive
volume group.
.TP
+.BR \-p ", " \-\-maxphysicalvolumes " " \fIMaxPhysicalVolumes\fR
+Changes the maximum number of physical volumes that can belong
+to this volume group.
+For volume groups with metadata in lvm1 format, the limit is 255.
+If the metadata uses lvm2 format, the value 0
+removes this restriction: there is then no limit.
+If you have a large number of physical volumes in
+a volume group with metadata in lvm2 format,
+for tool performance reasons, you should consider
+some use of \fB--metadatacopies 0\fP
+as described in \fBpvcreate(8)\fP.
+.TP
.BR \-s ", " \-\-physicalextentsize " " \fIPhysicalExtentSize\fR[\fBkKmMgGtT\fR]
Changes the physical extent size on physical volumes of this volume group.
A size suffix (k for kilobytes up to t for terabytes) is optional, megabytes
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/tools/commands.h new/LVM2.2.02.09/tools/commands.h
--- old/LVM2.2.02.08/tools/commands.h 2006-08-01 16:56:33.000000000 +0200
+++ new/LVM2.2.02.09/tools/commands.h 2006-08-16 16:41:42.000000000 +0200
@@ -607,6 +607,7 @@
"\t -c|--clustered {y|n} |" "\n"
"\t -x|--resizeable {y|n} |" "\n"
"\t -l|--logicalvolume MaxLogicalVolumes |" "\n"
+ "\t -p|--maxphysicalvolumes MaxPhysicalVolumes |" "\n"
"\t -s|--physicalextentsize PhysicalExtentSize[kKmMgGtT] |" "\n"
"\t --addtag Tag |\n"
"\t --deltag Tag}\n"
@@ -614,8 +615,8 @@
addtag_ARG, alloc_ARG, allocation_ARG, autobackup_ARG, available_ARG,
clustered_ARG, deltag_ARG, ignorelockingfailure_ARG, logicalvolume_ARG,
- monitor_ARG, partial_ARG, physicalextentsize_ARG, resizeable_ARG,
- resizable_ARG, test_ARG, uuid_ARG)
+ maxphysicalvolumes_ARG, monitor_ARG, partial_ARG, physicalextentsize_ARG,
+ resizeable_ARG, resizable_ARG, test_ARG, uuid_ARG)
xx(vgck,
"Check the consistency of volume group(s)",
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/tools/lvconvert.c new/LVM2.2.02.09/tools/lvconvert.c
--- old/LVM2.2.02.08/tools/lvconvert.c 2006-05-16 18:48:31.000000000 +0200
+++ new/LVM2.2.02.09/tools/lvconvert.c 2006-08-17 20:23:44.000000000 +0200
@@ -102,7 +102,7 @@
int argc, char **argv)
{
int region_size;
- int pagesize = getpagesize();
+ int pagesize = lvm_getpagesize();
memset(lp, 0, sizeof(*lp));
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/tools/lvcreate.c new/LVM2.2.02.09/tools/lvcreate.c
--- old/LVM2.2.02.08/tools/lvcreate.c 2006-05-24 15:58:14.000000000 +0200
+++ new/LVM2.2.02.09/tools/lvcreate.c 2006-08-17 20:23:44.000000000 +0200
@@ -249,7 +249,7 @@
{
int argc = *pargc;
int region_size;
- int pagesize = getpagesize();
+ int pagesize = lvm_getpagesize();
if (argc && (unsigned) argc < lp->mirrors) {
log_error("Too few physical volumes on "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/LVM2.2.02.08/tools/vgchange.c new/LVM2.2.02.09/tools/vgchange.c
--- old/LVM2.2.02.08/tools/vgchange.c 2006-05-12 21:16:48.000000000 +0200
+++ new/LVM2.2.02.09/tools/vgchange.c 2006-08-16 16:41:42.000000000 +0200
@@ -312,7 +312,7 @@
if (max_lv && max_lv < vg->lv_count) {
log_error("MaxLogicalVolume is less than the current number "
- "%d of logical volume(s) for \"%s\"", vg->lv_count,
+ "%d of LVs for \"%s\"", vg->lv_count,
vg->name);
return ECMD_FAILED;
}
@@ -332,6 +332,53 @@
return ECMD_PROCESSED;
}
+static int _vgchange_physicalvolumes(struct cmd_context *cmd,
+ struct volume_group *vg)
+{
+ uint32_t max_pv = arg_uint_value(cmd, maxphysicalvolumes_ARG, 0);
+
+ if (!(vg->status & RESIZEABLE_VG)) {
+ log_error("Volume group \"%s\" must be resizeable "
+ "to change MaxPhysicalVolumes", vg->name);
+ return ECMD_FAILED;
+ }
+
+ if (arg_sign_value(cmd, maxphysicalvolumes_ARG, 0) == SIGN_MINUS) {
+ log_error("MaxPhysicalVolumes may not be negative");
+ return EINVALID_CMD_LINE;
+ }
+
+ if (!(vg->fid->fmt->features & FMT_UNLIMITED_VOLS)) {
+ if (!max_pv)
+ max_pv = 255;
+ else if (max_pv > 255) {
+ log_error("MaxPhysicalVolume limit is 255");
+ return ECMD_FAILED;
+ }
+ }
+
+ if (max_pv && max_pv < vg->pv_count) {
+ log_error("MaxPhysicalVolumes is less than the current number "
+ "%d of PVs for \"%s\"", vg->pv_count,
+ vg->name);
+ return ECMD_FAILED;
+ }
+
+ if (!archive(vg))
+ return ECMD_FAILED;
+
+ vg->max_pv = max_pv;
+
+ if (!vg_write(vg) || !vg_commit(vg))
+ return ECMD_FAILED;
+
+ backup(vg);
+
+ log_print("Volume group \"%s\" successfully changed", vg->name);
+
+ return ECMD_PROCESSED;
+}
+
static int _vgchange_pesize(struct cmd_context *cmd, struct volume_group *vg)
{
uint32_t extent_size;
@@ -508,6 +555,9 @@
else if (arg_count(cmd, logicalvolume_ARG))
r = _vgchange_logicalvolume(cmd, vg);
+ else if (arg_count(cmd, maxphysicalvolumes_ARG))
+ r = _vgchange_physicalvolumes(cmd, vg);
+
else if (arg_count(cmd, addtag_ARG))
r = _vgchange_tag(cmd, vg, addtag_ARG);
@@ -533,24 +583,26 @@
{
if (!
(arg_count(cmd, available_ARG) + arg_count(cmd, logicalvolume_ARG) +
+ arg_count(cmd, maxphysicalvolumes_ARG) +
arg_count(cmd, resizeable_ARG) + arg_count(cmd, deltag_ARG) +
arg_count(cmd, addtag_ARG) + arg_count(cmd, uuid_ARG) +
arg_count(cmd, physicalextentsize_ARG) +
arg_count(cmd, clustered_ARG) + arg_count(cmd, alloc_ARG) +
arg_count(cmd, monitor_ARG))) {
- log_error("One of -a, -c, -l, -s, -x, --uuid, --alloc, --addtag or "
- "--deltag required");
+ log_error("One of -a, -c, -l, -p, -s, -x, --uuid, --alloc, "
+ "--addtag or --deltag required");
return EINVALID_CMD_LINE;
}
/* FIXME Cope with several changes at once! */
if (arg_count(cmd, available_ARG) + arg_count(cmd, logicalvolume_ARG) +
+ arg_count(cmd, maxphysicalvolumes_ARG) +
arg_count(cmd, resizeable_ARG) + arg_count(cmd, deltag_ARG) +
arg_count(cmd, addtag_ARG) + arg_count(cmd, alloc_ARG) +
arg_count(cmd, uuid_ARG) + arg_count(cmd, clustered_ARG) +
arg_count(cmd, physicalextentsize_ARG) > 1) {
- log_error("Only one of -a, -c, -l, -s, -x, --uuid, --alloc, "
- "--addtag or --deltag allowed");
+ log_error("Only one of -a, -c, -l, -p, -s, -x, --uuid, "
+ "--alloc, --addtag or --deltag allowed");
return EINVALID_CMD_LINE;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org