From mornfall@sourceware.org Thu Jul 1 10:10:00 2010 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Thu, 01 Jul 2010 10:10:00 -0000 Subject: LVM2/tools lvconvert.c Message-ID: <20100701101052.19929.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2010-07-01 10:10:52 Modified files: tools : lvconvert.c Log message: Restore the "removemissing" behaviour of lvconvert --repair --use-policies. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.135&r2=1.136 --- LVM2/tools/lvconvert.c 2010/06/23 20:32:29 1.135 +++ LVM2/tools/lvconvert.c 2010/07/01 10:10:52 1.136 @@ -790,7 +790,6 @@ stack; return; } - log_warn("%d missing and now unallocated Physical Volumes removed from VG.", removed); } } @@ -1177,7 +1176,6 @@ int replace_log = 0; int replace_mirrors = 0; uint32_t new_log_count, log_count; - struct dm_list *failed_pvs = NULL; struct logical_volume *log_lv; cmd->handles_missing_pvs = 1; @@ -1232,14 +1230,14 @@ /* * First phase - remove faulty devices */ - if (!(failed_pvs = _failed_pv_list(lv->vg))) + if (!(lp->failed_pvs = _failed_pv_list(lv->vg))) return_0; /* * We must adjust the log first, or the entire mirror * will get stuck during a suspend. */ - if (!_lv_update_mirrored_log(lv, failed_pvs, new_log_count)) + if (!_lv_update_mirrored_log(lv, lp->failed_pvs, new_log_count)) return 0; if (lp->mirrors == 1) @@ -1252,7 +1250,7 @@ return 0; } - if (!_lv_update_log_type(cmd, lp, lv, failed_pvs, + if (!_lv_update_log_type(cmd, lp, lv, lp->failed_pvs, new_log_count)) return 0; From agk@sourceware.org Thu Jul 1 10:57:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Thu, 01 Jul 2010 10:57:00 -0000 Subject: LVM2 ./WHATS_NEW_DM man/Makefile.in Message-ID: <20100701105704.15183.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-01 10:57:03 Modified files: . : WHATS_NEW_DM man : Makefile.in Log message: Move dmeventd man page from install_lvm2 to install_device-mapper. (1.02.50) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.385&r2=1.386 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/Makefile.in.diff?cvsroot=lvm2&r1=1.39&r2=1.40 --- LVM2/WHATS_NEW_DM 2010/06/30 14:50:32 1.385 +++ LVM2/WHATS_NEW_DM 2010/07/01 10:57:03 1.386 @@ -1,5 +1,6 @@ Version 1.02.52 - ================================ + Move dmeventd man page from install_lvm2 to install_device-mapper. (1.02.50) Version 1.02.51 - 30th June 2010 ================================ --- LVM2/man/Makefile.in 2010/06/18 10:19:30 1.39 +++ LVM2/man/Makefile.in 2010/07/01 10:57:03 1.40 @@ -36,7 +36,7 @@ pvresize.8 pvs.8 pvscan.8 vgcfgbackup.8 vgcfgrestore.8 vgchange.8 \ vgck.8 vgcreate.8 vgconvert.8 vgdisplay.8 vgexport.8 vgextend.8 \ vgimport.8 vgimportclone.8 vgmerge.8 vgmknodes.8 vgreduce.8 vgremove.8 \ - vgrename.8 vgs.8 vgscan.8 vgsplit.8 $(FSADMMAN) $(DMEVENTDMAN) + vgrename.8 vgs.8 vgscan.8 vgsplit.8 $(FSADMMAN) ifneq ("@CLVMD@", "none") MAN8CLUSTER=clvmd.8 @@ -47,7 +47,7 @@ MAN8CLUSTER+=cmirrord.8 endif -MAN8DM=dmsetup.8 +MAN8DM=dmsetup.8 $(DMEVENTDMAN) MAN5DIR=$(mandir)/man5 MAN8DIR=$(mandir)/man8 From agk@sourceware.org Thu Jul 1 11:04:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Thu, 01 Jul 2010 11:04:00 -0000 Subject: LVM2 ./WHATS_NEW tools/lvm.c Message-ID: <20100701110459.31253.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-01 11:04:58 Modified files: . : WHATS_NEW tools : lvm.c Log message: Fix lvm shell crash when input is entirely whitespace. (Xinwei Hu) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1645&r2=1.1646 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvm.c.diff?cvsroot=lvm2&r1=1.111&r2=1.112 --- LVM2/WHATS_NEW 2010/06/30 21:58:13 1.1645 +++ LVM2/WHATS_NEW 2010/07/01 11:04:58 1.1646 @@ -1,5 +1,6 @@ Version 2.02.70 - ================================ + Fix lvm shell crash when input is entirely whitespace. Update partial mode warning message. Preserve memlock balance in clvmd when activation triggers a resume. --- LVM2/tools/lvm.c 2009/12/16 19:22:13 1.111 +++ LVM2/tools/lvm.c 2010/07/01 11:04:58 1.112 @@ -217,6 +217,9 @@ continue; } + if (!argc) + continue; + if (!strcmp(argv[0], "lvm")) { argv++; argc--; From mbroz@sourceware.org Thu Jul 1 21:23:00 2010 From: mbroz@sourceware.org (mbroz@sourceware.org) Date: Thu, 01 Jul 2010 21:23:00 -0000 Subject: LVM2 ./WHATS_NEW daemons/clvmd/lvm-functions.c Message-ID: <20100701212348.13367.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mbroz@sourceware.org 2010-07-01 21:23:48 Modified files: . : WHATS_NEW daemons/clvmd : lvm-functions.c Log message: Remove superfluous suspended device counter from clvmd. Moreover, in current mirror handling, when it calls activate on removed but suspended detached log this counter drops below zero and confuses debug log. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1646&r2=1.1647 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.95&r2=1.96 --- LVM2/WHATS_NEW 2010/07/01 11:04:58 1.1646 +++ LVM2/WHATS_NEW 2010/07/01 21:23:47 1.1647 @@ -1,5 +1,6 @@ Version 2.02.70 - ================================ + Remove superfluous suspended device counter from clvmd. Fix lvm shell crash when input is entirely whitespace. Update partial mode warning message. Preserve memlock balance in clvmd when activation triggers a resume. --- LVM2/daemons/clvmd/lvm-functions.c 2010/06/30 21:40:27 1.95 +++ LVM2/daemons/clvmd/lvm-functions.c 2010/07/01 21:23:48 1.96 @@ -38,7 +38,6 @@ static pthread_mutex_t lv_hash_lock; static pthread_mutex_t lvm_lock; static char last_error[1024]; -static int suspended = 0; struct lv_info { int lock_id; @@ -498,15 +497,11 @@ case LCK_LV_SUSPEND: status = do_suspend_lv(resource, lock_flags); - if (!status) - suspended++; break; case LCK_UNLOCK: case LCK_LV_RESUME: /* if active */ status = do_resume_lv(resource, lock_flags); - if (!status) - suspended--; break; case LCK_LV_ACTIVATE: @@ -844,7 +839,7 @@ struct volume_group * vg; int consistent = 0; - DEBUGLOG("Triggering backup of VG metadata for %s. suspended=%d\n", vgname, suspended); + DEBUGLOG("Triggering backup of VG metadata for %s.\n", vgname); pthread_mutex_lock(&lvm_lock); From mbroz@sourceware.org Thu Jul 1 21:46:00 2010 From: mbroz@sourceware.org (mbroz@sourceware.org) Date: Thu, 01 Jul 2010 21:46:00 -0000 Subject: LVM2 ./WHATS_NEW daemons/clvmd/refresh_clvmd.c Message-ID: <20100701214610.947.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mbroz@sourceware.org 2010-07-01 21:46:09 Modified files: . : WHATS_NEW daemons/clvmd : refresh_clvmd.c Log message: Fix another segfault in clvmd -R if no response from daemon received. Missed the same problem in another function... Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1647&r2=1.1648 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/refresh_clvmd.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13 --- LVM2/WHATS_NEW 2010/07/01 21:23:47 1.1647 +++ LVM2/WHATS_NEW 2010/07/01 21:46:09 1.1648 @@ -1,5 +1,6 @@ Version 2.02.70 - ================================ + Fix another segfault in clvmd -R if no response from daemon received. (2.02.68) Remove superfluous suspended device counter from clvmd. Fix lvm shell crash when input is entirely whitespace. Update partial mode warning message. --- LVM2/daemons/clvmd/refresh_clvmd.c 2010/06/21 15:56:58 1.12 +++ LVM2/daemons/clvmd/refresh_clvmd.c 2010/07/01 21:46:09 1.13 @@ -285,7 +285,7 @@ { int num_responses; char args[1]; // No args really. - lvm_response_t *response; + lvm_response_t *response = NULL; int saved_errno; int status; int i; From agk@sourceware.org Fri Jul 2 02:09:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Fri, 02 Jul 2010 02:09:00 -0000 Subject: LVM2 ./WHATS_NEW doc/example.conf.in lib/comma ... Message-ID: <20100702020959.8357.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-02 02:09:57 Modified files: . : WHATS_NEW doc : example.conf.in lib/commands : toolcontext.c lib/filters : filter-persistent.c filter.c filter.h Log message: Always pass unsuspended dm devices through persistent filter to other filters. Move test for suspended dm devices ahead of other filters. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1648&r2=1.1649 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/doc/example.conf.in.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.100&r2=1.101 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-persistent.c.diff?cvsroot=lvm2&r1=1.42&r2=1.43 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter.h.diff?cvsroot=lvm2&r1=1.17&r2=1.18 --- LVM2/WHATS_NEW 2010/07/01 21:46:09 1.1648 +++ LVM2/WHATS_NEW 2010/07/02 02:09:57 1.1649 @@ -1,5 +1,7 @@ Version 2.02.70 - ================================ + Always pass unsuspended dm devices through persistent filter to other filters. + Move test for suspended dm devices ahead of other filters. Fix another segfault in clvmd -R if no response from daemon received. (2.02.68) Remove superfluous suspended device counter from clvmd. Fix lvm shell crash when input is entirely whitespace. --- LVM2/doc/example.conf.in 2010/06/30 14:04:15 1.4 +++ LVM2/doc/example.conf.in 2010/07/02 02:09:57 1.5 @@ -457,13 +457,15 @@ # pvmetadatacopies = 1 # Default number of copies of metadata to maintain for each VG. - # If set to a non-zero value, LVM automatically manages the PV - # 'metadataignore' flags (see pvchange) to achieve the requested - # copies of metadata. You may set a value larger than the - # the sum of all metadata areas on all physical volumes. This value - # can be overridden on the command line of various commands. The - # default value of 0 indicates that LVM should not automatically - # manage the 'metadataignore' flags. + # If set to a non-zero value, LVM automatically chooses which of + # the available metadata areas to use to achieve the requested + # number of copies of the VG metadata. If you set a value larger + # than the the total number of metadata areas available then + # metadata is stored in them all. + # The default value of 0 ("unmanaged") disables this automatic + # management and allows you to control which metadata areas + # are used at the individual PV level using 'pvchange + # --metadataignore y/n'. # vgmetadatacopies = 0 --- LVM2/lib/commands/toolcontext.c 2010/06/01 21:47:57 1.100 +++ LVM2/lib/commands/toolcontext.c 2010/07/02 02:09:57 1.101 @@ -24,6 +24,7 @@ #include "filter-md.h" #include "filter-persistent.h" #include "filter-regex.h" +#include "filter-suspended.h" #include "filter-sysfs.h" #include "label.h" #include "lvm-file.h" --- LVM2/lib/filters/filter-persistent.c 2010/06/01 19:02:12 1.42 +++ LVM2/lib/filters/filter-persistent.c 2010/07/02 02:09:57 1.43 @@ -16,9 +16,11 @@ #include "lib.h" #include "config.h" #include "dev-cache.h" +#include "filter.h" #include "filter-persistent.h" #include "lvm-file.h" #include "lvm-string.h" +#include "activate.h" #include #include @@ -266,15 +268,31 @@ void *l = dm_hash_lookup(pf->devices, dev_name(dev)); struct str_list *sl; + /* Cached BAD? */ + if (l == PF_BAD_DEVICE) { + log_debug("%s: Skipping (cached)", dev_name(dev)); + return 0; + } + + /* Test dm devices every time, so cache them as GOOD. */ + if (MAJOR(dev->dev) == dm_major()) { + if (!l) + dm_list_iterate_items(sl, &dev->aliases) + dm_hash_insert(pf->devices, sl->str, PF_GOOD_DEVICE); + if (ignore_suspended_devices() && !device_is_usable(dev)) { + log_debug("%s: Skipping (suspended/internal)", dev_name(dev)); + return 0; + } + return pf->real->passes_filter(pf->real, dev); + } + + /* Uncached */ if (!l) { - l = pf->real->passes_filter(pf->real, dev) ? - PF_GOOD_DEVICE : PF_BAD_DEVICE; + l = pf->real->passes_filter(pf->real, dev) ? PF_GOOD_DEVICE : PF_BAD_DEVICE; dm_list_iterate_items(sl, &dev->aliases) dm_hash_insert(pf->devices, sl->str, l); - - } else if (l == PF_BAD_DEVICE) - log_debug("%s: Skipping (cached)", dev_name(dev)); + } return (l == PF_BAD_DEVICE) ? 0 : 1; } --- LVM2/lib/filters/filter.c 2010/05/17 18:39:03 1.53 +++ LVM2/lib/filters/filter.c 2010/07/02 02:09:57 1.54 @@ -42,6 +42,11 @@ static int _drbd_major = -1; static int _device_mapper_major = -1; +int dm_major(void) +{ + return _device_mapper_major; +} + int md_major(void) { return _md_major; @@ -130,14 +135,6 @@ return 0; } - /* FIXME Always check 'layer' regardless of ignore_suspended_devices */ - /* Skip suspended devices */ - if (MAJOR(dev->dev) == _device_mapper_major && - ignore_suspended_devices() && !device_is_usable(dev)) { - log_debug("%s: Skipping: Suspended or internal dm device", name); - return 0; - } - /* Check it's accessible */ if (!dev_open_flags(dev, O_RDONLY, 0, 1)) { log_debug("%s: Skipping: open failed", name); --- LVM2/lib/filters/filter.h 2009/10/27 17:00:46 1.17 +++ LVM2/lib/filters/filter.h 2010/07/02 02:09:57 1.18 @@ -35,6 +35,7 @@ void lvm_type_filter_destroy(struct dev_filter *f); +int dm_major(void); int md_major(void); int blkext_major(void); int max_partitions(int major); From agk@sourceware.org Fri Jul 2 10:25:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Fri, 02 Jul 2010 10:25:00 -0000 Subject: LVM2/lib/commands toolcontext.c Message-ID: <20100702102517.31074.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-02 10:25:16 Modified files: lib/commands : toolcontext.c Log message: remove unneeded header Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.101&r2=1.102 --- LVM2/lib/commands/toolcontext.c 2010/07/02 02:09:57 1.101 +++ LVM2/lib/commands/toolcontext.c 2010/07/02 10:25:16 1.102 @@ -24,7 +24,6 @@ #include "filter-md.h" #include "filter-persistent.h" #include "filter-regex.h" -#include "filter-suspended.h" #include "filter-sysfs.h" #include "label.h" #include "lvm-file.h" From wysochanski@sourceware.org Fri Jul 2 17:05:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Fri, 02 Jul 2010 17:05:00 -0000 Subject: LVM2/man lvm.conf.5.in pvchange.8.in pvcreate. ... Message-ID: <20100702170523.25651.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-02 17:05:22 Modified files: man : lvm.conf.5.in pvchange.8.in pvcreate.8.in vgchange.8.in vgcreate.8.in Log message: Minor changes to man pages for --metadataignore. Move the definition from pvchange to pvcreate - the location of other metadata options. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvm.conf.5.in.diff?cvsroot=lvm2&r1=1.11&r2=1.12 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/pvchange.8.in.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/pvcreate.8.in.diff?cvsroot=lvm2&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgchange.8.in.diff?cvsroot=lvm2&r1=1.10&r2=1.11 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgcreate.8.in.diff?cvsroot=lvm2&r1=1.8&r2=1.9 --- LVM2/man/lvm.conf.5.in 2010/06/30 13:03:48 1.11 +++ LVM2/man/lvm.conf.5.in 2010/07/02 17:05:22 1.12 @@ -415,7 +415,7 @@ or extended after Logical Volumes have been allocated on the device. If you do not want to store metadata on this device, it is still wise always to allocate a metadata area (use a non-zero value for -\fB--pvmetadatacopies) in case you need it in the future and to use +\fB--pvmetadatacopies\fP) in case you need it in the future and to use this option to instruct LVM2 to ignore it. .IP \fBvgmetadatacopies\fP \(em When creating a volume group using the --- LVM2/man/pvchange.8.in 2010/06/28 20:34:12 1.3 +++ LVM2/man/pvchange.8.in 2010/07/02 17:05:22 1.4 @@ -26,16 +26,6 @@ .TP .I \-x, \-\-allocatable y|n Enable or disable allocation of physical extents on this physical volume. -.TP -.I \-\-metadataignore y|n -Ignore or un-ignore metadata areas on this physical volume. If metadata -areas on a physical volume are ignored, LVM will not not store metadata -in the metadata areas present on this Physical Volume. Metadata areas -cannot be created or extended after Logical Volumes have been allocated -on the device. If you do not want to store metadata on this device, it -is still wise always to allocate a metadata area in case you need it in -the future and to use this option to instruct LVM2 to ignore it. -(This option is not applicable to the old LVM1 metadata format.) .SH Example "pvchange -x n /dev/sdk1" disallows the allocation of physical extents on this physical volume (possibly because of disk errors, or because it will --- LVM2/man/pvcreate.8.in 2010/06/30 12:49:29 1.6 +++ LVM2/man/pvcreate.8.in 2010/07/02 17:05:22 1.7 @@ -118,6 +118,16 @@ then later use \fBvgsplit\fP you must ensure that each VG is still going to have a suitable number of copies of the metadata after the split! .TP +.I \-\-metadataignore y|n +Ignore or un-ignore metadata areas on this physical volume. The default +is "n". If metadata areas on a physical volume are ignored, LVM will +not not store metadata in the metadata areas present on this Physical +Volume. Metadata areas cannot be created or extended after Logical +Volumes have been allocated on the device. If you do not want to store +metadata on this device, it is still wise always to allocate a metadata +area in case you need it in the future and to use this option to instruct +LVM2 to ignore it. +.TP .BR \-\-restorefile " file" In conjunction with \fB--uuid\fP, this extracts the location and size of the data on the PV from the file (produced by \fBvgcfgbackup\fP) --- LVM2/man/vgchange.8.in 2010/06/28 20:36:18 1.10 +++ LVM2/man/vgchange.8.in 2010/07/02 17:05:22 1.11 @@ -138,7 +138,7 @@ .BR \-\-vgmetadatacopies " " \fINumberOfCopies|unmanaged|all\fP Sets the desired number of metadata copies in the volume group. If set to a non-zero value, LVM will automatically manage the 'metadataignore' -flags on the physical volumes (see \fBpvchange --metadataignore\fP) in order +flags on the physical volumes (see \fBpvchange\fP or \fBpvcreate\fP --metadataignore\fP) in order to achieve \fINumberOfCopies\fP copies of metadata. If set to \fIunmanaged\fP, LVM will not automatically manage the 'metadataignore' flags. If set to \fIall\fP, LVM will first clear all of the 'metadataignore' flags on all --- LVM2/man/vgcreate.8.in 2010/06/28 20:38:23 1.8 +++ LVM2/man/vgcreate.8.in 2010/07/02 17:05:22 1.9 @@ -77,7 +77,7 @@ .BR \-\-vgmetadatacopies " " \fINumberOfCopies|unmanaged|all\fP Sets the desired number of metadata copies in the volume group. If set to a non-zero value, LVM will automatically manage the 'metadataignore' -flags on the physical volumes (see \fBpvchange --metadataignore\fP) in order +flags on the physical volumes (see \fBpvcreate\fP or \fBpvchange\fP --metadataignore\fP) in order to achieve \fINumberOfCopies\fP copies of metadata. If set to \fIunmanaged\fP, LVM will not automatically manage the 'metadataignore' flags. If set to \fIall\fP, LVM will first clear all of the 'metadataignore' flags on all From mornfall@sourceware.org Fri Jul 2 17:44:00 2010 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Fri, 02 Jul 2010 17:44:00 -0000 Subject: LVM2 WHATS_NEW Message-ID: <20100702174418.14692.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2010-07-02 17:44:17 Modified files: . : WHATS_NEW Log message: . Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1649&r2=1.1650 --- LVM2/WHATS_NEW 2010/07/02 02:09:57 1.1649 +++ LVM2/WHATS_NEW 2010/07/02 17:44:17 1.1650 @@ -7,6 +7,7 @@ Fix lvm shell crash when input is entirely whitespace. Update partial mode warning message. Preserve memlock balance in clvmd when activation triggers a resume. + Restore the "removemissing" behaviour of lvconvert --repair --use-policies. Version 2.02.69 - 30th June 2010 ================================ From agk@sourceware.org Fri Jul 2 21:16:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Fri, 02 Jul 2010 21:16:00 -0000 Subject: LVM2 ./WHATS_NEW ./WHATS_NEW_DM lib/display/di ... Message-ID: <20100702211652.15123.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-02 21:16:51 Modified files: . : WHATS_NEW WHATS_NEW_DM lib/display : display.h lib/metadata : mirror.c libdm : libdevmapper.h libdm-deptree.c Log message: Add printf format attributes to yes_no_prompt & dm_{sn,as}printf and fix a calle Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1650&r2=1.1651 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.386&r2=1.387 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.h.diff?cvsroot=lvm2&r1=1.21&r2=1.22 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.121&r2=1.122 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.117&r2=1.118 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.83&r2=1.84 --- LVM2/WHATS_NEW 2010/07/02 17:44:17 1.1650 +++ LVM2/WHATS_NEW 2010/07/02 21:16:50 1.1651 @@ -1,5 +1,6 @@ Version 2.02.70 - ================================ + Add printf format attributes to yes_no_prompt and fix a caller. Always pass unsuspended dm devices through persistent filter to other filters. Move test for suspended dm devices ahead of other filters. Fix another segfault in clvmd -R if no response from daemon received. (2.02.68) --- LVM2/WHATS_NEW_DM 2010/07/01 10:57:03 1.386 +++ LVM2/WHATS_NEW_DM 2010/07/02 21:16:50 1.387 @@ -1,5 +1,6 @@ Version 1.02.52 - ================================ + Add printf format attributes to dm_{sn,as}printf and fix a caller. Move dmeventd man page from install_lvm2 to install_device-mapper. (1.02.50) Version 1.02.51 - 30th June 2010 --- LVM2/lib/display/display.h 2007/08/20 20:55:25 1.21 +++ LVM2/lib/display/display.h 2010/07/02 21:16:50 1.22 @@ -59,6 +59,6 @@ const char *get_alloc_string(alloc_policy_t alloc); alloc_policy_t get_alloc_from_string(const char *str); -char yes_no_prompt(const char *prompt, ...); +char yes_no_prompt(const char *prompt, ...) __attribute__ ((format(printf, 1, 2))); #endif --- LVM2/lib/metadata/mirror.c 2010/06/28 14:19:45 1.121 +++ LVM2/lib/metadata/mirror.c 2010/07/02 21:16:50 1.122 @@ -1543,7 +1543,7 @@ return 0; } else if (yes_no_prompt("Full resync required to convert " "inactive mirror %s to core log. " - "Proceed? [y/n]: ") == 'y') + "Proceed? [y/n]: ", lv->name) == 'y') sync_percent = 0; else return 0; --- LVM2/libdm/libdevmapper.h 2010/06/23 17:03:15 1.117 +++ LVM2/libdm/libdevmapper.h 2010/07/02 21:16:51 1.118 @@ -66,6 +66,7 @@ typedef void (*dm_log_fn) (int level, const char *file, int line, const char *f, ...) __attribute__ ((format(printf, 4, 5))); + void dm_log_init(dm_log_fn fn); /* * For backward-compatibility, indicate that dm_log_init() was used @@ -943,7 +944,8 @@ /* * Returns -1 if buffer too small */ -int dm_snprintf(char *buf, size_t bufsize, const char *format, ...); +int dm_snprintf(char *buf, size_t bufsize, const char *format, ...) + __attribute__ ((format(printf, 3, 4))); /* * Returns pointer to the last component of the path. @@ -975,7 +977,8 @@ * Pointer to the buffer is stored in *buf. * Returns -1 on failure leaving buf undefined. */ -int dm_asprintf(char **buf, const char *format, ...); +int dm_asprintf(char **buf, const char *format, ...) + __attribute__ ((format(printf, 2, 3))); /********************* * regular expressions --- LVM2/libdm/libdm-deptree.c 2010/06/21 08:54:32 1.83 +++ LVM2/libdm/libdm-deptree.c 2010/07/02 21:16:51 1.84 @@ -1442,7 +1442,7 @@ struct seg_area *area; char devbuf[DM_FORMAT_DEV_BUFSIZE]; unsigned first_time = 1; - const char *logtype; + const char *logtype, *synctype; unsigned log_parm_count; dm_list_iterate_items(area, &seg->areas) { @@ -1475,12 +1475,12 @@ EMIT_PARAMS(*pos, " %s %u%s %" PRIu64, logtype, log_parm_count, devbuf, area->region_size); - logtype = (area->flags & DM_NOSYNC) ? - " nosync" : (area->flags & DM_FORCESYNC) ? - " sync" : NULL; + synctype = (area->flags & DM_NOSYNC) ? + " nosync" : (area->flags & DM_FORCESYNC) ? + " sync" : NULL; - if (logtype) - EMIT_PARAMS(*pos, logtype); + if (synctype) + EMIT_PARAMS(*pos, "%s", synctype); } break; default: From agk@sourceware.org Mon Jul 5 22:22:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 05 Jul 2010 22:22:00 -0000 Subject: LVM2 ./WHATS_NEW_DM libdm/libdevmapper.h Message-ID: <20100705222244.8013.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-05 22:22:44 Modified files: . : WHATS_NEW_DM libdm : libdevmapper.h Log message: Add parentheses to some libdevmapper.h macro arguments. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.387&r2=1.388 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.118&r2=1.119 --- LVM2/WHATS_NEW_DM 2010/07/02 21:16:50 1.387 +++ LVM2/WHATS_NEW_DM 2010/07/05 22:22:43 1.388 @@ -1,5 +1,6 @@ Version 1.02.52 - ================================ + Add parentheses to some libdevmapper.h macro arguments. Add printf format attributes to dm_{sn,as}printf and fix a caller. Move dmeventd man page from install_lvm2 to install_device-mapper. (1.02.50) --- LVM2/libdm/libdevmapper.h 2010/07/02 21:16:51 1.118 +++ LVM2/libdm/libdevmapper.h 2010/07/05 22:22:43 1.119 @@ -657,22 +657,22 @@ #define DM_BITS_PER_INT (sizeof(int) * CHAR_BIT) #define dm_bit(bs, i) \ - (bs[(i / DM_BITS_PER_INT) + 1] & (0x1 << (i & (DM_BITS_PER_INT - 1)))) + ((bs)[((i) / DM_BITS_PER_INT) + 1] & (0x1 << ((i) & (DM_BITS_PER_INT - 1)))) #define dm_bit_set(bs, i) \ - (bs[(i / DM_BITS_PER_INT) + 1] |= (0x1 << (i & (DM_BITS_PER_INT - 1)))) + ((bs)[((i) / DM_BITS_PER_INT) + 1] |= (0x1 << ((i) & (DM_BITS_PER_INT - 1)))) #define dm_bit_clear(bs, i) \ - (bs[(i / DM_BITS_PER_INT) + 1] &= ~(0x1 << (i & (DM_BITS_PER_INT - 1)))) + ((bs)[((i) / DM_BITS_PER_INT) + 1] &= ~(0x1 << ((i) & (DM_BITS_PER_INT - 1)))) #define dm_bit_set_all(bs) \ - memset(bs + 1, -1, ((*bs / DM_BITS_PER_INT) + 1) * sizeof(int)) + memset((bs) + 1, -1, ((*(bs) / DM_BITS_PER_INT) + 1) * sizeof(int)) #define dm_bit_clear_all(bs) \ - memset(bs + 1, 0, ((*bs / DM_BITS_PER_INT) + 1) * sizeof(int)) + memset((bs) + 1, 0, ((*(bs) / DM_BITS_PER_INT) + 1) * sizeof(int)) #define dm_bit_copy(bs1, bs2) \ - memcpy(bs1 + 1, bs2 + 1, ((*bs1 / DM_BITS_PER_INT) + 1) * sizeof(int)) + memcpy((bs1) + 1, (bs2) + 1, ((*(bs1) / DM_BITS_PER_INT) + 1) * sizeof(int)) /* Returns number of set bits */ static inline unsigned hweight32(uint32_t i) @@ -716,8 +716,8 @@ struct dm_hash_node *dm_hash_get_next(struct dm_hash_table *t, struct dm_hash_node *n); #define dm_hash_iterate(v, h) \ - for (v = dm_hash_get_first(h); v; \ - v = dm_hash_get_next(h, v)) + for (v = dm_hash_get_first((h)); v; \ + v = dm_hash_get_next((h), v)) /**************** * list functions From agk@sourceware.org Mon Jul 5 22:23:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 05 Jul 2010 22:23:00 -0000 Subject: LVM2 ./WHATS_NEW ./configure ./configure.in li ... Message-ID: <20100705222320.8217.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-05 22:23:15 Modified files: . : WHATS_NEW configure configure.in lib/metadata : metadata.c lib/misc : configure.h.in Log message: Randomly select which mdas to use or ignore. Add some missing standard configure.in checks. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1651&r2=1.1652 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.132&r2=1.133 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.143&r2=1.144 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.378&r2=1.379 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/configure.h.in.diff?cvsroot=lvm2&r1=1.23&r2=1.24 --- LVM2/WHATS_NEW 2010/07/02 21:16:50 1.1651 +++ LVM2/WHATS_NEW 2010/07/05 22:23:15 1.1652 @@ -1,5 +1,7 @@ Version 2.02.70 - ================================ + Randomly select which mdas to use or ignore. + Add some missing standard configure.in checks. Add printf format attributes to yes_no_prompt and fix a caller. Always pass unsuspended dm devices through persistent filter to other filters. Move test for suspended dm devices ahead of other filters. --- LVM2/configure 2010/06/07 14:31:59 1.132 +++ LVM2/configure 2010/07/05 22:23:15 1.133 @@ -736,8 +736,6 @@ CCS_CFLAGS PKGCONFIGINIT_LIBS PKGCONFIGINIT_CFLAGS -PKG_CONFIG_LIBDIR -PKG_CONFIG_PATH PKG_CONFIG POW_LIB LIBOBJS @@ -877,8 +875,6 @@ CPPFLAGS CPP PKG_CONFIG -PKG_CONFIG_PATH -PKG_CONFIG_LIBDIR PKGCONFIGINIT_CFLAGS PKGCONFIGINIT_LIBS CCS_CFLAGS @@ -1607,10 +1603,6 @@ you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility - PKG_CONFIG_PATH - directories to add to pkg-config's search path - PKG_CONFIG_LIBDIR - path overriding pkg-config's built-in search path PKGCONFIGINIT_CFLAGS C compiler flags for PKGCONFIGINIT, overriding pkg-config PKGCONFIGINIT_LIBS @@ -4531,77 +4523,23 @@ fi -{ $as_echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 -$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) -#endif -#ifndef WIFEXITED -# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif +# On IRIX 5.3, sys/types and inttypes.h are conflicting. -int -main () -{ - int s; - wait (&s); - s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_sys_wait_h=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_sys_wait_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -$as_echo "$ac_cv_header_sys_wait_h" >&6; } -if test $ac_cv_header_sys_wait_h = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_SYS_WAIT_H 1 -_ACEOF -fi -{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if test "${ac_cv_header_time+set}" = set; then + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -4610,18 +4548,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#include +$ac_includes_default -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -4641,44 +4570,35 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_time=yes + eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_time=no + eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - +done -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +{ $as_echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 +$as_echo_n "checking whether sys/types.h defines makedev... " >&6; } +if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -4687,19 +4607,24 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> +#include +int +main () +{ +return makedev(0, 0); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -4708,64 +4633,39 @@ (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_header_sys_types_h_makedev=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" + ac_cv_header_sys_types_h_makedev=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 +$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } -done - - - - - - - - - - - - - - - -for ac_header in locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \ - libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h sys/wait.h time.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +if test $ac_cv_header_sys_types_h_makedev = no; then +if test "${ac_cv_header_sys_mkdev_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +$as_echo_n "checking for sys/mkdev.h... " >&6; } +if test "${ac_cv_header_sys_mkdev_h+set}" = set; then $as_echo_n "(cached) " >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 +$as_echo_n "checking sys/mkdev.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4773,7 +4673,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <$ac_header> +#include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -4806,15 +4706,15 @@ $as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 +$as_echo_n "checking sys/mkdev.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +#include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in @@ -4848,79 +4748,62 @@ # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +{ $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +$as_echo_n "checking for sys/mkdev.h... " >&6; } +if test "${ac_cv_header_sys_mkdev_h+set}" = set; then $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=\$ac_header_preproc" + ac_cv_header_sys_mkdev_h=$ac_header_preproc fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then + +cat >>confdefs.h <<\_ACEOF +#define MAJOR_IN_MKDEV 1 _ACEOF -else - { { $as_echo "$as_me:$LINENO: error: bailing out" >&5 -$as_echo "$as_me: error: bailing out" >&2;} - { (exit 1); exit 1; }; } fi -done - - -case "$host_os" in - linux*) - -for ac_header in asm/byteorder.h linux/fs.h malloc.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + if test $ac_cv_header_sys_mkdev_h = no; then + if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +$as_echo_n "checking for sys/sysmacros.h... " >&6; } +if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then $as_echo_n "(cached) " >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 +$as_echo_n "checking sys/sysmacros.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4928,7 +4811,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <$ac_header> +#include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -4961,15 +4844,15 @@ $as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 +$as_echo_n "checking sys/sysmacros.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +#include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in @@ -5003,84 +4886,74 @@ # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +{ $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +$as_echo_n "checking for sys/sysmacros.h... " >&6; } +if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=\$ac_header_preproc" + ac_cv_header_sys_sysmacros_h=$ac_header_preproc fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then + +cat >>confdefs.h <<\_ACEOF +#define MAJOR_IN_SYSMACROS 1 _ACEOF -else - { { $as_echo "$as_me:$LINENO: error: bailing out" >&5 -$as_echo "$as_me: error: bailing out" >&2;} - { (exit 1); exit 1; }; } fi -done - ;; - darwin*) + fi +fi -for ac_header in machine/endian.h sys/disk.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -5100,57 +4973,384 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +#include + _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +{ $as_echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 +$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if test "${ac_cv_header_sys_wait_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +int +main () +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && test -s conftest.$ac_objext; then + ac_cv_header_sys_wait_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no + ac_cv_header_sys_wait_h=no fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +$as_echo "$ac_cv_header_sys_wait_h" >&6; } +if test $ac_cv_header_sys_wait_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SYS_WAIT_H 1 +_ACEOF + +fi + +{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if test "${ac_cv_header_time+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_time=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_time=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + + + + + + + + + + + + + + + + +for ac_header in locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \ + langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \ + sys/wait.h time.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -5177,71 +5377,1316 @@ ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + { { $as_echo "$as_me:$LINENO: error: bailing out" >&5 +$as_echo "$as_me: error: bailing out" >&2;} + { (exit 1); exit 1; }; } +fi + +done + + +case "$host_os" in + linux*) + + + +for ac_header in asm/byteorder.h linux/fs.h malloc.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + { { $as_echo "$as_me:$LINENO: error: bailing out" >&5 +$as_echo "$as_me: error: bailing out" >&2;} + { (exit 1); exit 1; }; } +fi + +done + ;; + darwin*) + + +for ac_header in machine/endian.h sys/disk.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + { { $as_echo "$as_me:$LINENO: error: bailing out" >&5 +$as_echo "$as_me: error: bailing out" >&2;} + { (exit 1); exit 1; }; } +fi + +done + ;; +esac + + + + + + + + + + + + + + + + + +for ac_header in ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \ + stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \ + sys/types.h unistd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + { { $as_echo "$as_me:$LINENO: error: bailing out" >&5 +$as_echo "$as_me: error: bailing out" >&2;} + { (exit 1); exit 1; }; } +fi + +done + + + +for ac_header in termios.h sys/statvfs.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +################################################################################ +{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_const=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const /**/ +_ACEOF + +fi + +{ $as_echo "$as_me:$LINENO: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if test "${ac_cv_c_inline+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_inline=$ac_kw +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 +$as_echo_n "checking for struct stat.st_rdev... " >&6; } +if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static struct stat ac_aggr; +if (ac_aggr.st_rdev) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_stat_st_rdev=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static struct stat ac_aggr; +if (sizeof ac_aggr.st_rdev) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_stat_st_rdev=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_struct_stat_st_rdev=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 +$as_echo "$ac_cv_member_struct_stat_st_rdev" >&6; } +if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_RDEV 1 +_ACEOF + + +fi + +{ $as_echo "$as_me:$LINENO: checking for off_t" >&5 +$as_echo_n "checking for off_t... " >&6; } +if test "${ac_cv_type_off_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_off_t=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof (off_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((off_t))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_off_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +$as_echo "$ac_cv_type_off_t" >&6; } +if test "x$ac_cv_type_off_t" = x""yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5 +$as_echo_n "checking for pid_t... " >&6; } +if test "${ac_cv_type_pid_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_pid_t=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof (pid_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((pid_t))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_pid_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +$as_echo "$ac_cv_type_pid_t" >&6; } +if test "x$ac_cv_type_pid_t" = x""yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } +if test "${ac_cv_type_signal+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_signal=int +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_signal=void +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } +if test "${ac_cv_type_size_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_size_t=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((size_t))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_size_t=yes fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - { { $as_echo "$as_me:$LINENO: error: bailing out" >&5 -$as_echo "$as_me: error: bailing out" >&2;} - { (exit 1); exit 1; }; } -fi - -done - ;; -esac - - - - - - - - - - - + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +$as_echo "$ac_cv_type_size_t" >&6; } +if test "x$ac_cv_type_size_t" = x""yes; then + : +else +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF +fi -for ac_header in ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \ - stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \ - sys/types.h unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +{ $as_echo "$as_me:$LINENO: checking for mode_t" >&5 +$as_echo_n "checking for mode_t... " >&6; } +if test "${ac_cv_type_mode_t+set}" = set; then $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } + ac_cv_type_mode_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5249,7 +6694,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <$ac_header> +int +main () +{ +if (sizeof (mode_t)) + return 0; + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -5269,138 +6721,95 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +$ac_includes_default +int +main () +{ +if (sizeof ((mode_t))) + return 0; + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && test -s conftest.$ac_objext; then + : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no + ac_cv_type_mode_t=yes fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +$as_echo "$ac_cv_type_mode_t" >&6; } +if test "x$ac_cv_type_mode_t" = x""yes; then + : else - { { $as_echo "$as_me:$LINENO: error: bailing out" >&5 -$as_echo "$as_me: error: bailing out" >&2;} - { (exit 1); exit 1; }; } -fi -done +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF +fi -for ac_header in termios.h sys/statvfs.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for int8_t" >&5 +$as_echo_n "checking for int8_t... " >&6; } +if test "${ac_cv_c_int8_t+set}" = set; then $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_int8_t=no + for ac_type in 'int8_t' 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <$ac_header> +int +main () +{ +static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (8 - 2)) - 1) * 2 + 1))]; +test_array [0] = 0 + + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -5420,173 +6829,99 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$ac_header> +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (8 - 2)) - 1) * 2 + 1) + < ($ac_type) (((($ac_type) 1 << (8 - 2)) - 1) * 2 + 2))]; +test_array [0] = 0 + + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && test -s conftest.$ac_objext; then + : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } + case $ac_type in + int8_t) ac_cv_c_int8_t=yes ;; + *) ac_cv_c_int8_t=$ac_type ;; +esac -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +fi - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_int8_t" != no && break + done fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int8_t" >&5 +$as_echo "$ac_cv_c_int8_t" >&6; } + case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) -done +cat >>confdefs.h <<_ACEOF +#define int8_t $ac_cv_c_int8_t +_ACEOF +;; + esac -################################################################################ -{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for int16_t" >&5 +$as_echo_n "checking for int16_t... " >&6; } +if test "${ac_cv_c_int16_t+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_int16_t=no + for ac_type in 'int16_t' 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +$ac_includes_default int main () { -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif +static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (16 - 2)) - 1) * 2 + 1))]; +test_array [0] = 0 ; return 0; @@ -5610,45 +6945,23 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_c_const=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_const=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -cat >>confdefs.h <<\_ACEOF -#define const /**/ -_ACEOF - -fi - -{ $as_echo "$as_me:$LINENO: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (16 - 2)) - 1) * 2 + 1) + < ($ac_type) (((($ac_type) 1 << (16 - 2)) - 1) * 2 + 2))]; +test_array [0] = 0 + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -5668,44 +6981,52 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_c_inline=$ac_kw + : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + case $ac_type in + int16_t) ac_cv_c_int16_t=yes ;; + *) ac_cv_c_int16_t=$ac_type ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } +fi -case $ac_cv_c_inline in - inline | yes) ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_int16_t" != no && break + done +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int16_t" >&5 +$as_echo "$ac_cv_c_int16_t" >&6; } + case $ac_cv_c_int16_t in #( + no|yes) ;; #( *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif + +cat >>confdefs.h <<_ACEOF +#define int16_t $ac_cv_c_int16_t _ACEOF - ;; -esac +;; + esac -{ $as_echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 -$as_echo_n "checking for struct stat.st_rdev... " >&6; } -if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then + + { $as_echo "$as_me:$LINENO: checking for int32_t" >&5 +$as_echo_n "checking for int32_t... " >&6; } +if test "${ac_cv_c_int32_t+set}" = set; then $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_int32_t=no + for ac_type in 'int32_t' 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5715,9 +7036,9 @@ int main () { -static struct stat ac_aggr; -if (ac_aggr.st_rdev) -return 0; +static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1))]; +test_array [0] = 0 + ; return 0; } @@ -5740,12 +7061,7 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_rdev=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5755,9 +7071,10 @@ int main () { -static struct stat ac_aggr; -if (sizeof ac_aggr.st_rdev) -return 0; +static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1) + < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 2))]; +test_array [0] = 0 + ; return 0; } @@ -5780,37 +7097,52 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_member_struct_stat_st_rdev=yes + : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_member_struct_stat_st_rdev=no + case $ac_type in + int32_t) ac_cv_c_int32_t=yes ;; + *) ac_cv_c_int32_t=$ac_type ;; +esac + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_int32_t" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 -$as_echo "$ac_cv_member_struct_stat_st_rdev" >&6; } -if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int32_t" >&5 +$as_echo "$ac_cv_c_int32_t" >&6; } + case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_RDEV 1 +#define int32_t $ac_cv_c_int32_t _ACEOF +;; + esac -fi - -{ $as_echo "$as_me:$LINENO: checking for off_t" >&5 -$as_echo_n "checking for off_t... " >&6; } -if test "${ac_cv_type_off_t+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for int64_t" >&5 +$as_echo_n "checking for int64_t... " >&6; } +if test "${ac_cv_c_int64_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_off_t=no -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_int64_t=no + for ac_type in 'int64_t' 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5820,8 +7152,9 @@ int main () { -if (sizeof (off_t)) - return 0; +static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1))]; +test_array [0] = 0 + ; return 0; } @@ -5854,8 +7187,10 @@ int main () { -if (sizeof ((off_t))) - return 0; +static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1) + < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))]; +test_array [0] = 0 + ; return 0; } @@ -5883,7 +7218,11 @@ $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_off_t=yes + case $ac_type in + int64_t) ac_cv_c_int64_t=yes ;; + *) ac_cv_c_int64_t=$ac_type ;; +esac + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -5895,25 +7234,27 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_int64_t" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -$as_echo "$ac_cv_type_off_t" >&6; } -if test "x$ac_cv_type_off_t" = x""yes; then - : -else +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5 +$as_echo "$ac_cv_c_int64_t" >&6; } + case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) cat >>confdefs.h <<_ACEOF -#define off_t long int +#define int64_t $ac_cv_c_int64_t _ACEOF +;; + esac -fi - -{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5 -$as_echo_n "checking for pid_t... " >&6; } -if test "${ac_cv_type_pid_t+set}" = set; then +{ $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 +$as_echo_n "checking for ssize_t... " >&6; } +if test "${ac_cv_type_ssize_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_pid_t=no + ac_cv_type_ssize_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5924,7 +7265,7 @@ int main () { -if (sizeof (pid_t)) +if (sizeof (ssize_t)) return 0; ; return 0; @@ -5958,7 +7299,7 @@ int main () { -if (sizeof ((pid_t))) +if (sizeof ((ssize_t))) return 0; ; return 0; @@ -5987,7 +7328,7 @@ $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_pid_t=yes + ac_cv_type_ssize_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -6000,21 +7341,21 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -$as_echo "$ac_cv_type_pid_t" >&6; } -if test "x$ac_cv_type_pid_t" = x""yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 +$as_echo "$ac_cv_type_ssize_t" >&6; } +if test "x$ac_cv_type_ssize_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF -#define pid_t int +#define ssize_t int _ACEOF fi -{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if test "${ac_cv_type_signal+set}" = set; then +{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if test "${ac_cv_type_uid_t+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6024,59 +7365,42 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_signal=int +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then + ac_cv_type_uid_t=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_signal=void + ac_cv_type_uid_t=no fi +rm -f conftest* -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal +cat >>confdefs.h <<\_ACEOF +#define uid_t int _ACEOF -{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 -$as_echo_n "checking for size_t... " >&6; } -if test "${ac_cv_type_size_t+set}" = set; then +cat >>confdefs.h <<\_ACEOF +#define gid_t int +_ACEOF + +fi + + + { $as_echo "$as_me:$LINENO: checking for uint8_t" >&5 +$as_echo_n "checking for uint8_t... " >&6; } +if test "${ac_cv_c_uint8_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_size_t=no -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_uint8_t=no + for ac_type in 'uint8_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6086,8 +7410,9 @@ int main () { -if (sizeof (size_t)) - return 0; +static int test_array [1 - 2 * !(($ac_type) -1 >> (8 - 1) == 1)]; +test_array [0] = 0 + ; return 0; } @@ -6110,7 +7435,49 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF + case $ac_type in + uint8_t) ac_cv_c_uint8_t=yes ;; + *) ac_cv_c_uint8_t=$ac_type ;; +esac + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint8_t" != no && break + done +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint8_t" >&5 +$as_echo "$ac_cv_c_uint8_t" >&6; } + case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<\_ACEOF +#define _UINT8_T 1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac + + + { $as_echo "$as_me:$LINENO: checking for uint16_t" >&5 +$as_echo_n "checking for uint16_t... " >&6; } +if test "${ac_cv_c_uint16_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_uint16_t=no + for ac_type in 'uint16_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6120,8 +7487,9 @@ int main () { -if (sizeof ((size_t))) - return 0; +static int test_array [1 - 2 * !(($ac_type) -1 >> (16 - 1) == 1)]; +test_array [0] = 0 + ; return 0; } @@ -6144,15 +7512,11 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=yes -fi + case $ac_type in + uint16_t) ac_cv_c_uint16_t=yes ;; + *) ac_cv_c_uint16_t=$ac_type ;; +esac -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -6161,26 +7525,32 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint16_t" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -$as_echo "$ac_cv_type_size_t" >&6; } -if test "x$ac_cv_type_size_t" = x""yes; then - : -else +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint16_t" >&5 +$as_echo "$ac_cv_c_uint16_t" >&6; } + case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + cat >>confdefs.h <<_ACEOF -#define size_t unsigned int +#define uint16_t $ac_cv_c_uint16_t _ACEOF +;; + esac -fi -{ $as_echo "$as_me:$LINENO: checking for mode_t" >&5 -$as_echo_n "checking for mode_t... " >&6; } -if test "${ac_cv_type_mode_t+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for uint32_t" >&5 +$as_echo_n "checking for uint32_t... " >&6; } +if test "${ac_cv_c_uint32_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_mode_t=no -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_uint32_t=no + for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6190,8 +7560,9 @@ int main () { -if (sizeof (mode_t)) - return 0; +static int test_array [1 - 2 * !(($ac_type) -1 >> (32 - 1) == 1)]; +test_array [0] = 0 + ; return 0; } @@ -6214,7 +7585,49 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF + case $ac_type in + uint32_t) ac_cv_c_uint32_t=yes ;; + *) ac_cv_c_uint32_t=$ac_type ;; +esac + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint32_t" != no && break + done +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 +$as_echo "$ac_cv_c_uint32_t" >&6; } + case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<\_ACEOF +#define _UINT32_T 1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + + + { $as_echo "$as_me:$LINENO: checking for uint64_t" >&5 +$as_echo_n "checking for uint64_t... " >&6; } +if test "${ac_cv_c_uint64_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_uint64_t=no + for ac_type in 'uint64_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6224,8 +7637,9 @@ int main () { -if (sizeof ((mode_t))) - return 0; +static int test_array [1 - 2 * !(($ac_type) -1 >> (64 - 1) == 1)]; +test_array [0] = 0 + ; return 0; } @@ -6248,15 +7662,11 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_mode_t=yes -fi + case $ac_type in + uint64_t) ac_cv_c_uint64_t=yes ;; + *) ac_cv_c_uint64_t=$ac_type ;; +esac -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -6265,18 +7675,25 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint64_t" != no && break + done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -$as_echo "$ac_cv_type_mode_t" >&6; } -if test "x$ac_cv_type_mode_t" = x""yes; then - : -else +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5 +$as_echo "$ac_cv_c_uint64_t" >&6; } + case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) -cat >>confdefs.h <<_ACEOF -#define mode_t int +cat >>confdefs.h <<\_ACEOF +#define _UINT64_T 1 _ACEOF -fi + +cat >>confdefs.h <<_ACEOF +#define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac { $as_echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 $as_echo_n "checking for struct stat.st_rdev... " >&6; } @@ -6423,29 +7840,121 @@ (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_struct_tm=time.h + } && test -s conftest.$ac_objext; then + ac_cv_struct_tm=time.h +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_struct_tm=sys/time.h +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +cat >>confdefs.h <<\_ACEOF +#define TM_IN_SYS_TIME 1 +_ACEOF + +fi + + +################################################################################ +{ $as_echo "$as_me:$LINENO: checking for library containing floor" >&5 +$as_echo_n "checking for library containing floor... " >&6; } +if test "${ac_cv_search_floor+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char floor (); +int +main () +{ +return floor (); + ; + return 0; +} +_ACEOF +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_search_floor=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_struct_tm=sys/time.h -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then -cat >>confdefs.h <<\_ACEOF -#define TM_IN_SYS_TIME 1 -_ACEOF +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_floor+set}" = set; then + break +fi +done +if test "${ac_cv_search_floor+set}" = set; then + : +else + ac_cv_search_floor=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_floor" >&5 +$as_echo "$ac_cv_search_floor" >&6; } +ac_res=$ac_cv_search_floor +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +else + { { $as_echo "$as_me:$LINENO: error: bailing out" >&5 +$as_echo "$as_me: error: bailing out" >&2;} + { (exit 1); exit 1; }; } fi -################################################################################ @@ -6463,9 +7972,17 @@ -for ac_func in gethostname getpagesize memset mkdir rmdir munmap setlocale \ - strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \ - uname + + + + + + + +for ac_func in floor ftruncate gethostname getpagesize \ + gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \ + strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \ + strstr strtol strtoul uname do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -7040,20 +8557,241 @@ { $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + +{ $as_echo "$as_me:$LINENO: checking whether closedir returns void" >&5 +$as_echo_n "checking whether closedir returns void... " >&6; } +if test "${ac_cv_func_closedir_void+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_closedir_void=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header_dirent> +#ifndef __cplusplus +int closedir (); +#endif + +int +main () +{ +return closedir (opendir (".")) != 0; + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_closedir_void=no +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_closedir_void=yes +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 +$as_echo "$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +cat >>confdefs.h <<\_ACEOF +#define CLOSEDIR_VOID 1 +_ACEOF + +fi + + +for ac_header in unistd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - fi -{ $as_echo "$as_me:$LINENO: checking whether closedir returns void" >&5 -$as_echo_n "checking whether closedir returns void... " >&6; } -if test "${ac_cv_func_closedir_void+set}" = set; then +done + +{ $as_echo "$as_me:$LINENO: checking for working chown" >&5 +$as_echo_n "checking for working chown... " >&6; } +if test "${ac_cv_func_chown_works+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then - ac_cv_func_closedir_void=yes + ac_cv_func_chown_works=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7062,15 +8800,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <$ac_header_dirent> -#ifndef __cplusplus -int closedir (); -#endif +#include int main () { -return closedir (opendir (".")) != 0; + char *f = "conftest.chown"; + struct stat before, after; + + if (creat (f, 0600) < 0) + return 1; + if (stat (f, &before) < 0) + return 1; + if (chown (f, (uid_t) -1, (gid_t) -1) == -1) + return 1; + if (stat (f, &after) < 0) + return 1; + return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); + ; return 0; } @@ -7097,27 +8844,29 @@ ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_closedir_void=no + ac_cv_func_chown_works=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -ac_cv_func_closedir_void=yes +ac_cv_func_chown_works=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +rm -f conftest.chown + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 -$as_echo "$ac_cv_func_closedir_void" >&6; } -if test $ac_cv_func_closedir_void = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_chown_works" >&5 +$as_echo "$ac_cv_func_chown_works" >&6; } +if test $ac_cv_func_chown_works = yes; then cat >>confdefs.h <<\_ACEOF -#define CLOSEDIR_VOID 1 +#define HAVE_CHOWN 1 _ACEOF fi @@ -8501,20 +10250,242 @@ if (*(data + i) != *(data2 + i)) return 1; - /* Finally, make sure that changes to the mapped area do not - percolate back to the file as seen by read(). (This is a bug on - some variants of i386 svr4.0.) */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = (char *) malloc (pagesize); - if (!data3) - return 1; - if (read (fd, data3, pagesize) != pagesize) - return 1; - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - return 1; - close (fd); + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + return 1; + if (read (fd, data3, pagesize) != pagesize) + return 1; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + return 1; + close (fd); + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_mmap_fixed_mapped=yes +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_mmap_fixed_mapped=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 +$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MMAP 1 +_ACEOF + +fi +rm -f conftest.mmap + + +for ac_header in stdlib.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 +$as_echo_n "checking for GNU libc compatible realloc... " >&6; } +if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_realloc_0_nonnull=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *realloc (); +#endif + +int +main () +{ +return ! realloc (0, 0); + ; return 0; } _ACEOF @@ -8540,14 +10511,14 @@ ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_mmap_fixed_mapped=yes + ac_cv_func_realloc_0_nonnull=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -ac_cv_func_mmap_fixed_mapped=no +ac_cv_func_realloc_0_nonnull=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext @@ -8555,16 +10526,33 @@ fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } -if test $ac_cv_func_mmap_fixed_mapped = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } +if test $ac_cv_func_realloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP 1 +#define HAVE_REALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_REALLOC 0 +_ACEOF + + case " $LIBOBJS " in + *" realloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS realloc.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<\_ACEOF +#define realloc rpl_realloc _ACEOF fi -rm -f conftest.mmap + + { $as_echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 $as_echo_n "checking whether stat accepts an empty string... " >&6; } @@ -9409,10 +11397,6 @@ pkg_config_init() { - - - - if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. @@ -9525,6 +11509,7 @@ $as_echo "no" >&6; } PKG_CONFIG="" fi + fi pkg_failed=no @@ -9567,8 +11552,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -9583,11 +11566,11 @@ # Put the nasty error message in config.log where it belongs echo "$PKGCONFIGINIT_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: pkg-config initialized" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: result: pkg-config initialized" >&5 $as_echo "pkg-config initialized" >&6; } elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } { $as_echo "$as_me:$LINENO: result: pkg-config initialized" >&5 $as_echo "pkg-config initialized" >&6; } else @@ -9595,7 +11578,7 @@ PKGCONFIGINIT_LIBS=$pkg_cv_PKGCONFIGINIT_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - + : fi PKGCONFIG_INIT=1 } @@ -9801,8 +11784,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -9817,7 +11798,9 @@ # Put the nasty error message in config.log where it belongs echo "$CCS_PKG_ERRORS" >&5 - NOTFOUND=0 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + NOTFOUND=0 for ac_header in ccs.h do @@ -9974,8 +11957,6 @@ HAVE_CCS=yes fi elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } NOTFOUND=0 for ac_header in ccs.h @@ -10180,8 +12161,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -10196,7 +12175,9 @@ # Put the nasty error message in config.log where it belongs echo "$GULM_PKG_ERRORS" >&5 - NOTFOUND=0 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + NOTFOUND=0 for ac_header in libgulm.h do @@ -10353,8 +12334,6 @@ HAVE_GULM=yes fi elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } NOTFOUND=0 for ac_header in libgulm.h @@ -10562,8 +12541,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -10578,7 +12555,9 @@ # Put the nasty error message in config.log where it belongs echo "$CMAN_PKG_ERRORS" >&5 - NOTFOUND=0 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + NOTFOUND=0 for ac_header in libcman.h do @@ -10735,8 +12714,6 @@ HAVE_CMAN=yes fi elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } NOTFOUND=0 for ac_header in libcman.h @@ -10947,8 +12924,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -10963,10 +12938,10 @@ # Put the nasty error message in config.log where it belongs echo "$COROSYNC_PKG_ERRORS" >&5 - $bailout -elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } + $bailout +elif test $pkg_failed = untried; then $bailout else COROSYNC_CFLAGS=$pkg_cv_COROSYNC_CFLAGS @@ -11020,8 +12995,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -11036,10 +13009,10 @@ # Put the nasty error message in config.log where it belongs echo "$QUORUM_PKG_ERRORS" >&5 - $bailout -elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } + $bailout +elif test $pkg_failed = untried; then $bailout else QUORUM_CFLAGS=$pkg_cv_QUORUM_CFLAGS @@ -11094,8 +13067,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -11110,10 +13081,10 @@ # Put the nasty error message in config.log where it belongs echo "$SALCK_PKG_ERRORS" >&5 - $bailout -elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } + $bailout +elif test $pkg_failed = untried; then $bailout else SALCK_CFLAGS=$pkg_cv_SALCK_CFLAGS @@ -11169,8 +13140,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -11185,10 +13154,10 @@ # Put the nasty error message in config.log where it belongs echo "$CONFDB_PKG_ERRORS" >&5 - HAVE_CONFDB=no -elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } + HAVE_CONFDB=no +elif test $pkg_failed = untried; then HAVE_CONFDB=no else CONFDB_CFLAGS=$pkg_cv_CONFDB_CFLAGS @@ -11407,8 +13376,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -11423,10 +13390,10 @@ # Put the nasty error message in config.log where it belongs echo "$CPG_PKG_ERRORS" >&5 - $bailout -elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } + $bailout +elif test $pkg_failed = untried; then $bailout else CPG_CFLAGS=$pkg_cv_CPG_CFLAGS @@ -11479,8 +13446,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -11495,7 +13460,9 @@ # Put the nasty error message in config.log where it belongs echo "$DLM_PKG_ERRORS" >&5 - NOTFOUND=0 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + NOTFOUND=0 for ac_header in libdlm.h do @@ -11652,8 +13619,6 @@ HAVE_DLM=yes fi elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } NOTFOUND=0 for ac_header in libdlm.h @@ -11936,8 +13901,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -11961,7 +13924,8 @@ Alternatively, you may set the environment variables SACKPT_CFLAGS and SACKPT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." >&5 +See the pkg-config man page for more details. +" >&5 $as_echo "$as_me: error: Package requirements (libSaCkpt) were not met: $SACKPT_PKG_ERRORS @@ -11971,11 +13935,10 @@ Alternatively, you may set the environment variables SACKPT_CFLAGS and SACKPT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." >&2;} +See the pkg-config man page for more details. +" >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it @@ -12004,7 +13967,7 @@ SACKPT_LIBS=$pkg_cv_SACKPT_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - + : fi if test x$HAVE_CPG != xyes; then @@ -12048,8 +14011,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -12073,7 +14034,8 @@ Alternatively, you may set the environment variables CPG_CFLAGS and CPG_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." >&5 +See the pkg-config man page for more details. +" >&5 $as_echo "$as_me: error: Package requirements (libcpg) were not met: $CPG_PKG_ERRORS @@ -12083,11 +14045,10 @@ Alternatively, you may set the environment variables CPG_CFLAGS and CPG_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." >&2;} +See the pkg-config man page for more details. +" >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it @@ -12116,7 +14077,7 @@ CPG_LIBS=$pkg_cv_CPG_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - + : fi fi fi @@ -14509,7 +16470,6 @@ fi -# AC_FUNC_REALLOC for ac_header in sys/select.h sys/socket.h @@ -15007,6 +16967,159 @@ fi +if test x$DMEVENTD = xyes; then + +for ac_header in arpa/inet.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + { { $as_echo "$as_me:$LINENO: error: bailing out" >&5 +$as_echo "$as_me: error: bailing out" >&2;} + { (exit 1); exit 1; }; } +fi + +done + +fi + if test x$HAVE_LIBDL = xyes; then for ac_header in dlfcn.h --- LVM2/configure.in 2010/06/07 14:32:01 1.143 +++ LVM2/configure.in 2010/07/05 22:23:15 1.144 @@ -78,12 +78,14 @@ ################################################################################ dnl -- Check for header files. AC_HEADER_DIRENT +AC_HEADER_MAJOR AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_TIME AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \ - libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h sys/wait.h time.h], , + langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \ + sys/wait.h time.h], , [AC_MSG_ERROR(bailing out)]) case "$host_os" in @@ -108,22 +110,36 @@ AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_TYPE_MODE_T +AC_TYPE_INT8_T +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_SSIZE_T +AC_TYPE_UID_T +AC_TYPE_UINT8_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T AC_CHECK_MEMBERS([struct stat.st_rdev]) AC_STRUCT_TM ################################################################################ dnl -- Check for functions -AC_CHECK_FUNCS([gethostname getpagesize memset mkdir rmdir munmap setlocale \ - strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \ - uname], , [AC_MSG_ERROR(bailing out)]) +AC_SEARCH_LIBS([floor], [m], , [AC_MSG_ERROR(bailing out)]) +AC_CHECK_FUNCS([floor ftruncate gethostname getpagesize \ + gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \ + strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \ + strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)]) AC_CHECK_FUNCS(siginterrupt) AC_FUNC_ALLOCA AC_FUNC_CLOSEDIR_VOID +AC_FUNC_CHOWN AC_FUNC_FORK AC_FUNC_LSTAT AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_MMAP +AC_FUNC_REALLOC AC_FUNC_STAT AC_FUNC_STRTOD AC_FUNC_VPRINTF @@ -981,7 +997,6 @@ AC_CHECK_HEADERS(mntent.h netdb.h netinet/in.h pthread.h search.h sys/mount.h sys/socket.h sys/uio.h sys/un.h utmpx.h,,AC_MSG_ERROR(bailing out)) AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out)) AC_FUNC_GETMNTENT -# AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES fi @@ -990,6 +1005,10 @@ AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out)) fi +if test x$DMEVENTD = xyes; then + AC_CHECK_HEADERS(arpa/inet.h,,AC_MSG_ERROR(bailing out)) +fi + if test x$HAVE_LIBDL = xyes; then AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out)) fi --- LVM2/lib/metadata/metadata.c 2010/06/30 20:03:52 1.378 +++ LVM2/lib/metadata/metadata.c 2010/07/05 22:23:15 1.379 @@ -31,6 +31,7 @@ #include "defaults.h" #include "filter-persistent.h" +#include #include /* @@ -1013,63 +1014,140 @@ return 1; } +static dm_bitset_t _bitset_with_random_bits(struct dm_pool *mem, uint32_t num_bits, + uint32_t num_set_bits, unsigned *seed) +{ + dm_bitset_t bs; + unsigned bit_selected; + char buf[32]; + uint32_t i = num_bits - num_set_bits; + + if (!(bs = dm_bitset_create(mem, (unsigned) num_bits))) { + log_error("Failed to allocate bitset for setting random bits."); + return NULL; + } + + if (!dm_pool_begin_object(mem, 512)) { + log_error("dm_pool_begin_object failed for random list of bits."); + dm_pool_free(mem, bs); + return NULL; + } + + /* Perform loop num_set_bits times, selecting one bit each time */ + while (i++ < num_bits) { + /* Select a random bit between 0 and (i-1) inclusive. */ + bit_selected = (unsigned) floor(i * (rand_r(seed) / (RAND_MAX + 1.0))); + + /* + * If the bit was already set, set the new bit that became + * choosable for the first time during this pass. + * This maintains a uniform probability distribution by compensating + * for being unable to select it until this pass. + */ + if (dm_bit(bs, bit_selected)) + bit_selected = i - 1; + + dm_bit_set(bs, bit_selected); + + if (dm_snprintf(buf, sizeof(buf), "%u ", bit_selected) < 0) { + log_error("snprintf random bit failed."); + dm_pool_free(mem, bs); + return NULL; + } + if (!dm_pool_grow_object(mem, buf, strlen(buf))) { + log_error("Failed to generate list of random bits."); + dm_pool_free(mem, bs); + return NULL; + } + } + + log_debug("Selected %" PRIu32 " random bits from %" PRIu32 ": %s", num_set_bits, num_bits, (char *) dm_pool_end_object(mem)); + + return bs; +} + static int _vg_ignore_mdas(struct volume_group *vg, uint32_t num_to_ignore) { struct metadata_area *mda; + uint32_t mda_used_count = vg_mda_used_count(vg); + dm_bitset_t mda_to_ignore_bs; + int r = 1; - log_debug("Adjusting ignored mdas on vg %s: %" PRIu32 " mdas in use " + log_debug("Adjusting ignored mdas on vg %s: %" PRIu32 " of %" PRIu32 " mdas in use " "but %" PRIu32 " required. Changing %" PRIu32 " flags.", - vg->name, vg_mda_copies(vg), vg_mda_used_count(vg), num_to_ignore); + vg->name, mda_used_count, vg_mda_count(vg), vg_mda_copies(vg), num_to_ignore); if (!num_to_ignore) return 1; - /* FIXME: flip bits on random mdas */ + if (!(mda_to_ignore_bs = _bitset_with_random_bits(vg->vgmem, mda_used_count, + num_to_ignore, &vg->cmd->rand_seed))) + return_0; + dm_list_iterate_items(mda, &vg->fid->metadata_areas_in_use) - if (!mda_is_ignored(mda)) { + if (!mda_is_ignored(mda) && (--mda_used_count, + dm_bit(mda_to_ignore_bs, mda_used_count))) { mda_set_ignored(mda, 1); if (!--num_to_ignore) - return 1; + goto out; } log_error(INTERNAL_ERROR "Unable to find %"PRIu32" metadata areas to ignore " "on volume group %s", num_to_ignore, vg->name); - return 0; + r = 0; + +out: + dm_pool_free(vg->vgmem, mda_to_ignore_bs); + return r; } static int _vg_unignore_mdas(struct volume_group *vg, uint32_t num_to_unignore) { struct metadata_area *mda, *tmda; + uint32_t mda_used_count = vg_mda_used_count(vg); + uint32_t mda_count = vg_mda_count(vg); + uint32_t mda_free_count = mda_count - mda_used_count; + dm_bitset_t mda_to_unignore_bs; + int r = 1; if (!num_to_unignore) return 1; - log_debug("Adjusting ignored mdas on vg %s: %" PRIu32 " mdas in use " + log_debug("Adjusting ignored mdas on vg %s: %" PRIu32 " of %" PRIu32 " mdas in use " "but %" PRIu32 " required. Changing %" PRIu32 " flags.", - vg->name, vg_mda_copies(vg), vg_mda_used_count(vg), num_to_unignore); + vg->name, vg_mda_copies(vg), mda_count, mda_used_count, num_to_unignore); + + if (!(mda_to_unignore_bs = _bitset_with_random_bits(vg->vgmem, mda_free_count, + num_to_unignore, &vg->cmd->rand_seed))) + return_0; - /* FIXME: Select mdas to change at random */ dm_list_iterate_items_safe(mda, tmda, &vg->fid->metadata_areas_ignored) - if (mda_is_ignored(mda)) { + if (mda_is_ignored(mda) && (--mda_free_count, + dm_bit(mda_to_unignore_bs, mda_free_count))) { mda_set_ignored(mda, 0); dm_list_move(&vg->fid->metadata_areas_in_use, &mda->list); if (!--num_to_unignore) - return 1; + goto out; } dm_list_iterate_items(mda, &vg->fid->metadata_areas_in_use) - if (mda_is_ignored(mda)) { + if (mda_is_ignored(mda) && + dm_bit(mda_to_unignore_bs, num_to_unignore - 1)) { mda_set_ignored(mda, 0); if (!--num_to_unignore) - return 1; + goto out; } log_error(INTERNAL_ERROR "Unable to find %"PRIu32" metadata areas to unignore " "on volume group %s", num_to_unignore, vg->name); - return 0; + r = 0; + +out: + dm_pool_free(vg->vgmem, mda_to_unignore_bs); + return r; } static int _vg_adjust_ignored_mdas(struct volume_group *vg) @@ -1673,11 +1751,9 @@ log_very_verbose("Writing physical volume data to disk \"%s\"", pv_name); - if (pp->metadataignore) { - dm_list_iterate_items(mda, &mdas) { + if (pp->metadataignore) + dm_list_iterate_items(mda, &mdas) mda_set_ignored(mda, 1); - } - } if (!(pv_write(cmd, pv, &mdas, pp->labelsector))) { log_error("Failed to write physical volume \"%s\"", pv_name); --- LVM2/lib/misc/configure.h.in 2010/06/03 13:50:27 1.23 +++ LVM2/lib/misc/configure.h.in 2010/07/05 22:23:15 1.24 @@ -60,6 +60,9 @@ */ #undef HAVE_ALLOCA_H +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + /* Define to 1 if you have the header file. */ #undef HAVE_ASM_BYTEORDER_H @@ -72,6 +75,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_CCS_H +/* Define to 1 if your system has a working `chown' function. */ +#undef HAVE_CHOWN + /* Define to 1 if you have the header file. */ #undef HAVE_COROSYNC_CONFDB_H @@ -96,9 +102,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H +/* Define to 1 if you have the `floor' function. */ +#undef HAVE_FLOOR + /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK +/* Define to 1 if you have the `ftruncate' function. */ +#undef HAVE_FTRUNCATE + /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME @@ -117,9 +129,15 @@ /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LANGINFO_H + /* Define to 1 if you have the header file. */ #undef HAVE_LIBCMAN_H @@ -173,6 +191,9 @@ /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR +/* Define to 1 if you have the `mkfifo' function. */ +#undef HAVE_MKFIFO + /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP @@ -191,6 +212,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H +/* Define to 1 if you have the `nl_langinfo' function. */ +#undef HAVE_NL_LANGINFO + /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H @@ -200,6 +224,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#undef HAVE_REALLOC + /* Define to 1 to include support for realtime clock. */ #undef HAVE_REALTIME @@ -224,6 +252,9 @@ /* Define to 1 if sepol_check_context is available. */ #undef HAVE_SEPOL +/* Define to 1 if you have the `setenv' function. */ +#undef HAVE_SETENV + /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE @@ -261,6 +292,9 @@ /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR +/* Define to 1 if you have the `strcspn' function. */ +#undef HAVE_STRCSPN + /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP @@ -279,6 +313,9 @@ /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR +/* Define to 1 if you have the `strspn' function. */ +#undef HAVE_STRSPN + /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR @@ -403,6 +440,14 @@ /* Path to lvm binary. */ #undef LVM_PATH +/* Define to 1 if `major', `minor', and `makedev' are declared in . + */ +#undef MAJOR_IN_MKDEV + +/* Define to 1 if `major', `minor', and `makedev' are declared in + . */ +#undef MAJOR_IN_SYSMACROS + /* Define to 1 to include built-in support for mirrors. */ #undef MIRRORED_INTERNAL @@ -471,15 +516,49 @@ /* Define to 1 to enable synchronisation with udev processing. */ #undef UDEV_SYNC_SUPPORT +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + +/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + +/* Define for Solaris 2.5.1 so the uint8_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT8_T + /* Define to empty if `const' does not conform to ANSI C. */ #undef const +/* Define to `int' if doesn't define. */ +#undef gid_t + /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif +/* Define to the type of a signed integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef int16_t + +/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef int32_t + +/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef int64_t + +/* Define to the type of a signed integer type of width exactly 8 bits if such + a type exists and the standard includes do not define it. */ +#undef int8_t + /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc @@ -492,8 +571,33 @@ /* Define to `int' if does not define. */ #undef pid_t +/* Define to rpl_realloc if the replacement function should be used. */ +#undef realloc + /* Define to `unsigned int' if does not define. */ #undef size_t +/* Define to `int' if does not define. */ +#undef ssize_t + +/* Define to `int' if doesn't define. */ +#undef uid_t + +/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef uint16_t + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t + +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef uint64_t + +/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +#undef uint8_t + /* Define as `fork' if `vfork' does not work. */ #undef vfork From agk@sourceware.org Mon Jul 5 22:56:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 05 Jul 2010 22:56:00 -0000 Subject: LVM2 WHATS_NEW_DM Message-ID: <20100705225646.18661.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-05 22:56:45 Modified files: . : WHATS_NEW_DM Log message: Fix dmlosetup snprintf %llu compiler warning. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.388&r2=1.389 --- LVM2/WHATS_NEW_DM 2010/07/05 22:22:43 1.388 +++ LVM2/WHATS_NEW_DM 2010/07/05 22:56:45 1.389 @@ -1,5 +1,6 @@ Version 1.02.52 - ================================ + Fix dmlosetup snprintf %llu compiler warning. Add parentheses to some libdevmapper.h macro arguments. Add printf format attributes to dm_{sn,as}printf and fix a caller. Move dmeventd man page from install_lvm2 to install_device-mapper. (1.02.50) From agk@sourceware.org Mon Jul 5 22:56:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Mon, 05 Jul 2010 22:56:00 -0000 Subject: LVM2/tools dmsetup.c Message-ID: <20100705225632.18217.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-05 22:56:32 Modified files: tools : dmsetup.c Log message: Fix dmlosetup snprintf %llu compiler warning. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/dmsetup.c.diff?cvsroot=lvm2&r1=1.138&r2=1.139 --- LVM2/tools/dmsetup.c 2010/04/28 13:37:37 1.138 +++ LVM2/tools/dmsetup.c 2010/07/05 22:56:31 1.139 @@ -2942,7 +2942,7 @@ close(fd); if (dm_snprintf(table, tlen, "%llu %llu loop %s %llu\n", 0ULL, - (long long unsigned)sectors, file, off) < 0) + (long long unsigned)sectors, file, (long long unsigned)off) < 0) return 0; if (_switches[VERBOSE_ARG] > 1) @@ -2956,8 +2956,6 @@ return 0; } - - static int _process_losetup_switches(const char *base, int *argc, char ***argv, const char *dev_dir) { From agk@sourceware.org Tue Jul 6 16:49:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 06 Jul 2010 16:49:00 -0000 Subject: LVM2 VERSION VERSION_DM WHATS_NEW WHATS_NEW_DM Message-ID: <20100706164940.18826.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-06 16:49:39 Modified files: . : VERSION VERSION_DM WHATS_NEW WHATS_NEW_DM Log message: pre-release Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION.diff?cvsroot=lvm2&r1=1.244&r2=1.245 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION_DM.diff?cvsroot=lvm2&r1=1.55&r2=1.56 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1652&r2=1.1653 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.389&r2=1.390 --- LVM2/VERSION 2010/06/30 14:50:32 1.244 +++ LVM2/VERSION 2010/07/06 16:49:38 1.245 @@ -1 +1 @@ -2.02.70(2)-cvs (2010-06-30) +2.02.70(2)-cvs (2010-07-06) --- LVM2/VERSION_DM 2010/06/30 14:50:32 1.55 +++ LVM2/VERSION_DM 2010/07/06 16:49:38 1.56 @@ -1 +1 @@ -1.02.52-cvs (2010-06-30) +1.02.52-cvs (2010-07-06) --- LVM2/WHATS_NEW 2010/07/05 22:23:15 1.1652 +++ LVM2/WHATS_NEW 2010/07/06 16:49:38 1.1653 @@ -1,5 +1,5 @@ -Version 2.02.70 - -================================ +Version 2.02.70 - 6th July 2010 +=============================== Randomly select which mdas to use or ignore. Add some missing standard configure.in checks. Add printf format attributes to yes_no_prompt and fix a caller. @@ -10,7 +10,7 @@ Fix lvm shell crash when input is entirely whitespace. Update partial mode warning message. Preserve memlock balance in clvmd when activation triggers a resume. - Restore the "removemissing" behaviour of lvconvert --repair --use-policies. + Restore the removemissing behaviour of lvconvert --repair --use-policies. Version 2.02.69 - 30th June 2010 ================================ --- LVM2/WHATS_NEW_DM 2010/07/05 22:56:45 1.389 +++ LVM2/WHATS_NEW_DM 2010/07/06 16:49:39 1.390 @@ -1,5 +1,5 @@ -Version 1.02.52 - -================================ +Version 1.02.52 - 6th July 2010 +=============================== Fix dmlosetup snprintf %llu compiler warning. Add parentheses to some libdevmapper.h macro arguments. Add printf format attributes to dm_{sn,as}printf and fix a caller. From jbrassow@sourceware.org Tue Jul 6 17:02:00 2010 From: jbrassow@sourceware.org (jbrassow@sourceware.org) Date: Tue, 06 Jul 2010 17:02:00 -0000 Subject: LVM2 ./WHATS_NEW tools/lvconvert.c Message-ID: <20100706170204.5474.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2010-07-06 17:02:04 Modified files: . : WHATS_NEW tools : lvconvert.c Log message: Fix for bug 607347: failing both redundant mirror log legs... Rather than attempting to remove all the images of a mirrored log volume via remove_mirror_images, simply remove the log if all its devices have failed. Taka was the first to report that there is still an outstanding issue with handling this case. I've managed to reproduce it only very rarely, and am still working on identifying the problem. Failing to handle the problem rarely is better than not handling the scenario at all, so I'm checking this in. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1653&r2=1.1654 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.136&r2=1.137 --- LVM2/WHATS_NEW 2010/07/06 16:49:38 1.1653 +++ LVM2/WHATS_NEW 2010/07/06 17:02:03 1.1654 @@ -1,5 +1,6 @@ Version 2.02.70 - 6th July 2010 =============================== + Change logic to handle double failure of a "mirrored" mirror log. Randomly select which mdas to use or ignore. Add some missing standard configure.in checks. Add printf format attributes to yes_no_prompt and fix a caller. --- LVM2/tools/lvconvert.c 2010/07/01 10:10:52 1.136 +++ LVM2/tools/lvconvert.c 2010/07/06 17:02:03 1.137 @@ -705,9 +705,12 @@ return 1; /* Reducing redundancy of the log */ - return remove_mirror_images(log_lv, log_count, - is_mirror_image_removable, - operable_pvs, 0U); + if (log_count) + return remove_mirror_images(log_lv, log_count, + is_mirror_image_removable, + operable_pvs, 0U); + + return remove_mirror_log(lv->vg->cmd, lv, operable_pvs); } static int _lv_update_log_type(struct cmd_context *cmd, From agk@sourceware.org Tue Jul 6 17:26:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 06 Jul 2010 17:26:00 -0000 Subject: LVM2/lib/metadata metadata.c Message-ID: <20100706172611.21902.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-06 17:26:09 Modified files: lib/metadata : metadata.c Log message: fix jumbled args in 'Adjusting' message Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.379&r2=1.380 --- LVM2/lib/metadata/metadata.c 2010/07/05 22:23:15 1.379 +++ LVM2/lib/metadata/metadata.c 2010/07/06 17:26:08 1.380 @@ -1116,7 +1116,7 @@ log_debug("Adjusting ignored mdas on vg %s: %" PRIu32 " of %" PRIu32 " mdas in use " "but %" PRIu32 " required. Changing %" PRIu32 " flags.", - vg->name, vg_mda_copies(vg), mda_count, mda_used_count, num_to_unignore); + vg->name, mda_used_count, mda_count, vg_mda_copies(vg), num_to_unignore); if (!(mda_to_unignore_bs = _bitset_with_random_bits(vg->vgmem, mda_free_count, num_to_unignore, &vg->cmd->rand_seed))) From agk@sourceware.org Tue Jul 6 17:27:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 06 Jul 2010 17:27:00 -0000 Subject: LVM2/lib/metadata metadata.c Message-ID: <20100706172733.23389.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-06 17:27:32 Modified files: lib/metadata : metadata.c Log message: shorten mesg Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.380&r2=1.381 --- LVM2/lib/metadata/metadata.c 2010/07/06 17:26:08 1.380 +++ LVM2/lib/metadata/metadata.c 2010/07/06 17:27:32 1.381 @@ -1073,7 +1073,7 @@ dm_bitset_t mda_to_ignore_bs; int r = 1; - log_debug("Adjusting ignored mdas on vg %s: %" PRIu32 " of %" PRIu32 " mdas in use " + log_debug("Adjusting ignored mdas for %s: %" PRIu32 " of %" PRIu32 " mdas in use " "but %" PRIu32 " required. Changing %" PRIu32 " flags.", vg->name, mda_used_count, vg_mda_count(vg), vg_mda_copies(vg), num_to_ignore); @@ -1114,7 +1114,7 @@ if (!num_to_unignore) return 1; - log_debug("Adjusting ignored mdas on vg %s: %" PRIu32 " of %" PRIu32 " mdas in use " + log_debug("Adjusting ignored mdas for %s: %" PRIu32 " of %" PRIu32 " mdas in use " "but %" PRIu32 " required. Changing %" PRIu32 " flags.", vg->name, mda_used_count, mda_count, vg_mda_copies(vg), num_to_unignore); From agk@sourceware.org Tue Jul 6 17:29:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 06 Jul 2010 17:29:00 -0000 Subject: LVM2/lib/metadata metadata.c Message-ID: <20100706172950.24275.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-06 17:29:50 Modified files: lib/metadata : metadata.c Log message: s/flags/mda/ Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.381&r2=1.382 --- LVM2/lib/metadata/metadata.c 2010/07/06 17:27:32 1.381 +++ LVM2/lib/metadata/metadata.c 2010/07/06 17:29:50 1.382 @@ -1074,7 +1074,7 @@ int r = 1; log_debug("Adjusting ignored mdas for %s: %" PRIu32 " of %" PRIu32 " mdas in use " - "but %" PRIu32 " required. Changing %" PRIu32 " flags.", + "but %" PRIu32 " required. Changing %" PRIu32 " mda.", vg->name, mda_used_count, vg_mda_count(vg), vg_mda_copies(vg), num_to_ignore); if (!num_to_ignore) @@ -1115,7 +1115,7 @@ return 1; log_debug("Adjusting ignored mdas for %s: %" PRIu32 " of %" PRIu32 " mdas in use " - "but %" PRIu32 " required. Changing %" PRIu32 " flags.", + "but %" PRIu32 " required. Changing %" PRIu32 " mda.", vg->name, mda_used_count, mda_count, vg_mda_copies(vg), num_to_unignore); if (!(mda_to_unignore_bs = _bitset_with_random_bits(vg->vgmem, mda_free_count, From agk@sourceware.org Tue Jul 6 20:09:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 06 Jul 2010 20:09:00 -0000 Subject: LVM2/lib/metadata metadata.c Message-ID: <20100706200939.7274.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-06 20:09:38 Modified files: lib/metadata : metadata.c Log message: fix code in 2nd mda unignore loop to match 1st loop Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.382&r2=1.383 --- LVM2/lib/metadata/metadata.c 2010/07/06 17:29:50 1.382 +++ LVM2/lib/metadata/metadata.c 2010/07/06 20:09:38 1.383 @@ -1133,8 +1133,8 @@ } dm_list_iterate_items(mda, &vg->fid->metadata_areas_in_use) - if (mda_is_ignored(mda) && - dm_bit(mda_to_unignore_bs, num_to_unignore - 1)) { + if (mda_is_ignored(mda) && (--mda_free_count, + dm_bit(mda_to_unignore_bs, mda_free_count))) { mda_set_ignored(mda, 0); if (!--num_to_unignore) goto out; From agk@sourceware.org Wed Jul 7 02:24:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 07 Jul 2010 02:24:00 -0000 Subject: LVM2 WHATS_NEW Message-ID: <20100707022405.30169.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-07 02:24:05 Modified files: . : WHATS_NEW Log message: . Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1654&r2=1.1655 --- LVM2/WHATS_NEW 2010/07/06 17:02:03 1.1654 +++ LVM2/WHATS_NEW 2010/07/07 02:24:05 1.1655 @@ -1,6 +1,6 @@ Version 2.02.70 - 6th July 2010 =============================== - Change logic to handle double failure of a "mirrored" mirror log. + Remove log directly if all mirror images of a mirrored log fail. Randomly select which mdas to use or ignore. Add some missing standard configure.in checks. Add printf format attributes to yes_no_prompt and fix a caller. From agk@sourceware.org Wed Jul 7 02:37:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 07 Jul 2010 02:37:00 -0000 Subject: LVM2 WHATS_NEW WHATS_NEW_DM VERSION VERSION_DM Message-ID: <20100707023729.2226.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-07 02:37:28 Modified files: . : WHATS_NEW WHATS_NEW_DM VERSION VERSION_DM Log message: post-release Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1655&r2=1.1656 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.390&r2=1.391 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION.diff?cvsroot=lvm2&r1=1.245&r2=1.246 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION_DM.diff?cvsroot=lvm2&r1=1.56&r2=1.57 --- LVM2/WHATS_NEW 2010/07/07 02:24:05 1.1655 +++ LVM2/WHATS_NEW 2010/07/07 02:37:28 1.1656 @@ -1,3 +1,6 @@ +Version 2.02.71 - +=============================== + Version 2.02.70 - 6th July 2010 =============================== Remove log directly if all mirror images of a mirrored log fail. @@ -6,7 +9,7 @@ Add printf format attributes to yes_no_prompt and fix a caller. Always pass unsuspended dm devices through persistent filter to other filters. Move test for suspended dm devices ahead of other filters. - Fix another segfault in clvmd -R if no response from daemon received. (2.02.68) + Fix another segfault in clvmd -R if no response from daemon. (2.02.68) Remove superfluous suspended device counter from clvmd. Fix lvm shell crash when input is entirely whitespace. Update partial mode warning message. --- LVM2/WHATS_NEW_DM 2010/07/06 16:49:39 1.390 +++ LVM2/WHATS_NEW_DM 2010/07/07 02:37:28 1.391 @@ -1,3 +1,6 @@ +Version 1.02.53 - +=============================== + Version 1.02.52 - 6th July 2010 =============================== Fix dmlosetup snprintf %llu compiler warning. --- LVM2/VERSION 2010/07/06 16:49:38 1.245 +++ LVM2/VERSION 2010/07/07 02:37:28 1.246 @@ -1 +1 @@ -2.02.70(2)-cvs (2010-07-06) +2.02.71(2)-cvs (2010-07-07) --- LVM2/VERSION_DM 2010/07/06 16:49:38 1.56 +++ LVM2/VERSION_DM 2010/07/07 02:37:28 1.57 @@ -1 +1 @@ -1.02.52-cvs (2010-07-06) +1.02.53-cvs (2010-07-07) From agk@sourceware.org Wed Jul 7 02:53:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 07 Jul 2010 02:53:00 -0000 Subject: LVM2 ./WHATS_NEW lib/metadata/metadata.c lib/m ... Message-ID: <20100707025317.18198.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-07 02:53:17 Modified files: . : WHATS_NEW lib/metadata : metadata.c metadata.h Log message: Adjust auto-metadata repair and caching logic to try to cope with empty mdas. - If a PV contained empty mdas, the auto-recovery code was not kicking in. - The 'inconsistent' state was getting lost when metadata was cached so recovery didn't kick in. But leave the behaviour alone when using precommitted metadata because of a warning in a confusing FIXME. In my testing, pvs and vgs didn't repair inconsistent metadata like they used to do. (How many other tools fail similarly now?) And there should be no need to cache inconsistent metadata because it is supposed to get repaired under the protection of a write lock immediately it is discovered. This code is in need of a redesign based on first principles. I still see bugs in this code and this commit is risky. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1656&r2=1.1657 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.383&r2=1.384 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.214&r2=1.215 --- LVM2/WHATS_NEW 2010/07/07 02:37:28 1.1656 +++ LVM2/WHATS_NEW 2010/07/07 02:53:16 1.1657 @@ -1,5 +1,6 @@ Version 2.02.71 - =============================== + Adjust auto-metadata repair and caching logic to try to cope with empty mdas. Version 2.02.70 - 6th July 2010 =============================== --- LVM2/lib/metadata/metadata.c 2010/07/06 20:09:38 1.383 +++ LVM2/lib/metadata/metadata.c 2010/07/07 02:53:17 1.384 @@ -2899,6 +2899,7 @@ int inconsistent_vgid = 0; int inconsistent_pvs = 0; int inconsistent_seqno = 0; + int inconsistent_mdas = 0; unsigned use_precommitted = precommitted; unsigned saved_handles_missing_pvs = cmd->handles_missing_pvs; struct dm_list *pvids; @@ -2916,14 +2917,28 @@ return _vg_read_orphans(cmd, vgname); } - if ((correct_vg = lvmcache_get_vg(vgid, precommitted))) { + /* + * If cached metadata was inconsistent and *consistent is set + * then repair it now. Otherwise just return it. + * Also return if use_precommitted is set due to the FIXME in + * the missing PV logic below. + */ + if ((correct_vg = lvmcache_get_vg(vgid, precommitted)) && + (use_precommitted || !*consistent || !(correct_vg->status & INCONSISTENT_VG))) { + if (!(correct_vg->status & INCONSISTENT_VG)) + *consistent = 1; + else /* Inconsistent but we can't repair it */ + correct_vg->status &= ~INCONSISTENT_VG; + if (vg_missing_pv_count(correct_vg)) { log_verbose("There are %d physical volumes missing.", vg_missing_pv_count(correct_vg)); vg_mark_partial_lvs(correct_vg); } - *consistent = 1; return correct_vg; + } else { + vg_release(correct_vg); + correct_vg = NULL; } /* Find the vgname in the cache */ @@ -3009,14 +3024,29 @@ * not ignored. */ if (!(info = info_from_pvid(pvl->pv->dev->pvid, 1)) || - !info->vginfo || !is_orphan_vg(info->vginfo->vgname) || - !mdas_empty_or_ignored(&info->mdas)) { + !info->vginfo || !is_orphan_vg(info->vginfo->vgname)) { inconsistent_pvs = 1; break; } - if (dm_list_size(&info->mdas) && - !fid_add_mdas(fid, &info->mdas)) - return_NULL; + if (dm_list_size(&info->mdas)) { + if (!fid_add_mdas(fid, &info->mdas)) + return_NULL; + + log_debug("Empty mda found for VG %s.", vgname); + + if (inconsistent_mdas) + continue; + + /* + * If any newly-added mdas are in-use then their + * metadata needs updating. + */ + dm_list_iterate_items(mda, &info->mdas) + if (!mda_is_ignored(mda)) { + inconsistent_mdas = 1; + break; + } + } } /* If the check passed, let's update VG and recalculate pvids */ @@ -3056,6 +3086,11 @@ break; } } + + if (correct_vg && inconsistent_mdas) { + vg_release(correct_vg); + correct_vg = NULL; + } } dm_list_init(&all_pvs); @@ -3132,7 +3167,8 @@ * If there is no precommitted metadata, committed metadata * is read and stored in the cache even if use_precommitted is set */ - lvmcache_update_vg(correct_vg, correct_vg->status & PRECOMMITTED); + lvmcache_update_vg(correct_vg, correct_vg->status & PRECOMMITTED & + (inconsistent ? INCONSISTENT_VG : 0)); if (inconsistent) { /* FIXME Test should be if we're *using* precommitted metadata not if we were searching for it */ --- LVM2/lib/metadata/metadata.h 2010/06/30 13:51:13 1.214 +++ LVM2/lib/metadata/metadata.h 2010/07/07 02:53:17 1.215 @@ -76,6 +76,7 @@ //#define CONVERTING 0x00400000U /* LV */ //#define MISSING_PV 0x00800000U /* PV */ +#define INCONSISTENT_VG 0x00800000U /* VG - internal use only */ //#define PARTIAL_LV 0x01000000U /* LV - derived flag, not // written out in metadata*/ From prajnoha@sourceware.org Wed Jul 7 11:22:00 2010 From: prajnoha@sourceware.org (prajnoha@sourceware.org) Date: Wed, 07 Jul 2010 11:22:00 -0000 Subject: LVM2 ./WHATS_NEW_DM udev/10-dm.rules.in udev/1 ... Message-ID: <20100707112247.8237.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: prajnoha@sourceware.org 2010-07-07 11:22:46 Modified files: . : WHATS_NEW_DM udev : 10-dm.rules.in 11-dm-lvm.rules Log message: Use "nowatch" udev rule for known inappropriate devices. For now, this is just a precaution. Normally, all the other (non-dm) rules should check DM_UDEV_DISABLE_OTHER_RULES_FLAG and therefore avoid setting any inotify watches as well. But let's make sure. Support for final assignment of the "nowatch" rule (the use of ":=") will appear in next udev release, v160. This should also work in previous udev versions but the setting won't be sealed so any further OPTIONS="watch" will always prevail there. We may want to add more specific "nowatch" rules later if needed. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.391&r2=1.392 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/udev/10-dm.rules.in.diff?cvsroot=lvm2&r1=1.9&r2=1.10 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/udev/11-dm-lvm.rules.diff?cvsroot=lvm2&r1=1.6&r2=1.7 --- LVM2/WHATS_NEW_DM 2010/07/07 02:37:28 1.391 +++ LVM2/WHATS_NEW_DM 2010/07/07 11:22:46 1.392 @@ -1,5 +1,6 @@ Version 1.02.53 - =============================== + Use "nowatch" udev rule for inappropriate devices. Version 1.02.52 - 6th July 2010 =============================== --- LVM2/udev/10-dm.rules.in 2010/06/23 17:00:32 1.9 +++ LVM2/udev/10-dm.rules.in 2010/07/07 11:22:46 1.10 @@ -119,5 +119,6 @@ ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}="1" ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="1" ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" +OPTIONS:="nowatch" LABEL="dm_end" --- LVM2/udev/11-dm-lvm.rules 2010/02/15 16:38:23 1.6 +++ LVM2/udev/11-dm-lvm.rules 2010/07/07 11:22:46 1.7 @@ -32,5 +32,6 @@ LABEL="lvm_disable" ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="1" ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1" +OPTIONS:="nowatch" LABEL="lvm_end" From wysochanski@sourceware.org Wed Jul 7 14:44:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Wed, 07 Jul 2010 14:44:00 -0000 Subject: LVM2/test t-inconsistent-metadata.sh Message-ID: <20100707144359.23408.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-07 14:43:58 Modified files: test : t-inconsistent-metadata.sh Log message: Test failed commit of mda on new pv - failed vgextend. Test the auto-repair capability when we fail committing to an mda on a new pv adding to a vg. This test should fail until we fix the auto-repair in this case. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-inconsistent-metadata.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4 --- LVM2/test/t-inconsistent-metadata.sh 2009/07/01 17:06:04 1.3 +++ LVM2/test/t-inconsistent-metadata.sh 2010/07/07 14:43:57 1.4 @@ -63,3 +63,13 @@ vgs 2>&1 | tee cmd.out not grep "Inconsistent metadata found for VG $vg" cmd.out check + +echo Check auto-repair of failed vgextend - metadata written to original pv but not new pv +vgremove -f $vg +pvremove -ff $devs +pvcreate $devs +backup_dev $dev2 +vgcreate $vg $dev1 +vgextend $vg $dev2 +restore_dev $dev2 +should compare_two_fields_ vgs $vg vg_mda_count pvs $dev2 vg_mda_count From wysochanski@sourceware.org Wed Jul 7 18:59:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Wed, 07 Jul 2010 18:59:00 -0000 Subject: LVM2 lib/metadata/metadata.c tools/vgextend.c Message-ID: <20100707185947.9483.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-07 18:59:46 Modified files: lib/metadata : metadata.c tools : vgextend.c Log message: Add warning to vgextend and pvchange if metadataignore given on cmdline. Warn the user then change the value of vg_mda_copies. Signed-off-by: Dave Wysochanski Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.384&r2=1.385 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgextend.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56 --- LVM2/lib/metadata/metadata.c 2010/07/07 02:53:17 1.384 +++ LVM2/lib/metadata/metadata.c 2010/07/07 18:59:45 1.385 @@ -4396,8 +4396,13 @@ * This does not guarantee this PV's ignore bits will be * preserved in future operations. */ - if (!is_orphan(pv) && vg_mda_copies(pv->vg)) + if (!is_orphan(pv) && + vg_mda_copies(pv->vg) != VGMETADATACOPIES_UNMANAGED) { + log_warn("WARNING: Changing preferred number of copies of VG %s " + "metadata from %"PRIu32" to %"PRIu32, pv_vg_name(pv), + vg_mda_copies(pv->vg), vg_mda_used_count(pv->vg)); vg_set_mda_copies(pv->vg, vg_mda_used_count(pv->vg)); + } return 1; } --- LVM2/tools/vgextend.c 2009/11/01 19:51:55 1.55 +++ LVM2/tools/vgextend.c 2010/07/07 18:59:46 1.56 @@ -63,6 +63,15 @@ if (!vg_extend(vg, argc, argv, &pp)) goto_bad; + if (arg_count(cmd, metadataignore_ARG) && + (vg_mda_copies(vg) != VGMETADATACOPIES_UNMANAGED) && + (vg_mda_copies(vg) != vg_mda_used_count(vg))) { + log_warn("WARNING: Changing preferred number of copies of VG %s " + "metadata from %"PRIu32" to %"PRIu32, vg_name, + vg_mda_copies(vg), vg_mda_used_count(vg)); + vg_set_mda_copies(vg, vg_mda_used_count(vg)); + } + /* ret > 0 */ log_verbose("Volume group \"%s\" will be extended by %d new " "physical volumes", vg_name, argc); From wysochanski@sourceware.org Wed Jul 7 19:02:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Wed, 07 Jul 2010 19:02:00 -0000 Subject: LVM2 ./WHATS_NEW tools/pvchange.c tools/vgextend.c Message-ID: <20100707190251.31639.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-07 19:02:50 Modified files: . : WHATS_NEW tools : pvchange.c vgextend.c Log message: Add prompt if using --metadataignore argument with vgmetadatacopies. When using vgmetadatacopies value other than "umanaged" (0), prompt the user if the usage of --metadataignore would change the value of vgmetadatacopies. The main 2 cases are: 1) pvchange --metadataignore 2) vgextend --metadataignore We leave the prompt check in the tools, and do not change anything if the user says 'n'. Examples: vgextend --metadataignore y vgtest /dev/loop0 Setting metadataignore will override preferred number of copies of VG vgtest metadata. Are you sure? [y/n]: y No physical volume label read from /dev/loop0 Physical volume "/dev/loop0" successfully created Volume group "vgtest" successfully extended pvchange --metadataignore y /dev/loop3 Setting metadataignore on /dev/loop3 will override preferred number of copies of VG vgtest metadata. Are you sure? [y/n]: y WARNING: Changing preferred number of copies of VG vgtest metadata from 3 to 2 Physical volume "/dev/loop3" changed 1 physical volume changed / 0 physical volumes not changed Signed-off-by: Dave Wysochanski Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1657&r2=1.1658 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.79&r2=1.80 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgextend.c.diff?cvsroot=lvm2&r1=1.56&r2=1.57 --- LVM2/WHATS_NEW 2010/07/07 02:53:16 1.1657 +++ LVM2/WHATS_NEW 2010/07/07 19:02:50 1.1658 @@ -1,5 +1,7 @@ Version 2.02.71 - =============================== + Prompt if metadataignore with vgextend or pvchange would adjust vg_mda_copies. + Adjust vg_mda_copies if metadataignore given with vgextend or pvchange. Adjust auto-metadata repair and caching logic to try to cope with empty mdas. Version 2.02.70 - 6th July 2010 --- LVM2/tools/pvchange.c 2010/06/29 21:32:44 1.79 +++ LVM2/tools/pvchange.c 2010/07/07 19:02:50 1.80 @@ -122,6 +122,14 @@ } } } else if (arg_count(cmd, metadataignore_ARG)) { + if ((vg_mda_copies(vg) != VGMETADATACOPIES_UNMANAGED) && + yes_no_prompt("Setting metadataignore on %s will override " + "preferred number of copies of VG %s " + "metadata.\nAre you sure? [y/n]: ", + pv_name, pv_vg_name(pv)) == 'n') { + log_error("Physical volume %s not changed", pv_name); + goto out; + } if (!pv_change_metadataignore(pv, mda_ignore)) goto out; } else { --- LVM2/tools/vgextend.c 2010/07/07 18:59:46 1.56 +++ LVM2/tools/vgextend.c 2010/07/07 19:02:50 1.57 @@ -59,6 +59,16 @@ if (!archive(vg)) goto_bad; + if (arg_count(cmd, metadataignore_ARG) && + (vg_mda_copies(vg) != VGMETADATACOPIES_UNMANAGED) && + yes_no_prompt("Setting metadataignore will override " + "preferred number of copies of VG %s " + "metadata.\nAre you sure? [y/n]: ", + vg_name) == 'n') { + log_error("Volume group %s not changed", vg_name); + goto_bad; + } + /* extend vg */ if (!vg_extend(vg, argc, argv, &pp)) goto_bad; From wysochanski@sourceware.org Wed Jul 7 19:15:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Wed, 07 Jul 2010 19:15:00 -0000 Subject: LVM2 man/pvchange.8.in man/vgextend.8.in test/ ... Message-ID: <20100707191501.31957.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-07 19:14:59 Modified files: man : pvchange.8.in vgextend.8.in test : t-metadata-balance.sh tools : commands.h pvchange.c vgextend.c Log message: Add --force to pvchange, and allow override of prompt involving metadataignore. Signed-off-by: Dave Wysochanski Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/pvchange.8.in.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgextend.8.in.diff?cvsroot=lvm2&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-metadata-balance.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/commands.h.diff?cvsroot=lvm2&r1=1.152&r2=1.153 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.80&r2=1.81 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgextend.c.diff?cvsroot=lvm2&r1=1.57&r2=1.58 --- LVM2/man/pvchange.8.in 2010/07/02 17:05:22 1.4 +++ LVM2/man/pvchange.8.in 2010/07/07 19:14:57 1.5 @@ -5,6 +5,7 @@ .B pvchange [\-\-addtag Tag] [\-A|\-\-autobackup y|n] [\-d|\-\-debug] +[\-f|\-\-force] [\-\-deltag Tag] [\-\-metadataignore y|n] [\-h|\-?|\-\-help] --- LVM2/man/vgextend.8.in 2010/06/30 13:03:48 1.7 +++ LVM2/man/vgextend.8.in 2010/07/07 19:14:57 1.8 @@ -4,6 +4,7 @@ .SH SYNOPSIS .B vgextend [\-A|\-\-autobackup y|n] [\-d|\-\-debug] [\-h|\-?|\-\-help] +[\-f|\-\-force] [\-t|\-\-test] [\-v|\-\-verbose] [ \fIPHYSICAL DEVICE OPTIONS\fP ] --- LVM2/test/t-metadata-balance.sh 2010/06/30 22:22:00 1.3 +++ LVM2/test/t-metadata-balance.sh 2010/07/07 19:14:58 1.4 @@ -214,7 +214,7 @@ vgextend $vg1 $dev3 check_vg_field_ $vg1 vg_mda_used_count $(($mdacp * 1)) echo Using pvchange to unignore should update vg_mda_used_count - pvchange --metadataignore n $dev3 + pvchange -f --metadataignore n $dev3 check_pv_field_ $dev3 pv_mda_used_count $mdacp check_vg_field_ $vg1 vg_mda_used_count $(($mdacp * 2)) echo Set unmanaged on the vg should keep ignore bits the same during vgextend @@ -225,7 +225,7 @@ check_pv_field_ $dev4 pv_mda_used_count $mdacp check_vg_field_ $vg1 vg_mda_used_count $(($mdacp * 3)) echo Using pvchange to ignore should update vg_mda_used_count - pvchange --metadataignore y $dev4 + pvchange -f --metadataignore y $dev4 check_pv_field_ $dev4 pv_mda_used_count 0 check_vg_field_ $vg1 vg_mda_used_count $(($mdacp * 2)) vgremove -f $vg1 --- LVM2/tools/commands.h 2010/06/30 13:03:48 1.152 +++ LVM2/tools/commands.h 2010/07/07 19:14:58 1.153 @@ -451,6 +451,7 @@ "\t[-a|--all]\n" "\t[-A|--autobackup y|n]\n" "\t[-d|--debug]\n" + "\t[-f|--force]\n" "\t[-h|--help]\n" "\t[-t|--test]\n" "\t[-u|--uuid]\n" @@ -463,7 +464,7 @@ "\t[PhysicalVolumePath...]\n", all_ARG, allocatable_ARG, allocation_ARG, autobackup_ARG, deltag_ARG, - addtag_ARG, metadataignore_ARG, test_ARG, uuid_ARG) + addtag_ARG, force_ARG, metadataignore_ARG, test_ARG, uuid_ARG) xx(pvresize, "Resize physical volume(s)", @@ -846,6 +847,7 @@ "vgextend\n" "\t[-A|--autobackup y|n]\n" "\t[-d|--debug]\n" + "\t[-f|--force]\n" "\t[-h|--help]\n" "\t[-t|--test]\n" "\t[-v|--verbose]\n" --- LVM2/tools/pvchange.c 2010/07/07 19:02:50 1.80 +++ LVM2/tools/pvchange.c 2010/07/07 19:14:58 1.81 @@ -123,6 +123,7 @@ } } else if (arg_count(cmd, metadataignore_ARG)) { if ((vg_mda_copies(vg) != VGMETADATACOPIES_UNMANAGED) && + (arg_count(cmd, force_ARG) == PROMPT) && yes_no_prompt("Setting metadataignore on %s will override " "preferred number of copies of VG %s " "metadata.\nAre you sure? [y/n]: ", --- LVM2/tools/vgextend.c 2010/07/07 19:02:50 1.57 +++ LVM2/tools/vgextend.c 2010/07/07 19:14:58 1.58 @@ -61,6 +61,7 @@ if (arg_count(cmd, metadataignore_ARG) && (vg_mda_copies(vg) != VGMETADATACOPIES_UNMANAGED) && + (pp.force == PROMPT) && yes_no_prompt("Setting metadataignore will override " "preferred number of copies of VG %s " "metadata.\nAre you sure? [y/n]: ", From wysochanski@sourceware.org Wed Jul 7 21:30:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Wed, 07 Jul 2010 21:30:00 -0000 Subject: LVM2/tools pvchange.c vgextend.c Message-ID: <20100707213009.27381.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-07 21:30:08 Modified files: tools : pvchange.c vgextend.c Log message: Shorten prompt for pvchange and vgextend. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.81&r2=1.82 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgextend.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59 --- LVM2/tools/pvchange.c 2010/07/07 19:14:58 1.81 +++ LVM2/tools/pvchange.c 2010/07/07 21:30:07 1.82 @@ -124,10 +124,9 @@ } else if (arg_count(cmd, metadataignore_ARG)) { if ((vg_mda_copies(vg) != VGMETADATACOPIES_UNMANAGED) && (arg_count(cmd, force_ARG) == PROMPT) && - yes_no_prompt("Setting metadataignore on %s will override " - "preferred number of copies of VG %s " - "metadata.\nAre you sure? [y/n]: ", - pv_name, pv_vg_name(pv)) == 'n') { + yes_no_prompt("Override preferred number of copies " + "of VG %s metadata? [y/n]: ", + pv_vg_name(pv)) == 'n') { log_error("Physical volume %s not changed", pv_name); goto out; } --- LVM2/tools/vgextend.c 2010/07/07 19:14:58 1.58 +++ LVM2/tools/vgextend.c 2010/07/07 21:30:07 1.59 @@ -62,9 +62,8 @@ if (arg_count(cmd, metadataignore_ARG) && (vg_mda_copies(vg) != VGMETADATACOPIES_UNMANAGED) && (pp.force == PROMPT) && - yes_no_prompt("Setting metadataignore will override " - "preferred number of copies of VG %s " - "metadata.\nAre you sure? [y/n]: ", + yes_no_prompt("Override preferred number of copies " + "of VG %s metadata? [y/n]: ", vg_name) == 'n') { log_error("Volume group %s not changed", vg_name); goto_bad; From zkabelac@sourceware.org Thu Jul 8 12:02:00 2010 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Thu, 08 Jul 2010 12:02:00 -0000 Subject: LVM2 configure.in configure Message-ID: <20100708120250.23525.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2010-07-08 12:02:49 Modified files: . : configure.in configure Log message: Cleanups for configure: Indent updates. Use AC_HELP_STRING for help string. Start help string with lower letter. Add [] around some default values i.e. [TYPE=internal]. Skip some "" around shell assigment when not needed. Fix typo --with-device-gid=UID string. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.144&r2=1.145 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.133&r2=1.134 --- LVM2/configure.in 2010/07/05 22:23:15 1.144 +++ LVM2/configure.in 2010/07/08 12:02:48 1.145 @@ -148,9 +148,10 @@ dnl -- Enables statically-linked tools AC_MSG_CHECKING(whether to use static linking) AC_ARG_ENABLE(static_link, - [ --enable-static_link Use this to link the tools to their libraries - statically. Default is dynamic linking], - STATIC_LINK=$enableval, STATIC_LINK=no) + AC_HELP_STRING([--enable-static_link], + [use this to link the tools to their libraries + statically (default is dynamic linking]), + STATIC_LINK=$enableval, STATIC_LINK=no) AC_MSG_RESULT($STATIC_LINK) ################################################################################ @@ -161,8 +162,9 @@ dnl -- Setup the ownership of the files AC_MSG_CHECKING(file owner) AC_ARG_WITH(user, - [ --with-user=USER Set the owner of installed files [[USER=]] ], - [ OWNER="$withval" ]) + AC_HELP_STRING([--with-user=USER], + [set the owner of installed files [[USER=]]]), + OWNER=$withval) AC_MSG_RESULT($OWNER) if test x$OWNER != x; then @@ -173,8 +175,9 @@ dnl -- Setup the group ownership of the files AC_MSG_CHECKING(group owner) AC_ARG_WITH(group, - [ --with-group=GROUP Set the group owner of installed files [[GROUP=]] ], - [ GROUP="$withval" ]) + AC_HELP_STRING([--with-group=GROUP], + [set the group owner of installed files [[GROUP=]]]), + GROUP=$withval) AC_MSG_RESULT($GROUP) if test x$GROUP != x; then @@ -186,8 +189,9 @@ AC_MSG_CHECKING(device node uid) AC_ARG_WITH(device-uid, - [ --with-device-uid=UID Set the owner used for new device nodes [[UID=0]] ], - [ DM_DEVICE_UID="$withval" ], [ DM_DEVICE_UID="0" ] ) + AC_HELP_STRING([--with-device-uid=UID], + [set the owner used for new device nodes [[UID=0]]]), + DM_DEVICE_UID=$withval, DM_DEVICE_UID=0) AC_MSG_RESULT($DM_DEVICE_UID) ################################################################################ @@ -195,8 +199,9 @@ AC_MSG_CHECKING(device node gid) AC_ARG_WITH(device-gid, - [ --with-device-gid=UID Set the group used for new device nodes [[GID=0]] ], - [ DM_DEVICE_GID="$withval" ], [ DM_DEVICE_GID="0" ] ) + AC_HELP_STRING([--with-device-gid=GID], + [set the group used for new device nodes [[GID=0]]]), + DM_DEVICE_GID=$withval, DM_DEVICE_GID=0) AC_MSG_RESULT($DM_DEVICE_GID) ################################################################################ @@ -204,15 +209,19 @@ AC_MSG_CHECKING(device node mode) AC_ARG_WITH(device-mode, - [ --with-device-mode=MODE Set the mode used for new device nodes [[MODE=0600]] ], - [ DM_DEVICE_MODE="$withval" ], [ DM_DEVICE_MODE="0600" ] ) + AC_HELP_STRING([--with-device-mode=MODE], + [set the mode used for new device nodes [[MODE=0600]]]), + DM_DEVICE_MODE=$withval, DM_DEVICE_MODE=0600) AC_MSG_RESULT($DM_DEVICE_MODE) ################################################################################ dnl -- LVM1 tool fallback option AC_MSG_CHECKING(whether to enable lvm1 fallback) -AC_ARG_ENABLE(lvm1_fallback, [ --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if - device-mapper is missing from the kernel], LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no) +AC_ARG_ENABLE(lvm1_fallback, + AC_HELP_STRING([--enable-lvm1_fallback], + [use this to fall back and use LVM1 binaries if + device-mapper is missing from the kernel]), + LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no) AC_MSG_RESULT($LVM1_FALLBACK) if test x$LVM1_FALLBACK = xyes; then @@ -223,10 +232,10 @@ dnl -- format1 inclusion type AC_MSG_CHECKING(whether to include support for lvm1 metadata) AC_ARG_WITH(lvm1, - [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none - [TYPE=internal] ], - [ LVM1="$withval" ], - [ LVM1="internal" ]) + AC_HELP_STRING([--with-lvm1=TYPE], + [LVM1 metadata support: internal/shared/none + [[TYPE=internal]]]), + LVM1=$withval, LVM1=internal) AC_MSG_RESULT($LVM1) if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]]; @@ -243,10 +252,10 @@ dnl -- format_pool inclusion type AC_MSG_CHECKING(whether to include support for GFS pool metadata) AC_ARG_WITH(pool, - [ --with-pool=TYPE GFS pool read-only support: internal/shared/none - [TYPE=internal] ], - [ POOL="$withval" ], - [ POOL="internal" ]) + AC_HELP_STRING([--with-pool=TYPE], + [GFS pool read-only support: internal/shared/none + [[TYPE=internal]]]), + POOL=$withval, POOL=internal) AC_MSG_RESULT($POOL) if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]]; @@ -263,9 +272,10 @@ dnl -- cluster_locking inclusion type AC_MSG_CHECKING(whether to include support for cluster locking) AC_ARG_WITH(cluster, - [ --with-cluster=TYPE Cluster LVM locking support: internal/shared/none - [TYPE=internal] ], - [ CLUSTER="$withval" ]) + AC_HELP_STRING([--with-cluster=TYPE], + [cluster LVM locking support: internal/shared/none + [[TYPE=internal]]]), + CLUSTER=$withval) AC_MSG_RESULT($CLUSTER) if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]]; @@ -282,10 +292,10 @@ dnl -- snapshots inclusion type AC_MSG_CHECKING(whether to include snapshots) AC_ARG_WITH(snapshots, - [ --with-snapshots=TYPE Snapshot support: internal/shared/none - [TYPE=internal] ], - [ SNAPSHOTS="$withval" ], - [ SNAPSHOTS="internal" ]) + AC_HELP_STRING([--with-snapshots=TYPE], + [snapshot support: internal/shared/none + [[TYPE=internal]]]), + SNAPSHOTS=$withval, SNAPSHOTS=internal) AC_MSG_RESULT($SNAPSHOTS) if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]]; @@ -302,10 +312,10 @@ dnl -- mirrors inclusion type AC_MSG_CHECKING(whether to include mirrors) AC_ARG_WITH(mirrors, - [ --with-mirrors=TYPE Mirror support: internal/shared/none - [TYPE=internal] ], - [ MIRRORS="$withval" ], - [ MIRRORS="internal" ]) + AC_HELP_STRING([--with-mirrors=TYPE], + [mirror support: internal/shared/none + [[TYPE=internal]]]), + MIRRORS=$withval, MIRRORS=internal) AC_MSG_RESULT($MIRRORS) if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]]; @@ -321,9 +331,11 @@ ################################################################################ dnl -- asynchronous volume replicator inclusion type AC_MSG_CHECKING(whether to include replicators) -AC_ARG_WITH(replicators, AC_HELP_STRING([--with-replicators=TYPE], - [Replicator support: internal/shared/none [TYPE=none] ]), - [REPLICATORS=$withval], [REPLICATORS="none"]) +AC_ARG_WITH(replicators, + AC_HELP_STRING([--with-replicators=TYPE], + [replicator support: internal/shared/none + [[TYPE=none]]]), + REPLICATORS=$withval, REPLICATORS=none) AC_MSG_RESULT($REPLICATORS) case "$REPLICATORS" in @@ -337,15 +349,16 @@ dnl -- Disable readline AC_MSG_CHECKING(whether to enable readline) AC_ARG_ENABLE([readline], - [ --disable-readline Disable readline support], - [READLINE=$enableval], [READLINE=maybe]) + AC_HELP_STRING([--disable-readline], [disable readline support]), + READLINE=$enableval, READLINE=maybe) AC_MSG_RESULT($READLINE) ################################################################################ dnl -- Disable realtime clock support AC_MSG_CHECKING(whether to enable realtime support) -AC_ARG_ENABLE(realtime, [ --enable-realtime Enable realtime clock support], -REALTIME=$enableval) +AC_ARG_ENABLE(realtime, + AC_HELP_STRING([--enable-realtime], [enable realtime clock support]), + REALTIME=$enableval) AC_MSG_RESULT($REALTIME) ################################################################################ @@ -363,7 +376,7 @@ dnl -- Build cluster LVM daemon AC_MSG_CHECKING(whether to build cluster LVM daemon) AC_ARG_WITH(clvmd, - [ --with-clvmd=TYPE Build cluster LVM Daemon. + [ --with-clvmd=TYPE build cluster LVM Daemon The following cluster manager combinations are valid: * cman,gulm (RHEL4 or equivalent) * cman (RHEL5 or equivalent) @@ -371,9 +384,8 @@ * singlenode (localhost only) * all (autodetect) * none (disable build) - [TYPE=none] ], - [ CLVMD="$withval" ], - [ CLVMD="none" ]) + [[TYPE=none]]], + CLVMD=$withval, CLVMD=none) if test x$CLVMD = xyes; then CLVMD=all fi @@ -591,20 +603,24 @@ ################################################################################ dnl -- Build cluster mirror log daemon AC_MSG_CHECKING(whether to build cluster mirror log daemon) -AC_ARG_ENABLE(cmirrord, [ --enable-cmirrord Enable the cluster mirror log daemon], -CMIRRORD=$enableval, CMIRRORD=no) +AC_ARG_ENABLE(cmirrord, + AC_HELP_STRING([--enable-cmirrord], + [enable the cluster mirror log daemon]), + CMIRRORD=$enableval, CMIRRORD=no) AC_MSG_RESULT($CMIRRORD) BUILD_CMIRRORD=$CMIRRORD ################################################################################ dnl -- cmirrord pidfile -AH_TEMPLATE(CMIRRORD_PIDFILE, [Path to cmirrord pidfile.]) if test "x$BUILD_CMIRRORD" = xyes; then AC_ARG_WITH(cmirrord-pidfile, - [ --with-cmirrord-pidfile=PATH cmirrord pidfile [[/var/run/cmirrord.pid]] ], - [ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"$withval") ], - [ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"/var/run/cmirrord.pid") ]) + AC_HELP_STRING([--with-cmirrord-pidfile=PATH], + [cmirrord pidfile [[/var/run/cmirrord.pid]]]), + CMIRRORD_PIDFILE=$withval, + CMIRRORD_PIDFILE="/var/run/cmirrord.pid") + AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE, ["$CMIRRORD_PIDFILE"], + [Path to cmirrord pidfile.]) fi ################################################################################ @@ -623,8 +639,8 @@ ################################################################################ dnl -- Enable debugging AC_MSG_CHECKING(whether to enable debugging) -AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging], - DEBUG=$enableval, DEBUG=no) +AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]), + DEBUG=$enableval, DEBUG=no) AC_MSG_RESULT($DEBUG) dnl -- Normally turn off optimisation for debug builds @@ -638,16 +654,17 @@ dnl -- Override optimisation AC_MSG_CHECKING(for C optimisation flag) AC_ARG_WITH(optimisation, - [ --with-optimisation=OPT C optimisation flag [[OPT=-O2]] ], - [ COPTIMISE_FLAG="$withval" ]) + AC_HELP_STRING([--with-optimisation=OPT], + [C optimisation flag [[OPT=-O2]]]), + COPTIMISE_FLAG=$withval) AC_MSG_RESULT($COPTIMISE_FLAG) ################################################################################ dnl -- Enable profiling AC_MSG_CHECKING(whether to gather gcov profiling data) AC_ARG_ENABLE(profiling, - AC_HELP_STRING(--enable-profiling, [Gather gcov profiling data]), - PROFILING=$enableval, PROFILING=no) + AC_HELP_STRING(--enable-profiling, [gather gcov profiling data]), + PROFILING=$enableval, PROFILING=no) AC_MSG_RESULT($PROFILING) if test "x$PROFILING" = xyes; then @@ -674,8 +691,10 @@ ################################################################################ dnl -- Disable devmapper AC_MSG_CHECKING(whether to use device-mapper) -AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable LVM2 device-mapper interaction], -DEVMAPPER=$enableval) +AC_ARG_ENABLE(devmapper, + AC_HELP_STRING([--disable-devmapper], + [disable LVM2 device-mapper interaction]), + DEVMAPPER=$enableval) AC_MSG_RESULT($DEVMAPPER) if test x$DEVMAPPER = xyes; then @@ -685,8 +704,10 @@ ################################################################################ dnl -- Enable udev synchronisation AC_MSG_CHECKING(whether to enable synchronisation with udev processing) -AC_ARG_ENABLE(udev_sync, [ --enable-udev_sync Enable synchronisation with udev processing], -UDEV_SYNC=$enableval, UDEV_SYNC=no) +AC_ARG_ENABLE(udev_sync, + AC_HELP_STRING([--enable-udev_sync], + [enable synchronisation with udev processing]), + UDEV_SYNC=$enableval, UDEV_SYNC=no) AC_MSG_RESULT($UDEV_SYNC) if test x$UDEV_SYNC = xyes; then @@ -698,21 +719,26 @@ dnl -- Enable udev rules AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation) -AC_ARG_ENABLE(udev_rules, [ --enable-udev_rules Install rule files needed for udev synchronisation], -UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC) +AC_ARG_ENABLE(udev_rules, + AC_HELP_STRING([--enable-udev_rules], + [install rule files needed for udev synchronisation]), + UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC) AC_MSG_RESULT($UDEV_RULES) ################################################################################ dnl -- Compatibility mode -AC_ARG_ENABLE(compat, [ --enable-compat Enable support for old device-mapper versions], - DM_COMPAT=$enableval, DM_COMPAT=no) +AC_ARG_ENABLE(compat, + AC_HELP_STRING([--enable-compat], + [enable support for old device-mapper versions]), + DM_COMPAT=$enableval, DM_COMPAT=no) ################################################################################ dnl -- Compatible units suffix mode AC_ARG_ENABLE(units-compat, - [ --enable-units-compat Enable output compatibility with old versions that - that don't use KiB-style unit suffixes], - UNITS_COMPAT=$enableval, UNITS_COMPAT=no) + AC_HELP_STRING([--enable-units-compat], + [enable output compatibility with old versions that + that do not use KiB-style unit suffixes]), + UNITS_COMPAT=$enableval, UNITS_COMPAT=no) if test x$UNITS_COMPAT = xyes; then AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.]) @@ -720,14 +746,17 @@ ################################################################################ dnl -- Disable ioctl -AC_ARG_ENABLE(ioctl, [ --disable-driver Disable calls to device-mapper in the kernel], - DM_IOCTLS=$enableval) +AC_ARG_ENABLE(ioctl, + AC_HELP_STRING([--disable-driver], + [disable calls to device-mapper in the kernel]), + DM_IOCTLS=$enableval) ################################################################################ dnl -- Disable O_DIRECT AC_MSG_CHECKING(whether to enable O_DIRECT) -AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT], -ODIRECT=$enableval) +AC_ARG_ENABLE(o_direct, + AC_HELP_STRING([--disable-o_direct], [disable O_DIRECT]), + ODIRECT=$enableval) AC_MSG_RESULT($ODIRECT) if test x$ODIRECT = xyes; then @@ -738,8 +767,8 @@ dnl -- Enable liblvm2app.so AC_MSG_CHECKING(whether to build liblvm2app.so application library) AC_ARG_ENABLE(applib, - [ --enable-applib Build application library], - APPLIB=$enableval, APPLIB=no) + AC_HELP_STRING([--enable-applib], [build application library]), + APPLIB=$enableval, APPLIB=no) AC_MSG_RESULT($APPLIB) AC_SUBST([LVM2APP_LIB]) test x$APPLIB = xyes \ @@ -749,8 +778,9 @@ ################################################################################ dnl -- Enable cmdlib AC_MSG_CHECKING(whether to compile liblvm2cmd.so) -AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library], -CMDLIB=$enableval, CMDLIB=no) +AC_ARG_ENABLE(cmdlib, + AC_HELP_STRING([--enable-cmdlib], [build shared command library]), + CMDLIB=$enableval, CMDLIB=no) AC_MSG_RESULT($CMDLIB) AC_SUBST([LVM2CMD_LIB]) test x$CMDLIB = xyes \ @@ -759,27 +789,30 @@ ################################################################################ dnl -- Enable pkg-config -AC_ARG_ENABLE(pkgconfig, [ --enable-pkgconfig Install pkgconfig support], - PKGCONFIG=$enableval, PKGCONFIG=no) +AC_ARG_ENABLE(pkgconfig, + AC_HELP_STRING([--enable-pkgconfig], [install pkgconfig support]), + PKGCONFIG=$enableval, PKGCONFIG=no) ################################################################################ dnl -- Enable installation of writable files by user -AC_ARG_ENABLE(write_install, AC_HELP_STRING([--enable-write_install], - [Install user writable files]), - [WRITE_INSTALL=$enableval], [WRITE_INSTALL=no]) +AC_ARG_ENABLE(write_install, + AC_HELP_STRING([--enable-write_install], + [install user writable files]), + WRITE_INSTALL=$enableval, WRITE_INSTALL=no) ################################################################################ dnl -- Enable fsadm AC_MSG_CHECKING(whether to install fsadm) -AC_ARG_ENABLE(fsadm, [AC_HELP_STRING([--disable-fsadm], [Disable fsadm])], - FSADM=$enableval) +AC_ARG_ENABLE(fsadm, AC_HELP_STRING([--disable-fsadm], [disable fsadm]), + FSADM=$enableval) AC_MSG_RESULT($FSADM) ################################################################################ dnl -- enable dmeventd handling AC_MSG_CHECKING(whether to use dmeventd) -AC_ARG_ENABLE(dmeventd, [ --enable-dmeventd Enable the device-mapper event daemon], -DMEVENTD=$enableval) +AC_ARG_ENABLE(dmeventd, AC_HELP_STRING([--enable-dmeventd], + [enable the device-mapper event daemon]), + DMEVENTD=$enableval) AC_MSG_RESULT($DMEVENTD) BUILD_DMEVENTD=$DMEVENTD @@ -849,8 +882,9 @@ ################################################################################ dnl -- Disable selinux AC_MSG_CHECKING(whether to enable selinux support) -AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support], - SELINUX=$enableval) +AC_ARG_ENABLE(selinux, + AC_HELP_STRING([--disable-selinux], [disable selinux support]), + SELINUX=$enableval) AC_MSG_RESULT($SELINUX) ################################################################################ @@ -935,8 +969,9 @@ ################################################################################ dnl -- Internationalisation stuff AC_MSG_CHECKING(whether to enable internationalisation) -AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support], - INTL=$enableval, INTL=no) +AC_ARG_ENABLE(nls, + AC_HELP_STRING([--enable-nls], [enable Native Language Support]), + INTL=$enableval, INTL=no) AC_MSG_RESULT($INTL) if test x$INTL = xyes; then @@ -950,42 +985,43 @@ fi; AC_ARG_WITH(localedir, - [ --with-localedir=DIR Translation files in DIR [[PREFIX/share/locale]] ], - [ LOCALEDIR="$withval" ], - [ LOCALEDIR='${prefix}/share/locale' ]) + AC_HELP_STRING([--with-localedir=DIR], + [translation files in DIR + [[PREFIX/share/locale]]]), + LOCALEDIR=$withval, LOCALEDIR='${prefix}/share/locale') fi ################################################################################ AC_ARG_WITH(confdir, - [ --with-confdir=DIR Configuration files in DIR [[/etc]]], - [ CONFDIR="$withval" ], - [ CONFDIR='/etc' ]) + AC_HELP_STRING([--with-confdir=DIR], + [configuration files in DIR [[/etc]]]), + CONFDIR=$withval, CONFDIR="/etc") AC_ARG_WITH(staticdir, - [ --with-staticdir=DIR Static binary in DIR [[EPREFIX/sbin]]], - [ STATICDIR="$withval" ], - [ STATICDIR='${exec_prefix}/sbin' ]) + AC_HELP_STRING([--with-staticdir=DIR], + [static binaries in DIR [[EPREFIX/sbin]]]), + STATICDIR=$withval, STATICDIR='${exec_prefix}/sbin') AC_ARG_WITH(usrlibdir, - [ --with-usrlibdir=DIR], - [ usrlibdir="$withval"], - [ usrlibdir='${prefix}/lib' ]) + AC_HELP_STRING([--with-usrlibdir=DIR], + [usrlib in DIR [[PREFIX/lib]]]), + usrlibdir=$withval, usrlibdir='${prefix}/lib') AC_ARG_WITH(usrsbindir, - [ --with-usrsbindir=DIR], - [ usrsbindir="$withval"], - [ usrsbindir='${prefix}/sbin' ]) + AC_HELP_STRING([--with-usrsbindir=DIR], + [usrsbin executables in DIR [[PREFIX/sbin]]]), + usrsbindir=$withval, usrsbindir='${prefix}/sbin') ################################################################################ AC_ARG_WITH(udev_prefix, - [ --with-udev-prefix=UPREFIX Install udev rule files in UPREFIX [[EPREFIX]]], - [ udev_prefix="$withval"], - [ udev_prefix='${exec_prefix}' ]) + AC_HELP_STRING([--with-udev-prefix=UPREFIX], + [install udev rule files in UPREFIX [[EPREFIX]]]), + udev_prefix=$withval, udev_prefix='${exec_prefix}') AC_ARG_WITH(udevdir, - [ --with-udevdir=DIR udev rules in DIR [[UPREFIX/lib/udev/rules.d]]], - [ udevdir="$withval"], - [ udevdir='${udev_prefix}/lib/udev/rules.d' ]) + AC_HELP_STRING([--with-udevdir=DIR], + [udev rules in DIR [[UPREFIX/lib/udev/rules.d]]]), + udevdir=$withval, udevdir='${udev_prefix}/lib/udev/rules.d') ################################################################################ dnl -- Ensure additional headers required @@ -1037,71 +1073,76 @@ if test "$CLVMD" != none; then clvmd_prefix=$ac_default_prefix test "$prefix" != NONE && clvmd_prefix=$prefix - AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$clvmd_prefix/sbin/clvmd"], [Path to clvmd binary.]) + AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$clvmd_prefix/sbin/clvmd"], + [Path to clvmd binary.]) fi ################################################################################ dnl -- dmeventd pidfile and executable path -AH_TEMPLATE(DMEVENTD_PIDFILE, [Path to dmeventd pidfile.]) if test "$BUILD_DMEVENTD" = yes; then AC_ARG_WITH(dmeventd-pidfile, - [ --with-dmeventd-pidfile=PATH dmeventd pidfile [[/var/run/dmeventd.pid]] ], - [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"$withval") ], - [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"/var/run/dmeventd.pid") ]) + AC_HELP_STRING([--with-dmeventd-pidfile=PATH], + [dmeventd pidfile [[/var/run/dmeventd.pid]]]), + DMEVENTD_PIDFILE=$withval, + DMEVENTD_PIDFILE="/var/run/dmeventd.pid") + AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE, ["$DMEVENTD_PIDFILE"], + [Path to dmeventd pidfile.]) fi -AH_TEMPLATE(DMEVENTD_PATH, [Path to dmeventd binary.]) if test "$BUILD_DMEVENTD" = yes; then AC_ARG_WITH(dmeventd-path, - [ --with-dmeventd-path=PATH dmeventd path [[EPREFIX/sbin/dmeventd]] ], - [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$withval") ], - [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$lvm_exec_prefix/sbin/dmeventd") ]) + AC_HELP_STRING([--with-dmeventd-path=PATH], + [dmeventd path [[EPREFIX/sbin/dmeventd]]]), + DMEVENTD_PATH=$withval, + DMEVENTD_PATH="$lvm_exec_prefix/sbin/dmeventd") + AC_DEFINE_UNQUOTED(DMEVENTD_PATH, ["$DMEVENTD_PATH"], + [Path to dmeventd binary.]) fi ################################################################################ dnl -- various defaults -AH_TEMPLATE(DEFAULT_SYS_DIR, [Path to LVM system directory.]) AC_ARG_WITH(default-system-dir, - [ --with-default-system-dir=DIR Default LVM system directory [[/etc/lvm]] ], - [ DEFAULT_SYS_DIR="$withval" ], - [ DEFAULT_SYS_DIR="/etc/lvm" ]) -AC_DEFINE_UNQUOTED(DEFAULT_SYS_DIR,["$DEFAULT_SYS_DIR"] ) + AC_HELP_STRING([--with-default-system-dir=DIR], + [default LVM system directory [[/etc/lvm]]]), + DEFAULT_SYS_DIR=$withval, DEFAULT_SYS_DIR="/etc/lvm") +AC_DEFINE_UNQUOTED(DEFAULT_SYS_DIR, ["$DEFAULT_SYS_DIR"], + [Path to LVM system directory.]) -AH_TEMPLATE(DEFAULT_ARCHIVE_SUBDIR, [Name of default metadata archive subdirectory.]) AC_ARG_WITH(default-archive-subdir, - [ --with-default-archive-subdir=SUBDIR Default metadata archive subdir [[archive]] ], - [ DEFAULT_ARCHIVE_SUBDIR="$withval" ], - [ DEFAULT_ARCHIVE_SUBDIR="archive" ]) -AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR,["$DEFAULT_ARCHIVE_SUBDIR"]) + AC_HELP_STRING([--with-default-archive-subdir=SUBDIR], + [default metadata archive subdir [[archive]]]), + DEFAULT_ARCHIVE_SUBDIR=$withval, DEFAULT_ARCHIVE_SUBDIR=archive) +AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR, ["$DEFAULT_ARCHIVE_SUBDIR"], + [Name of default metadata archive subdirectory.]) -AH_TEMPLATE(DEFAULT_BACKUP_SUBDIR, [Name of default metadata backup subdirectory.]) AC_ARG_WITH(default-backup-subdir, - [ --with-default-backup-subdir=SUBDIR Default metadata backup subdir [[backup]] ], - [ DEFAULT_BACKUP_SUBDIR="$withval" ], - [ DEFAULT_BACKUP_SUBDIR="backup" ]) -AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR,["$DEFAULT_BACKUP_SUBDIR"] ) + AC_HELP_STRING([--with-default-backup-subdir=SUBDIR], + [default metadata backup subdir [[backup]]]), + DEFAULT_BACKUP_SUBDIR=$withval, DEFAULT_BACKUP_SUBDIR=backup) +AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR, ["$DEFAULT_BACKUP_SUBDIR"], + [Name of default metadata backup subdirectory.]) -AH_TEMPLATE(DEFAULT_CACHE_SUBDIR, [Name of default metadata cache subdirectory.]) AC_ARG_WITH(default-cache-subdir, - [ --with-default-cache-subdir=SUBDIR Default metadata cache subdir [[cache]] ], - [ DEFAULT_CACHE_SUBDIR="$withval" ], - [ DEFAULT_CACHE_SUBDIR="cache" ]) -AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR,["$DEFAULT_CACHE_SUBDIR"] ) + AC_HELP_STRING([--with-default-cache-subdir=SUBDIR], + [default metadata cache subdir [[cache]]]), + DEFAULT_CACHE_SUBDIR=$withval, DEFAULT_CACHE_SUBDIR=cache) +AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR, ["$DEFAULT_CACHE_SUBDIR"], + [Name of default metadata cache subdirectory.]) -AH_TEMPLATE(DEFAULT_LOCK_DIR, [Name of default locking directory.]) AC_ARG_WITH(default-locking-dir, - [ --with-default-locking-dir=DIR Default locking directory [[/var/lock/lvm]] ], - [ DEFAULT_LOCK_DIR="$withval" ], - [ DEFAULT_LOCK_DIR="/var/lock/lvm" ]) -AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR,["$DEFAULT_LOCK_DIR"] ) + AC_HELP_STRING([--with-default-locking-dir=DIR], + [default locking directory [[/var/lock/lvm]]]), + DEFAULT_LOCK_DIR=$withval, DEFAULT_LOCK_DIR="/var/lock/lvm") +AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"], + [Name of default locking directory.]) ################################################################################ dnl -- which kernel interface to use (ioctl only) AC_MSG_CHECKING(for kernel interface choice) AC_ARG_WITH(interface, - [ --with-interface=IFACE Choose kernel interface (ioctl) [[ioctl]] ], - [ interface="$withval" ], - [ interface=ioctl ]) + AC_HELP_STRING([--with-interface=IFACE], + [choose kernel interface (ioctl) [[ioctl]]]), + interface=$withval, interface=ioctl) if [[ "x$interface" != xioctl ]]; then AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.) --- LVM2/configure 2010/07/05 22:23:15 1.133 +++ LVM2/configure 2010/07/08 12:02:48 1.134 @@ -736,6 +736,8 @@ CCS_CFLAGS PKGCONFIGINIT_LIBS PKGCONFIGINIT_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH PKG_CONFIG POW_LIB LIBOBJS @@ -875,6 +877,8 @@ CPPFLAGS CPP PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR PKGCONFIGINIT_CFLAGS PKGCONFIGINIT_LIBS CCS_CFLAGS @@ -1521,52 +1525,53 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-static_link Use this to link the tools to their libraries - statically. Default is dynamic linking - --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if + --enable-static_link use this to link the tools to their libraries + statically (default is dynamic linking + --enable-lvm1_fallback use this to fall back and use LVM1 binaries if device-mapper is missing from the kernel - --disable-readline Disable readline support - --enable-realtime Enable realtime clock support - --enable-cmirrord Enable the cluster mirror log daemon - --enable-debug Enable debugging - --enable-profiling Gather gcov profiling data - --disable-devmapper Disable LVM2 device-mapper interaction - --enable-udev_sync Enable synchronisation with udev processing - --enable-udev_rules Install rule files needed for udev synchronisation - --enable-compat Enable support for old device-mapper versions - --enable-units-compat Enable output compatibility with old versions that - that don't use KiB-style unit suffixes - --disable-driver Disable calls to device-mapper in the kernel - --disable-o_direct Disable O_DIRECT - --enable-applib Build application library - --enable-cmdlib Build shared command library - --enable-pkgconfig Install pkgconfig support - --enable-write_install Install user writable files - --disable-fsadm Disable fsadm - --enable-dmeventd Enable the device-mapper event daemon - --disable-selinux Disable selinux support - --enable-nls Enable Native Language Support + --disable-readline disable readline support + --enable-realtime enable realtime clock support + --enable-cmirrord enable the cluster mirror log daemon + --enable-debug enable debugging + --enable-profiling gather gcov profiling data + --disable-devmapper disable LVM2 device-mapper interaction + --enable-udev_sync enable synchronisation with udev processing + --enable-udev_rules install rule files needed for udev synchronisation + --enable-compat enable support for old device-mapper versions + --enable-units-compat enable output compatibility with old versions that + that do not use KiB-style unit suffixes + --disable-driver disable calls to device-mapper in the kernel + --disable-o_direct disable O_DIRECT + --enable-applib build application library + --enable-cmdlib build shared command library + --enable-pkgconfig install pkgconfig support + --enable-write_install install user writable files + --disable-fsadm disable fsadm + --enable-dmeventd enable the device-mapper event daemon + --disable-selinux disable selinux support + --enable-nls enable Native Language Support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-user=USER Set the owner of installed files [USER=] - --with-group=GROUP Set the group owner of installed files [GROUP=] - --with-device-uid=UID Set the owner used for new device nodes [UID=0] - --with-device-gid=UID Set the group used for new device nodes [GID=0] - --with-device-mode=MODE Set the mode used for new device nodes [MODE=0600] + --with-user=USER set the owner of installed files [USER=] + --with-group=GROUP set the group owner of installed files [GROUP=] + --with-device-uid=UID set the owner used for new device nodes [UID=0] + --with-device-gid=GID set the group used for new device nodes [GID=0] + --with-device-mode=MODE set the mode used for new device nodes [MODE=0600] --with-lvm1=TYPE LVM1 metadata support: internal/shared/none - TYPE=internal + [TYPE=internal] --with-pool=TYPE GFS pool read-only support: internal/shared/none - TYPE=internal - --with-cluster=TYPE Cluster LVM locking support: internal/shared/none - TYPE=internal - --with-snapshots=TYPE Snapshot support: internal/shared/none - TYPE=internal - --with-mirrors=TYPE Mirror support: internal/shared/none - TYPE=internal - --with-replicators=TYPE Replicator support: internal/shared/none TYPE=none - --with-clvmd=TYPE Build cluster LVM Daemon. + [TYPE=internal] + --with-cluster=TYPE cluster LVM locking support: internal/shared/none + [TYPE=internal] + --with-snapshots=TYPE snapshot support: internal/shared/none + [TYPE=internal] + --with-mirrors=TYPE mirror support: internal/shared/none + [TYPE=internal] + --with-replicators=TYPE replicator support: internal/shared/none + [TYPE=none] + --with-clvmd=TYPE build cluster LVM Daemon The following cluster manager combinations are valid: * cman,gulm (RHEL4 or equivalent) * cman (RHEL5 or equivalent) @@ -1574,24 +1579,33 @@ * singlenode (localhost only) * all (autodetect) * none (disable build) - TYPE=none - --with-cmirrord-pidfile=PATH cmirrord pidfile [/var/run/cmirrord.pid] + [TYPE=none] + --with-cmirrord-pidfile=PATH + cmirrord pidfile [/var/run/cmirrord.pid] --with-optimisation=OPT C optimisation flag [OPT=-O2] - --with-localedir=DIR Translation files in DIR [PREFIX/share/locale] - --with-confdir=DIR Configuration files in DIR [/etc] - --with-staticdir=DIR Static binary in DIR [EPREFIX/sbin] - --with-usrlibdir=DIR - --with-usrsbindir=DIR - --with-udev-prefix=UPREFIX Install udev rule files in UPREFIX [EPREFIX] + --with-localedir=DIR translation files in DIR [PREFIX/share/locale] + --with-confdir=DIR configuration files in DIR [/etc] + --with-staticdir=DIR static binaries in DIR [EPREFIX/sbin] + --with-usrlibdir=DIR usrlib in DIR [PREFIX/lib] + --with-usrsbindir=DIR usrsbin executables in DIR [PREFIX/sbin] + --with-udev-prefix=UPREFIX + install udev rule files in UPREFIX [EPREFIX] --with-udevdir=DIR udev rules in DIR [UPREFIX/lib/udev/rules.d] - --with-dmeventd-pidfile=PATH dmeventd pidfile [/var/run/dmeventd.pid] - --with-dmeventd-path=PATH dmeventd path [EPREFIX/sbin/dmeventd] - --with-default-system-dir=DIR Default LVM system directory [/etc/lvm] - --with-default-archive-subdir=SUBDIR Default metadata archive subdir [archive] - --with-default-backup-subdir=SUBDIR Default metadata backup subdir [backup] - --with-default-cache-subdir=SUBDIR Default metadata cache subdir [cache] - --with-default-locking-dir=DIR Default locking directory [/var/lock/lvm] - --with-interface=IFACE Choose kernel interface (ioctl) [ioctl] + --with-dmeventd-pidfile=PATH + dmeventd pidfile [/var/run/dmeventd.pid] + --with-dmeventd-path=PATH + dmeventd path [EPREFIX/sbin/dmeventd] + --with-default-system-dir=DIR + default LVM system directory [/etc/lvm] + --with-default-archive-subdir=SUBDIR + default metadata archive subdir [archive] + --with-default-backup-subdir=SUBDIR + default metadata backup subdir [backup] + --with-default-cache-subdir=SUBDIR + default metadata cache subdir [cache] + --with-default-locking-dir=DIR + default locking directory [/var/lock/lvm] + --with-interface=IFACE choose kernel interface (ioctl) [ioctl] Some influential environment variables: CC C compiler command @@ -1603,6 +1617,10 @@ you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path PKGCONFIGINIT_CFLAGS C compiler flags for PKGCONFIGINIT, overriding pkg-config PKGCONFIGINIT_LIBS @@ -11103,7 +11121,7 @@ # Check whether --with-user was given. if test "${with_user+set}" = set; then - withval=$with_user; OWNER="$withval" + withval=$with_user; OWNER=$withval fi { $as_echo "$as_me:$LINENO: result: $OWNER" >&5 @@ -11119,7 +11137,7 @@ # Check whether --with-group was given. if test "${with_group+set}" = set; then - withval=$with_group; GROUP="$withval" + withval=$with_group; GROUP=$withval fi { $as_echo "$as_me:$LINENO: result: $GROUP" >&5 @@ -11136,9 +11154,9 @@ # Check whether --with-device-uid was given. if test "${with_device_uid+set}" = set; then - withval=$with_device_uid; DM_DEVICE_UID="$withval" + withval=$with_device_uid; DM_DEVICE_UID=$withval else - DM_DEVICE_UID="0" + DM_DEVICE_UID=0 fi { $as_echo "$as_me:$LINENO: result: $DM_DEVICE_UID" >&5 @@ -11151,9 +11169,9 @@ # Check whether --with-device-gid was given. if test "${with_device_gid+set}" = set; then - withval=$with_device_gid; DM_DEVICE_GID="$withval" + withval=$with_device_gid; DM_DEVICE_GID=$withval else - DM_DEVICE_GID="0" + DM_DEVICE_GID=0 fi { $as_echo "$as_me:$LINENO: result: $DM_DEVICE_GID" >&5 @@ -11166,9 +11184,9 @@ # Check whether --with-device-mode was given. if test "${with_device_mode+set}" = set; then - withval=$with_device_mode; DM_DEVICE_MODE="$withval" + withval=$with_device_mode; DM_DEVICE_MODE=$withval else - DM_DEVICE_MODE="0600" + DM_DEVICE_MODE=0600 fi { $as_echo "$as_me:$LINENO: result: $DM_DEVICE_MODE" >&5 @@ -11201,9 +11219,9 @@ # Check whether --with-lvm1 was given. if test "${with_lvm1+set}" = set; then - withval=$with_lvm1; LVM1="$withval" + withval=$with_lvm1; LVM1=$withval else - LVM1="internal" + LVM1=internal fi { $as_echo "$as_me:$LINENO: result: $LVM1" >&5 @@ -11231,9 +11249,9 @@ # Check whether --with-pool was given. if test "${with_pool+set}" = set; then - withval=$with_pool; POOL="$withval" + withval=$with_pool; POOL=$withval else - POOL="internal" + POOL=internal fi { $as_echo "$as_me:$LINENO: result: $POOL" >&5 @@ -11261,7 +11279,7 @@ # Check whether --with-cluster was given. if test "${with_cluster+set}" = set; then - withval=$with_cluster; CLUSTER="$withval" + withval=$with_cluster; CLUSTER=$withval fi { $as_echo "$as_me:$LINENO: result: $CLUSTER" >&5 @@ -11289,9 +11307,9 @@ # Check whether --with-snapshots was given. if test "${with_snapshots+set}" = set; then - withval=$with_snapshots; SNAPSHOTS="$withval" + withval=$with_snapshots; SNAPSHOTS=$withval else - SNAPSHOTS="internal" + SNAPSHOTS=internal fi { $as_echo "$as_me:$LINENO: result: $SNAPSHOTS" >&5 @@ -11319,9 +11337,9 @@ # Check whether --with-mirrors was given. if test "${with_mirrors+set}" = set; then - withval=$with_mirrors; MIRRORS="$withval" + withval=$with_mirrors; MIRRORS=$withval else - MIRRORS="internal" + MIRRORS=internal fi { $as_echo "$as_me:$LINENO: result: $MIRRORS" >&5 @@ -11351,7 +11369,7 @@ if test "${with_replicators+set}" = set; then withval=$with_replicators; REPLICATORS=$withval else - REPLICATORS="none" + REPLICATORS=none fi { $as_echo "$as_me:$LINENO: result: $REPLICATORS" >&5 @@ -11397,6 +11415,10 @@ pkg_config_init() { + + + + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. @@ -11509,7 +11531,6 @@ $as_echo "no" >&6; } PKG_CONFIG="" fi - fi pkg_failed=no @@ -11552,6 +11573,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -11566,11 +11589,11 @@ # Put the nasty error message in config.log where it belongs echo "$PKGCONFIGINIT_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:$LINENO: result: pkg-config initialized" >&5 + { $as_echo "$as_me:$LINENO: result: pkg-config initialized" >&5 $as_echo "pkg-config initialized" >&6; } elif test $pkg_failed = untried; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } { $as_echo "$as_me:$LINENO: result: pkg-config initialized" >&5 $as_echo "pkg-config initialized" >&6; } else @@ -11578,7 +11601,7 @@ PKGCONFIGINIT_LIBS=$pkg_cv_PKGCONFIGINIT_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - : + fi PKGCONFIG_INIT=1 } @@ -11589,9 +11612,9 @@ # Check whether --with-clvmd was given. if test "${with_clvmd+set}" = set; then - withval=$with_clvmd; CLVMD="$withval" + withval=$with_clvmd; CLVMD=$withval else - CLVMD="none" + CLVMD=none fi if test x$CLVMD = xyes; then @@ -11784,6 +11807,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -11798,9 +11823,7 @@ # Put the nasty error message in config.log where it belongs echo "$CCS_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - NOTFOUND=0 + NOTFOUND=0 for ac_header in ccs.h do @@ -11957,6 +11980,8 @@ HAVE_CCS=yes fi elif test $pkg_failed = untried; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } NOTFOUND=0 for ac_header in ccs.h @@ -12161,6 +12186,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -12175,9 +12202,7 @@ # Put the nasty error message in config.log where it belongs echo "$GULM_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - NOTFOUND=0 + NOTFOUND=0 for ac_header in libgulm.h do @@ -12334,6 +12359,8 @@ HAVE_GULM=yes fi elif test $pkg_failed = untried; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } NOTFOUND=0 for ac_header in libgulm.h @@ -12541,6 +12568,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -12555,9 +12584,7 @@ # Put the nasty error message in config.log where it belongs echo "$CMAN_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - NOTFOUND=0 + NOTFOUND=0 for ac_header in libcman.h do @@ -12714,6 +12741,8 @@ HAVE_CMAN=yes fi elif test $pkg_failed = untried; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } NOTFOUND=0 for ac_header in libcman.h @@ -12924,6 +12953,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -12938,10 +12969,10 @@ # Put the nasty error message in config.log where it belongs echo "$COROSYNC_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - $bailout + $bailout elif test $pkg_failed = untried; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } $bailout else COROSYNC_CFLAGS=$pkg_cv_COROSYNC_CFLAGS @@ -12995,6 +13026,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13009,10 +13042,10 @@ # Put the nasty error message in config.log where it belongs echo "$QUORUM_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - $bailout + $bailout elif test $pkg_failed = untried; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } $bailout else QUORUM_CFLAGS=$pkg_cv_QUORUM_CFLAGS @@ -13067,6 +13100,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13081,10 +13116,10 @@ # Put the nasty error message in config.log where it belongs echo "$SALCK_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - $bailout + $bailout elif test $pkg_failed = untried; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } $bailout else SALCK_CFLAGS=$pkg_cv_SALCK_CFLAGS @@ -13140,6 +13175,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13154,10 +13191,10 @@ # Put the nasty error message in config.log where it belongs echo "$CONFDB_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - HAVE_CONFDB=no + HAVE_CONFDB=no elif test $pkg_failed = untried; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } HAVE_CONFDB=no else CONFDB_CFLAGS=$pkg_cv_CONFDB_CFLAGS @@ -13376,6 +13413,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13390,10 +13429,10 @@ # Put the nasty error message in config.log where it belongs echo "$CPG_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - $bailout + $bailout elif test $pkg_failed = untried; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } $bailout else CPG_CFLAGS=$pkg_cv_CPG_CFLAGS @@ -13446,6 +13485,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13460,9 +13501,7 @@ # Put the nasty error message in config.log where it belongs echo "$DLM_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - NOTFOUND=0 + NOTFOUND=0 for ac_header in libdlm.h do @@ -13619,6 +13658,8 @@ HAVE_DLM=yes fi elif test $pkg_failed = untried; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } NOTFOUND=0 for ac_header in libdlm.h @@ -13836,23 +13877,20 @@ BUILD_CMIRRORD=$CMIRRORD ################################################################################ - - if test "x$BUILD_CMIRRORD" = xyes; then # Check whether --with-cmirrord-pidfile was given. if test "${with_cmirrord_pidfile+set}" = set; then - withval=$with_cmirrord_pidfile; cat >>confdefs.h <<_ACEOF -#define CMIRRORD_PIDFILE "$withval" -_ACEOF - + withval=$with_cmirrord_pidfile; CMIRRORD_PIDFILE=$withval else - cat >>confdefs.h <<_ACEOF -#define CMIRRORD_PIDFILE "/var/run/cmirrord.pid" -_ACEOF - + CMIRRORD_PIDFILE="/var/run/cmirrord.pid" fi + +cat >>confdefs.h <<_ACEOF +#define CMIRRORD_PIDFILE "$CMIRRORD_PIDFILE" +_ACEOF + fi ################################################################################ @@ -13901,6 +13939,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13924,8 +13964,7 @@ Alternatively, you may set the environment variables SACKPT_CFLAGS and SACKPT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&5 +See the pkg-config man page for more details." >&5 $as_echo "$as_me: error: Package requirements (libSaCkpt) were not met: $SACKPT_PKG_ERRORS @@ -13935,10 +13974,11 @@ Alternatively, you may set the environment variables SACKPT_CFLAGS and SACKPT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&2;} +See the pkg-config man page for more details." >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it @@ -13967,7 +14007,7 @@ SACKPT_LIBS=$pkg_cv_SACKPT_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - : + fi if test x$HAVE_CPG != xyes; then @@ -14011,6 +14051,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14034,8 +14076,7 @@ Alternatively, you may set the environment variables CPG_CFLAGS and CPG_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&5 +See the pkg-config man page for more details." >&5 $as_echo "$as_me: error: Package requirements (libcpg) were not met: $CPG_PKG_ERRORS @@ -14045,10 +14086,11 @@ Alternatively, you may set the environment variables CPG_CFLAGS and CPG_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&2;} +See the pkg-config man page for more details." >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it @@ -14077,7 +14119,7 @@ CPG_LIBS=$pkg_cv_CPG_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - : + fi fi fi @@ -14107,7 +14149,7 @@ # Check whether --with-optimisation was given. if test "${with_optimisation+set}" = set; then - withval=$with_optimisation; COPTIMISE_FLAG="$withval" + withval=$with_optimisation; COPTIMISE_FLAG=$withval fi { $as_echo "$as_me:$LINENO: result: $COPTIMISE_FLAG" >&5 @@ -15886,9 +15928,9 @@ # Check whether --with-localedir was given. if test "${with_localedir+set}" = set; then - withval=$with_localedir; LOCALEDIR="$withval" + withval=$with_localedir; LOCALEDIR=$withval else - LOCALEDIR='${prefix}/share/locale' + LOCALEDIR='${prefix}/share/locale' fi fi @@ -15897,36 +15939,36 @@ # Check whether --with-confdir was given. if test "${with_confdir+set}" = set; then - withval=$with_confdir; CONFDIR="$withval" + withval=$with_confdir; CONFDIR=$withval else - CONFDIR='/etc' + CONFDIR="/etc" fi # Check whether --with-staticdir was given. if test "${with_staticdir+set}" = set; then - withval=$with_staticdir; STATICDIR="$withval" + withval=$with_staticdir; STATICDIR=$withval else - STATICDIR='${exec_prefix}/sbin' + STATICDIR='${exec_prefix}/sbin' fi # Check whether --with-usrlibdir was given. if test "${with_usrlibdir+set}" = set; then - withval=$with_usrlibdir; usrlibdir="$withval" + withval=$with_usrlibdir; usrlibdir=$withval else - usrlibdir='${prefix}/lib' + usrlibdir='${prefix}/lib' fi # Check whether --with-usrsbindir was given. if test "${with_usrsbindir+set}" = set; then - withval=$with_usrsbindir; usrsbindir="$withval" + withval=$with_usrsbindir; usrsbindir=$withval else - usrsbindir='${prefix}/sbin' + usrsbindir='${prefix}/sbin' fi @@ -15934,18 +15976,18 @@ # Check whether --with-udev_prefix was given. if test "${with_udev_prefix+set}" = set; then - withval=$with_udev_prefix; udev_prefix="$withval" + withval=$with_udev_prefix; udev_prefix=$withval else - udev_prefix='${exec_prefix}' + udev_prefix='${exec_prefix}' fi # Check whether --with-udevdir was given. if test "${with_udevdir+set}" = set; then - withval=$with_udevdir; udevdir="$withval" + withval=$with_udevdir; udevdir=$withval else - udevdir='${udev_prefix}/lib/udev/rules.d' + udevdir='${udev_prefix}/lib/udev/rules.d' fi @@ -17651,115 +17693,104 @@ fi ################################################################################ - - if test "$BUILD_DMEVENTD" = yes; then # Check whether --with-dmeventd-pidfile was given. if test "${with_dmeventd_pidfile+set}" = set; then - withval=$with_dmeventd_pidfile; cat >>confdefs.h <<_ACEOF -#define DMEVENTD_PIDFILE "$withval" -_ACEOF - + withval=$with_dmeventd_pidfile; DMEVENTD_PIDFILE=$withval else - cat >>confdefs.h <<_ACEOF -#define DMEVENTD_PIDFILE "/var/run/dmeventd.pid" -_ACEOF - + DMEVENTD_PIDFILE="/var/run/dmeventd.pid" fi -fi +cat >>confdefs.h <<_ACEOF +#define DMEVENTD_PIDFILE "$DMEVENTD_PIDFILE" +_ACEOF +fi if test "$BUILD_DMEVENTD" = yes; then # Check whether --with-dmeventd-path was given. if test "${with_dmeventd_path+set}" = set; then - withval=$with_dmeventd_path; cat >>confdefs.h <<_ACEOF -#define DMEVENTD_PATH "$withval" -_ACEOF - + withval=$with_dmeventd_path; DMEVENTD_PATH=$withval else - cat >>confdefs.h <<_ACEOF -#define DMEVENTD_PATH "$lvm_exec_prefix/sbin/dmeventd" -_ACEOF - + DMEVENTD_PATH="$lvm_exec_prefix/sbin/dmeventd" fi -fi -################################################################################ +cat >>confdefs.h <<_ACEOF +#define DMEVENTD_PATH "$DMEVENTD_PATH" +_ACEOF +fi +################################################################################ # Check whether --with-default-system-dir was given. if test "${with_default_system_dir+set}" = set; then - withval=$with_default_system_dir; DEFAULT_SYS_DIR="$withval" + withval=$with_default_system_dir; DEFAULT_SYS_DIR=$withval else - DEFAULT_SYS_DIR="/etc/lvm" + DEFAULT_SYS_DIR="/etc/lvm" fi + cat >>confdefs.h <<_ACEOF #define DEFAULT_SYS_DIR "$DEFAULT_SYS_DIR" _ACEOF - - # Check whether --with-default-archive-subdir was given. if test "${with_default_archive_subdir+set}" = set; then - withval=$with_default_archive_subdir; DEFAULT_ARCHIVE_SUBDIR="$withval" + withval=$with_default_archive_subdir; DEFAULT_ARCHIVE_SUBDIR=$withval else - DEFAULT_ARCHIVE_SUBDIR="archive" + DEFAULT_ARCHIVE_SUBDIR=archive fi + cat >>confdefs.h <<_ACEOF #define DEFAULT_ARCHIVE_SUBDIR "$DEFAULT_ARCHIVE_SUBDIR" _ACEOF - - # Check whether --with-default-backup-subdir was given. if test "${with_default_backup_subdir+set}" = set; then - withval=$with_default_backup_subdir; DEFAULT_BACKUP_SUBDIR="$withval" + withval=$with_default_backup_subdir; DEFAULT_BACKUP_SUBDIR=$withval else - DEFAULT_BACKUP_SUBDIR="backup" + DEFAULT_BACKUP_SUBDIR=backup fi + cat >>confdefs.h <<_ACEOF #define DEFAULT_BACKUP_SUBDIR "$DEFAULT_BACKUP_SUBDIR" _ACEOF - - # Check whether --with-default-cache-subdir was given. if test "${with_default_cache_subdir+set}" = set; then - withval=$with_default_cache_subdir; DEFAULT_CACHE_SUBDIR="$withval" + withval=$with_default_cache_subdir; DEFAULT_CACHE_SUBDIR=$withval else - DEFAULT_CACHE_SUBDIR="cache" + DEFAULT_CACHE_SUBDIR=cache fi + cat >>confdefs.h <<_ACEOF #define DEFAULT_CACHE_SUBDIR "$DEFAULT_CACHE_SUBDIR" _ACEOF - - # Check whether --with-default-locking-dir was given. if test "${with_default_locking_dir+set}" = set; then - withval=$with_default_locking_dir; DEFAULT_LOCK_DIR="$withval" + withval=$with_default_locking_dir; DEFAULT_LOCK_DIR=$withval else - DEFAULT_LOCK_DIR="/var/lock/lvm" + DEFAULT_LOCK_DIR="/var/lock/lvm" fi + cat >>confdefs.h <<_ACEOF #define DEFAULT_LOCK_DIR "$DEFAULT_LOCK_DIR" _ACEOF @@ -17771,9 +17802,9 @@ # Check whether --with-interface was given. if test "${with_interface+set}" = set; then - withval=$with_interface; interface="$withval" + withval=$with_interface; interface=$withval else - interface=ioctl + interface=ioctl fi if [ "x$interface" != xioctl ]; From zkabelac@sourceware.org Thu Jul 8 12:16:00 2010 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Thu, 08 Jul 2010 12:16:00 -0000 Subject: LVM2/libdm/datastruct bitset.c Message-ID: <20100708121617.29258.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2010-07-08 12:16:16 Modified files: libdm/datastruct: bitset.c Log message: Minor optimalization of _test_word. Skip ffs() if (test >> bit) is 0. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/datastruct/bitset.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11 --- LVM2/libdm/datastruct/bitset.c 2010/04/20 13:58:23 1.10 +++ LVM2/libdm/datastruct/bitset.c 2010/07/08 12:16:16 1.11 @@ -69,9 +69,9 @@ static int _test_word(uint32_t test, int bit) { - int next_set_bit; + uint32_t tb = test >> bit; - return ((next_set_bit = ffs(test >> bit)) ? next_set_bit + bit - 1 : -1); + return (tb ? ffs(tb) + bit - 1 : -1); } int dm_bit_get_next(dm_bitset_t bs, int last_bit) From zkabelac@sourceware.org Thu Jul 8 12:24:00 2010 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Thu, 08 Jul 2010 12:24:00 -0000 Subject: LVM2 lib/activate/activate.c ./WHATS_NEW Message-ID: <20100708122405.556.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2010-07-08 12:24:04 Modified files: lib/activate : activate.c . : WHATS_NEW Log message: Do not log backtrace in valid _lv_resume() code path Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.170&r2=1.171 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1658&r2=1.1659 --- LVM2/lib/activate/activate.c 2010/05/24 15:32:20 1.170 +++ LVM2/lib/activate/activate.c 2010/07/08 12:24:04 1.171 @@ -961,8 +961,10 @@ goto_out; if (!info.exists || !info.suspended) { - r = error_if_not_active ? 0 : 1; - goto_out; + if (error_if_not_active) + goto_out; + r = 1; + goto out; } if (!_lv_activate_lv(lv)) --- LVM2/WHATS_NEW 2010/07/07 19:02:50 1.1658 +++ LVM2/WHATS_NEW 2010/07/08 12:24:04 1.1659 @@ -1,5 +1,7 @@ Version 2.02.71 - =============================== + Do not log backtrace in valid _lv_resume() code path. + Cleanup help strings in configure.in. Prompt if metadataignore with vgextend or pvchange would adjust vg_mda_copies. Adjust vg_mda_copies if metadataignore given with vgextend or pvchange. Adjust auto-metadata repair and caching logic to try to cope with empty mdas. From zkabelac@sourceware.org Thu Jul 8 13:05:00 2010 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Thu, 08 Jul 2010 13:05:00 -0000 Subject: LVM2/lib/mm memlock.c Message-ID: <20100708130527.3469.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2010-07-08 13:05:27 Modified files: lib/mm : memlock.c Log message: Small update of memlock debug messages. Gives slightly better alligned lines for reading. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mm/memlock.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28 --- LVM2/lib/mm/memlock.c 2010/06/24 08:29:31 1.27 +++ LVM2/lib/mm/memlock.c 2010/07/08 13:05:27 1.28 @@ -137,7 +137,8 @@ /* Select readable maps */ if (fr != 'r') { - log_debug("mlock area unreadable '%s': Skipping.", line); + log_debug("% area unreadable %s : Skipping.", + (lock == LVM_MLOCK) ? "mlock" : "munlock", line); return 1; } @@ -171,7 +172,7 @@ } *mstats += sz; - log_debug("%s %10ldKiB %12lx - %12lx %c%c%c%c %s", + log_debug("%s %10ldKiB %12lx - %12lx %c%c%c%c%s", (lock == LVM_MLOCK) ? "mlock" : "munlock", ((long)sz + 1023) / 1024, from, to, fr, fw, fx, fp, line + pos); From zkabelac@sourceware.org Thu Jul 8 13:31:00 2010 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Thu, 08 Jul 2010 13:31:00 -0000 Subject: LVM2/tools dmsetup.c Message-ID: <20100708133108.18517.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2010-07-08 13:31:07 Modified files: tools : dmsetup.c Log message: Set return value 0 for 'dmsetup -c -o help' Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/dmsetup.c.diff?cvsroot=lvm2&r1=1.139&r2=1.140 --- LVM2/tools/dmsetup.c 2010/07/05 22:56:31 1.139 +++ LVM2/tools/dmsetup.c 2010/07/08 13:31:03 1.140 @@ -3341,6 +3341,7 @@ if (argc == 0) { _usage(stderr); + r = 0; goto out; } From zkabelac@sourceware.org Thu Jul 8 13:35:00 2010 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Thu, 08 Jul 2010 13:35:00 -0000 Subject: LVM2 WHATS_NEW_DM Message-ID: <20100708133557.22432.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2010-07-08 13:35:56 Modified files: . : WHATS_NEW_DM Log message: Update for dmsetup Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.392&r2=1.393 --- LVM2/WHATS_NEW_DM 2010/07/07 11:22:46 1.392 +++ LVM2/WHATS_NEW_DM 2010/07/08 13:35:55 1.393 @@ -1,5 +1,6 @@ Version 1.02.53 - =============================== + Fix return value to 0 for 'dmsetup -c -o help'. Use "nowatch" udev rule for inappropriate devices. Version 1.02.52 - 6th July 2010 From zkabelac@sourceware.org Thu Jul 8 14:29:00 2010 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Thu, 08 Jul 2010 14:29:00 -0000 Subject: LVM2 ./WHATS_NEW_DM tools/dmsetup.c Message-ID: <20100708142929.12575.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2010-07-08 14:29:28 Modified files: . : WHATS_NEW_DM tools : dmsetup.c Log message: Revert previous commit as it would return also for incorrect syntax. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.393&r2=1.394 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/dmsetup.c.diff?cvsroot=lvm2&r1=1.140&r2=1.141 --- LVM2/WHATS_NEW_DM 2010/07/08 13:35:55 1.393 +++ LVM2/WHATS_NEW_DM 2010/07/08 14:29:26 1.394 @@ -1,6 +1,5 @@ Version 1.02.53 - =============================== - Fix return value to 0 for 'dmsetup -c -o help'. Use "nowatch" udev rule for inappropriate devices. Version 1.02.52 - 6th July 2010 --- LVM2/tools/dmsetup.c 2010/07/08 13:31:03 1.140 +++ LVM2/tools/dmsetup.c 2010/07/08 14:29:28 1.141 @@ -3341,7 +3341,6 @@ if (argc == 0) { _usage(stderr); - r = 0; goto out; } From zkabelac@sourceware.org Thu Jul 8 14:47:00 2010 From: zkabelac@sourceware.org (zkabelac@sourceware.org) Date: Thu, 08 Jul 2010 14:47:00 -0000 Subject: LVM2/lib/mm memlock.c Message-ID: <20100708144747.23027.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2010-07-08 14:47:47 Modified files: lib/mm : memlock.c Log message: Fix format string from patch apply mistake Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mm/memlock.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29 --- LVM2/lib/mm/memlock.c 2010/07/08 13:05:27 1.28 +++ LVM2/lib/mm/memlock.c 2010/07/08 14:47:46 1.29 @@ -137,7 +137,7 @@ /* Select readable maps */ if (fr != 'r') { - log_debug("% area unreadable %s : Skipping.", + log_debug("%s area unreadable %s : Skipping.", (lock == LVM_MLOCK) ? "mlock" : "munlock", line); return 1; } From wysochanski@sourceware.org Thu Jul 8 17:41:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Thu, 08 Jul 2010 17:41:00 -0000 Subject: LVM2/lib/metadata metadata.c Message-ID: <20100708174146.7500.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-08 17:41:46 Modified files: lib/metadata : metadata.c Log message: Init mda->list in mda_copy. This patch should be no functional change as all callers initialize mda->list. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.385&r2=1.386 --- LVM2/lib/metadata/metadata.c 2010/07/07 18:59:45 1.385 +++ LVM2/lib/metadata/metadata.c 2010/07/08 17:41:46 1.386 @@ -4207,7 +4207,7 @@ } } - /* FIXME mda 'list' left invalid here */ + dm_list_init(&mda_new->list); return mda_new; } From wysochanski@sourceware.org Thu Jul 8 18:24:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Thu, 08 Jul 2010 18:24:00 -0000 Subject: LVM2 lib/format1/format1.c lib/format_pool/for ... Message-ID: <20100708182431.7914.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-08 18:24:30 Modified files: lib/format1 : format1.c lib/format_pool: format_pool.c lib/format_text: archiver.c format-text.c lib/metadata : metadata-exported.h metadata.c metadata.h tools : vgconvert.c Log message: Pass metadataignore to pv_create, pv_setup, _mda_setup, and add_mda. Pass metadataignore through PV creation / setup paths. As a result of this cleanup, we can remove the unnecessary setting of mda_ignore bits inside pvcreate_single(), after call to pv_create. For now, just set metadataignore to '0' in some places. This is equivalent to the prior functionality, although the 0 is given by the caller not hardcoded in _mda_setup() call. Signed-off-by: Dave Wysochanski Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/format1.c.diff?cvsroot=lvm2&r1=1.119&r2=1.120 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/format_pool.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.139&r2=1.140 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata-exported.h.diff?cvsroot=lvm2&r1=1.164&r2=1.165 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.386&r2=1.387 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.215&r2=1.216 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgconvert.c.diff?cvsroot=lvm2&r1=1.41&r2=1.42 --- LVM2/lib/format1/format1.c 2010/06/29 14:52:56 1.119 +++ LVM2/lib/format1/format1.c 2010/07/08 18:24:29 1.120 @@ -294,13 +294,15 @@ } static int _format1_pv_setup(const struct format_type *fmt, - uint64_t pe_start, uint32_t extent_count, - uint32_t extent_size, - unsigned long data_alignment __attribute((unused)), - unsigned long data_alignment_offset __attribute((unused)), - int pvmetadatacopies __attribute((unused)), - uint64_t pvmetadatasize __attribute((unused)), struct dm_list *mdas __attribute((unused)), - struct physical_volume *pv, struct volume_group *vg __attribute((unused))) + uint64_t pe_start, uint32_t extent_count, + uint32_t extent_size, + unsigned long data_alignment __attribute((unused)), + unsigned long data_alignment_offset __attribute((unused)), + int pvmetadatacopies __attribute((unused)), + uint64_t pvmetadatasize __attribute((unused)), + unsigned metadataignore __attribute((unused)), + struct dm_list *mdas __attribute((unused)), + struct physical_volume *pv, struct volume_group *vg __attribute((unused))) { if (pv->size > MAX_PV_SIZE) pv->size--; --- LVM2/lib/format_pool/format_pool.c 2010/06/29 14:52:56 1.30 +++ LVM2/lib/format_pool/format_pool.c 2010/07/08 18:24:29 1.31 @@ -196,6 +196,7 @@ unsigned long data_alignment_offset __attribute((unused)), int pvmetadatacopies __attribute((unused)), uint64_t pvmetadatasize __attribute((unused)), + unsigned metadataignore __attribute((unused)), struct dm_list *mdas __attribute((unused)), struct physical_volume *pv __attribute((unused)), struct volume_group *vg __attribute((unused))) --- LVM2/lib/format_text/archiver.c 2010/06/29 15:03:59 1.32 +++ LVM2/lib/format_text/archiver.c 2010/07/08 18:24:29 1.33 @@ -327,7 +327,8 @@ } if (!vg->fid->fmt->ops-> pv_setup(vg->fid->fmt, UINT64_C(0), 0, 0, 0, 0, 0UL, - UINT64_C(0), &vg->fid->metadata_areas_in_use, pv, vg)) { + UINT64_C(0), 0, + &vg->fid->metadata_areas_in_use, pv, vg)) { log_error("Format-specific setup for %s failed", pv_dev_name(pv)); return 0; --- LVM2/lib/format_text/format-text.c 2010/06/30 17:13:05 1.139 +++ LVM2/lib/format_text/format-text.c 2010/07/08 18:24:30 1.140 @@ -1248,8 +1248,8 @@ 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, - uint64_t pvmetadatasize, struct dm_list *mdas, + int pvmetadatacopies, uint64_t pvmetadatasize, + unsigned metadataignore, struct dm_list *mdas, struct physical_volume *pv, struct volume_group *vg __attribute((unused))) { @@ -1337,7 +1337,7 @@ /* FIXME If creating new mdas, wipe them! */ if (mda_size1) { if (!add_mda(fmt, fmt->cmd->mem, mdas, pv->dev, start1, - mda_size1, 0)) + mda_size1, metadataignore)) return 0; if (!dev_set((struct device *) pv->dev, start1, @@ -1384,7 +1384,7 @@ if (mda_size2) { if (!add_mda(fmt, fmt->cmd->mem, mdas, pv->dev, start2, - mda_size2, 0)) return 0; + mda_size2, metadataignore)) return 0; if (!dev_set(pv->dev, start2, (size_t) (mda_size1 > wipe_size ? : mda_size1), 0)) { @@ -1766,12 +1766,12 @@ * setting of pv->pe_start to .pv_write */ static int _text_pv_setup(const struct format_type *fmt, - uint64_t pe_start, uint32_t extent_count, - uint32_t extent_size, unsigned long data_alignment, - unsigned long data_alignment_offset, - int pvmetadatacopies, - uint64_t pvmetadatasize, struct dm_list *mdas, - struct physical_volume *pv, struct volume_group *vg) + uint64_t pe_start, uint32_t extent_count, + uint32_t extent_size, unsigned long data_alignment, + unsigned long data_alignment_offset, + int pvmetadatacopies, uint64_t pvmetadatasize, + unsigned metadataignore, struct dm_list *mdas, + struct physical_volume *pv, struct volume_group *vg) { struct metadata_area *mda, *mda_new, *mda2; struct mda_context *mdac, *mdac2; @@ -1894,7 +1894,7 @@ if (extent_count) pe_end = pe_start + extent_count * extent_size - 1; if (!_mda_setup(fmt, pe_start, pe_end, pvmetadatacopies, - pvmetadatasize, mdas, pv, vg)) + pvmetadatasize, metadataignore, mdas, pv, vg)) return_0; } --- LVM2/lib/metadata/metadata-exported.h 2010/06/30 20:03:52 1.164 +++ LVM2/lib/metadata/metadata-exported.h 2010/07/08 18:24:30 1.165 @@ -522,16 +522,17 @@ /* pe_start and pe_end relate to any existing data so that new metadata * areas can avoid overlap */ struct physical_volume *pv_create(const struct cmd_context *cmd, - struct device *dev, - struct id *id, - uint64_t size, - unsigned long data_alignment, - unsigned long data_alignment_offset, - uint64_t pe_start, - uint32_t existing_extent_count, - uint32_t existing_extent_size, - int pvmetadatacopies, - uint64_t pvmetadatasize, struct dm_list *mdas); + struct device *dev, + struct id *id, + uint64_t size, + unsigned long data_alignment, + unsigned long data_alignment_offset, + uint64_t pe_start, + uint32_t existing_extent_count, + uint32_t existing_extent_size, + int pvmetadatacopies, uint64_t pvmetadatasize, + unsigned metadataignore, + struct dm_list *mdas); int pv_resize(struct physical_volume *pv, struct volume_group *vg, uint32_t new_pe_count); int pv_analyze(struct cmd_context *cmd, const char *pv_name, --- LVM2/lib/metadata/metadata.c 2010/07/08 17:41:46 1.386 +++ LVM2/lib/metadata/metadata.c 2010/07/08 18:24:30 1.387 @@ -234,7 +234,7 @@ if (!fid->fmt->ops->pv_setup(fid->fmt, UINT64_C(0), 0, vg->extent_size, 0, 0, 0UL, UINT64_C(0), - mdas, pv, vg)) { + 0, mdas, pv, vg)) { log_error("Format-specific setup of physical volume '%s' " "failed.", pv_name); return 0; @@ -1684,7 +1684,6 @@ struct dm_list mdas; struct pvcreate_params default_pp; char buffer[64] __attribute((aligned(8))); - struct metadata_area *mda; pvcreate_params_set_defaults(&default_pp); if (!pp) @@ -1718,8 +1717,8 @@ if (!(pv = pv_create(cmd, dev, pp->idp, pp->size, pp->data_alignment, pp->data_alignment_offset, pp->pe_start, pp->extent_count, pp->extent_size, - pp->pvmetadatacopies, - pp->pvmetadatasize,&mdas))) { + pp->pvmetadatacopies, pp->pvmetadatasize, + pp->metadataignore, &mdas))) { log_error("Failed to setup physical volume \"%s\"", pv_name); goto error; } @@ -1751,10 +1750,6 @@ log_very_verbose("Writing physical volume data to disk \"%s\"", pv_name); - if (pp->metadataignore) - dm_list_iterate_items(mda, &mdas) - mda_set_ignored(mda, 1); - if (!(pv_write(cmd, pv, &mdas, pp->labelsector))) { log_error("Failed to write physical volume \"%s\"", pv_name); goto error; @@ -1827,8 +1822,8 @@ uint64_t pe_start, uint32_t existing_extent_count, uint32_t existing_extent_size, - int pvmetadatacopies, - uint64_t pvmetadatasize, struct dm_list *mdas) + int pvmetadatacopies, uint64_t pvmetadatasize, + unsigned metadataignore, struct dm_list *mdas) { const struct format_type *fmt = cmd->fmt; struct dm_pool *mem = fmt->cmd->mem; @@ -1877,8 +1872,8 @@ if (!fmt->ops->pv_setup(fmt, pe_start, existing_extent_count, existing_extent_size, data_alignment, data_alignment_offset, - pvmetadatacopies, pvmetadatasize, mdas, - pv, NULL)) { + pvmetadatacopies, pvmetadatasize, + metadataignore, mdas, pv, NULL)) { log_error("%s: Format-specific setup of physical volume " "failed.", pv_dev_name(pv)); goto bad; --- LVM2/lib/metadata/metadata.h 2010/07/07 02:53:17 1.215 +++ LVM2/lib/metadata/metadata.h 2010/07/08 18:24:30 1.216 @@ -244,8 +244,8 @@ uint64_t pe_start, uint32_t extent_count, uint32_t extent_size, unsigned long data_alignment, unsigned long data_alignment_offset, - int pvmetadatacopies, - uint64_t pvmetadatasize, struct dm_list * mdas, + int pvmetadatacopies, uint64_t pvmetadatasize, + unsigned metadataignore, struct dm_list * mdas, struct physical_volume * pv, struct volume_group * vg); /* --- LVM2/tools/vgconvert.c 2009/10/05 20:55:57 1.41 +++ LVM2/tools/vgconvert.c 2010/07/08 18:24:30 1.42 @@ -127,7 +127,7 @@ &existing_pv->id, size, 0, 0, pe_start, pv_pe_count(existing_pv), pv_pe_size(existing_pv), pvmetadatacopies, - pvmetadatasize, &mdas))) { + pvmetadatasize, 0, &mdas))) { log_error("Failed to setup physical volume \"%s\"", pv_dev_name(existing_pv)); if (change_made) From jbrassow@sourceware.org Fri Jul 9 15:08:00 2010 From: jbrassow@sourceware.org (jbrassow@sourceware.org) Date: Fri, 09 Jul 2010 15:08:00 -0000 Subject: LVM2 ./WHATS_NEW lib/metadata/mirror.c Message-ID: <20100709150816.3655.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2010-07-09 15:08:15 Modified files: . : WHATS_NEW lib/metadata : mirror.c Log message: Finish fix for bug 607347: failing both redundant mirror log legs... A previous check-in added logic to handle the case where both images of a mirrored log failed. It solved the problem by simply removing the log entirely - leaving the parent mirror with a 'core' log. This worked for most cases. However, if there was a small delay between the failures of the two mirrored log devices, the mirror would hang, LVM would hang, and no additional LVM commands could be issued. When the first leg of the log fails, it signals the need for repair. Before 'lvconvert --repair' is run by dmeventd, the second leg fails. 'lvconvert' would see both devices as failed and try to remove the log entirely. When it came time to suspend the parent mirror to update the configuration, the suspend would hang because it couldn't get any I/O through the mirrored log, which was plugged waiting for corrective action. The solution is to replace the log with an error target to clear any pending writes before removing it. This allows the parent mirror to suspend and make the proper changes. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1659&r2=1.1660 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.122&r2=1.123 --- LVM2/WHATS_NEW 2010/07/08 12:24:04 1.1659 +++ LVM2/WHATS_NEW 2010/07/09 15:08:12 1.1660 @@ -1,5 +1,6 @@ Version 2.02.71 - =============================== + Fix possible hang when all mirror images of a mirrored log fail. Do not log backtrace in valid _lv_resume() code path. Cleanup help strings in configure.in. Prompt if metadataignore with vgextend or pvchange would adjust vg_mda_copies. --- LVM2/lib/metadata/mirror.c 2010/07/02 21:16:50 1.122 +++ LVM2/lib/metadata/mirror.c 2010/07/09 15:08:15 1.123 @@ -864,9 +864,72 @@ lv->status &= ~MIRROR_NOTSYNCED; if (!replace_lv_with_error_segment(lv)) return_0; - } else if (remove_log) + } else if (remove_log) { detached_log_lv = detach_mirror_log(mirrored_seg); + /* + * The log may be removed due to repair. If the log + * happens to be a mirrored log, then there is a special + * case we need to consider. One of the images of a + * mirrored log can fail followed shortly afterwards by + * a failure of the second. This means that the top-level + * mirror is waiting for writes to the log to finish, but + * they never will unless the mirrored log can be repaired + * or replaced with an error target. Since both the devices + * have failed, we must replace with error target - it is + * the only way to release the pending writes. + */ + if (lv_is_mirrored(detached_log_lv) && + (detached_log_lv->status & PARTIAL_LV)) { + struct lv_segment *seg = first_seg(detached_log_lv); + + log_very_verbose("%s being removed due to failures", + detached_log_lv->name); + + /* + * We are going to replace the mirror with an + * error segment, but before we do, we must remember + * all of the LVs that must be deleted later (i.e. + * the sub-lv's) + */ + for (m = 0; m < seg->area_count; m++) { + seg_lv(seg, m)->status &= ~MIRROR_IMAGE; + lv_set_visible(seg_lv(seg, m)); + if (!(lvl = dm_pool_alloc(lv->vg->cmd->mem, + sizeof(*lvl)))) + return 0; + lvl->lv = seg_lv(seg, m); + dm_list_add(&tmp_orphan_lvs, &lvl->list); + } + + if (!replace_lv_with_error_segment(detached_log_lv)) { + log_error("Failed error target substitution for %s", + detached_log_lv->name); + return_0; + } + + if (!vg_write(detached_log_lv->vg)) { + log_error("intermediate VG write fail."); + return 0; + } + + if (!suspend_lv(detached_log_lv->vg->cmd, + detached_log_lv)) { + log_error("Failed to suspend %s", + detached_log_lv->name); + vg_revert(detached_log_lv->vg); + return 0; + } + + if (!vg_commit(detached_log_lv->vg)) + return_0; + + if (!resume_lv(detached_log_lv->vg->cmd, + detached_log_lv)) + return 0; + } + } + /* * To successfully remove these unwanted LVs we need to * remove the LVs from the mirror set, commit that metadata From agk@sourceware.org Fri Jul 9 15:21:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Fri, 09 Jul 2010 15:21:00 -0000 Subject: LVM2 lib/metadata/pv_map.h tools/toollib.h Message-ID: <20100709152111.8182.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-09 15:21:10 Modified files: lib/metadata : pv_map.h tools : toollib.h Log message: Remove superfluous fn prototypes. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_map.h.diff?cvsroot=lvm2&r1=1.13&r2=1.14 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.h.diff?cvsroot=lvm2&r1=1.74&r2=1.75 --- LVM2/lib/metadata/pv_map.h 2010/03/25 21:19:27 1.13 +++ LVM2/lib/metadata/pv_map.h 2010/07/09 15:21:10 1.14 @@ -69,6 +69,5 @@ void reinsert_reduced_pv_area(struct pv_area *pva); uint32_t pv_maps_size(struct dm_list *pvms); -void reinsert_reduced_pv_area(struct pv_area *pva); #endif --- LVM2/tools/toollib.h 2010/05/21 12:21:52 1.74 +++ LVM2/tools/toollib.h 2010/07/09 15:21:10 1.75 @@ -96,9 +96,6 @@ struct dm_list *clone_pv_list(struct dm_pool *mem, struct dm_list *pvs); -int apply_lvname_restrictions(const char *name); -int is_reserved_lvname(const char *name); - void vgcreate_params_set_defaults(struct vgcreate_params *vp_def, struct volume_group *vg); int vgcreate_params_set_from_args(struct cmd_context *cmd, From agk@sourceware.org Fri Jul 9 15:26:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Fri, 09 Jul 2010 15:26:00 -0000 Subject: LVM2 WHATS_NEW make.tmpl.in Message-ID: <20100709152641.11156.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-09 15:26:41 Modified files: . : WHATS_NEW make.tmpl.in Log message: Fix redundant declarations and always compile with -Wredundant-decls. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1660&r2=1.1661 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/make.tmpl.in.diff?cvsroot=lvm2&r1=1.104&r2=1.105 --- LVM2/WHATS_NEW 2010/07/09 15:08:12 1.1660 +++ LVM2/WHATS_NEW 2010/07/09 15:26:41 1.1661 @@ -1,5 +1,6 @@ Version 2.02.71 - =============================== + Fix redundant declarations and always compile with -Wredundant-decls. Fix possible hang when all mirror images of a mirrored log fail. Do not log backtrace in valid _lv_resume() code path. Cleanup help strings in configure.in. --- LVM2/make.tmpl.in 2010/06/25 18:17:38 1.104 +++ LVM2/make.tmpl.in 2010/07/09 15:26:41 1.105 @@ -107,9 +107,9 @@ .SUFFIXES: .c .d .o .so .a .po .pot .mo .dylib -CFLAGS += -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security +CFLAGS += -fPIC -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wmissing-noreturn -Wformat-security -Wredundant-decls -#CFLAGS += -W -Wconversion -Wpointer-arith -Wredundant-decls -Wbad-function-cast -Wcast-qual +#CFLAGS += -W -Wconversion -Wpointer-arith -Wbad-function-cast -Wcast-qual #CFLAGS += -pedantic -std=gnu99 CFLAGS += @COPTIMISE_FLAG@ From agk@sourceware.org Fri Jul 9 15:35:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Fri, 09 Jul 2010 15:35:00 -0000 Subject: LVM2 ./WHATS_NEW daemons/cmirrord/clogd.c daem ... Message-ID: <20100709153504.14637.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-09 15:34:48 Modified files: . : WHATS_NEW daemons/cmirrord: clogd.c cluster.c compat.c functions.c local.c daemons/dmeventd: dmeventd.c daemons/dmeventd/plugins/lvm2: dmeventd_lvm.c daemons/dmeventd/plugins/mirror: dmeventd_mirror.c daemons/dmeventd/plugins/snapshot: dmeventd_snapshot.c lib/activate : dev_manager.c lib/cache : lvmcache.c lib/config : config.c lib/device : dev-io.c dev-md.c lib/display : display.c lib/error : errseg.c lib/filters : filter-md.c filter-sysfs.c filter.c lib/format1 : disk-rep.c disk-rep.h format1.c import-export.c lvm1-label.c lib/format_pool: disk_rep.c format_pool.c pool_label.c lib/format_text: export.c format-text.c import_vsn1.c text_label.c lib/label : label.c lib/locking : cluster_locking.c file_locking.c locking.c no_locking.c lib/metadata : lv_manip.c metadata.c mirror.c lib/mirror : mirrored.c lib/replicator : replicator.c lib/report : report.c lib/snapshot : snapshot.c lib/striped : striped.c lib/unknown : unknown.c lib/zero : zero.c libdm : libdevmapper.h libdm-common.c libdm-deptree.c libdm-string.c libdm/datastruct: hash.c libdm/mm : dbg_malloc.c liblvm : lvm_lv.c lvm_pv.c lvm_vg.c tools : dmsetup.c formats.c lvchange.c lvconvert.c lvcreate.c lvm-static.c lvm.c lvm2cmd.c lvmchange.c lvmcmdline.c lvmdiskscan.c lvremove.c lvscan.c polldaemon.c pvchange.c pvmove.c pvremove.c pvscan.c reporter.c segtypes.c stub.h tools.h vgchange.c vgck.c vgconvert.c vgdisplay.c vgexport.c vgimport.c vgmerge.c vgmknodes.c vgreduce.c vgremove.c vgscan.c Log message: Use __attribute__ consistently throughout. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1661&r2=1.1662 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/cmirrord/clogd.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/cmirrord/cluster.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/cmirrord/compat.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/cmirrord/functions.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/cmirrord/local.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/dmeventd.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.195&r2=1.196 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.92&r2=1.93 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/config/config.c.diff?cvsroot=lvm2&r1=1.79&r2=1.80 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.68&r2=1.69 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-md.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.110&r2=1.111 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/error/errseg.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-md.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-sysfs.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter.c.diff?cvsroot=lvm2&r1=1.54&r2=1.55 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.c.diff?cvsroot=lvm2&r1=1.80&r2=1.81 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.h.diff?cvsroot=lvm2&r1=1.55&r2=1.56 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/format1.c.diff?cvsroot=lvm2&r1=1.120&r2=1.121 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-export.c.diff?cvsroot=lvm2&r1=1.113&r2=1.114 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/lvm1-label.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/disk_rep.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/format_pool.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/pool_label.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.140&r2=1.141 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/text_label.c.diff?cvsroot=lvm2&r1=1.36&r2=1.37 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/label/label.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.46&r2=1.47 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.84&r2=1.85 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/no_locking.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.230&r2=1.231 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.387&r2=1.388 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.123&r2=1.124 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.71&r2=1.72 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/replicator/replicator.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.122&r2=1.123 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.46&r2=1.47 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/unknown/unknown.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.119&r2=1.120 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-common.c.diff?cvsroot=lvm2&r1=1.96&r2=1.97 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.84&r2=1.85 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-string.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/datastruct/hash.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/mm/dbg_malloc.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm_lv.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm_pv.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm_vg.c.diff?cvsroot=lvm2&r1=1.41&r2=1.42 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/dmsetup.c.diff?cvsroot=lvm2&r1=1.141&r2=1.142 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/formats.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.121&r2=1.122 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.137&r2=1.138 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.222&r2=1.223 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvm-static.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvm.c.diff?cvsroot=lvm2&r1=1.112&r2=1.113 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvm2cmd.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmchange.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.126&r2=1.127 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmdiskscan.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvremove.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvscan.c.diff?cvsroot=lvm2&r1=1.40&r2=1.41 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/polldaemon.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.82&r2=1.83 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvmove.c.diff?cvsroot=lvm2&r1=1.77&r2=1.78 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvremove.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvscan.c.diff?cvsroot=lvm2&r1=1.51&r2=1.52 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.61&r2=1.62 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/segtypes.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/stub.h.diff?cvsroot=lvm2&r1=1.46&r2=1.47 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/tools.h.diff?cvsroot=lvm2&r1=1.70&r2=1.71 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.108&r2=1.109 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgck.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgconvert.c.diff?cvsroot=lvm2&r1=1.42&r2=1.43 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgdisplay.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgexport.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgimport.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgmerge.c.diff?cvsroot=lvm2&r1=1.68&r2=1.69 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgmknodes.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.102&r2=1.103 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgremove.c.diff?cvsroot=lvm2&r1=1.61&r2=1.62 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgscan.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38 --- LVM2/WHATS_NEW 2010/07/09 15:26:41 1.1661 +++ LVM2/WHATS_NEW 2010/07/09 15:34:40 1.1662 @@ -1,5 +1,6 @@ Version 2.02.71 - =============================== + Use __attribute__ consistently throughout. Fix redundant declarations and always compile with -Wredundant-decls. Fix possible hang when all mirror images of a mirrored log fail. Do not log backtrace in valid _lv_resume() code path. --- LVM2/daemons/cmirrord/clogd.c 2010/03/29 14:05:17 1.10 +++ LVM2/daemons/cmirrord/clogd.c 2010/07/09 15:34:40 1.11 @@ -32,7 +32,7 @@ static void init_all(void); static void cleanup_all(void); -int main(int argc __attribute((unused)), char *argv[] __attribute((unused))) +int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused))) { daemonize(); @@ -60,7 +60,7 @@ * @sig: the signal * */ -static void parent_exit_handler(int sig __attribute((unused))) +static void parent_exit_handler(int sig __attribute__((unused))) { exit_now = 1; } --- LVM2/daemons/cmirrord/cluster.c 2010/01/27 22:28:06 1.14 +++ LVM2/daemons/cmirrord/cluster.c 2010/07/09 15:34:40 1.15 @@ -215,7 +215,7 @@ } static char rq_buffer[DM_ULOG_REQUEST_SIZE]; -static int handle_cluster_request(struct clog_cpg *entry __attribute((unused)), +static int handle_cluster_request(struct clog_cpg *entry __attribute__((unused)), struct clog_request *rq, int server) { int r = 0; @@ -855,7 +855,7 @@ return r; } -static int do_cluster_work(void *data __attribute((unused))) +static int do_cluster_work(void *data __attribute__((unused))) { int r = SA_AIS_OK; struct clog_cpg *entry, *tmp; @@ -927,8 +927,8 @@ return 0; } -static void cpg_message_callback(cpg_handle_t handle, const struct cpg_name *gname __attribute((unused)), - uint32_t nodeid, uint32_t pid __attribute((unused)), +static void cpg_message_callback(cpg_handle_t handle, const struct cpg_name *gname __attribute__((unused)), + uint32_t nodeid, uint32_t pid __attribute__((unused)), void *msg, size_t msg_len) { int i; @@ -1366,7 +1366,7 @@ } } -static void cpg_config_callback(cpg_handle_t handle, const struct cpg_name *gname __attribute((unused)), +static void cpg_config_callback(cpg_handle_t handle, const struct cpg_name *gname __attribute__((unused)), const struct cpg_address *member_list, size_t member_list_entries, const struct cpg_address *left_list, --- LVM2/daemons/cmirrord/compat.c 2010/01/18 21:07:24 1.4 +++ LVM2/daemons/cmirrord/compat.c 2010/07/09 15:34:41 1.5 @@ -21,7 +21,7 @@ */ #define COMPAT_OFFSET 256 -static void v5_data_endian_switch(struct clog_request *rq, int to_network __attribute((unused))) +static void v5_data_endian_switch(struct clog_request *rq, int to_network __attribute__((unused))) { int i, end; int64_t *pi64; --- LVM2/daemons/cmirrord/functions.c 2010/06/21 16:07:06 1.20 +++ LVM2/daemons/cmirrord/functions.c 2010/07/09 15:34:41 1.21 @@ -290,7 +290,7 @@ } /* FIXME Rewrite this function taking advantage of the udev changes (where in use) to improve its efficiency! */ -static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_path __attribute((unused))) +static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_path __attribute__((unused))) { int r; DIR *dp; @@ -1369,7 +1369,7 @@ return 0; } -static int core_status_info(struct log_c *lc __attribute((unused)), struct dm_ulog_request *rq) +static int core_status_info(struct log_c *lc __attribute__((unused)), struct dm_ulog_request *rq) { int r; char *data = (char *)rq->data; --- LVM2/daemons/cmirrord/local.c 2010/01/19 15:58:45 1.8 +++ LVM2/daemons/cmirrord/local.c 2010/07/09 15:34:41 1.9 @@ -214,7 +214,7 @@ * * Returns: 0 on success, -EXXX on failure */ -static int do_local_work(void *data __attribute((unused))) +static int do_local_work(void *data __attribute__((unused))) { int r; struct clog_request *rq; --- LVM2/daemons/dmeventd/dmeventd.c 2010/05/14 14:56:39 1.62 +++ LVM2/daemons/dmeventd/dmeventd.c 2010/07/09 15:34:41 1.63 @@ -476,14 +476,14 @@ dm_lib_exit(); } -static void _exit_timeout(void *unused __attribute((unused))) +static void _exit_timeout(void *unused __attribute__((unused))) { _timeout_running = 0; pthread_mutex_unlock(&_timeout_mutex); } /* Wake up monitor threads every so often. */ -static void *_timeout_thread(void *unused __attribute((unused))) +static void *_timeout_thread(void *unused __attribute__((unused))) { struct timespec timeout; time_t curr_time; @@ -1492,7 +1492,7 @@ _unlock_mutex(); } -static void _sig_alarm(int signum __attribute((unused))) +static void _sig_alarm(int signum __attribute__((unused))) { pthread_testcancel(); } @@ -1524,7 +1524,7 @@ * Set the global variable which the process should * be watching to determine when to exit. */ -static void _exit_handler(int sig __attribute((unused))) +static void _exit_handler(int sig __attribute__((unused))) { /* * We exit when '_exit_now' is set. --- LVM2/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c 2010/05/14 14:56:39 1.3 +++ LVM2/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c 2010/07/09 15:34:41 1.4 @@ -49,9 +49,9 @@ * configurable and we don't have that option yet */ static void _temporary_log_fn(int level, - const char *file __attribute((unused)), - int line __attribute((unused)), - int dm_errno __attribute((unused)), + const char *file __attribute__((unused)), + int line __attribute__((unused)), + int dm_errno __attribute__((unused)), const char *message) { level &= ~(_LOG_STDERR | _LOG_ONCE); --- LVM2/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c 2010/05/14 14:56:39 1.35 +++ LVM2/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c 2010/07/09 15:34:41 1.36 @@ -167,8 +167,8 @@ } void process_event(struct dm_task *dmt, - enum dm_event_mask event __attribute((unused)), - void **unused __attribute((unused))) + enum dm_event_mask event __attribute__((unused)), + void **unused __attribute__((unused))) { void *next = NULL; uint64_t start, length; @@ -224,10 +224,10 @@ } int register_device(const char *device, - const char *uuid __attribute((unused)), - int major __attribute((unused)), - int minor __attribute((unused)), - void **unused __attribute((unused))) + const char *uuid __attribute__((unused)), + int major __attribute__((unused)), + int minor __attribute__((unused)), + void **unused __attribute__((unused))) { int r = dmeventd_lvm2_init(); syslog(LOG_INFO, "Monitoring mirror device %s for events.", device); @@ -235,10 +235,10 @@ } int unregister_device(const char *device, - const char *uuid __attribute((unused)), - int major __attribute((unused)), - int minor __attribute((unused)), - void **unused __attribute((unused))) + const char *uuid __attribute__((unused)), + int major __attribute__((unused)), + int minor __attribute__((unused)), + void **unused __attribute__((unused))) { syslog(LOG_INFO, "No longer monitoring mirror device %s for events.", device); --- LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c 2010/05/11 08:32:22 1.9 +++ LVM2/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c 2010/07/09 15:34:41 1.10 @@ -70,7 +70,7 @@ } void process_event(struct dm_task *dmt, - enum dm_event_mask event __attribute((unused)), + enum dm_event_mask event __attribute__((unused)), void **private) { void *next = NULL; @@ -113,9 +113,9 @@ } int register_device(const char *device, - const char *uuid __attribute((unused)), - int major __attribute((unused)), - int minor __attribute((unused)), + const char *uuid __attribute__((unused)), + int major __attribute__((unused)), + int minor __attribute__((unused)), void **private) { int *percent_warning = (int*)private; @@ -128,10 +128,10 @@ } int unregister_device(const char *device, - const char *uuid __attribute((unused)), - int major __attribute((unused)), - int minor __attribute((unused)), - void **unused __attribute((unused))) + const char *uuid __attribute__((unused)), + int major __attribute__((unused)), + int minor __attribute__((unused)), + void **unused __attribute__((unused))) { syslog(LOG_INFO, "No longer monitoring snapshot %s\n", device); --- LVM2/lib/activate/dev_manager.c 2010/05/24 15:32:20 1.195 +++ LVM2/lib/activate/dev_manager.c 2010/07/09 15:34:42 1.196 @@ -1752,7 +1752,7 @@ { struct dm_tree *dtree; struct dm_tree_node *root; - char dlid[sizeof(UUID_PREFIX) + sizeof(struct id) - 1] __attribute((aligned(8))); + char dlid[sizeof(UUID_PREFIX) + sizeof(struct id) - 1] __attribute__((aligned(8))); int r = 1; if (!(dtree = dm_tree_create())) { --- LVM2/lib/cache/lvmcache.c 2010/06/28 20:34:58 1.92 +++ LVM2/lib/cache/lvmcache.c 2010/07/09 15:34:42 1.93 @@ -90,7 +90,7 @@ */ static void _store_metadata(struct volume_group *vg, unsigned precommitted) { - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); struct lvmcache_vginfo *vginfo; int size; @@ -275,7 +275,7 @@ return 1; } -void lvmcache_lock_vgname(const char *vgname, int read_only __attribute((unused))) +void lvmcache_lock_vgname(const char *vgname, int read_only __attribute__((unused))) { if (!_lock_hash && !lvmcache_init()) { log_error("Internal cache initialisation failed"); @@ -374,7 +374,7 @@ struct dm_list *devh, *tmp; struct dm_list devs; struct device_list *devl; - char vgid_found[ID_LEN + 1] __attribute((aligned(8))); + char vgid_found[ID_LEN + 1] __attribute__((aligned(8))); if (!(vginfo = vginfo_from_vgname(vgname, vgid))) return NULL; @@ -411,7 +411,7 @@ struct lvmcache_vginfo *vginfo_from_vgid(const char *vgid) { struct lvmcache_vginfo *vginfo; - char id[ID_LEN + 1] __attribute((aligned(8))); + char id[ID_LEN + 1] __attribute__((aligned(8))); if (!_vgid_hash || !vgid) return NULL; @@ -492,7 +492,7 @@ struct lvmcache_info *info_from_pvid(const char *pvid, int valid_only) { struct lvmcache_info *info; - char id[ID_LEN + 1] __attribute((aligned(8))); + char id[ID_LEN + 1] __attribute__((aligned(8))); if (!_pvid_hash || !pvid) return NULL; @@ -930,8 +930,8 @@ struct lvmcache_vginfo *primary_vginfo) { struct lvmcache_vginfo *last_vginfo = primary_vginfo; - char uuid_primary[64] __attribute((aligned(8))); - char uuid_new[64] __attribute((aligned(8))); + char uuid_primary[64] __attribute__((aligned(8))); + char uuid_new[64] __attribute__((aligned(8))); int use_new = 0; /* Pre-existing VG takes precedence. Unexported VG takes precedence. */ @@ -1219,7 +1219,7 @@ { struct pv_list *pvl; struct lvmcache_info *info; - char pvid_s[ID_LEN + 1] __attribute((aligned(8))); + char pvid_s[ID_LEN + 1] __attribute__((aligned(8))); pvid_s[sizeof(pvid_s) - 1] = '\0'; @@ -1247,7 +1247,7 @@ { struct label *label; struct lvmcache_info *existing, *info; - char pvid_s[ID_LEN + 1] __attribute((aligned(8))); + char pvid_s[ID_LEN + 1] __attribute__((aligned(8))); if (!_vgname_hash && !lvmcache_init()) { log_error("Internal cache initialisation failed"); --- LVM2/lib/config/config.c 2010/04/12 11:52:53 1.79 +++ LVM2/lib/config/config.c 2010/07/09 15:34:42 1.80 @@ -159,7 +159,7 @@ return 1; } -struct config_tree *create_config_tree_from_string(struct cmd_context *cmd __attribute((unused)), +struct config_tree *create_config_tree_from_string(struct cmd_context *cmd __attribute__((unused)), const char *config_settings) { struct cs *c; --- LVM2/lib/device/dev-io.c 2010/05/05 22:37:53 1.68 +++ LVM2/lib/device/dev-io.c 2010/07/09 15:34:42 1.69 @@ -678,7 +678,7 @@ int dev_set(struct device *dev, uint64_t offset, size_t len, int value) { size_t s; - char buffer[4096] __attribute((aligned(8))); + char buffer[4096] __attribute__((aligned(8))); if (!dev_open(dev)) return_0; --- LVM2/lib/device/dev-md.c 2009/08/19 15:34:43 1.19 +++ LVM2/lib/device/dev-md.c 2010/07/09 15:34:42 1.20 @@ -320,14 +320,14 @@ #else -int dev_is_md(struct device *dev __attribute((unused)), - uint64_t *sb __attribute((unused))) +int dev_is_md(struct device *dev __attribute__((unused)), + uint64_t *sb __attribute__((unused))) { return 0; } -unsigned long dev_md_stripe_width(const char *sysfs_dir __attribute((unused)), - struct device *dev __attribute((unused))) +unsigned long dev_md_stripe_width(const char *sysfs_dir __attribute__((unused)), + struct device *dev __attribute__((unused))) { return 0UL; } --- LVM2/lib/display/display.c 2010/06/28 20:32:21 1.110 +++ LVM2/lib/display/display.c 2010/07/09 15:34:42 1.111 @@ -307,7 +307,7 @@ void pvdisplay_colons(const struct physical_volume *pv) { - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); if (!pv) return; @@ -358,9 +358,9 @@ /* FIXME Include label fields */ void pvdisplay_full(const struct cmd_context *cmd, const struct physical_volume *pv, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); const char *size; uint32_t pe_free; @@ -423,12 +423,12 @@ log_print(" "); } -int pvdisplay_short(const struct cmd_context *cmd __attribute((unused)), - const struct volume_group *vg __attribute((unused)), +int pvdisplay_short(const struct cmd_context *cmd __attribute__((unused)), + const struct volume_group *vg __attribute__((unused)), const struct physical_volume *pv, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); if (!pv) return 0; @@ -469,11 +469,11 @@ int lvdisplay_full(struct cmd_context *cmd, const struct logical_volume *lv, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { struct lvinfo info; int inkernel, snap_active = 0; - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); struct lv_segment *snap_seg = NULL, *mirror_seg = NULL; float snap_percent; /* fused, fsize; */ percent_range_t percent_range; @@ -646,7 +646,7 @@ return 1; } -void vgdisplay_extents(const struct volume_group *vg __attribute((unused))) +void vgdisplay_extents(const struct volume_group *vg __attribute__((unused))) { } @@ -654,7 +654,7 @@ { uint32_t access_str; uint32_t active_pvs; - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); active_pvs = vg->pv_count - vg_missing_pv_count(vg); @@ -728,7 +728,7 @@ { uint32_t active_pvs; const char *access_str; - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); active_pvs = vg->pv_count - vg_missing_pv_count(vg); --- LVM2/lib/error/errseg.c 2009/02/28 20:04:24 1.20 +++ LVM2/lib/error/errseg.c 2010/07/09 15:34:43 1.21 @@ -40,20 +40,20 @@ } #ifdef DEVMAPPER_SUPPORT -static int _errseg_add_target_line(struct dev_manager *dm __attribute((unused)), - struct dm_pool *mem __attribute((unused)), - struct cmd_context *cmd __attribute((unused)), - void **target_state __attribute((unused)), - struct lv_segment *seg __attribute((unused)), +static int _errseg_add_target_line(struct dev_manager *dm __attribute__((unused)), + struct dm_pool *mem __attribute__((unused)), + struct cmd_context *cmd __attribute__((unused)), + void **target_state __attribute__((unused)), + struct lv_segment *seg __attribute__((unused)), struct dm_tree_node *node, uint64_t len, - uint32_t *pvmove_mirror_count __attribute((unused))) + uint32_t *pvmove_mirror_count __attribute__((unused))) { return dm_tree_node_add_error_target(node, len); } static int _errseg_target_present(struct cmd_context *cmd, - const struct lv_segment *seg __attribute((unused)), - unsigned *attributes __attribute((unused))) + const struct lv_segment *seg __attribute__((unused)), + unsigned *attributes __attribute__((unused))) { static int _errseg_checked = 0; static int _errseg_present = 0; @@ -70,7 +70,7 @@ #endif static int _errseg_modules_needed(struct dm_pool *mem, - const struct lv_segment *seg __attribute((unused)), + const struct lv_segment *seg __attribute__((unused)), struct dm_list *modules) { if (!str_list_add(mem, modules, "error")) { --- LVM2/lib/filters/filter-md.c 2008/01/31 12:19:35 1.8 +++ LVM2/lib/filters/filter-md.c 2010/07/09 15:34:43 1.9 @@ -19,7 +19,7 @@ #ifdef linux -static int _ignore_md(struct dev_filter *f __attribute((unused)), +static int _ignore_md(struct dev_filter *f __attribute__((unused)), struct device *dev) { int ret; --- LVM2/lib/filters/filter-sysfs.c 2008/09/19 03:42:37 1.20 +++ LVM2/lib/filters/filter-sysfs.c 2010/07/09 15:34:43 1.21 @@ -326,7 +326,7 @@ #else -struct dev_filter *sysfs_filter_create(const char *sysfs_dir __attribute((unused))) +struct dev_filter *sysfs_filter_create(const char *sysfs_dir __attribute__((unused))) { return NULL; } --- LVM2/lib/filters/filter.c 2010/07/02 02:09:57 1.54 +++ LVM2/lib/filters/filter.c 2010/07/09 15:34:43 1.55 @@ -121,7 +121,7 @@ {NULL, 0} }; -static int _passes_lvm_type_device_filter(struct dev_filter *f __attribute((unused)), +static int _passes_lvm_type_device_filter(struct dev_filter *f __attribute__((unused)), struct device *dev) { const char *name = dev_name(dev); --- LVM2/lib/format1/disk-rep.c 2009/10/27 17:00:46 1.80 +++ LVM2/lib/format1/disk-rep.c 2010/07/09 15:34:44 1.81 @@ -247,7 +247,7 @@ { unsigned num_read = 0; struct uuid_list *ul; - char buffer[NAME_LEN] __attribute((aligned(8))); + char buffer[NAME_LEN] __attribute__((aligned(8))); uint64_t pos = data->pvd.pv_uuidlist_on_disk.base; uint64_t end = pos + data->pvd.pv_uuidlist_on_disk.size; @@ -650,7 +650,7 @@ /* * assumes the device has been opened. */ -static int __write_all_pvd(const struct format_type *fmt __attribute((unused)), +static int __write_all_pvd(const struct format_type *fmt __attribute__((unused)), struct disk_list *data) { const char *pv_name = dev_name(data->dev); --- LVM2/lib/format1/disk-rep.h 2010/04/06 14:04:20 1.55 +++ LVM2/lib/format1/disk-rep.h 2010/07/09 15:34:44 1.56 @@ -148,7 +148,7 @@ struct uuid_list { struct dm_list list; - char uuid[NAME_LEN] __attribute((aligned(8))); + char uuid[NAME_LEN] __attribute__((aligned(8))); }; struct lvd_list { @@ -161,11 +161,11 @@ struct dm_pool *mem; struct device *dev; - struct pv_disk pvd __attribute((aligned(8))); - struct vg_disk vgd __attribute((aligned(8))); - struct dm_list uuids __attribute((aligned(8))); - struct dm_list lvds __attribute((aligned(8))); - struct pe_disk *extents __attribute((aligned(8))); + struct pv_disk pvd __attribute__((aligned(8))); + struct vg_disk vgd __attribute__((aligned(8))); + struct dm_list uuids __attribute__((aligned(8))); + struct dm_list lvds __attribute__((aligned(8))); + struct pe_disk *extents __attribute__((aligned(8))); }; /* --- LVM2/lib/format1/format1.c 2010/07/08 18:24:29 1.120 +++ LVM2/lib/format1/format1.c 2010/07/09 15:34:44 1.121 @@ -163,7 +163,7 @@ static struct volume_group *_format1_vg_read(struct format_instance *fid, const char *vg_name, - struct metadata_area *mda __attribute((unused))) + struct metadata_area *mda __attribute__((unused))) { struct dm_pool *mem = dm_pool_create("lvm1 vg_read", VG_MEMPOOL_CHUNK); struct dm_list pvs; @@ -241,7 +241,7 @@ } static int _format1_vg_write(struct format_instance *fid, struct volume_group *vg, - struct metadata_area *mda __attribute((unused))) + struct metadata_area *mda __attribute__((unused))) { struct dm_pool *mem = dm_pool_create("lvm1 vg_write", VG_MEMPOOL_CHUNK); struct dm_list pvds; @@ -262,8 +262,8 @@ } static int _format1_pv_read(const struct format_type *fmt, const char *pv_name, - struct physical_volume *pv, struct dm_list *mdas __attribute((unused)), - int scan_label_only __attribute((unused))) + struct physical_volume *pv, struct dm_list *mdas __attribute__((unused)), + int scan_label_only __attribute__((unused))) { struct dm_pool *mem = dm_pool_create("lvm1 pv_read", 1024); struct disk_list *dl; @@ -296,13 +296,13 @@ static int _format1_pv_setup(const struct format_type *fmt, uint64_t pe_start, uint32_t extent_count, uint32_t extent_size, - unsigned long data_alignment __attribute((unused)), - unsigned long data_alignment_offset __attribute((unused)), - int pvmetadatacopies __attribute((unused)), - uint64_t pvmetadatasize __attribute((unused)), - unsigned metadataignore __attribute((unused)), - struct dm_list *mdas __attribute((unused)), - struct physical_volume *pv, struct volume_group *vg __attribute((unused))) + unsigned long data_alignment __attribute__((unused)), + unsigned long data_alignment_offset __attribute__((unused)), + int pvmetadatacopies __attribute__((unused)), + uint64_t pvmetadatasize __attribute__((unused)), + unsigned metadataignore __attribute__((unused)), + struct dm_list *mdas __attribute__((unused)), + struct physical_volume *pv, struct volume_group *vg __attribute__((unused))) { if (pv->size > MAX_PV_SIZE) pv->size--; @@ -354,7 +354,7 @@ } static int _format1_pv_write(const struct format_type *fmt, struct physical_volume *pv, - struct dm_list *mdas __attribute((unused)), int64_t sector __attribute((unused))) + struct dm_list *mdas __attribute__((unused)), int64_t sector __attribute__((unused))) { struct dm_pool *mem; struct disk_list *dl; @@ -439,7 +439,7 @@ return 1; } -static int _format1_segtype_supported(struct format_instance *fid __attribute((unused)), +static int _format1_segtype_supported(struct format_instance *fid __attribute__((unused)), const struct segment_type *segtype) { if (!(segtype->flags & SEG_FORMAT1_SUPPORT)) @@ -454,9 +454,9 @@ }; static struct format_instance *_format1_create_instance(const struct format_type *fmt, - const char *vgname __attribute((unused)), - const char *vgid __attribute((unused)), - void *private __attribute((unused))) + const char *vgname __attribute__((unused)), + const char *vgid __attribute__((unused)), + void *private __attribute__((unused))) { struct format_instance *fid; struct metadata_area *mda; @@ -482,7 +482,7 @@ return fid; } -static void _format1_destroy_instance(struct format_instance *fid __attribute((unused))) +static void _format1_destroy_instance(struct format_instance *fid __attribute__((unused))) { } --- LVM2/lib/format1/import-export.c 2010/04/06 14:04:54 1.113 +++ LVM2/lib/format1/import-export.c 2010/07/09 15:34:44 1.114 @@ -137,7 +137,7 @@ return 1; } -int export_pv(struct cmd_context *cmd, struct dm_pool *mem __attribute((unused)), +int export_pv(struct cmd_context *cmd, struct dm_pool *mem __attribute__((unused)), struct volume_group *vg, struct pv_disk *pvd, struct physical_volume *pv) { @@ -552,7 +552,7 @@ /* * FIXME: More inefficient code. */ -int import_snapshots(struct dm_pool *mem __attribute((unused)), struct volume_group *vg, +int import_snapshots(struct dm_pool *mem __attribute__((unused)), struct volume_group *vg, struct dm_list *pvds) { struct logical_volume *lvs[MAX_LV]; @@ -641,7 +641,7 @@ * This calculates the nasty pv_number field * used by LVM1. */ -void export_numbers(struct dm_list *pvds, struct volume_group *vg __attribute((unused))) +void export_numbers(struct dm_list *pvds, struct volume_group *vg __attribute__((unused))) { struct disk_list *dl; int pv_num = 1; --- LVM2/lib/format1/lvm1-label.c 2009/12/11 13:16:38 1.22 +++ LVM2/lib/format1/lvm1-label.c 2010/07/09 15:34:44 1.23 @@ -30,7 +30,7 @@ op); } -static int _lvm1_can_handle(struct labeller *l __attribute((unused)), void *buf, uint64_t sector) +static int _lvm1_can_handle(struct labeller *l __attribute__((unused)), void *buf, uint64_t sector) { struct pv_disk *pvd = (struct pv_disk *) buf; uint32_t version; @@ -48,7 +48,7 @@ return 0; } -static int _lvm1_write(struct label *label __attribute((unused)), void *buf __attribute((unused))) +static int _lvm1_write(struct label *label __attribute__((unused)), void *buf __attribute__((unused))) { _not_supported("write"); return 0; @@ -87,14 +87,14 @@ return 1; } -static int _lvm1_initialise_label(struct labeller *l __attribute((unused)), struct label *label) +static int _lvm1_initialise_label(struct labeller *l __attribute__((unused)), struct label *label) { strcpy(label->type, "LVM1"); return 1; } -static void _lvm1_destroy_label(struct labeller *l __attribute((unused)), struct label *label __attribute((unused))) +static void _lvm1_destroy_label(struct labeller *l __attribute__((unused)), struct label *label __attribute__((unused))) { } --- LVM2/lib/format_pool/disk_rep.c 2009/10/27 17:00:46 1.16 +++ LVM2/lib/format_pool/disk_rep.c 2010/07/09 15:34:44 1.17 @@ -34,10 +34,10 @@ #define CPOUT_64(x, y) {(y) = xlate64_be((x));} static int __read_pool_disk(const struct format_type *fmt, struct device *dev, - struct dm_pool *mem __attribute((unused)), struct pool_list *pl, - const char *vg_name __attribute((unused))) + struct dm_pool *mem __attribute__((unused)), struct pool_list *pl, + const char *vg_name __attribute__((unused))) { - char buf[512] __attribute((aligned(8))); + char buf[512] __attribute__((aligned(8))); /* FIXME: Need to check the cache here first */ if (!dev_read(dev, UINT64_C(0), 512, buf)) { @@ -58,7 +58,7 @@ dm_list_iterate_items(pl, head) { if (id_equal(&data->pv_uuid, &pl->pv_uuid)) { - char uuid[ID_LEN + 7] __attribute((aligned(8))); + char uuid[ID_LEN + 7] __attribute__((aligned(8))); id_write_format(&pl->pv_uuid, uuid, ID_LEN + 7); @@ -84,7 +84,7 @@ struct lvmcache_info *info; struct id pvid; struct id vgid; - char uuid[ID_LEN + 7] __attribute((aligned(8))); + char uuid[ID_LEN + 7] __attribute__((aligned(8))); struct pool_disk *pd = &pl->pd; pool_label_in(pd, buf); --- LVM2/lib/format_pool/format_pool.c 2010/07/08 18:24:29 1.31 +++ LVM2/lib/format_pool/format_pool.c 2010/07/09 15:34:44 1.32 @@ -158,7 +158,7 @@ static struct volume_group *_pool_vg_read(struct format_instance *fid, const char *vg_name, - struct metadata_area *mda __attribute((unused))) + struct metadata_area *mda __attribute__((unused))) { struct dm_pool *mem = dm_pool_create("pool vg_read", VG_MEMPOOL_CHUNK); struct dm_list pds; @@ -188,26 +188,26 @@ return NULL; } -static int _pool_pv_setup(const struct format_type *fmt __attribute((unused)), - uint64_t pe_start __attribute((unused)), - uint32_t extent_count __attribute((unused)), - uint32_t extent_size __attribute((unused)), - unsigned long data_alignment __attribute((unused)), - unsigned long data_alignment_offset __attribute((unused)), - int pvmetadatacopies __attribute((unused)), - uint64_t pvmetadatasize __attribute((unused)), - unsigned metadataignore __attribute((unused)), - struct dm_list *mdas __attribute((unused)), - struct physical_volume *pv __attribute((unused)), - struct volume_group *vg __attribute((unused))) +static int _pool_pv_setup(const struct format_type *fmt __attribute__((unused)), + uint64_t pe_start __attribute__((unused)), + uint32_t extent_count __attribute__((unused)), + uint32_t extent_size __attribute__((unused)), + unsigned long data_alignment __attribute__((unused)), + unsigned long data_alignment_offset __attribute__((unused)), + int pvmetadatacopies __attribute__((unused)), + uint64_t pvmetadatasize __attribute__((unused)), + unsigned metadataignore __attribute__((unused)), + struct dm_list *mdas __attribute__((unused)), + struct physical_volume *pv __attribute__((unused)), + struct volume_group *vg __attribute__((unused))) { return 1; } static int _pool_pv_read(const struct format_type *fmt, const char *pv_name, struct physical_volume *pv, - struct dm_list *mdas __attribute((unused)), - int scan_label_only __attribute((unused))) + struct dm_list *mdas __attribute__((unused)), + int scan_label_only __attribute__((unused))) { struct dm_pool *mem = dm_pool_create("pool pv_read", 1024); struct pool_list *pl; @@ -249,9 +249,9 @@ /* *INDENT-ON* */ static struct format_instance *_pool_create_instance(const struct format_type *fmt, - const char *vgname __attribute((unused)), - const char *vgid __attribute((unused)), - void *private __attribute((unused))) + const char *vgname __attribute__((unused)), + const char *vgid __attribute__((unused)), + void *private __attribute__((unused))) { struct format_instance *fid; struct metadata_area *mda; @@ -282,7 +282,7 @@ return fid; } -static void _pool_destroy_instance(struct format_instance *fid __attribute((unused))) +static void _pool_destroy_instance(struct format_instance *fid __attribute__((unused))) { } --- LVM2/lib/format_pool/pool_label.c 2009/12/11 13:16:38 1.9 +++ LVM2/lib/format_pool/pool_label.c 2010/07/09 15:34:44 1.10 @@ -29,7 +29,7 @@ op); } -static int _pool_can_handle(struct labeller *l __attribute((unused)), void *buf, uint64_t sector) +static int _pool_can_handle(struct labeller *l __attribute__((unused)), void *buf, uint64_t sector) { struct pool_disk pd; @@ -50,7 +50,7 @@ return 0; } -static int _pool_write(struct label *label __attribute((unused)), void *buf __attribute((unused))) +static int _pool_write(struct label *label __attribute__((unused)), void *buf __attribute__((unused))) { _pool_not_supported("write"); return 0; @@ -64,14 +64,14 @@ return read_pool_label(&pl, l, dev, buf, label); } -static int _pool_initialise_label(struct labeller *l __attribute((unused)), struct label *label) +static int _pool_initialise_label(struct labeller *l __attribute__((unused)), struct label *label) { strcpy(label->type, "POOL"); return 1; } -static void _pool_destroy_label(struct labeller *l __attribute((unused)), struct label *label __attribute((unused))) +static void _pool_destroy_label(struct labeller *l __attribute__((unused)), struct label *label __attribute__((unused))) { } --- LVM2/lib/format_text/export.c 2010/06/28 20:37:10 1.76 +++ LVM2/lib/format_text/export.c 2010/07/09 15:34:44 1.77 @@ -183,7 +183,7 @@ } static int _out_with_comment_raw(struct formatter *f, - const char *comment __attribute((unused)), + const char *comment __attribute__((unused)), const char *fmt, va_list ap) { int n; @@ -413,7 +413,7 @@ static const char *_get_pv_name(struct formatter *f, struct physical_volume *pv) { - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); if (!pv || !id_write_format(&pv->id, uuid, sizeof(uuid))) return_NULL; --- LVM2/lib/format_text/format-text.c 2010/07/08 18:24:30 1.140 +++ LVM2/lib/format_text/format-text.c 2010/07/09 15:34:44 1.141 @@ -80,7 +80,7 @@ * NOTE: Currently there can be only one vg per text file. */ -static int _text_vg_setup(struct format_instance *fid __attribute((unused)), +static int _text_vg_setup(struct format_instance *fid __attribute__((unused)), struct volume_group *vg) { if (vg->extent_size & (vg->extent_size - 1)) { @@ -108,7 +108,7 @@ /* * Check if metadata area belongs to vg */ -static int _mda_in_vg_raw(struct format_instance *fid __attribute((unused)), +static int _mda_in_vg_raw(struct format_instance *fid __attribute__((unused)), struct volume_group *vg, struct metadata_area *mda) { struct mda_context *mdac = (struct mda_context *) mda->metadata_locn; @@ -279,7 +279,7 @@ -static int _text_lv_setup(struct format_instance *fid __attribute((unused)), +static int _text_lv_setup(struct format_instance *fid __attribute__((unused)), struct logical_volume *lv) { /******** FIXME Any LV size restriction? @@ -396,7 +396,7 @@ int *precommitted) { size_t len; - char vgnamebuf[NAME_LEN + 2] __attribute((aligned(8))); + char vgnamebuf[NAME_LEN + 2] __attribute__((aligned(8))); struct raw_locn *rlocn, *rlocn_precommitted; struct lvmcache_info *info; @@ -892,7 +892,7 @@ return vg; } -static int _vg_write_file(struct format_instance *fid __attribute((unused)), +static int _vg_write_file(struct format_instance *fid __attribute__((unused)), struct volume_group *vg, struct metadata_area *mda) { struct text_context *tc = (struct text_context *) mda->metadata_locn; @@ -958,7 +958,7 @@ return 1; } -static int _vg_commit_file_backup(struct format_instance *fid __attribute((unused)), +static int _vg_commit_file_backup(struct format_instance *fid __attribute__((unused)), struct volume_group *vg, struct metadata_area *mda) { @@ -1025,8 +1025,8 @@ return 1; } -static int _vg_remove_file(struct format_instance *fid __attribute((unused)), - struct volume_group *vg __attribute((unused)), +static int _vg_remove_file(struct format_instance *fid __attribute__((unused)), + struct volume_group *vg __attribute__((unused)), struct metadata_area *mda) { struct text_context *tc = (struct text_context *) mda->metadata_locn; @@ -1105,8 +1105,8 @@ uint32_t wrap = 0; const char *vgname = NULL; unsigned int len = 0; - char buf[NAME_LEN + 1] __attribute((aligned(8))); - char uuid[64] __attribute((aligned(8))); + char buf[NAME_LEN + 1] __attribute__((aligned(8))); + char uuid[64] __attribute__((aligned(8))); uint64_t buffer_size, current_usage; if (mda_free_sectors) @@ -1251,7 +1251,7 @@ int pvmetadatacopies, uint64_t pvmetadatasize, unsigned metadataignore, struct dm_list *mdas, struct physical_volume *pv, - struct volume_group *vg __attribute((unused))) + struct volume_group *vg __attribute__((unused))) { uint64_t mda_adjustment, disk_size, alignment, alignment_offset; uint64_t start1, mda_size1; /* First area - start of disk */ @@ -1407,7 +1407,7 @@ struct lvmcache_info *info; struct mda_context *mdac; struct metadata_area *mda; - char buf[MDA_HEADER_SIZE] __attribute((aligned(8))); + char buf[MDA_HEADER_SIZE] __attribute__((aligned(8))); struct mda_header *mdah = (struct mda_header *) buf; uint64_t adjustment; struct data_area_list *da; @@ -1689,7 +1689,7 @@ return 1; } -static void _text_destroy_instance(struct format_instance *fid __attribute((unused))) +static void _text_destroy_instance(struct format_instance *fid __attribute__((unused))) { } @@ -2106,7 +2106,7 @@ } if (!(dev_area.dev = device_from_pvid(cmd, &id, NULL))) { - char buffer[64] __attribute((aligned(8))); + char buffer[64] __attribute__((aligned(8))); if (!id_write_format(&id, buffer, sizeof(buffer))) log_error("Couldn't find device."); --- LVM2/lib/format_text/import_vsn1.c 2010/06/28 20:37:10 1.76 +++ LVM2/lib/format_text/import_vsn1.c 2010/07/09 15:34:44 1.77 @@ -156,9 +156,9 @@ static int _read_pv(struct format_instance *fid, struct dm_pool *mem, struct volume_group *vg, struct config_node *pvn, - struct config_node *vgn __attribute((unused)), + struct config_node *vgn __attribute__((unused)), struct dm_hash_table *pv_hash, - struct dm_hash_table *lv_hash __attribute((unused)), + struct dm_hash_table *lv_hash __attribute__((unused)), unsigned *scan_done_once, unsigned report_missing_devices) { @@ -194,7 +194,7 @@ * Convert the uuid into a device. */ if (!(pv->dev = device_from_pvid(fid->fmt->cmd, &pv->id, scan_done_once))) { - char buffer[64] __attribute((aligned(8))); + char buffer[64] __attribute__((aligned(8))); if (!id_write_format(&pv->id, buffer, sizeof(buffer))) buffer[0] = '\0'; @@ -491,14 +491,14 @@ return 1; } -static int _read_lvnames(struct format_instance *fid __attribute((unused)), +static int _read_lvnames(struct format_instance *fid __attribute__((unused)), struct dm_pool *mem, struct volume_group *vg, struct config_node *lvn, - struct config_node *vgn __attribute((unused)), - struct dm_hash_table *pv_hash __attribute((unused)), + struct config_node *vgn __attribute__((unused)), + struct dm_hash_table *pv_hash __attribute__((unused)), struct dm_hash_table *lv_hash, - unsigned *scan_done_once __attribute((unused)), - unsigned report_missing_devices __attribute((unused))) + unsigned *scan_done_once __attribute__((unused)), + unsigned report_missing_devices __attribute__((unused))) { struct logical_volume *lv; struct config_node *cn; @@ -563,14 +563,14 @@ return link_lv_to_vg(vg, lv); } -static int _read_lvsegs(struct format_instance *fid __attribute((unused)), +static int _read_lvsegs(struct format_instance *fid __attribute__((unused)), struct dm_pool *mem, struct volume_group *vg, struct config_node *lvn, - struct config_node *vgn __attribute((unused)), + struct config_node *vgn __attribute__((unused)), struct dm_hash_table *pv_hash, struct dm_hash_table *lv_hash, - unsigned *scan_done_once __attribute((unused)), - unsigned report_missing_devices __attribute((unused))) + unsigned *scan_done_once __attribute__((unused)), + unsigned report_missing_devices __attribute__((unused))) { struct logical_volume *lv; --- LVM2/lib/format_text/text_label.c 2010/06/30 19:28:35 1.36 +++ LVM2/lib/format_text/text_label.c 2010/07/09 15:34:44 1.37 @@ -23,9 +23,9 @@ #include #include -static int _text_can_handle(struct labeller *l __attribute((unused)), +static int _text_can_handle(struct labeller *l __attribute__((unused)), void *buf, - uint64_t sector __attribute((unused))) + uint64_t sector __attribute__((unused))) { struct label_header *lh = (struct label_header *) buf; @@ -44,7 +44,7 @@ struct metadata_area *mda; struct mda_context *mdac; struct data_area_list *da; - char buffer[64] __attribute((aligned(8))); + char buffer[64] __attribute__((aligned(8))); int da1, mda1, mda2; /* FIXME Move to where label is created */ @@ -242,7 +242,7 @@ } } -static int _text_initialise_label(struct labeller *l __attribute((unused)), +static int _text_initialise_label(struct labeller *l __attribute__((unused)), struct label *label) { strncpy(label->type, LVM2_LABEL, sizeof(label->type)); @@ -343,7 +343,7 @@ return 1; } -static void _text_destroy_label(struct labeller *l __attribute((unused)), +static void _text_destroy_label(struct labeller *l __attribute__((unused)), struct label *label) { struct lvmcache_info *info = (struct lvmcache_info *) label->info; --- LVM2/lib/label/label.c 2009/07/15 20:02:47 1.49 +++ LVM2/lib/label/label.c 2010/07/09 15:34:44 1.50 @@ -114,7 +114,7 @@ struct lvmcache_info *info; uint64_t sector; int found = 0; - char readbuf[LABEL_SCAN_SIZE] __attribute((aligned(8))); + char readbuf[LABEL_SCAN_SIZE] __attribute__((aligned(8))); if (!dev_read(dev, scan_sector << SECTOR_SHIFT, LABEL_SCAN_SIZE, readbuf)) { @@ -190,8 +190,8 @@ /* FIXME Also wipe associated metadata area headers? */ int label_remove(struct device *dev) { - char buf[LABEL_SIZE] __attribute((aligned(8))); - char readbuf[LABEL_SCAN_SIZE] __attribute((aligned(8))); + char buf[LABEL_SIZE] __attribute__((aligned(8))); + char readbuf[LABEL_SCAN_SIZE] __attribute__((aligned(8))); int r = 1; uint64_t sector; int wipe; @@ -260,7 +260,7 @@ int label_read(struct device *dev, struct label **result, uint64_t scan_sector) { - char buf[LABEL_SIZE] __attribute((aligned(8))); + char buf[LABEL_SIZE] __attribute__((aligned(8))); struct labeller *l; uint64_t sector; struct lvmcache_info *info; @@ -299,7 +299,7 @@ /* Caller may need to use label_get_handler to create label struct! */ int label_write(struct device *dev, struct label *label) { - char buf[LABEL_SIZE] __attribute((aligned(8))); + char buf[LABEL_SIZE] __attribute__((aligned(8))); struct label_header *lh = (struct label_header *) buf; int r = 1; @@ -347,7 +347,7 @@ int label_verify(struct device *dev) { struct labeller *l; - char buf[LABEL_SIZE] __attribute((aligned(8))); + char buf[LABEL_SIZE] __attribute__((aligned(8))); uint64_t sector; struct lvmcache_info *info; int r = 0; --- LVM2/lib/locking/cluster_locking.c 2010/05/19 02:36:33 1.44 +++ LVM2/lib/locking/cluster_locking.c 2010/07/09 15:34:45 1.45 @@ -97,7 +97,7 @@ /* Send a request and return the status */ static int _send_request(char *inbuf, int inlen, char **retbuf) { - char outbuf[PIPE_BUF] __attribute((aligned(8))); + char outbuf[PIPE_BUF] __attribute__((aligned(8))); struct clvm_header *outheader = (struct clvm_header *) outbuf; int len; int off; @@ -199,7 +199,7 @@ static int _cluster_request(char clvmd_cmd, const char *node, void *data, int len, lvm_response_t ** response, int *num) { - char outbuf[sizeof(struct clvm_header) + len + strlen(node) + 1] __attribute((aligned(8))); + char outbuf[sizeof(struct clvm_header) + len + strlen(node) + 1] __attribute__((aligned(8))); char *inptr; char *retbuf = NULL; int status; --- LVM2/lib/locking/file_locking.c 2010/05/19 02:36:33 1.46 +++ LVM2/lib/locking/file_locking.c 2010/07/09 15:34:45 1.47 @@ -112,7 +112,7 @@ log_sys_error("signal", "_remove_ctrl_c_handler"); } -static void _trap_ctrl_c(int sig __attribute((unused))) +static void _trap_ctrl_c(int sig __attribute__((unused))) { _remove_ctrl_c_handler(); log_error("CTRL-c detected: giving up waiting for lock"); --- LVM2/lib/locking/locking.c 2010/05/19 02:36:33 1.84 +++ LVM2/lib/locking/locking.c 2010/07/09 15:34:45 1.85 @@ -127,7 +127,7 @@ sigaction(SIGINT, &_oldhandler, NULL); } -static void _block_signals(uint32_t flags __attribute((unused))) +static void _block_signals(uint32_t flags __attribute__((unused))) { sigset_t set; @@ -396,7 +396,7 @@ int lock_vol(struct cmd_context *cmd, const char *vol, uint32_t flags) { - char resource[258] __attribute((aligned(8))); + char resource[258] __attribute__((aligned(8))); lv_operation_t lv_op; switch (flags & (LCK_SCOPE_MASK | LCK_TYPE_MASK)) { --- LVM2/lib/locking/no_locking.c 2010/01/22 09:45:29 1.21 +++ LVM2/lib/locking/no_locking.c 2010/07/09 15:34:45 1.22 @@ -79,7 +79,7 @@ return _no_lock_resource(cmd, resource, flags); } -int init_no_locking(struct locking_type *locking, struct cmd_context *cmd __attribute((unused))) +int init_no_locking(struct locking_type *locking, struct cmd_context *cmd __attribute__((unused))) { locking->lock_resource = _no_lock_resource; locking->reset_locking = _no_reset_locking; @@ -89,7 +89,7 @@ return 1; } -int init_readonly_locking(struct locking_type *locking, struct cmd_context *cmd __attribute((unused))) +int init_readonly_locking(struct locking_type *locking, struct cmd_context *cmd __attribute__((unused))) { locking->lock_resource = _readonly_lock_resource; locking->reset_locking = _no_reset_locking; --- LVM2/lib/metadata/lv_manip.c 2010/05/21 12:36:31 1.230 +++ LVM2/lib/metadata/lv_manip.c 2010/07/09 15:34:45 1.231 @@ -951,7 +951,7 @@ return 1; } -static int _is_condition(struct cmd_context *cmd __attribute((unused)), +static int _is_condition(struct cmd_context *cmd __attribute__((unused)), struct pv_segment *pvseg, uint32_t s, void *data) { @@ -1743,8 +1743,8 @@ const struct segment_type *segtype, uint32_t stripes, uint32_t stripe_size, uint32_t mirrors, uint32_t extents, - struct physical_volume *mirrored_pv __attribute((unused)), - uint32_t mirrored_pe __attribute((unused)), + struct physical_volume *mirrored_pv __attribute__((unused)), + uint32_t mirrored_pe __attribute__((unused)), uint64_t status, struct dm_list *allocatable_pvs, alloc_policy_t alloc) { @@ -2072,7 +2072,7 @@ } static int _add_pvs(struct cmd_context *cmd, struct pv_segment *peg, - uint32_t s __attribute((unused)), void *data) + uint32_t s __attribute__((unused)), void *data) { struct seg_pvs *spvs = (struct seg_pvs *) data; struct pv_list *pvl; --- LVM2/lib/metadata/metadata.c 2010/07/08 18:24:30 1.387 +++ LVM2/lib/metadata/metadata.c 2010/07/09 15:34:45 1.388 @@ -172,7 +172,7 @@ struct pv_list *pvl; struct format_instance *fid = vg->fid; struct dm_pool *mem = vg->vgmem; - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); struct dm_list *mdas; log_verbose("Adding physical volume '%s' to volume group '%s'", @@ -1491,7 +1491,7 @@ * Separate metadata areas after splitting a VG. * Also accepts orphan VG as destination (for vgreduce). */ -int vg_split_mdas(struct cmd_context *cmd __attribute((unused)), +int vg_split_mdas(struct cmd_context *cmd __attribute__((unused)), struct volume_group *vg_from, struct volume_group *vg_to) { struct dm_list *mdas_from_in_use, *mdas_to_in_use; @@ -1683,7 +1683,7 @@ struct device *dev; struct dm_list mdas; struct pvcreate_params default_pp; - char buffer[64] __attribute((aligned(8))); + char buffer[64] __attribute__((aligned(8))); pvcreate_params_set_defaults(&default_pp); if (!pp) @@ -2122,7 +2122,7 @@ /* * Determine whether two vgs are compatible for merging. */ -int vgs_are_compatible(struct cmd_context *cmd __attribute((unused)), +int vgs_are_compatible(struct cmd_context *cmd __attribute__((unused)), struct volume_group *vg_from, struct volume_group *vg_to) { @@ -2411,7 +2411,7 @@ { struct pv_list *pvl, *pvl2; struct lv_list *lvl, *lvl2; - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); int r = 1; uint32_t hidden_lv_count = 0, lv_count = 0, lv_visible_count = 0; uint32_t pv_count = 0; @@ -2900,7 +2900,7 @@ struct dm_list *pvids; struct pv_list *pvl, *pvl2; struct dm_list all_pvs; - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); if (is_orphan_vg(vgname)) { if (use_precommitted) { @@ -3638,7 +3638,7 @@ return _get_pvs(cmd, NULL); } -int pv_write(struct cmd_context *cmd __attribute((unused)), +int pv_write(struct cmd_context *cmd __attribute__((unused)), struct physical_volume *pv, struct dm_list *mdas, int64_t label_sector) { --- LVM2/lib/metadata/mirror.c 2010/07/09 15:08:15 1.123 +++ LVM2/lib/metadata/mirror.c 2010/07/09 15:34:45 1.124 @@ -1064,8 +1064,8 @@ return 1; } -static int _no_removable_images(struct logical_volume *lv __attribute((unused)), - void *baton __attribute((unused))) { +static int _no_removable_images(struct logical_volume *lv __attribute__((unused)), + void *baton __attribute__((unused))) { return 0; } @@ -1110,7 +1110,7 @@ return 1; } -static int get_mirror_fault_policy(struct cmd_context *cmd __attribute((unused)), +static int get_mirror_fault_policy(struct cmd_context *cmd __attribute__((unused)), int log_policy) { const char *policy; @@ -1432,7 +1432,7 @@ struct logical_volume *find_pvmove_lv_from_pvname(struct cmd_context *cmd, struct volume_group *vg, const char *name, - const char *uuid __attribute((unused)), + const char *uuid __attribute__((unused)), uint32_t lv_type) { struct physical_volume *pv; @@ -2000,7 +2000,7 @@ * 'mirror' is the number of mirrors to be removed. * 'pvs' is removable pvs. */ -int lv_remove_mirrors(struct cmd_context *cmd __attribute((unused)), +int lv_remove_mirrors(struct cmd_context *cmd __attribute__((unused)), struct logical_volume *lv, uint32_t mirrors, uint32_t log_count, int (*is_removable)(struct logical_volume *, void *), --- LVM2/lib/mirror/mirrored.c 2010/05/24 23:11:35 1.71 +++ LVM2/lib/mirror/mirrored.c 2010/07/09 15:34:45 1.72 @@ -610,7 +610,7 @@ /* FIXME This gets run while suspended and performs banned operations. */ static int _target_set_events(struct lv_segment *seg, - int evmask __attribute((unused)), int set) + int evmask __attribute__((unused)), int set) { char *dso, *uuid; struct logical_volume *lv; --- LVM2/lib/replicator/replicator.c 2010/05/21 13:17:21 1.1 +++ LVM2/lib/replicator/replicator.c 2010/07/09 15:34:45 1.2 @@ -221,7 +221,7 @@ /* Import replicator segment */ static int _replicator_text_import(struct lv_segment *seg, const struct config_node *sn, - struct dm_hash_table *pv_hash __attribute((unused))) + struct dm_hash_table *pv_hash __attribute__((unused))) { const struct config_node *cn; struct logical_volume *rlog_lv; @@ -377,8 +377,8 @@ /* Check for module presence */ static int _replicator_target_present(struct cmd_context *cmd, - const struct lv_segment *seg __attribute((unused)), - unsigned *attributes __attribute((unused))) + const struct lv_segment *seg __attribute__((unused)), + unsigned *attributes __attribute__((unused))) { static int _checked = 0; static int _present = 0; @@ -394,7 +394,7 @@ #endif static int _replicator_modules_needed(struct dm_pool *mem, - const struct lv_segment *seg __attribute((unused)), + const struct lv_segment *seg __attribute__((unused)), struct dm_list *modules) { if (!str_list_add(mem, modules, REPLICATOR_MODULE)) @@ -520,7 +520,7 @@ /* Import replicator segment */ static int _replicator_dev_text_import(struct lv_segment *seg, const struct config_node *sn, - struct dm_hash_table *pv_hash __attribute((unused))) + struct dm_hash_table *pv_hash __attribute__((unused))) { const struct config_node *cn; struct logical_volume *replicator; @@ -721,8 +721,8 @@ /* Check for module presence */ static int _replicator_dev_target_present(struct cmd_context *cmd, - const struct lv_segment *seg __attribute((unused)), - unsigned *attributes __attribute((unused))) + const struct lv_segment *seg __attribute__((unused)), + unsigned *attributes __attribute__((unused))) { static int _checked = 0; static int _present = 0; --- LVM2/lib/report/report.c 2010/06/28 20:40:01 1.122 +++ LVM2/lib/report/report.c 2010/07/09 15:34:46 1.123 @@ -56,16 +56,16 @@ /* * Data-munging functions to prepare each data type for display and sorting */ -static int _string_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)), +static int _string_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { return dm_report_field_string(rh, field, (const char **) data); } -static int _dev_name_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)), +static int _dev_name_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const char *name = dev_name(*(const struct device * const *) data); @@ -147,23 +147,23 @@ return 1; } -static int _devices_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem, +static int _devices_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { return _format_pvsegs(mem, field, data, 0); } -static int _peranges_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem, +static int _peranges_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { return _format_pvsegs(mem, field, data, 1); } -static int _tags_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem, +static int _tags_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct dm_list *tags = (const struct dm_list *) data; struct str_list *sl; @@ -238,9 +238,9 @@ return _string_disp(rh, mem, field, &pv->fmt->name, private); } -static int _lvkmaj_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)), +static int _lvkmaj_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct logical_volume *lv = (const struct logical_volume *) data; struct lvinfo info; @@ -251,9 +251,9 @@ return dm_report_field_int32(rh, field, &_minusone32); } -static int _lvkmin_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)), +static int _lvkmin_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct logical_volume *lv = (const struct logical_volume *) data; struct lvinfo info; @@ -280,9 +280,9 @@ return (percent_range == PERCENT_100) ? 1 : 0; } -static int _lvstatus_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem, +static int _lvstatus_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct logical_volume *lv = (const struct logical_volume *) data; struct lvinfo info; @@ -386,9 +386,9 @@ return 1; } -static int _pvstatus_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem, +static int _pvstatus_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const uint32_t status = *(const uint32_t *) data; char *repstr; @@ -412,9 +412,9 @@ return 1; } -static int _vgstatus_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem, +static int _vgstatus_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct volume_group *vg = (const struct volume_group *) data; char *repstr; @@ -455,10 +455,10 @@ return 1; } -static int _segtype_disp(struct dm_report *rh __attribute((unused)), - struct dm_pool *mem __attribute((unused)), +static int _segtype_disp(struct dm_report *rh __attribute__((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct lv_segment *seg = (const struct lv_segment *) data; @@ -471,9 +471,9 @@ return 1; } -static int _loglv_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)), +static int _loglv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct logical_volume *lv = (const struct logical_volume *) data; struct lv_segment *seg; @@ -491,7 +491,7 @@ static int _lvname_disp(struct dm_report *rh, struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct logical_volume *lv = (const struct logical_volume *) data; char *repstr, *lvname; @@ -525,7 +525,7 @@ static int _lvpath_disp(struct dm_report *rh, struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct logical_volume *lv = (const struct logical_volume *) data; char *repstr; @@ -560,9 +560,9 @@ return 1; } -static int _movepv_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)), +static int _movepv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct logical_volume *lv = (const struct logical_volume *) data; const char *name; @@ -579,9 +579,9 @@ return 1; } -static int _convertlv_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)), +static int _convertlv_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct logical_volume *lv = (const struct logical_volume *) data; const char *name = NULL; @@ -605,7 +605,7 @@ return 1; } -static int _size32_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem, +static int _size32_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem, struct dm_report_field *field, const void *data, void *private) { @@ -633,7 +633,7 @@ return 1; } -static int _size64_disp(struct dm_report *rh __attribute((unused)), +static int _size64_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem, struct dm_report_field *field, const void *data, void *private) @@ -663,7 +663,7 @@ static int _lvreadahead_disp(struct dm_report *rh, struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct logical_volume *lv = (const struct logical_volume *) data; @@ -714,10 +714,10 @@ } static int _segstartpe_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { const struct lv_segment *seg = (const struct lv_segment *) data; @@ -835,9 +835,9 @@ return _size64_disp(rh, mem, field, &freespace, private); } -static int _uuid_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem, +static int _uuid_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { char *repstr = NULL; @@ -853,16 +853,16 @@ return 1; } -static int _uint32_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)), +static int _uint32_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { return dm_report_field_uint32(rh, field, data); } -static int _int32_disp(struct dm_report *rh, struct dm_pool *mem __attribute((unused)), +static int _int32_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { return dm_report_field_int32(rh, field, data); } @@ -1062,9 +1062,9 @@ return _uint32_disp(rh, mem, field, &count, private); } -static int _snpercent_disp(struct dm_report *rh __attribute((unused)), struct dm_pool *mem, +static int _snpercent_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const struct logical_volume *lv = (const struct logical_volume *) data; struct lvinfo info; @@ -1122,10 +1122,10 @@ return 1; } -static int _copypercent_disp(struct dm_report *rh __attribute((unused)), +static int _copypercent_disp(struct dm_report *rh __attribute__((unused)), struct dm_pool *mem, struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { struct logical_volume *lv = (struct logical_volume *) data; float percent; --- LVM2/lib/snapshot/snapshot.c 2010/04/14 13:01:43 1.46 +++ LVM2/lib/snapshot/snapshot.c 2010/07/09 15:34:46 1.47 @@ -32,7 +32,7 @@ } static int _snap_text_import(struct lv_segment *seg, const struct config_node *sn, - struct dm_hash_table *pv_hash __attribute((unused))) + struct dm_hash_table *pv_hash __attribute__((unused))) { uint32_t chunk_size; const char *org_name, *cow_name; @@ -103,11 +103,11 @@ } #ifdef DEVMAPPER_SUPPORT -static int _snap_target_percent(void **target_state __attribute((unused)), +static int _snap_target_percent(void **target_state __attribute__((unused)), percent_range_t *percent_range, - struct dm_pool *mem __attribute((unused)), - struct cmd_context *cmd __attribute((unused)), - struct lv_segment *seg __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), + struct cmd_context *cmd __attribute__((unused)), + struct lv_segment *seg __attribute__((unused)), char *params, uint64_t *total_numerator, uint64_t *total_denominator) { @@ -141,7 +141,7 @@ static int _snap_target_present(struct cmd_context *cmd, const struct lv_segment *seg, - unsigned *attributes __attribute((unused))) + unsigned *attributes __attribute__((unused))) { static int _snap_checked = 0; static int _snap_merge_checked = 0; @@ -249,7 +249,7 @@ /* FIXME This gets run while suspended and performs banned operations. */ static int _target_set_events(struct lv_segment *seg, - int events __attribute((unused)), int set) + int events __attribute__((unused)), int set) { char *dso, *uuid; struct volume_group *vg = seg->lv->vg; @@ -293,7 +293,7 @@ #endif static int _snap_modules_needed(struct dm_pool *mem, - const struct lv_segment *seg __attribute((unused)), + const struct lv_segment *seg __attribute__((unused)), struct dm_list *modules) { if (!str_list_add(mem, modules, "snapshot")) { --- LVM2/lib/striped/striped.c 2010/01/07 14:46:52 1.31 +++ LVM2/lib/striped/striped.c 2010/07/09 15:34:46 1.32 @@ -160,12 +160,12 @@ #ifdef DEVMAPPER_SUPPORT static int _striped_add_target_line(struct dev_manager *dm, - struct dm_pool *mem __attribute((unused)), - struct cmd_context *cmd __attribute((unused)), - void **target_state __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), + struct cmd_context *cmd __attribute__((unused)), + void **target_state __attribute__((unused)), struct lv_segment *seg, struct dm_tree_node *node, uint64_t len, - uint32_t *pvmove_mirror_count __attribute((unused))) + uint32_t *pvmove_mirror_count __attribute__((unused))) { if (!seg->area_count) { log_error(INTERNAL_ERROR "striped add_target_line called " @@ -183,8 +183,8 @@ } static int _striped_target_present(struct cmd_context *cmd, - const struct lv_segment *seg __attribute((unused)), - unsigned *attributes __attribute((unused))) + const struct lv_segment *seg __attribute__((unused)), + unsigned *attributes __attribute__((unused))) { static int _striped_checked = 0; static int _striped_present = 0; --- LVM2/lib/unknown/unknown.c 2009/10/22 10:38:07 1.2 +++ LVM2/lib/unknown/unknown.c 2010/07/09 15:34:46 1.3 @@ -62,13 +62,13 @@ } #ifdef DEVMAPPER_SUPPORT -static int _unknown_add_target_line(struct dev_manager *dm __attribute((unused)), - struct dm_pool *mem __attribute((unused)), - struct cmd_context *cmd __attribute((unused)), - void **target_state __attribute((unused)), - struct lv_segment *seg __attribute((unused)), +static int _unknown_add_target_line(struct dev_manager *dm __attribute__((unused)), + struct dm_pool *mem __attribute__((unused)), + struct cmd_context *cmd __attribute__((unused)), + void **target_state __attribute__((unused)), + struct lv_segment *seg __attribute__((unused)), struct dm_tree_node *node, uint64_t len, - uint32_t *pvmove_mirror_count __attribute((unused))) + uint32_t *pvmove_mirror_count __attribute__((unused))) { return dm_tree_node_add_error_target(node, len); } --- LVM2/lib/zero/zero.c 2009/05/27 13:05:54 1.21 +++ LVM2/lib/zero/zero.c 2010/07/09 15:34:46 1.22 @@ -39,20 +39,20 @@ } #ifdef DEVMAPPER_SUPPORT -static int _zero_add_target_line(struct dev_manager *dm __attribute((unused)), - struct dm_pool *mem __attribute((unused)), - struct cmd_context *cmd __attribute((unused)), - void **target_state __attribute((unused)), - struct lv_segment *seg __attribute((unused)), +static int _zero_add_target_line(struct dev_manager *dm __attribute__((unused)), + struct dm_pool *mem __attribute__((unused)), + struct cmd_context *cmd __attribute__((unused)), + void **target_state __attribute__((unused)), + struct lv_segment *seg __attribute__((unused)), struct dm_tree_node *node,uint64_t len, - uint32_t *pvmove_mirror_count __attribute((unused))) + uint32_t *pvmove_mirror_count __attribute__((unused))) { return dm_tree_node_add_zero_target(node, len); } static int _zero_target_present(struct cmd_context *cmd, - const struct lv_segment *seg __attribute((unused)), - unsigned *attributes __attribute((unused))) + const struct lv_segment *seg __attribute__((unused)), + unsigned *attributes __attribute__((unused))) { static int _zero_checked = 0; static int _zero_present = 0; @@ -67,7 +67,7 @@ #endif static int _zero_modules_needed(struct dm_pool *mem, - const struct lv_segment *seg __attribute((unused)), + const struct lv_segment *seg __attribute__((unused)), struct dm_list *modules) { if (!str_list_add(mem, modules, "zero")) { --- LVM2/libdm/libdevmapper.h 2010/07/05 22:22:43 1.119 +++ LVM2/libdm/libdevmapper.h 2010/07/09 15:34:47 1.120 @@ -244,7 +244,7 @@ * Release library resources */ void dm_lib_release(void); -void dm_lib_exit(void) __attribute((destructor)); +void dm_lib_exit(void) __attribute__((destructor)); /* * Use NULL for all devices. --- LVM2/libdm/libdm-common.c 2010/05/27 15:02:56 1.96 +++ LVM2/libdm/libdm-common.c 2010/07/09 15:34:47 1.97 @@ -71,8 +71,8 @@ */ static void _default_log_line(int level, - const char *file __attribute((unused)), - int line __attribute((unused)), int dm_errno, + const char *file __attribute__((unused)), + int line __attribute__((unused)), int dm_errno, const char *f, va_list ap) { int use_stderr = level & _LOG_STDERR; @@ -94,8 +94,8 @@ } static void _default_log_with_errno(int level, - const char *file __attribute((unused)), - int line __attribute((unused)), int dm_errno, + const char *file __attribute__((unused)), + int line __attribute__((unused)), int dm_errno, const char *f, ...) { va_list ap; --- LVM2/libdm/libdm-deptree.c 2010/07/02 21:16:51 1.84 +++ LVM2/libdm/libdm-deptree.c 2010/07/09 15:34:47 1.85 @@ -1435,7 +1435,7 @@ * * Returns: 1 on success, 0 on failure */ -static int _emit_areas_line(struct dm_task *dmt __attribute((unused)), +static int _emit_areas_line(struct dm_task *dmt __attribute__((unused)), struct load_segment *seg, char *params, size_t paramsize, int *pos) { --- LVM2/libdm/libdm-string.c 2009/06/03 11:40:23 1.11 +++ LVM2/libdm/libdm-string.c 2010/07/09 15:34:47 1.12 @@ -38,7 +38,7 @@ * Returns number of words. */ int dm_split_words(char *buffer, unsigned max, - unsigned ignore_comments __attribute((unused)), + unsigned ignore_comments __attribute__((unused)), char **argv) { unsigned arg; --- LVM2/libdm/datastruct/hash.c 2009/11/03 00:45:35 1.10 +++ LVM2/libdm/datastruct/hash.c 2010/07/09 15:34:47 1.11 @@ -236,13 +236,13 @@ t->num_nodes = 0u; } -char *dm_hash_get_key(struct dm_hash_table *t __attribute((unused)), +char *dm_hash_get_key(struct dm_hash_table *t __attribute__((unused)), struct dm_hash_node *n) { return n->key; } -void *dm_hash_get_data(struct dm_hash_table *t __attribute((unused)), +void *dm_hash_get_data(struct dm_hash_table *t __attribute__((unused)), struct dm_hash_node *n) { return n->data; --- LVM2/libdm/mm/dbg_malloc.c 2010/03/25 18:22:04 1.17 +++ LVM2/libdm/mm/dbg_malloc.c 2010/07/09 15:34:47 1.18 @@ -231,8 +231,8 @@ } } -void *dm_malloc_aux(size_t s, const char *file __attribute((unused)), - int line __attribute((unused))) +void *dm_malloc_aux(size_t s, const char *file __attribute__((unused)), + int line __attribute__((unused))) { if (s > 50000000) { log_error("Huge memory allocation (size %" PRIsize_t --- LVM2/liblvm/lvm_lv.c 2010/04/19 15:22:24 1.22 +++ LVM2/liblvm/lvm_lv.c 2010/07/09 15:34:47 1.23 @@ -41,7 +41,7 @@ const char *lvm_lv_get_uuid(const lv_t lv) { - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); if (!id_write_format(&lv->lvid.id[1], uuid, sizeof(uuid))) { log_error(INTERNAL_ERROR "unable to convert uuid"); --- LVM2/liblvm/lvm_pv.c 2010/04/19 15:22:24 1.11 +++ LVM2/liblvm/lvm_pv.c 2010/07/09 15:34:47 1.12 @@ -19,7 +19,7 @@ const char *lvm_pv_get_uuid(const pv_t pv) { - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); if (!id_write_format(&pv->id, uuid, sizeof(uuid))) { log_error(INTERNAL_ERROR "Unable to convert uuid"); --- LVM2/liblvm/lvm_vg.c 2010/06/30 18:03:53 1.41 +++ LVM2/liblvm/lvm_vg.c 2010/07/09 15:34:47 1.42 @@ -332,7 +332,7 @@ const char *lvm_vg_get_uuid(const vg_t vg) { - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); if (!id_write_format(&vg->id, uuid, sizeof(uuid))) { log_error(INTERNAL_ERROR "Unable to convert uuid"); --- LVM2/tools/dmsetup.c 2010/07/08 14:29:28 1.141 +++ LVM2/tools/dmsetup.c 2010/07/09 15:34:48 1.142 @@ -502,7 +502,7 @@ return 1; } -static int _load(int argc, char **argv, void *data __attribute((unused))) +static int _load(int argc, char **argv, void *data __attribute__((unused))) { int r = 0; struct dm_task *dmt; @@ -562,7 +562,7 @@ return r; } -static int _create(int argc, char **argv, void *data __attribute((unused))) +static int _create(int argc, char **argv, void *data __attribute__((unused))) { int r = 0; struct dm_task *dmt; @@ -644,7 +644,7 @@ return r; } -static int _rename(int argc, char **argv, void *data __attribute((unused))) +static int _rename(int argc, char **argv, void *data __attribute__((unused))) { int r = 0; struct dm_task *dmt; @@ -691,7 +691,7 @@ return r; } -static int _message(int argc, char **argv, void *data __attribute((unused))) +static int _message(int argc, char **argv, void *data __attribute__((unused))) { int r = 0, i; size_t sz = 1; @@ -758,7 +758,7 @@ return r; } -static int _setgeometry(int argc, char **argv, void *data __attribute((unused))) +static int _setgeometry(int argc, char **argv, void *data __attribute__((unused))) { int r = 0; struct dm_task *dmt; @@ -797,7 +797,7 @@ return r; } -static int _splitname(int argc, char **argv, void *data __attribute((unused))) +static int _splitname(int argc, char **argv, void *data __attribute__((unused))) { struct dmsetup_report_obj obj; int r = 1; @@ -831,7 +831,7 @@ return (uint32_t) value; } -static int _udevflags(int args, char **argv, void *data __attribute((unused))) +static int _udevflags(int args, char **argv, void *data __attribute__((unused))) { uint32_t cookie; uint16_t flags; @@ -873,7 +873,7 @@ return 1; } -static int _udevcomplete(int argc, char **argv, void *data __attribute((unused))) +static int _udevcomplete(int argc, char **argv, void *data __attribute__((unused))) { uint32_t cookie; @@ -899,7 +899,7 @@ static const char _cmd_not_supported[] = "Command not supported. Recompile with \"--enable-udev-sync\" to enable."; static int _udevcreatecookie(int argc, char **argv, - void *data __attribute((unused))) + void *data __attribute__((unused))) { log_error(_cmd_not_supported); @@ -907,21 +907,21 @@ } static int _udevreleasecookie(int argc, char **argv, - void *data __attribute((unused))) + void *data __attribute__((unused))) { log_error(_cmd_not_supported); return 0; } -static int _udevcomplete_all(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused))) +static int _udevcomplete_all(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused))) { log_error(_cmd_not_supported); return 0; } -static int _udevcookies(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused))) +static int _udevcookies(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused))) { log_error(_cmd_not_supported); @@ -996,7 +996,7 @@ } static int _udevcreatecookie(int argc, char **argv, - void *data __attribute((unused))) + void *data __attribute__((unused))) { uint32_t cookie; @@ -1010,7 +1010,7 @@ } static int _udevreleasecookie(int argc, char **argv, - void *data __attribute((unused))) + void *data __attribute__((unused))) { if (argv[1] && !(_udev_cookie = _get_cookie_value(argv[1]))) return 0; @@ -1051,7 +1051,7 @@ return ret; } -static int _udevcomplete_all(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused))) +static int _udevcomplete_all(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused))) { int max_id, id, sid; struct seminfo sinfo; @@ -1100,7 +1100,7 @@ return 1; } -static int _udevcookies(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused))) +static int _udevcookies(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused))) { int max_id, id, sid; struct seminfo sinfo; @@ -1139,7 +1139,7 @@ } #endif /* UDEV_SYNC_SUPPORT */ -static int _version(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused))) +static int _version(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused))) { char version[80]; @@ -1216,22 +1216,22 @@ return r; } -static int _suspend(int argc, char **argv, void *data __attribute((unused))) +static int _suspend(int argc, char **argv, void *data __attribute__((unused))) { return _simple(DM_DEVICE_SUSPEND, argc > 1 ? argv[1] : NULL, 0, 1); } -static int _resume(int argc, char **argv, void *data __attribute((unused))) +static int _resume(int argc, char **argv, void *data __attribute__((unused))) { return _simple(DM_DEVICE_RESUME, argc > 1 ? argv[1] : NULL, 0, 1); } -static int _clear(int argc, char **argv, void *data __attribute((unused))) +static int _clear(int argc, char **argv, void *data __attribute__((unused))) { return _simple(DM_DEVICE_CLEAR, argc > 1 ? argv[1] : NULL, 0, 1); } -static int _wait(int argc, char **argv, void *data __attribute((unused))) +static int _wait(int argc, char **argv, void *data __attribute__((unused))) { const char *name = NULL; @@ -1325,7 +1325,7 @@ return size; } -static int _error_device(int argc __attribute((unused)), char **argv __attribute((unused)), void *data) +static int _error_device(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data) { struct dm_names *names = (struct dm_names *) data; struct dm_task *dmt; @@ -1373,7 +1373,7 @@ return r; } -static int _remove(int argc, char **argv, void *data __attribute((unused))) +static int _remove(int argc, char **argv, void *data __attribute__((unused))) { int r; @@ -1383,14 +1383,14 @@ return _simple(DM_DEVICE_REMOVE, argc > 1 ? argv[1] : NULL, 0, 0); } -static int _count_devices(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused))) +static int _count_devices(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused))) { _num_devices++; return 1; } -static int _remove_all(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused))) +static int _remove_all(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused))) { int r; @@ -1428,7 +1428,7 @@ printf("%s\t(%u, %u)\n", name, info.major, info.minor); } -static int _mknodes(int argc, char **argv, void *data __attribute((unused))) +static int _mknodes(int argc, char **argv, void *data __attribute__((unused))) { return dm_mknodes(argc > 1 ? argv[1] : NULL); } @@ -1599,7 +1599,7 @@ } /* Show target names and their version numbers */ -static int _targets(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused))) +static int _targets(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data __attribute__((unused))) { int r = 0; struct dm_task *dmt; @@ -1739,7 +1739,7 @@ return r; } -static int _display_name(int argc __attribute((unused)), char **argv __attribute((unused)), void *data) +static int _display_name(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data) { struct dm_names *names = (struct dm_names *) data; @@ -1962,7 +1962,7 @@ } static void _display_tree_node(struct dm_tree_node *node, unsigned depth, - unsigned first_child __attribute((unused)), + unsigned first_child __attribute__((unused)), unsigned last_child, unsigned has_children) { int offset; @@ -2054,7 +2054,7 @@ } } -static int _add_dep(int argc __attribute((unused)), char **argv __attribute((unused)), void *data) +static int _add_dep(int argc __attribute__((unused)), char **argv __attribute__((unused)), void *data) { struct dm_names *names = (struct dm_names *) data; @@ -2081,9 +2081,9 @@ return 1; } -static int _display_tree(int argc __attribute((unused)), - char **argv __attribute((unused)), - void *data __attribute((unused))) +static int _display_tree(int argc __attribute__((unused)), + char **argv __attribute__((unused)), + void *data __attribute__((unused))) { if (!_build_whole_deptree()) return 0; @@ -2100,9 +2100,9 @@ /* dm specific display functions */ static int _int32_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { const int32_t value = *(const int32_t *)data; @@ -2110,9 +2110,9 @@ } static int _uint32_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { const uint32_t value = *(const int32_t *)data; @@ -2120,9 +2120,9 @@ } static int _dm_name_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { const char *name = dm_task_get_name((const struct dm_task *) data); @@ -2130,9 +2130,9 @@ } static int _dm_uuid_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, - const void *data, void *private __attribute((unused))) + const void *data, void *private __attribute__((unused))) { const char *uuid = dm_task_get_uuid((const struct dm_task *) data); @@ -2143,9 +2143,9 @@ } static int _dm_read_ahead_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { uint32_t value; @@ -2156,9 +2156,9 @@ } static int _dm_info_status_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { char buf[5]; const char *s = buf; @@ -2174,10 +2174,10 @@ } static int _dm_info_table_loaded_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { const struct dm_info *info = data; @@ -2198,10 +2198,10 @@ } static int _dm_info_suspended_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { const struct dm_info *info = data; @@ -2214,10 +2214,10 @@ } static int _dm_info_read_only_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { const struct dm_info *info = data; @@ -2431,35 +2431,35 @@ } static int _dm_subsystem_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { return dm_report_field_string(rh, field, (const char **) data); } static int _dm_vg_name_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { return dm_report_field_string(rh, field, (const char **) data); } static int _dm_lv_name_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { return dm_report_field_string(rh, field, (const char **) data); } static int _dm_lv_layer_name_disp(struct dm_report *rh, - struct dm_pool *mem __attribute((unused)), + struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, - void *private __attribute((unused))) + void *private __attribute__((unused))) { return dm_report_field_string(rh, field, (const char **) data); @@ -2743,9 +2743,9 @@ "[-o offset] [-f|loop_device] [file]\n\n"); } -static int _help(int argc __attribute((unused)), - char **argv __attribute((unused)), - void *data __attribute((unused))) +static int _help(int argc __attribute__((unused)), + char **argv __attribute__((unused)), + void *data __attribute__((unused))) { _usage(stderr); @@ -2899,7 +2899,7 @@ * create a table for a mapped device using the loop target. */ static int _loop_table(char *table, size_t tlen, char *file, - char *dev __attribute((unused)), off_t off) + char *dev __attribute__((unused)), off_t off) { struct stat fbuf; off_t size, sectors; --- LVM2/tools/formats.c 2008/01/30 14:00:01 1.4 +++ LVM2/tools/formats.c 2010/07/09 15:34:48 1.5 @@ -15,8 +15,8 @@ #include "tools.h" -int formats(struct cmd_context *cmd, int argc __attribute((unused)), - char **argv __attribute((unused))) +int formats(struct cmd_context *cmd, int argc __attribute__((unused)), + char **argv __attribute__((unused))) { display_formats(cmd); --- LVM2/tools/lvchange.c 2010/06/28 19:10:16 1.121 +++ LVM2/tools/lvchange.c 2010/07/09 15:34:48 1.122 @@ -515,7 +515,7 @@ } static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { int doit = 0, docmds = 0; int dmeventd_mode, archived = 0; --- LVM2/tools/lvconvert.c 2010/07/06 17:02:03 1.137 +++ LVM2/tools/lvconvert.c 2010/07/09 15:34:48 1.138 @@ -326,7 +326,7 @@ static struct volume_group *_get_lvconvert_vg(struct cmd_context *cmd, const char *name, - const char *uuid __attribute((unused))) + const char *uuid __attribute__((unused))) { dev_close_all(); @@ -338,11 +338,11 @@ NULL, 0); } -static struct logical_volume *_get_lvconvert_lv(struct cmd_context *cmd __attribute((unused)), +static struct logical_volume *_get_lvconvert_lv(struct cmd_context *cmd __attribute__((unused)), struct volume_group *vg, const char *name, const char *uuid, - uint32_t lv_type __attribute((unused))) + uint32_t lv_type __attribute__((unused))) { struct logical_volume *lv = find_lv(vg, name); @@ -355,7 +355,7 @@ static int _finish_lvconvert_mirror(struct cmd_context *cmd, struct volume_group *vg, struct logical_volume *lv, - struct dm_list *lvs_changed __attribute((unused))) + struct dm_list *lvs_changed __attribute__((unused))) { int r = 0; @@ -402,7 +402,7 @@ static int _finish_lvconvert_merge(struct cmd_context *cmd, struct volume_group *vg, struct logical_volume *lv, - struct dm_list *lvs_changed __attribute((unused))) + struct dm_list *lvs_changed __attribute__((unused))) { struct lv_segment *snap_seg = find_merging_cow(lv); if (!snap_seg) { @@ -422,7 +422,7 @@ static progress_t _poll_merge_progress(struct cmd_context *cmd, struct logical_volume *lv, - const char *name __attribute((unused)), + const char *name __attribute__((unused)), struct daemon_parms *parms) { float percent = 0.0; @@ -605,7 +605,7 @@ } static int _is_partial_lv(struct logical_volume *lv, - void *baton __attribute((unused))) + void *baton __attribute__((unused))) { return lv->status & PARTIAL_LV; } --- LVM2/tools/lvcreate.c 2010/05/11 21:40:11 1.222 +++ LVM2/tools/lvcreate.c 2010/07/09 15:34:48 1.223 @@ -236,7 +236,7 @@ * Generic mirror parameter checks. * FIXME: Should eventually be moved into lvm library. */ -static int _validate_mirror_params(const struct cmd_context *cmd __attribute((unused)), +static int _validate_mirror_params(const struct cmd_context *cmd __attribute__((unused)), const struct lvcreate_params *lp) { int pagesize = lvm_getpagesize(); --- LVM2/tools/lvm-static.c 2009/01/20 20:37:41 1.8 +++ LVM2/tools/lvm-static.c 2010/07/09 15:34:48 1.9 @@ -22,8 +22,8 @@ return lvm2_main(argc, argv); } -int lvm_shell(struct cmd_context *cmd __attribute((unused)), - struct cmdline_context *cmdline __attribute((unused))) +int lvm_shell(struct cmd_context *cmd __attribute__((unused)), + struct cmdline_context *cmdline __attribute__((unused))) { return 0; } --- LVM2/tools/lvm.c 2010/07/01 11:04:58 1.112 +++ LVM2/tools/lvm.c 2010/07/09 15:34:48 1.113 @@ -122,7 +122,7 @@ /* Custom completion function */ static char **_completion(const char *text, int start_pos, - int end_pos __attribute((unused))) + int end_pos __attribute__((unused))) { char **match_list = NULL; int p = 0; --- LVM2/tools/lvm2cmd.c 2008/01/31 12:19:36 1.4 +++ LVM2/tools/lvm2cmd.c 2010/07/09 15:34:48 1.5 @@ -20,8 +20,8 @@ return cmdlib_lvm2_init(0); } -int lvm_shell(struct cmd_context *cmd __attribute((unused)), - struct cmdline_context *cmdline __attribute((unused))) +int lvm_shell(struct cmd_context *cmd __attribute__((unused)), + struct cmdline_context *cmdline __attribute__((unused))) { return 0; } --- LVM2/tools/lvmchange.c 2009/12/03 19:18:34 1.9 +++ LVM2/tools/lvmchange.c 2010/07/09 15:34:48 1.10 @@ -15,8 +15,8 @@ #include "tools.h" -int lvmchange(struct cmd_context *cmd __attribute((unused)), - int argc __attribute((unused)), char **argv __attribute((unused))) +int lvmchange(struct cmd_context *cmd __attribute__((unused)), + int argc __attribute__((unused)), char **argv __attribute__((unused))) { log_error("With LVM2 and the device mapper, this program is obsolete."); return ECMD_FAILED; --- LVM2/tools/lvmcmdline.c 2010/06/30 20:21:03 1.126 +++ LVM2/tools/lvmcmdline.c 2010/07/09 15:34:48 1.127 @@ -60,7 +60,7 @@ /* Command line args */ /* FIXME: Move static _the_args into cmd? */ -unsigned arg_count(const struct cmd_context *cmd __attribute((unused)), int a) +unsigned arg_count(const struct cmd_context *cmd __attribute__((unused)), int a) { return _the_args[a].count; } @@ -70,7 +70,7 @@ return arg_count(cmd, a) ? 1 : 0; } -const char *arg_value(struct cmd_context *cmd __attribute((unused)), int a) +const char *arg_value(struct cmd_context *cmd __attribute__((unused)), int a) { return _the_args[a].value; } @@ -117,12 +117,12 @@ return arg_count(cmd, a) ? _the_args[a].percent : def; } -int arg_count_increment(struct cmd_context *cmd __attribute((unused)), int a) +int arg_count_increment(struct cmd_context *cmd __attribute__((unused)), int a) { return _the_args[a].count++; } -int yes_no_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a) +int yes_no_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a) { a->sign = SIGN_NONE; a->percent = PERCENT_NONE; @@ -143,7 +143,7 @@ return 1; } -int yes_no_excl_arg(struct cmd_context *cmd __attribute((unused)), +int yes_no_excl_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a) { a->sign = SIGN_NONE; @@ -225,7 +225,7 @@ } /* Size stored in sectors */ -static int _size_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a, int factor) +static int _size_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a, int factor) { char *ptr; int i; @@ -307,7 +307,7 @@ return _size_arg(cmd, a, 2048); } -int int_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a) +int int_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a) { char *ptr; @@ -317,7 +317,7 @@ return 1; } -int int_arg_with_sign(struct cmd_context *cmd __attribute((unused)), struct arg *a) +int int_arg_with_sign(struct cmd_context *cmd __attribute__((unused)), struct arg *a) { char *ptr; @@ -327,7 +327,7 @@ return 1; } -int int_arg_with_sign_and_percent(struct cmd_context *cmd __attribute((unused)), +int int_arg_with_sign_and_percent(struct cmd_context *cmd __attribute__((unused)), struct arg *a) { char *ptr; @@ -360,7 +360,7 @@ return 1; } -int minor_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a) +int minor_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a) { char *ptr; @@ -375,7 +375,7 @@ return 1; } -int major_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a) +int major_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a) { char *ptr; @@ -392,13 +392,13 @@ return 1; } -int string_arg(struct cmd_context *cmd __attribute((unused)), - struct arg *a __attribute((unused))) +int string_arg(struct cmd_context *cmd __attribute__((unused)), + struct arg *a __attribute__((unused))) { return 1; } -int tag_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a) +int tag_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a) { char *pos = a->value; @@ -413,7 +413,7 @@ return 1; } -int permission_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a) +int permission_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a) { a->sign = SIGN_NONE; @@ -429,7 +429,7 @@ return 1; } -int alloc_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a) +int alloc_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a) { alloc_policy_t alloc; @@ -452,7 +452,7 @@ /* * Positive integer, zero or "auto". */ -int readahead_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a) +int readahead_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a) { if (!strcasecmp(a->value, "auto")) { a->ui_value = DM_READ_AHEAD_AUTO; @@ -476,7 +476,7 @@ /* * Non-zero, positive integer, "all", or "unmanaged" */ -int metadatacopies_arg(struct cmd_context *cmd __attribute((unused)), +int metadatacopies_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a) { if (!strncmp(cmd->command->name, "vg", 2)) { @@ -763,9 +763,9 @@ return 1; } -int version(struct cmd_context *cmd __attribute((unused)), - int argc __attribute((unused)), - char **argv __attribute((unused))) +int version(struct cmd_context *cmd __attribute__((unused)), + int argc __attribute__((unused)), + char **argv __attribute__((unused))) { char vsn[80]; @@ -890,7 +890,7 @@ } } -int help(struct cmd_context *cmd __attribute((unused)), int argc, char **argv) +int help(struct cmd_context *cmd __attribute__((unused)), int argc, char **argv) { int ret = ECMD_PROCESSED; --- LVM2/tools/lvmdiskscan.c 2007/08/20 20:55:30 1.20 +++ LVM2/tools/lvmdiskscan.c 2010/07/09 15:34:48 1.21 @@ -91,8 +91,8 @@ return 1; } -int lvmdiskscan(struct cmd_context *cmd, int argc __attribute((unused)), - char **argv __attribute((unused))) +int lvmdiskscan(struct cmd_context *cmd, int argc __attribute__((unused)), + char **argv __attribute__((unused))) { uint64_t size; struct dev_iter *iter; --- LVM2/tools/lvremove.c 2010/04/23 19:27:11 1.60 +++ LVM2/tools/lvremove.c 2010/07/09 15:34:48 1.61 @@ -16,7 +16,7 @@ #include "tools.h" static int lvremove_single(struct cmd_context *cmd, struct logical_volume *lv, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { struct logical_volume *origin; --- LVM2/tools/lvscan.c 2009/10/01 00:35:30 1.40 +++ LVM2/tools/lvscan.c 2010/07/09 15:34:48 1.41 @@ -16,7 +16,7 @@ #include "tools.h" static int lvscan_single(struct cmd_context *cmd, struct logical_volume *lv, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { struct lvinfo info; int lv_total = 0; --- LVM2/tools/polldaemon.c 2010/04/13 01:43:56 1.33 +++ LVM2/tools/polldaemon.c 2010/07/09 15:34:48 1.34 @@ -19,7 +19,7 @@ #include #include -static void _sigchld_handler(int sig __attribute((unused))) +static void _sigchld_handler(int sig __attribute__((unused))) { while (wait4(-1, NULL, WNOHANG | WUNTRACED, NULL) > 0) ; } --- LVM2/tools/pvchange.c 2010/07/07 21:30:07 1.82 +++ LVM2/tools/pvchange.c 2010/07/09 15:34:48 1.83 @@ -19,7 +19,7 @@ static int _pvchange_single(struct cmd_context *cmd, struct volume_group *vg, struct physical_volume *pv, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { uint32_t orig_pe_alloc_count; /* FIXME Next three only required for format1. */ @@ -29,7 +29,7 @@ const char *pv_name = pv_dev_name(pv); const char *tag = NULL; const char *orig_vg_name; - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); int allocatable = 0; int tagarg = 0; --- LVM2/tools/pvmove.c 2010/05/24 15:32:21 1.77 +++ LVM2/tools/pvmove.c 2010/07/09 15:34:48 1.78 @@ -596,7 +596,7 @@ static struct volume_group *_get_move_vg(struct cmd_context *cmd, const char *name, - const char *uuid __attribute((unused))) + const char *uuid __attribute__((unused))) { struct physical_volume *pv; --- LVM2/tools/pvremove.c 2009/12/03 19:18:34 1.27 +++ LVM2/tools/pvremove.c 2010/07/09 15:34:48 1.28 @@ -90,7 +90,7 @@ } static int pvremove_single(struct cmd_context *cmd, const char *pv_name, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { struct device *dev; int ret = ECMD_FAILED; --- LVM2/tools/pvscan.c 2010/05/07 15:24:18 1.51 +++ LVM2/tools/pvscan.c 2010/07/09 15:34:48 1.52 @@ -20,9 +20,9 @@ static void _pvscan_display_single(struct cmd_context *cmd, struct physical_volume *pv, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); unsigned vg_name_len = 0; char pv_tmp_name[NAME_LEN] = { 0, }; @@ -96,8 +96,8 @@ pv_pe_size(pv))); } -int pvscan(struct cmd_context *cmd, int argc __attribute((unused)), - char **argv __attribute((unused))) +int pvscan(struct cmd_context *cmd, int argc __attribute__((unused)), + char **argv __attribute__((unused))) { int new_pvs_found = 0; int pvs_found = 0; --- LVM2/tools/reporter.c 2010/06/17 13:15:52 1.61 +++ LVM2/tools/reporter.c 2010/07/09 15:34:48 1.62 @@ -16,7 +16,7 @@ #include "tools.h" #include "report.h" -static int _vgs_single(struct cmd_context *cmd __attribute((unused)), +static int _vgs_single(struct cmd_context *cmd __attribute__((unused)), const char *vg_name, struct volume_group *vg, void *handle) { @@ -41,7 +41,7 @@ return ECMD_PROCESSED; } -static int _segs_single(struct cmd_context *cmd __attribute((unused)), +static int _segs_single(struct cmd_context *cmd __attribute__((unused)), struct lv_segment *seg, void *handle) { if (!report_object(handle, seg->lv->vg, seg->lv, NULL, seg, NULL)) { @@ -133,7 +133,7 @@ int ret = ECMD_PROCESSED; const char *vg_name = NULL; struct volume_group *old_vg = vg; - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); if (is_pv(pv) && !is_orphan(pv) && !vg) { vg_name = pv_vg_name(pv); --- LVM2/tools/segtypes.c 2008/01/30 14:00:02 1.4 +++ LVM2/tools/segtypes.c 2010/07/09 15:34:48 1.5 @@ -15,8 +15,8 @@ #include "tools.h" -int segtypes(struct cmd_context *cmd, int argc __attribute((unused)), - char **argv __attribute((unused))) +int segtypes(struct cmd_context *cmd, int argc __attribute__((unused)), + char **argv __attribute__((unused))) { display_segtypes(cmd); --- LVM2/tools/stub.h 2007/08/20 20:55:30 1.46 +++ LVM2/tools/stub.h 2010/07/09 15:34:48 1.47 @@ -17,23 +17,23 @@ log_error("Command not implemented yet."); return ECMD_FAILED /*int e2fsadm(struct cmd_context *cmd, int argc, char **argv) unimplemented*/ -int lvmsadc(struct cmd_context *cmd __attribute((unused)), - int argc __attribute((unused)), - char **argv __attribute((unused))) +int lvmsadc(struct cmd_context *cmd __attribute__((unused)), + int argc __attribute__((unused)), + char **argv __attribute__((unused))) { unimplemented; } -int lvmsar(struct cmd_context *cmd __attribute((unused)), - int argc __attribute((unused)), - char **argv __attribute((unused))) +int lvmsar(struct cmd_context *cmd __attribute__((unused)), + int argc __attribute__((unused)), + char **argv __attribute__((unused))) { unimplemented; } -int pvdata(struct cmd_context *cmd __attribute((unused)), - int argc __attribute((unused)), - char **argv __attribute((unused))) +int pvdata(struct cmd_context *cmd __attribute__((unused)), + int argc __attribute__((unused)), + char **argv __attribute__((unused))) { log_error("There's no 'pvdata' command in LVM2."); log_error("Use lvs, pvs, vgs instead; or use vgcfgbackup and read the text file backup."); --- LVM2/tools/tools.h 2010/06/30 20:21:03 1.70 +++ LVM2/tools/tools.h 2010/07/09 15:34:48 1.71 @@ -152,7 +152,7 @@ int segtype_arg(struct cmd_context *cmd, struct arg *a); int alloc_arg(struct cmd_context *cmd, struct arg *a); int readahead_arg(struct cmd_context *cmd, struct arg *a); -int metadatacopies_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a); +int metadatacopies_arg(struct cmd_context *cmd __attribute__((unused)), struct arg *a); /* we use the enums to access the switches */ unsigned arg_count(const struct cmd_context *cmd, int a); --- LVM2/tools/vgchange.c 2010/06/30 20:03:53 1.108 +++ LVM2/tools/vgchange.c 2010/07/09 15:34:48 1.109 @@ -476,7 +476,7 @@ return ECMD_PROCESSED; } -static int _vgchange_uuid(struct cmd_context *cmd __attribute((unused)), +static int _vgchange_uuid(struct cmd_context *cmd __attribute__((unused)), struct volume_group *vg) { struct lv_list *lvl; @@ -564,7 +564,7 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name, struct volume_group *vg, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { int dmeventd_mode, r = ECMD_FAILED; --- LVM2/tools/vgck.c 2009/09/15 01:38:59 1.25 +++ LVM2/tools/vgck.c 2010/07/09 15:34:48 1.26 @@ -16,10 +16,10 @@ #include "tools.h" #include "metadata.h" -static int vgck_single(struct cmd_context *cmd __attribute((unused)), +static int vgck_single(struct cmd_context *cmd __attribute__((unused)), const char *vg_name, struct volume_group *vg, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { if (!vg_check_status(vg, EXPORTED_VG)) { stack; --- LVM2/tools/vgconvert.c 2010/07/08 18:24:30 1.42 +++ LVM2/tools/vgconvert.c 2010/07/09 15:34:48 1.43 @@ -17,7 +17,7 @@ static int vgconvert_single(struct cmd_context *cmd, const char *vg_name, struct volume_group *vg, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { struct physical_volume *pv, *existing_pv; struct logical_volume *lv; --- LVM2/tools/vgdisplay.c 2010/05/21 12:21:52 1.28 +++ LVM2/tools/vgdisplay.c 2010/07/09 15:34:48 1.29 @@ -17,7 +17,7 @@ static int vgdisplay_single(struct cmd_context *cmd, const char *vg_name, struct volume_group *vg, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { /* FIXME Do the active check here if activevolumegroups_ARG ? */ vg_check_status(vg, EXPORTED_VG); --- LVM2/tools/vgexport.c 2009/09/15 01:38:59 1.23 +++ LVM2/tools/vgexport.c 2010/07/09 15:34:48 1.24 @@ -15,10 +15,10 @@ #include "tools.h" -static int vgexport_single(struct cmd_context *cmd __attribute((unused)), +static int vgexport_single(struct cmd_context *cmd __attribute__((unused)), const char *vg_name, struct volume_group *vg, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { struct pv_list *pvl; struct physical_volume *pv; --- LVM2/tools/vgimport.c 2009/09/15 01:38:59 1.23 +++ LVM2/tools/vgimport.c 2010/07/09 15:34:48 1.24 @@ -15,10 +15,10 @@ #include "tools.h" -static int vgimport_single(struct cmd_context *cmd __attribute((unused)), +static int vgimport_single(struct cmd_context *cmd __attribute__((unused)), const char *vg_name, struct volume_group *vg, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { struct pv_list *pvl; struct physical_volume *pv; --- LVM2/tools/vgmerge.c 2010/06/28 20:39:08 1.68 +++ LVM2/tools/vgmerge.c 2010/07/09 15:34:48 1.69 @@ -92,7 +92,7 @@ /* Fix up LVIDs */ dm_list_iterate_items(lvl1, &vg_to->lvs) { union lvid *lvid1 = &lvl1->lv->lvid; - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); dm_list_iterate_items(lvl2, &vg_from->lvs) { union lvid *lvid2 = &lvl2->lv->lvid; --- LVM2/tools/vgmknodes.c 2009/09/14 22:47:50 1.8 +++ LVM2/tools/vgmknodes.c 2010/07/09 15:34:48 1.9 @@ -16,7 +16,7 @@ #include "tools.h" static int _vgmknodes_single(struct cmd_context *cmd, struct logical_volume *lv, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { if (arg_count(cmd, refresh_ARG) && lv_is_visible(lv)) if (!lv_refresh(cmd, lv)) { --- LVM2/tools/vgreduce.c 2010/04/13 17:26:20 1.102 +++ LVM2/tools/vgreduce.c 2010/07/09 15:34:48 1.103 @@ -18,7 +18,7 @@ static int _remove_pv(struct volume_group *vg, struct pv_list *pvl, int silent) { - char uuid[64] __attribute((aligned(8))); + char uuid[64] __attribute__((aligned(8))); if (vg->pv_count == 1) { log_error("Volume Groups must always contain at least one PV"); @@ -376,7 +376,7 @@ /* Or take pv_name instead? */ static int _vgreduce_single(struct cmd_context *cmd, struct volume_group *vg, struct physical_volume *pv, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { struct pv_list *pvl; struct volume_group *orphan_vg = NULL; --- LVM2/tools/vgremove.c 2010/06/30 18:03:53 1.61 +++ LVM2/tools/vgremove.c 2010/07/09 15:34:48 1.62 @@ -17,7 +17,7 @@ static int vgremove_single(struct cmd_context *cmd, const char *vg_name, struct volume_group *vg, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { unsigned lv_count, missing; force_t force; --- LVM2/tools/vgscan.c 2009/09/15 01:38:59 1.37 +++ LVM2/tools/vgscan.c 2010/07/09 15:34:48 1.38 @@ -17,7 +17,7 @@ static int vgscan_single(struct cmd_context *cmd, const char *vg_name, struct volume_group *vg, - void *handle __attribute((unused))) + void *handle __attribute__((unused))) { log_print("Found %svolume group \"%s\" using metadata type %s", vg_is_exported(vg) ? "exported " : "", vg_name, From wysochanski@sourceware.org Fri Jul 9 16:57:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Fri, 09 Jul 2010 16:57:00 -0000 Subject: LVM2/lib/metadata metadata.c Message-ID: <20100709165744.19714.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-09 16:57:44 Modified files: lib/metadata : metadata.c Log message: Add log_error when strdup fails in {vg|lv}_change_tag(). Signed-off-by: Dave Wysochanski Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.388&r2=1.389 --- LVM2/lib/metadata/metadata.c 2010/07/09 15:34:45 1.388 +++ LVM2/lib/metadata/metadata.c 2010/07/09 16:57:44 1.389 @@ -723,7 +723,9 @@ if (add_tag) { if (!(tag_new = dm_pool_strdup(lv->vg->vgmem, tag))) { - return_0; + log_error("Failed to duplicate tag %s from %s/%s", + tag, lv->vg->name, lv->name); + return 0; } if (!str_list_add(lv->vg->vgmem, &lv->tags, tag_new)) { log_error("Failed to add tag %s to %s/%s", @@ -751,7 +753,9 @@ if (add_tag) { if (!(tag_new = dm_pool_strdup(vg->vgmem, tag))) { - return_0; + log_error("Failed to duplicate tag %s from %s", + tag, vg->name); + return 0; } if (!str_list_add(vg->vgmem, &vg->tags, tag_new)) { log_error("Failed to add tag %s to volume group %s", From wysochanski@sourceware.org Fri Jul 9 16:57:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Fri, 09 Jul 2010 16:57:00 -0000 Subject: LVM2/liblvm lvm_lv.c lvm_misc.c lvm_misc.h lvm ... Message-ID: <20100709165735.19125.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-09 16:57:34 Modified files: liblvm : lvm_lv.c lvm_misc.c lvm_misc.h lvm_vg.c Log message: Remove unnecessary list of includes in liblvm files. Signed-off-by: Dave Wysochanski Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm_lv.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm_misc.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm_misc.h.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm_vg.c.diff?cvsroot=lvm2&r1=1.42&r2=1.43 --- LVM2/liblvm/lvm_lv.c 2010/07/09 15:34:47 1.23 +++ LVM2/liblvm/lvm_lv.c 2010/07/09 16:57:34 1.24 @@ -22,8 +22,6 @@ #include "activate.h" #include "lvm_misc.h" -#include - static int _lv_check_handle(const lv_t lv, const int vg_writeable) { if (!lv || !lv->vg || vg_read_error(lv->vg)) --- LVM2/liblvm/lvm_misc.c 2010/02/24 18:16:54 1.1 +++ LVM2/liblvm/lvm_misc.c 2010/07/09 16:57:34 1.2 @@ -12,7 +12,9 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "lvm2app.h" #include "lvm_misc.h" +#include "lib.h" struct dm_list *tag_list_copy(struct dm_pool *p, struct dm_list *tag_list) { --- LVM2/liblvm/lvm_misc.h 2010/02/24 18:16:54 1.1 +++ LVM2/liblvm/lvm_misc.h 2010/07/09 16:57:34 1.2 @@ -14,15 +14,7 @@ #ifndef _LVM2APP_MISC_H #define _LVM2APP_MISC_H -#include "lib.h" -#include "lvm2app.h" -#include "toolcontext.h" -#include "metadata-exported.h" -#include "archiver.h" -#include "locking.h" -#include "lvm-string.h" -#include "lvmcache.h" -#include "metadata.h" +#include "libdevmapper.h" struct dm_list *tag_list_copy(struct dm_pool *p, struct dm_list *tag_list); --- LVM2/liblvm/lvm_vg.c 2010/07/09 15:34:47 1.42 +++ LVM2/liblvm/lvm_vg.c 2010/07/09 16:57:34 1.43 @@ -15,17 +15,12 @@ #include "lib.h" #include "lvm2app.h" #include "toolcontext.h" -#include "metadata-exported.h" +#include "metadata.h" #include "archiver.h" #include "locking.h" -#include "lvm-string.h" #include "lvmcache.h" -#include "metadata.h" #include "lvm_misc.h" -#include -#include - int lvm_vg_add_tag(vg_t vg, const char *tag) { if (vg_read_error(vg)) From wysochanski@sourceware.org Fri Jul 9 17:01:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Fri, 09 Jul 2010 17:01:00 -0000 Subject: LVM2 WHATS_NEW Message-ID: <20100709170112.22886.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-09 17:01:12 Modified files: . : WHATS_NEW Log message: Update WHATS_NEW Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1662&r2=1.1663 --- LVM2/WHATS_NEW 2010/07/09 15:34:40 1.1662 +++ LVM2/WHATS_NEW 2010/07/09 17:01:11 1.1663 @@ -1,7 +1,11 @@ Version 2.02.71 - =============================== + Add log_error when strdup fails in {vg|lv}_change_tag(). + Remove unnecessary includes in liblvm files. Use __attribute__ consistently throughout. Fix redundant declarations and always compile with -Wredundant-decls. + Pass metadataignore to pv_create, pv_setup, _mda_setup, and add_mda. + Init mda->list in mda_copy. Fix possible hang when all mirror images of a mirrored log fail. Do not log backtrace in valid _lv_resume() code path. Cleanup help strings in configure.in. From jbrassow@sourceware.org Fri Jul 9 17:57:00 2010 From: jbrassow@sourceware.org (jbrassow@sourceware.org) Date: Fri, 09 Jul 2010 17:57:00 -0000 Subject: LVM2/lib/metadata mirror.c Message-ID: <20100709175752.32205.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2010-07-09 17:57:52 Modified files: lib/metadata : mirror.c Log message: Failed to test for the case where a log was requested to be removed even though there was no log. A simple run through the in-tree test suite would have caught this. :( - if (lv_is_mirrored(detached_log_lv) && + if (detached_log_lv && lv_is_mirrored(detached_log_lv) && Also, made some cosmetic changes suggested by kabi after my last check-in (e.g. s/return 0/return_0/ and adding an error message). Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.124&r2=1.125 --- LVM2/lib/metadata/mirror.c 2010/07/09 15:34:45 1.124 +++ LVM2/lib/metadata/mirror.c 2010/07/09 17:57:51 1.125 @@ -879,7 +879,7 @@ * have failed, we must replace with error target - it is * the only way to release the pending writes. */ - if (lv_is_mirrored(detached_log_lv) && + if (detached_log_lv && lv_is_mirrored(detached_log_lv) && (detached_log_lv->status & PARTIAL_LV)) { struct lv_segment *seg = first_seg(detached_log_lv); @@ -896,8 +896,10 @@ seg_lv(seg, m)->status &= ~MIRROR_IMAGE; lv_set_visible(seg_lv(seg, m)); if (!(lvl = dm_pool_alloc(lv->vg->cmd->mem, - sizeof(*lvl)))) + sizeof(*lvl)))) { + log_error("dm_pool_alloc failed"); return 0; + } lvl->lv = seg_lv(seg, m); dm_list_add(&tmp_orphan_lvs, &lvl->list); } @@ -905,7 +907,7 @@ if (!replace_lv_with_error_segment(detached_log_lv)) { log_error("Failed error target substitution for %s", detached_log_lv->name); - return_0; + return 0; } if (!vg_write(detached_log_lv->vg)) { @@ -926,7 +928,7 @@ if (!resume_lv(detached_log_lv->vg->cmd, detached_log_lv)) - return 0; + return_0; } } From prajnoha@sourceware.org Mon Jul 12 11:37:00 2010 From: prajnoha@sourceware.org (prajnoha@sourceware.org) Date: Mon, 12 Jul 2010 11:37:00 -0000 Subject: LVM2 ./WHATS_NEW lib/activate/activate.c Message-ID: <20100712113750.27091.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: prajnoha@sourceware.org 2010-07-12 11:37:50 Modified files: . : WHATS_NEW lib/activate : activate.c Log message: Add more verbose messages while checking volume_list and hosttags settings. This should bring less confusion when there are some settings left and people just forgot about it and then they run into problems. These messages should give them a hint of what's really going on. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1663&r2=1.1664 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.171&r2=1.172 --- LVM2/WHATS_NEW 2010/07/09 17:01:11 1.1663 +++ LVM2/WHATS_NEW 2010/07/12 11:37:49 1.1664 @@ -1,5 +1,6 @@ Version 2.02.71 - =============================== + Add more verbose messages while checking volume_list and hosttags settings. Add log_error when strdup fails in {vg|lv}_change_tag(). Remove unnecessary includes in liblvm files. Use __attribute__ consistently throughout. --- LVM2/lib/activate/activate.c 2010/07/08 12:24:04 1.171 +++ LVM2/lib/activate/activate.c 2010/07/12 11:37:50 1.172 @@ -262,6 +262,9 @@ char path[PATH_MAX]; if (!(cn = find_config_tree_node(cmd, "activation/volume_list"))) { + log_verbose("activation/volume_list configuration setting " + "not defined, checking host tags only"); + /* If no host tags defined, activate */ if (dm_list_empty(&cmd->tags)) return 1; @@ -271,11 +274,18 @@ str_list_match_list(&cmd->tags, &lv->vg->tags)) return 1; + log_verbose("No host tag matches %s/%s", + lv->vg->name, lv->name); + /* Don't activate */ return 0; } for (cv = cn->v; cv; cv = cv->next) { + log_verbose("activation/volume_list configuration setting " + "defined, checking the list to match %s/%s", + lv->vg->name, lv->name); + if (cv->type != CFG_STRING) { log_error("Ignoring invalid string in config file " "activation/volume_list"); @@ -330,6 +340,9 @@ return 1; } + log_verbose("No item supplied in activation/volume_list configuration " + "setting matches %s/%s", lv->vg->name, lv->name); + return 0; } From prajnoha@sourceware.org Mon Jul 12 12:38:00 2010 From: prajnoha@sourceware.org (prajnoha@sourceware.org) Date: Mon, 12 Jul 2010 12:38:00 -0000 Subject: LVM2/lib/activate activate.c Message-ID: <20100712123836.1759.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: prajnoha@sourceware.org 2010-07-12 12:38:35 Modified files: lib/activate : activate.c Log message: Addendum for previous patch - show VG/LV name everywhere so the messages are consistent. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.172&r2=1.173 --- LVM2/lib/activate/activate.c 2010/07/12 11:37:50 1.172 +++ LVM2/lib/activate/activate.c 2010/07/12 12:38:35 1.173 @@ -263,7 +263,8 @@ if (!(cn = find_config_tree_node(cmd, "activation/volume_list"))) { log_verbose("activation/volume_list configuration setting " - "not defined, checking host tags only"); + "not defined, checking only host tags for %s/%s", + lv->vg->name, lv->name); /* If no host tags defined, activate */ if (dm_list_empty(&cmd->tags)) From wysochanski@sourceware.org Mon Jul 12 18:12:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Mon, 12 Jul 2010 18:12:00 -0000 Subject: LVM2 ./WHATS_NEW liblvm/lvm2app.h Message-ID: <20100712181225.17641.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-12 18:12:24 Modified files: . : WHATS_NEW liblvm : lvm2app.h Log message: Update comments about memory handling in lvm2app.h. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1664&r2=1.1665 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm2app.h.diff?cvsroot=lvm2&r1=1.17&r2=1.18 --- LVM2/WHATS_NEW 2010/07/12 11:37:49 1.1664 +++ LVM2/WHATS_NEW 2010/07/12 18:12:23 1.1665 @@ -1,5 +1,6 @@ Version 2.02.71 - =============================== + Update comments about memory handling in lvm2app.h. Add more verbose messages while checking volume_list and hosttags settings. Add log_error when strdup fails in {vg|lv}_change_tag(). Remove unnecessary includes in liblvm files. --- LVM2/liblvm/lvm2app.h 2010/06/16 13:01:25 1.17 +++ LVM2/liblvm/lvm2app.h 2010/07/12 18:12:23 1.18 @@ -929,8 +929,8 @@ * * \memberof lv_t * - * Memory is allocated using dm_malloc() and caller must free the memory - * using dm_free(). + * The memory allocated for the uuid is tied to the vg_t handle and will be + * released when lvm_vg_close() is called. * * \param lv * Logical volume handle. @@ -945,8 +945,8 @@ * * \memberof lv_t * - * Memory is allocated using dm_malloc() and caller must free the memory - * using dm_free(). + * The memory allocated for the uuid is tied to the vg_t handle and will be + * released when lvm_vg_close() is called. * * \param lv * Logical volume handle. From wysochanski@sourceware.org Mon Jul 12 18:29:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Mon, 12 Jul 2010 18:29:00 -0000 Subject: LVM2/liblvm lvm2app.h Message-ID: <20100712182932.25391.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-12 18:29:31 Modified files: liblvm : lvm2app.h Log message: More comment updates in lvm2app.h. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm2app.h.diff?cvsroot=lvm2&r1=1.18&r2=1.19 --- LVM2/liblvm/lvm2app.h 2010/07/12 18:12:23 1.18 +++ LVM2/liblvm/lvm2app.h 2010/07/12 18:29:31 1.19 @@ -102,7 +102,7 @@ * This is the base handle that is needed to open and create objects such as * volume groups and logical volumes. In addition, this handle provides a * context for error handling information, saving any error number (see - * lvm_errno) and error message (see lvm_errmsg) that any function may + * lvm_errno()) and error message (see lvm_errmsg()) that any function may * generate. */ typedef struct lvm *lvm_t; @@ -174,7 +174,7 @@ * * \memberof lvm_t * - * Once all LVM operations have been completed, use lvm_quit to release + * Once all LVM operations have been completed, use lvm_quit() to release * the handle and any associated resources. * * \param system_dir @@ -185,7 +185,7 @@ * \return * A valid LVM handle is returned or NULL if there has been a * memory allocation problem. You have to check if an error occured - * with the lvm_error function. + * with the lvm_error() function. */ lvm_t lvm_init(const char *system_dir); @@ -268,7 +268,7 @@ * * \memberof lvm_t * - * This function may be used in conjunction with lvm_errno to obtain more + * This function may be used in conjunction with lvm_errno() to obtain more * specific error information for a function that is known to have failed. * * \param libh @@ -295,10 +295,10 @@ * \memberof lvm_t * * The memory allocated for the list is tied to the lvm_t handle and will be - * released when lvm_quit is called. + * released when lvm_quit() is called. * * NOTE: This function normally does not scan devices in the system for LVM - * metadata. To scan the system, use lvm_scan. + * metadata. To scan the system, use lvm_scan(). * * To process the list, use the dm_list iterator functions. For example: * vg_t vg; @@ -329,10 +329,10 @@ * \memberof lvm_t * * The memory allocated for the list is tied to the lvm_t handle and will be - * released when lvm_quit is called. + * released when lvm_quit() is called. * * NOTE: This function normally does not scan devices in the system for LVM - * metadata. To scan the system, use lvm_scan. + * metadata. To scan the system, use lvm_scan(). * * \param libh * Handle obtained from lvm_init(). @@ -352,7 +352,7 @@ * \memberof lvm_t * * The memory allocated for the name is tied to the lvm_t handle and will be - * released when lvm_quit is called. + * released when lvm_quit() is called. * * NOTE: This function may scan devices in the system for LVM metadata. * @@ -371,7 +371,7 @@ * \memberof lvm_t * * The memory allocated for the name is tied to the lvm_t handle and will be - * released when lvm_quit is called. + * released when lvm_quit() is called. * * NOTE: This function may scan devices in the system for LVM metadata. * @@ -443,7 +443,7 @@ * \memberof vg_t * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * A list of lvm_lv_list structures containing lv handles for this vg. @@ -457,7 +457,7 @@ * \memberof vg_t * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * A list of lvm_pv_list structures containing pv handles for this vg. @@ -475,7 +475,7 @@ * with lvm_vg_close(). * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * 0 (success) or -1 (failure). @@ -491,7 +491,7 @@ * calling lvm_vg_write() to commit the removal to disk. * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * 0 (success) or -1 (failure). @@ -507,7 +507,7 @@ * handle. * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * 0 (success) or -1 (failure). @@ -526,10 +526,10 @@ * If the device is not initialized for LVM use, it will be initialized * before adding to the VG. Although some internal checks are done, * the caller should be sure the device is not in use by other subsystems - * before calling lvm_vg_extend. + * before calling lvm_vg_extend(). * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \param device * Absolute pathname of device to add to VG. @@ -550,7 +550,7 @@ * lvm_vg_close(). * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \param device * Name of device to remove from VG. @@ -571,7 +571,7 @@ * with lvm_vg_close(). * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \param tag * Tag to add to the VG. @@ -592,7 +592,7 @@ * with lvm_vg_close(). * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \param tag * Tag to remove from VG. @@ -613,7 +613,7 @@ * handle with lvm_vg_close(). * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \param new_size * New extent size in bytes. @@ -629,7 +629,7 @@ * \memberof vg_t * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * 1 if the VG is clustered, 0 if not @@ -642,7 +642,7 @@ * \memberof vg_t * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * 1 if the VG is exported, 0 if not @@ -659,7 +659,7 @@ * group. * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * 1 if the VG is PVs, 0 if not @@ -676,7 +676,7 @@ * have changed from a prior query. * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * Metadata sequence number. @@ -692,7 +692,7 @@ * released when lvm_vg_close() is called. * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * Copy of the uuid string. @@ -708,7 +708,7 @@ * released when lvm_vg_close() is called. * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * Copy of the name. @@ -721,7 +721,7 @@ * \memberof vg_t * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * Size in bytes. @@ -734,7 +734,7 @@ * \memberof vg_t * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * Free size in bytes. @@ -747,7 +747,7 @@ * \memberof vg_t * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * Extent size in bytes. @@ -760,7 +760,7 @@ * \memberof vg_t * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * Extent count. @@ -773,7 +773,7 @@ * \memberof vg_t * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * Free extent count. @@ -786,7 +786,7 @@ * \memberof vg_t * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * Physical volume count. @@ -799,7 +799,7 @@ * \memberof vg_t * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * Maximum number of physical volumes allowed in a volume group. @@ -812,7 +812,7 @@ * \memberof vg_t * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \return * Maximum number of logical volumes allowed in a volume group. @@ -858,7 +858,7 @@ * as the API is developed. * * \param vg - * VG handle obtained from lvm_vg_create or lvm_vg_open(). + * VG handle obtained from lvm_vg_create() or lvm_vg_open(). * * \param name * Name of logical volume to create. @@ -945,7 +945,7 @@ * * \memberof lv_t * - * The memory allocated for the uuid is tied to the vg_t handle and will be + * The memory allocated for the name is tied to the vg_t handle and will be * released when lvm_vg_close() is called. * * \param lv @@ -1115,7 +1115,7 @@ * * \memberof pv_t * - * The memory allocated for the uuid is tied to the vg_t handle and will be + * The memory allocated for the name is tied to the vg_t handle and will be * released when lvm_vg_close() is called. * * \param pv From fabbione@sourceware.org Tue Jul 13 13:51:00 2010 From: fabbione@sourceware.org (fabbione@sourceware.org) Date: Tue, 13 Jul 2010 13:51:00 -0000 Subject: LVM2 ./WHATS_NEW ./WHATS_NEW_DM ./configure ./ ... Message-ID: <20100713135107.28171.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: fabbione@sourceware.org 2010-07-13 13:51:03 Modified files: . : WHATS_NEW WHATS_NEW_DM configure configure.in daemons/clvmd : clvmd.c daemons/cmirrord: clogd.c daemons/dmeventd: dmeventd.c dmeventd.h lib/misc : configure.h.in libdm : libdevmapper.h libdm-file.c Log message: Add dm_create_lockfile to libdm to handle pidfiles for all daemons. Switch dmeventd to use dm_create_lockfile and drop duplicate code. Allow clvmd pidfile to be configurable. Switch cmirrord and clvmd to use dm_create_lockfile. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1665&r2=1.1666 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.394&r2=1.395 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.134&r2=1.135 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.145&r2=1.146 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.72&r2=1.73 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/cmirrord/clogd.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/dmeventd.c.diff?cvsroot=lvm2&r1=1.63&r2=1.64 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/dmeventd/dmeventd.h.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/configure.h.in.diff?cvsroot=lvm2&r1=1.24&r2=1.25 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.120&r2=1.121 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-file.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11 --- LVM2/WHATS_NEW 2010/07/12 18:12:23 1.1665 +++ LVM2/WHATS_NEW 2010/07/13 13:51:01 1.1666 @@ -1,5 +1,7 @@ Version 2.02.71 - =============================== + Switch cmirrord and clvmd to use dm_create_lockfile. + Allow clvmd pidfile to be configurable. Update comments about memory handling in lvm2app.h. Add more verbose messages while checking volume_list and hosttags settings. Add log_error when strdup fails in {vg|lv}_change_tag(). --- LVM2/WHATS_NEW_DM 2010/07/08 14:29:26 1.394 +++ LVM2/WHATS_NEW_DM 2010/07/13 13:51:01 1.395 @@ -1,5 +1,7 @@ Version 1.02.53 - =============================== + Switch dmeventd to use dm_create_lockfile and drop duplicate code. + Add dm_create_lockfile to libdm to handle pidfiles for all daemons. Use "nowatch" udev rule for inappropriate devices. Version 1.02.52 - 6th July 2010 --- LVM2/configure 2010/07/08 12:02:48 1.134 +++ LVM2/configure 2010/07/13 13:51:01 1.135 @@ -736,8 +736,6 @@ CCS_CFLAGS PKGCONFIGINIT_LIBS PKGCONFIGINIT_CFLAGS -PKG_CONFIG_LIBDIR -PKG_CONFIG_PATH PKG_CONFIG POW_LIB LIBOBJS @@ -831,6 +829,7 @@ enable_readline enable_realtime with_clvmd +with_clvmd_pidfile enable_cmirrord with_cmirrord_pidfile enable_debug @@ -877,8 +876,6 @@ CPPFLAGS CPP PKG_CONFIG -PKG_CONFIG_PATH -PKG_CONFIG_LIBDIR PKGCONFIGINIT_CFLAGS PKGCONFIGINIT_LIBS CCS_CFLAGS @@ -1580,6 +1577,8 @@ * all (autodetect) * none (disable build) [TYPE=none] + --with-clvmd-pidfile=PATH + clvmd pidfile [/var/run/clvmd.pid] --with-cmirrord-pidfile=PATH cmirrord pidfile [/var/run/cmirrord.pid] --with-optimisation=OPT C optimisation flag [OPT=-O2] @@ -1617,10 +1616,6 @@ you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility - PKG_CONFIG_PATH - directories to add to pkg-config's search path - PKG_CONFIG_LIBDIR - path overriding pkg-config's built-in search path PKGCONFIGINIT_CFLAGS C compiler flags for PKGCONFIGINIT, overriding pkg-config PKGCONFIGINIT_LIBS @@ -11415,10 +11410,6 @@ pkg_config_init() { - - - - if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. @@ -11531,6 +11522,7 @@ $as_echo "no" >&6; } PKG_CONFIG="" fi + fi pkg_failed=no @@ -11573,8 +11565,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -11589,11 +11579,11 @@ # Put the nasty error message in config.log where it belongs echo "$PKGCONFIGINIT_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: pkg-config initialized" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: result: pkg-config initialized" >&5 $as_echo "pkg-config initialized" >&6; } elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } { $as_echo "$as_me:$LINENO: result: pkg-config initialized" >&5 $as_echo "pkg-config initialized" >&6; } else @@ -11601,7 +11591,7 @@ PKGCONFIGINIT_LIBS=$pkg_cv_PKGCONFIGINIT_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - + : fi PKGCONFIG_INIT=1 } @@ -11807,8 +11797,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -11823,7 +11811,9 @@ # Put the nasty error message in config.log where it belongs echo "$CCS_PKG_ERRORS" >&5 - NOTFOUND=0 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + NOTFOUND=0 for ac_header in ccs.h do @@ -11980,8 +11970,6 @@ HAVE_CCS=yes fi elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } NOTFOUND=0 for ac_header in ccs.h @@ -12186,8 +12174,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -12202,7 +12188,9 @@ # Put the nasty error message in config.log where it belongs echo "$GULM_PKG_ERRORS" >&5 - NOTFOUND=0 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + NOTFOUND=0 for ac_header in libgulm.h do @@ -12359,8 +12347,6 @@ HAVE_GULM=yes fi elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } NOTFOUND=0 for ac_header in libgulm.h @@ -12568,8 +12554,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -12584,7 +12568,9 @@ # Put the nasty error message in config.log where it belongs echo "$CMAN_PKG_ERRORS" >&5 - NOTFOUND=0 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + NOTFOUND=0 for ac_header in libcman.h do @@ -12741,8 +12727,6 @@ HAVE_CMAN=yes fi elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } NOTFOUND=0 for ac_header in libcman.h @@ -12953,8 +12937,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -12969,10 +12951,10 @@ # Put the nasty error message in config.log where it belongs echo "$COROSYNC_PKG_ERRORS" >&5 - $bailout -elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } + $bailout +elif test $pkg_failed = untried; then $bailout else COROSYNC_CFLAGS=$pkg_cv_COROSYNC_CFLAGS @@ -13026,8 +13008,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13042,10 +13022,10 @@ # Put the nasty error message in config.log where it belongs echo "$QUORUM_PKG_ERRORS" >&5 - $bailout -elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } + $bailout +elif test $pkg_failed = untried; then $bailout else QUORUM_CFLAGS=$pkg_cv_QUORUM_CFLAGS @@ -13100,8 +13080,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13116,10 +13094,10 @@ # Put the nasty error message in config.log where it belongs echo "$SALCK_PKG_ERRORS" >&5 - $bailout -elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } + $bailout +elif test $pkg_failed = untried; then $bailout else SALCK_CFLAGS=$pkg_cv_SALCK_CFLAGS @@ -13175,8 +13153,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13191,10 +13167,10 @@ # Put the nasty error message in config.log where it belongs echo "$CONFDB_PKG_ERRORS" >&5 - HAVE_CONFDB=no -elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } + HAVE_CONFDB=no +elif test $pkg_failed = untried; then HAVE_CONFDB=no else CONFDB_CFLAGS=$pkg_cv_CONFDB_CFLAGS @@ -13413,8 +13389,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13429,10 +13403,10 @@ # Put the nasty error message in config.log where it belongs echo "$CPG_PKG_ERRORS" >&5 - $bailout -elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } + $bailout +elif test $pkg_failed = untried; then $bailout else CPG_CFLAGS=$pkg_cv_CPG_CFLAGS @@ -13485,8 +13459,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13501,7 +13473,9 @@ # Put the nasty error message in config.log where it belongs echo "$DLM_PKG_ERRORS" >&5 - NOTFOUND=0 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + NOTFOUND=0 for ac_header in libdlm.h do @@ -13658,8 +13632,6 @@ HAVE_DLM=yes fi elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } NOTFOUND=0 for ac_header in libdlm.h @@ -13862,6 +13834,23 @@ fi ################################################################################ +if test "x$CLVMD" != xnone; then + +# Check whether --with-clvmd-pidfile was given. +if test "${with_clvmd_pidfile+set}" = set; then + withval=$with_clvmd_pidfile; CLVMD_PIDFILE=$withval +else + CLVMD_PIDFILE="/var/run/clvmd.pid" +fi + + +cat >>confdefs.h <<_ACEOF +#define CLVMD_PIDFILE "$CLVMD_PIDFILE" +_ACEOF + +fi + +################################################################################ { $as_echo "$as_me:$LINENO: checking whether to build cluster mirror log daemon" >&5 $as_echo_n "checking whether to build cluster mirror log daemon... " >&6; } # Check whether --enable-cmirrord was given. @@ -13939,8 +13928,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -13964,7 +13951,8 @@ Alternatively, you may set the environment variables SACKPT_CFLAGS and SACKPT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." >&5 +See the pkg-config man page for more details. +" >&5 $as_echo "$as_me: error: Package requirements (libSaCkpt) were not met: $SACKPT_PKG_ERRORS @@ -13974,11 +13962,10 @@ Alternatively, you may set the environment variables SACKPT_CFLAGS and SACKPT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." >&2;} +See the pkg-config man page for more details. +" >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it @@ -14007,7 +13994,7 @@ SACKPT_LIBS=$pkg_cv_SACKPT_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - + : fi if test x$HAVE_CPG != xyes; then @@ -14051,8 +14038,6 @@ if test $pkg_failed = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -14076,7 +14061,8 @@ Alternatively, you may set the environment variables CPG_CFLAGS and CPG_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." >&5 +See the pkg-config man page for more details. +" >&5 $as_echo "$as_me: error: Package requirements (libcpg) were not met: $CPG_PKG_ERRORS @@ -14086,11 +14072,10 @@ Alternatively, you may set the environment variables CPG_CFLAGS and CPG_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." >&2;} +See the pkg-config man page for more details. +" >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it @@ -14119,7 +14104,7 @@ CPG_LIBS=$pkg_cv_CPG_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } - + : fi fi fi --- LVM2/configure.in 2010/07/08 12:02:48 1.145 +++ LVM2/configure.in 2010/07/13 13:51:01 1.146 @@ -601,6 +601,18 @@ fi ################################################################################ +dnl -- clvmd pidfile +if test "x$CLVMD" != xnone; then + AC_ARG_WITH(clvmd-pidfile, + AC_HELP_STRING([--with-clvmd-pidfile=PATH], + [clvmd pidfile [[/var/run/clvmd.pid]]]), + CLVMD_PIDFILE=$withval, + CLVMD_PIDFILE="/var/run/clvmd.pid") + AC_DEFINE_UNQUOTED(CLVMD_PIDFILE, ["$CLVMD_PIDFILE"], + [Path to clvmd pidfile.]) +fi + +################################################################################ dnl -- Build cluster mirror log daemon AC_MSG_CHECKING(whether to build cluster mirror log daemon) AC_ARG_ENABLE(cmirrord, --- LVM2/daemons/clvmd/clvmd.c 2010/06/21 15:56:58 1.72 +++ LVM2/daemons/clvmd/clvmd.c 2010/07/13 13:51:02 1.73 @@ -271,6 +271,11 @@ return buf; } +static void remove_lockfile(void) +{ + unlink(CLVMD_PIDFILE); +} + int main(int argc, char *argv[]) { int local_sock; @@ -370,6 +375,14 @@ be_daemon(start_timeout); } + /* Create pidfile */ + if (dm_create_lockfile(CLVMD_PIDFILE) == 0) { + DEBUGLOG("clvmd: unable to create lockfile\n"); + exit(1); + } + + atexit(remove_lockfile); + DEBUGLOG("CLVMD started\n"); /* Open the Unix socket we listen for commands on. --- LVM2/daemons/cmirrord/clogd.c 2010/07/09 15:34:40 1.11 +++ LVM2/daemons/cmirrord/clogd.c 2010/07/13 13:51:02 1.12 @@ -65,49 +65,6 @@ exit_now = 1; } -/* - * create_lockfile - create and lock a lock file - * @lockfile: location of lock file - * - * Returns: 0 on success, -1 otherwise - */ -static int create_lockfile(const char *lockfile) -{ - int fd; - struct flock lock; - char buffer[50]; - - if((fd = open(lockfile, O_CREAT | O_WRONLY, - (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) < 0) - return -errno; - - lock.l_type = F_WRLCK; - lock.l_start = 0; - lock.l_whence = SEEK_SET; - lock.l_len = 0; - - if (fcntl(fd, F_SETLK, &lock) < 0) { - close(fd); - return -errno; - } - - if (ftruncate(fd, 0) < 0) { - close(fd); - return -errno; - } - - sprintf(buffer, "%d\n", getpid()); - - /* FIXME Handle other non-error returns without aborting */ - if (write(fd, buffer, strlen(buffer)) < strlen(buffer)){ - close(fd); - unlink(lockfile); - return -errno; - } - - return 0; -} - static void sig_handler(int sig) { /* FIXME Races - don't touch signal_mask here. */ @@ -162,6 +119,11 @@ } } +static void remove_lockfile(void) +{ + unlink(CMIRRORD_PIDFILE); +} + /* * daemonize * @@ -226,9 +188,11 @@ LOG_OPEN("cmirrord", LOG_PID, LOG_DAEMON); - if (create_lockfile(CMIRRORD_PIDFILE)) + if (dm_create_lockfile(CMIRRORD_PIDFILE) == 0) exit(EXIT_LOCKFILE); + atexit(remove_lockfile); + /* FIXME Replace with sigaction. (deprecated) */ signal(SIGINT, &sig_handler); signal(SIGQUIT, &sig_handler); --- LVM2/daemons/dmeventd/dmeventd.c 2010/07/09 15:34:41 1.63 +++ LVM2/daemons/dmeventd/dmeventd.c 2010/07/13 13:51:02 1.64 @@ -394,26 +394,6 @@ return pthread_mutex_unlock(&_global_mutex); } -/* Store pid in pidfile. */ -static int _storepid(int lf) -{ - int len; - char pid[8]; - - if ((len = snprintf(pid, sizeof(pid), "%u\n", getpid())) < 0) - return 0; - - if (len > (int) sizeof(pid)) - len = (int) sizeof(pid); - - if (write(lf, pid, (size_t) len) != len) - return 0; - - fsync(lf); - - return 1; -} - /* Check, if a device exists. */ static int _fill_device_data(struct thread_status *ts) { @@ -1541,23 +1521,6 @@ } -static int _lock_pidfile(void) -{ - int lf; - char pidfile[] = DMEVENTD_PIDFILE; - - if ((lf = open(pidfile, O_CREAT | O_RDWR, 0644)) < 0) - exit(EXIT_OPEN_PID_FAILURE); - - if (flock(lf, LOCK_EX | LOCK_NB) < 0) - exit(EXIT_LOCKFILE_INUSE); - - if (!_storepid(lf)) - exit(EXIT_FAILURE); - - return 0; -} - #ifdef linux /* * Protection against OOM killer if kernel supports it @@ -1589,6 +1552,11 @@ } #endif +static void remove_lockfile(void) +{ + unlink(DMEVENTD_PIDFILE); +} + static void _daemonize(void) { int child_status; @@ -1626,12 +1594,8 @@ /* Problem with child. Determine what it is by exit code */ switch (WEXITSTATUS(child_status)) { - case EXIT_LOCKFILE_INUSE: - fprintf(stderr, "Another dmeventd daemon is already running\n"); - break; case EXIT_DESC_CLOSE_FAILURE: case EXIT_DESC_OPEN_FAILURE: - case EXIT_OPEN_PID_FAILURE: case EXIT_FIFO_FAILURE: case EXIT_CHDIR_FAILURE: default: @@ -1717,7 +1681,10 @@ openlog("dmeventd", LOG_PID, LOG_DAEMON); - _lock_pidfile(); /* exits if failure */ + if (dm_create_lockfile(DMEVENTD_PIDFILE) == 0) + exit(EXIT_FAILURE); + + atexit(remove_lockfile); /* Set the rest of the signals to cause '_exit_now' to be set */ signal(SIGINT, &_exit_handler); --- LVM2/daemons/dmeventd/dmeventd.h 2007/08/21 16:26:06 1.5 +++ LVM2/daemons/dmeventd/dmeventd.h 2010/07/13 13:51:02 1.6 @@ -56,10 +56,10 @@ /* EXIT_SUCCESS 0 -- stdlib.h */ /* EXIT_FAILURE 1 -- stdlib.h */ -#define EXIT_LOCKFILE_INUSE 2 +/* EXIT_LOCKFILE_INUSE 2 -- obsoleted */ #define EXIT_DESC_CLOSE_FAILURE 3 #define EXIT_DESC_OPEN_FAILURE 4 -#define EXIT_OPEN_PID_FAILURE 5 +/* EXIT_OPEN_PID_FAILURE 5 -- obsoleted */ #define EXIT_FIFO_FAILURE 6 #define EXIT_CHDIR_FAILURE 7 --- LVM2/lib/misc/configure.h.in 2010/07/05 22:23:15 1.24 +++ LVM2/lib/misc/configure.h.in 2010/07/13 13:51:03 1.25 @@ -9,6 +9,9 @@ /* Path to clvmd binary. */ #undef CLVMD_PATH +/* Path to clvmd pidfile. */ +#undef CLVMD_PIDFILE + /* Path to cmirrord pidfile. */ #undef CMIRRORD_PIDFILE --- LVM2/libdm/libdevmapper.h 2010/07/09 15:34:47 1.120 +++ LVM2/libdm/libdevmapper.h 2010/07/13 13:51:03 1.121 @@ -980,6 +980,14 @@ int dm_asprintf(char **buf, const char *format, ...) __attribute__ ((format(printf, 2, 3))); +/* + * create lockfile (pidfile) - create and lock a lock file + * @lockfile: location of lock file + * + * Returns: 1 on success, 0 otherwise, errno is handled internally + */ +int dm_create_lockfile(const char* lockfile); + /********************* * regular expressions *********************/ --- LVM2/libdm/libdm-file.c 2008/11/03 18:59:59 1.10 +++ LVM2/libdm/libdm-file.c 2010/07/13 13:51:03 1.11 @@ -84,3 +84,85 @@ return prev_fail || fclose_fail ? EOF : 0; } + +int dm_create_lockfile(const char *lockfile) +{ + int fd, value; + size_t bufferlen; + ssize_t write_out; + struct flock lock; + char buffer[50]; + + if((fd = open(lockfile, O_CREAT | O_WRONLY, + (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) < 0) { + log_error("Cannot open lockfile [%s], error was [%s]", + lockfile, strerror(errno)); + return 0; + } + + lock.l_type = F_WRLCK; + lock.l_start = 0; + lock.l_whence = SEEK_SET; + lock.l_len = 0; + if (fcntl(fd, F_SETLK, &lock) < 0) { + if (errno != EACCES && errno != EAGAIN) + log_error("Cannot lock lockfile [%s], error was [%s]", + lockfile, strerror(errno)); + else + log_error("process is already running"); + + goto fail; + } + + if (ftruncate(fd, 0) < 0) { + log_error("Cannot truncate pidfile [%s], error was [%s]", + lockfile, strerror(errno)); + + goto fail; + } + + memset(buffer, 0, sizeof(buffer)); + snprintf(buffer, sizeof(buffer)-1, "%u\n", getpid()); + + bufferlen = strlen(buffer); + write_out = write(fd, buffer, bufferlen); + + if ((write_out < 0) || (write_out == 0 && errno)) { + log_error("Cannot write pid to pidfile [%s], error was [%s]", + lockfile, strerror(errno)); + + goto fail; + } + + if ((write_out == 0) || (write_out < bufferlen)) { + log_error("Cannot write pid to pidfile [%s], shortwrite of" + "[%" PRIsize_t "] bytes, expected [%" PRIsize_t "]\n", + lockfile, write_out, bufferlen); + + goto fail; + } + + if ((value = fcntl(fd, F_GETFD, 0)) < 0) { + log_error("Cannot get close-on-exec flag from pidfile [%s], " + "error was [%s]", lockfile, strerror(errno)); + + goto fail; + } + value |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, value) < 0) { + log_error("Cannot set close-on-exec flag from pidfile [%s], " + "error was [%s]", lockfile, strerror(errno)); + + goto fail; + } + + return 1; + +fail: + if (close(fd)) + stack; + if (unlink(lockfile)) + stack; + + return 0; +} From wysochanski@sourceware.org Tue Jul 13 15:04:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Tue, 13 Jul 2010 15:04:00 -0000 Subject: LVM2/man lvm.conf.5.in pvchange.8.in pvcreate. ... Message-ID: <20100713150425.18492.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-13 15:04:24 Modified files: man : lvm.conf.5.in pvchange.8.in pvcreate.8.in vgchange.8.in Log message: Minor man page updates related to metadataignore and vgmetadatacopies. pvchange: Add --metadataignore description vgchange: Fix minor formatting pvcreate: Update metadataignore description to refer to pvchange lvm.conf: Refer to pvcreate and pvchange for metadata options. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvm.conf.5.in.diff?cvsroot=lvm2&r1=1.12&r2=1.13 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/pvchange.8.in.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/pvcreate.8.in.diff?cvsroot=lvm2&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/vgchange.8.in.diff?cvsroot=lvm2&r1=1.11&r2=1.12 --- LVM2/man/lvm.conf.5.in 2010/07/02 17:05:22 1.12 +++ LVM2/man/lvm.conf.5.in 2010/07/13 15:04:23 1.13 @@ -386,7 +386,8 @@ Currently it can be set to 0, 1 or 2. The default is 1. If set to 2, one copy is placed at the beginning of the disk and the other is placed at the end. -It can be overridden on the command line with \fB--pvmetadatacopies\fP. +It can be overridden on the command line with \fB--pvmetadatacopies\fP +(see \fBpvcreate\fP). If creating a volume group with just one physical volume, it's a good idea to have 2 copies. If creating a large volume group with many physical volumes, you may decide that 3 copies of the metadata @@ -411,8 +412,9 @@ The default is "n". If metadata areas on a physical volume are ignored, LVM will not not store metadata in the metadata areas present on newly created Physical Volumes. The option can be overridden on the command -line with \fB--metadataignore\fP. Metadata areas cannot be created -or extended after Logical Volumes have been allocated on the device. +line with \fB--metadataignore\fP (See \fBpvcreate\fP and \fBpvchange\fP). +Metadata areas cannot be created or extended after Logical Volumes have +been allocated on the device. If you do not want to store metadata on this device, it is still wise always to allocate a metadata area (use a non-zero value for \fB--pvmetadatacopies\fP) in case you need it in the future and to use @@ -422,13 +424,14 @@ LVM2 metadata format, this is the default number of copies of metadata desired across all the physical volumes in the volume group. If set to a non-zero value, LVM will automatically set or clear the metadataignore -flag on the physical volumes (see \fBpvchange --metadataignore\fP) in order -to achieve the desired number of metadata copies. An LVM command that -adds or removes physical volumes (for example, \fBvgextend\fP, \fBvgreduce\fP, -\fBvgsplit\fP, or \fBvgmerge\fP), may cause LVM to automatically set or -clear the metadataignore flags. Also, if physical volumes go missing or -reappear, or a new number of copies is explicitly set (see -\fBvgchange --vgmetadatacopies\fP), LVM may adjust the metadataignore flags. +flag on the physical volumes (see \fBpvcreate\fP and \fBpvchange\fP +\fB--metadataignore\fP) in order to achieve the desired number of metadata +copies. An LVM command that adds or removes physical volumes (for example, +\fBvgextend\fP, \fBvgreduce\fP, \fBvgsplit\fP, or \fBvgmerge\fP), may cause +LVM to automatically set or clear the metadataignore flags. Also, if +physical volumes go missing or reappear, or a new number of copies is +explicitly set (see \fBvgchange --vgmetadatacopies\fP), LVM may adjust +the metadataignore flags. Set \fBvgmetadatacopies\fP to 0 instructs LVM not to set or clear the metadataignore flags automatically. You may set a value larger than the sum of all metadata areas on all physical volumes. The value can --- LVM2/man/pvchange.8.in 2010/07/07 19:14:57 1.5 +++ LVM2/man/pvchange.8.in 2010/07/13 15:04:23 1.6 @@ -22,6 +22,12 @@ If PhysicalVolumePath is not specified on the command line all physical volumes are searched for and used. .TP +.I \-\-metadataignore " y|n" +Ignore or un-ignore metadata areas on this physical volume. +If metadata areas on a physical volume are ignored, LVM will +not not store metadata in the metadata areas present on this Physical +Volume. +.TP .I \-u, \-\-uuid Generate new random UUID for specified physical volumes. .TP --- LVM2/man/pvcreate.8.in 2010/07/02 17:05:22 1.7 +++ LVM2/man/pvcreate.8.in 2010/07/13 15:04:23 1.8 @@ -118,9 +118,10 @@ then later use \fBvgsplit\fP you must ensure that each VG is still going to have a suitable number of copies of the metadata after the split! .TP -.I \-\-metadataignore y|n -Ignore or un-ignore metadata areas on this physical volume. The default -is "n". If metadata areas on a physical volume are ignored, LVM will +.BR \-\-metadataignore " y|n" +Ignore or un-ignore metadata areas on this physical volume. +The default is "n". This setting can be changed with \fBpvchange\fP. +If metadata areas on a physical volume are ignored, LVM will not not store metadata in the metadata areas present on this Physical Volume. Metadata areas cannot be created or extended after Logical Volumes have been allocated on the device. If you do not want to store --- LVM2/man/vgchange.8.in 2010/07/02 17:05:22 1.11 +++ LVM2/man/vgchange.8.in 2010/07/13 15:04:23 1.12 @@ -135,10 +135,10 @@ you should consider some use of \fB--pvmetadatacopies 0\fP as described in \fBpvcreate(8)\fP, and/or use \fB--vgmetadatacopies\fP. .TP -.BR \-\-vgmetadatacopies " " \fINumberOfCopies|unmanaged|all\fP +.BR \-\-[vg]metadatacopies " " \fINumberOfCopies|unmanaged|all\fP Sets the desired number of metadata copies in the volume group. If set to a non-zero value, LVM will automatically manage the 'metadataignore' -flags on the physical volumes (see \fBpvchange\fP or \fBpvcreate\fP --metadataignore\fP) in order +flags on the physical volumes (see \fBpvchange\fP or \fBpvcreate --metadataignore\fP) in order to achieve \fINumberOfCopies\fP copies of metadata. If set to \fIunmanaged\fP, LVM will not automatically manage the 'metadataignore' flags. If set to \fIall\fP, LVM will first clear all of the 'metadataignore' flags on all From jbrassow@sourceware.org Tue Jul 13 21:48:00 2010 From: jbrassow@sourceware.org (jbrassow@sourceware.org) Date: Tue, 13 Jul 2010 21:48:00 -0000 Subject: LVM2 ./WHATS_NEW lib/metadata/mirror.c Message-ID: <20100713214818.17286.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2010-07-13 21:48:17 Modified files: . : WHATS_NEW lib/metadata : mirror.c Log message: Fix for bugs: 612248 & 612291 Split mirror issues The main problem with these bugs was that the newly split off LV was not being suspended properly. This meant that the memlock count was not being balanced, the DM devices were not being renamed, and some DM devices which should have been removed were not. I've also renamed some of the variables and added comments to make things clearer as to what is going on. (I can break this patch in two if it means easier review.) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1666&r2=1.1667 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.125&r2=1.126 --- LVM2/WHATS_NEW 2010/07/13 13:51:01 1.1666 +++ LVM2/WHATS_NEW 2010/07/13 21:48:16 1.1667 @@ -1,5 +1,6 @@ Version 2.02.71 - =============================== + Fix suspend/resume logic for LVs resulting from splitting a mirror. Switch cmirrord and clvmd to use dm_create_lockfile. Allow clvmd pidfile to be configurable. Update comments about memory handling in lvm2app.h. --- LVM2/lib/metadata/mirror.c 2010/07/09 17:57:51 1.125 +++ LVM2/lib/metadata/mirror.c 2010/07/13 21:48:17 1.126 @@ -553,9 +553,9 @@ struct dm_list *removable_pvs) { uint32_t i; - struct logical_volume *sub_lv, *new_lv = NULL; + struct logical_volume *sub_lv = NULL; + struct logical_volume *new_lv = NULL; struct logical_volume *detached_log_lv = NULL; - struct logical_volume *lv1 = NULL; struct lv_segment *mirrored_seg = first_seg(lv); struct dm_list split_images; struct lv_list *lvl; @@ -597,6 +597,8 @@ release_lv_segment_area(mirrored_seg, mirrored_seg->area_count, mirrored_seg->area_len); + log_very_verbose("%s assigned to be split", sub_lv->name); + if (!new_lv) { new_lv = sub_lv; new_lv->name = dm_pool_strdup(lv->vg->cmd->mem, @@ -662,13 +664,19 @@ init_mirror_in_sync(1); } - /* If no more mirrors, remove mirror layer */ + sub_lv = NULL; + + /* + * If no more mirrors, remove mirror layer. + * The sub_lv is removed entirely later - leaving + * only the top-level (now linear) LV. + */ if (mirrored_seg->area_count == 1) { - lv1 = seg_lv(mirrored_seg, 0); - lv1->status &= ~MIRROR_IMAGE; - lv_set_visible(lv1); + sub_lv = seg_lv(mirrored_seg, 0); + sub_lv->status &= ~MIRROR_IMAGE; + lv_set_visible(sub_lv); detached_log_lv = detach_mirror_log(mirrored_seg); - if (!remove_layer_from_lv(lv, lv1)) + if (!remove_layer_from_lv(lv, sub_lv)) return_0; lv->status &= ~MIRRORED; lv->status &= ~MIRROR_NOTSYNCED; @@ -679,6 +687,9 @@ return 0; } + /* + * Suspend the original device and all its sub devices + */ if (!suspend_lv(mirrored_seg->lv->vg->cmd, mirrored_seg->lv)) { log_error("Failed to lock %s", mirrored_seg->lv->name); vg_revert(mirrored_seg->lv->vg); @@ -690,35 +701,32 @@ return 0; } - log_very_verbose("Updating \"%s\" in kernel", mirrored_seg->lv->name); - /* - * If we have split off a mirror instead of linear (i.e. the - * split_images list is not empty), then we must perform a - * resume to get the mirror started. + * Suspend the newly split-off LV (balance memlock count + * and prepare for DM automated renaming via resume). */ - if (!dm_list_empty(&split_images) && !resume_lv(lv->vg->cmd, new_lv)) { - log_error("Failed to resume newly split LV, %s", new_lv->name); + if (!suspend_lv(lv->vg->cmd, new_lv)) { + log_error("Failed to lock newly split LV, %s", new_lv->name); + vg_revert(lv->vg); return 0; } - /* - * Avoid having same mirror target loaded twice simultaneously by first - * resuming the removed LV which now contains an error segment. - * As it's now detached from mirrored_seg->lv we must resume it - * explicitly. - */ - if (lv1 && !resume_lv(lv1->vg->cmd, lv1)) { - log_error("Problem resuming temporary LV, %s", lv1->name); + /* Bring newly split-off LV into existence */ + log_very_verbose("Creating %s", new_lv->name); + if (!resume_lv(lv->vg->cmd, new_lv)) { + log_error("Failed to activate newly split LV, %s", + new_lv->name); return 0; } + /* Resume altered original LV */ + log_very_verbose("Updating \"%s\" in kernel", mirrored_seg->lv->name); if (!resume_lv(mirrored_seg->lv->vg->cmd, mirrored_seg->lv)) { log_error("Problem reactivating %s", mirrored_seg->lv->name); return 0; } - if (lv1 && !_delete_lv(lv, lv1)) + if (sub_lv && !_delete_lv(lv, sub_lv)) return_0; if (detached_log_lv && !_delete_lv(lv, detached_log_lv)) From jbrassow@sourceware.org Tue Jul 13 21:53:00 2010 From: jbrassow@sourceware.org (jbrassow@sourceware.org) Date: Tue, 13 Jul 2010 21:53:00 -0000 Subject: LVM2/tools lvconvert.c Message-ID: <20100713215308.19532.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2010-07-13 21:53:08 Modified files: tools : lvconvert.c Log message: Fix for bug 612311: Split of linear provides no error msg An unhandled condition allowed the command to terminate cleanly without a warning. Added a check for the '--splitmirrors' argument to allow execution to the lower level function that has the check to see if the user is trying to split a linear device. You should now see a message if you try to use --splitmirrors on a linear device. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.138&r2=1.139 --- LVM2/tools/lvconvert.c 2010/07/09 15:34:48 1.138 +++ LVM2/tools/lvconvert.c 2010/07/13 21:53:07 1.139 @@ -861,7 +861,8 @@ else if (lp->mirrors_sign == SIGN_PLUS) lp->mirrors = *old_mimage_count + lp->mirrors; else if (lp->mirrors_sign == SIGN_MINUS) - lp->mirrors = *old_mimage_count - lp->mirrors; + lp->mirrors = (*old_mimage_count > lp->mirrors) ? + *old_mimage_count - lp->mirrors: 0; else lp->mirrors += 1; @@ -876,8 +877,8 @@ /* Did the user try to subtract more legs than available? */ if (lp->mirrors < 1) { - log_error("Logical volume %s only has %" PRIu32 " mirrors.", - lv->name, *old_mimage_count); + log_error("Unable to reduce images by specified amount - only %d in %s", + *old_mimage_count, lv->name); return 0; } @@ -1561,7 +1562,9 @@ stack; return ECMD_FAILED; } - } else if (arg_count(cmd, mirrors_ARG) || (lv->status & MIRRORED)) { + } else if (arg_count(cmd, mirrors_ARG) || + arg_count(cmd, splitmirrors_ARG) || + (lv->status & MIRRORED)) { if (!archive(lv->vg)) { stack; return ECMD_FAILED; From jbrassow@sourceware.org Tue Jul 13 22:04:00 2010 From: jbrassow@sourceware.org (jbrassow@sourceware.org) Date: Tue, 13 Jul 2010 22:04:00 -0000 Subject: LVM2/tools lvconvert.c Message-ID: <20100713220437.6239.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2010-07-13 22:04:36 Modified files: tools : lvconvert.c Log message: Fix reversal of LV list before performing a split mirror. When splitting off mirror images from a mirror, we always take LVs from the end of a list. For example, if the mirror sub-devices are lv_mimage_[012], we should select lv_mimage_2 if splitting off one image. However, lv_mimage_0 was being selected instead. The problem came from calling '_move_removable_mimages_to_end' when it was unnecessary to do so. When the user /does/ specify specific devices to be removed, this function properly moved the appropriate LVs to the end of the list for extraction. However, if the user /doesn't/ give any specific PVs, the function should do nothing. '_move_removable_mimages_to_end' was keying off of whether 'removable_pvs' was NULL or not and this value was improperly being populated with the set of all available PVs. This was causing '_move_removable_mimages_to_end' to completely reverse the list, which in turn caused us to extract the hithertofore front-of-the-list LVs. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.139&r2=1.140 --- LVM2/tools/lvconvert.c 2010/07/13 21:53:07 1.139 +++ LVM2/tools/lvconvert.c 2010/07/13 22:04:36 1.140 @@ -1002,7 +1002,7 @@ lv->le_count, lp->region_size); - if (!operable_pvs) + if (!operable_pvs && !lp->keep_mimages) operable_pvs = lp->pvh; seg = first_seg(lv); From jbrassow@sourceware.org Tue Jul 13 22:24:00 2010 From: jbrassow@sourceware.org (jbrassow@sourceware.org) Date: Tue, 13 Jul 2010 22:24:00 -0000 Subject: LVM2 ./WHATS_NEW lib/metadata/mirror.c Message-ID: <20100713222440.15949.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2010-07-13 22:24:40 Modified files: . : WHATS_NEW lib/metadata : mirror.c Log message: Fix for bug 614164: No check for existing name when splitting mirror The user could use the same name as an existing LV when specifying a name for an LV split off from a mirror. This causes all sorts of issues. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1667&r2=1.1668 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.126&r2=1.127 --- LVM2/WHATS_NEW 2010/07/13 21:48:16 1.1667 +++ LVM2/WHATS_NEW 2010/07/13 22:24:39 1.1668 @@ -1,5 +1,6 @@ Version 2.02.71 - =============================== + Check if LV with specified name already exists when splitting a mirror. Fix suspend/resume logic for LVs resulting from splitting a mirror. Switch cmirrord and clvmd to use dm_create_lockfile. Allow clvmd pidfile to be configurable. --- LVM2/lib/metadata/mirror.c 2010/07/13 21:48:17 1.126 +++ LVM2/lib/metadata/mirror.c 2010/07/13 22:24:39 1.127 @@ -1982,6 +1982,12 @@ { int r; + if (find_lv_in_vg(lv->vg, split_name)) { + log_error("Logical Volume \"%s\" already exists in " + "volume group \"%s\"", split_name, lv->vg->name); + return 0; + } + /* Can't split a mirror that is not in-sync... unless force? */ if (!_mirrored_lv_in_sync(lv)) { log_error("Unable to split mirror that is not in-sync."); From thornber@sourceware.org Tue Jul 20 14:26:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 14:26:00 -0000 Subject: LVM2/report-generators Message-ID: <20100720142643.4961.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 14:26:43 LVM2/report-generators Update of /cvs/lvm2/LVM2/report-generators In directory sourceware.org:/tmp/cvs-serv4953/report-generators Log Message: Directory /cvs/lvm2/LVM2/report-generators added to the repository From thornber@sourceware.org Tue Jul 20 14:26:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 14:26:00 -0000 Subject: LVM2/reports Message-ID: <20100720142608.4665.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 14:26:08 LVM2/reports Update of /cvs/lvm2/LVM2/reports In directory sourceware.org:/tmp/cvs-serv4659/reports Log Message: Directory /cvs/lvm2/LVM2/reports added to the repository From thornber@sourceware.org Tue Jul 20 14:30:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 14:30:00 -0000 Subject: LVM2/report-generators/test Message-ID: <20100720143021.7484.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 14:30:21 LVM2/report-generators/test Update of /cvs/lvm2/LVM2/report-generators/test In directory sourceware.org:/tmp/cvs-serv7392/report-generators/test Log Message: Directory /cvs/lvm2/LVM2/report-generators/test added to the repository From thornber@sourceware.org Tue Jul 20 14:30:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 14:30:00 -0000 Subject: LVM2/report-generators/lib Message-ID: <20100720143021.7457.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 14:30:21 LVM2/report-generators/lib Update of /cvs/lvm2/LVM2/report-generators/lib In directory sourceware.org:/tmp/cvs-serv7392/report-generators/lib Log Message: Directory /cvs/lvm2/LVM2/report-generators/lib added to the repository From thornber@sourceware.org Tue Jul 20 14:30:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 14:30:00 -0000 Subject: LVM2/report-generators/templates Message-ID: <20100720143021.7477.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 14:30:21 LVM2/report-generators/templates Update of /cvs/lvm2/LVM2/report-generators/templates In directory sourceware.org:/tmp/cvs-serv7392/report-generators/templates Log Message: Directory /cvs/lvm2/LVM2/report-generators/templates added to the repository From thornber@sourceware.org Tue Jul 20 14:31:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 14:31:00 -0000 Subject: LVM2/report-generators/test/strings/more_strings Message-ID: <20100720143122.8316.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 14:31:22 LVM2/report-generators/test/strings/more_strings Update of /cvs/lvm2/LVM2/report-generators/test/strings/more_strings In directory sourceware.org:/tmp/cvs-serv8305/report-generators/test/strings/more_strings Log Message: Directory /cvs/lvm2/LVM2/report-generators/test/strings/more_strings added to the repository From thornber@sourceware.org Tue Jul 20 14:31:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 14:31:00 -0000 Subject: LVM2/report-generators/test/strings Message-ID: <20100720143101.8107.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 14:31:01 LVM2/report-generators/test/strings Update of /cvs/lvm2/LVM2/report-generators/test/strings In directory sourceware.org:/tmp/cvs-serv8100/report-generators/test/strings Log Message: Directory /cvs/lvm2/LVM2/report-generators/test/strings added to the repository From thornber@sourceware.org Tue Jul 20 14:38:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 14:38:00 -0000 Subject: LVM2 ./Makefile.in ./configure.in ./make.tmpl. ... Message-ID: <20100720143849.13269.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 14:38:45 Modified files: . : Makefile.in configure.in make.tmpl.in Added files: report-generators: memcheck.rb title_page.rb unit_test.rb report-generators/lib: log.rb report_templates.rb reports.rb schedule_file.rb string-store.rb report-generators/templates: boiler_plate.rhtml index.rhtml memcheck.rhtml unit_detail.rhtml unit_test.rhtml report-generators/test: example.schedule tc_log.rb tc_schedule_file.rb tc_string_store.rb ts.rb report-generators/test/strings: test1.txt test2 report-generators/test/strings/more_strings: test3.txt reports : stylesheet.css Log message: Report generators for unit tests and memory checks. Configure with --enable-testing. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/Makefile.in.diff?cvsroot=lvm2&r1=1.55&r2=1.56 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.146&r2=1.147 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/make.tmpl.in.diff?cvsroot=lvm2&r1=1.105&r2=1.106 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/memcheck.rb.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/title_page.rb.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/unit_test.rb.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/lib/log.rb.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/lib/report_templates.rb.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/lib/reports.rb.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/lib/schedule_file.rb.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/lib/string-store.rb.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/templates/boiler_plate.rhtml.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/templates/index.rhtml.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/templates/memcheck.rhtml.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/templates/unit_detail.rhtml.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/templates/unit_test.rhtml.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/test/example.schedule.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/test/tc_log.rb.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/test/tc_schedule_file.rb.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/test/tc_string_store.rb.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/test/ts.rb.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/test/strings/test1.txt.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/test/strings/test2.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/test/strings/more_strings/test3.txt.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/reports/stylesheet.css.diff?cvsroot=lvm2&r1=NONE&r2=1.1 --- LVM2/Makefile.in 2010/05/24 09:04:27 1.55 +++ LVM2/Makefile.in 2010/07/20 14:38:44 1.56 @@ -127,3 +127,23 @@ endif endif + +ifeq ("$(TESTING)", "yes") +# testing and report generation +RUBY=ruby1.9 -Ireport-generators/lib -Ireport-generators/test + +.PHONEY: unit-test ruby-test test-programs + +test-programs: + +unit-test: test-programs + $(RUBY) report-generators/unit_test.rb $(shell find . -name TESTS) + $(RUBY) report-generators/title_page.rb + +memcheck: test-programs + $(RUBY) report-generators/memcheck.rb $(shell find . -name TESTS) + $(RUBY) report-generators/title_page.rb + +ruby-test: + $(RUBY) report-generators/test/ts.rb +endif \ No newline at end of file --- LVM2/configure.in 2010/07/13 13:51:01 1.146 +++ LVM2/configure.in 2010/07/20 14:38:44 1.147 @@ -701,6 +701,22 @@ fi ################################################################################ +dnl -- Enable testing +AC_MSG_CHECKING(whether to enable unit testing) +AC_ARG_ENABLE(testing, + AC_HELP_STRING(--enable-testing, [enable testing targets in the makefile]), + TESTING=$enableval, TESTING=no) +AC_MSG_RESULT($TESTING) + +if test "$TESTING" = yes; then + AC_PATH_PROG(RUBY19, ruby1.9) + AC_PATH_PROG(VALGRIND, valgrind) + if test -z "$RUBY19" -o -z "$VALGRIND"; then + AC_MSG_ERROR([ruby1.9 and valgrind are required for testing]) + fi +fi + +################################################################################ dnl -- Disable devmapper AC_MSG_CHECKING(whether to use device-mapper) AC_ARG_ENABLE(devmapper, @@ -1260,6 +1276,7 @@ AC_SUBST(SNAPSHOTS) AC_SUBST(STATICDIR) AC_SUBST(STATIC_LINK) +AC_SUBST(TESTING) AC_SUBST(UDEV_LIBS) AC_SUBST(UDEV_PC) AC_SUBST(UDEV_RULES) --- LVM2/make.tmpl.in 2010/07/09 15:26:41 1.105 +++ LVM2/make.tmpl.in 2010/07/20 14:38:44 1.106 @@ -45,6 +45,7 @@ READLINE_LIBS = @READLINE_LIBS@ SELINUX_LIBS = @SELINUX_LIBS@ UDEV_LIBS = @UDEV_LIBS@ +TESTING = @TESTING@ # Setup directory variables prefix = @prefix@ /cvs/lvm2/LVM2/report-generators/memcheck.rb,v --> standard output revision 1.1 --- LVM2/report-generators/memcheck.rb +++ - 2010-07-20 14:38:47.194654000 +0000 @@ -0,0 +1,76 @@ +# Reads the schedule files given on the command line. Runs them and +# generates the reports. + +# FIXME: a lot of duplication with unit_test.rb + +require 'schedule_file' +require 'pathname' +require 'reports' +require 'erb' +require 'report_templates' + +include ReportTemplates + +schedules = ARGV.map do |f| + p = Pathname.new(f) + Schedule.read(p.dirname, p) +end + +total_passed = 0 +total_failed = 0 + +# We need to make sure the lvm shared libs are in the LD_LIBRARY_PATH +ENV['LD_LIBRARY_PATH'] = `pwd`.strip + "/libdm:" + (ENV['LD_LIBRARY_PATH'] || '') + +ENV['TEST_TOOL'] = "valgrind --leak-check=full --show-reachable=yes" + +schedules.each do |s| + s.run + + s.schedules.each do |t| + if t.status.success? + total_passed += 1 + else + total_failed += 1 + end + end +end + +def mangle(txt) + txt.gsub(/\s+/, '_') +end + +MemcheckStats = Struct.new(:definitely_lost, :indirectly_lost, :possibly_lost, :reachable) + +def format(bytes, blocks) + "#{bytes} bytes, #{blocks} blocks" +end + +# Examines the output for details of leaks +def extract_stats(t) + d = i = p = r = '-' + + t.output.split("\n").each do |l| + case l + when /==\d+== definitely lost: ([0-9,]+) bytes in ([0-9,]+) blocks/ + d = format($1, $2) + when /==\d+== indirectly lost: ([0-9,]+) bytes in ([0-9,]+) blocks/ + i = format($1, $2) + when /==\d+== possibly lost: ([0-9,]+) bytes in ([0-9,]+) blocks/ + p = format($1, $2) + when /==\d+== still reachable: ([0-9,]+) bytes in ([0-9,]+) blocks/ + r = format($1, $2) + end + end + + MemcheckStats.new(d, i, p, r) +end + +generate_report(:memcheck, binding) + +# now we generate a detail report for each schedule +schedules.each do |s| + s.schedules.each do |t| + generate_report(:unit_detail, binding, Pathname.new("reports/memcheck_#{mangle(t.desc)}.html")) + end +end /cvs/lvm2/LVM2/report-generators/title_page.rb,v --> standard output revision 1.1 --- LVM2/report-generators/title_page.rb +++ - 2010-07-20 14:38:47.282849000 +0000 @@ -0,0 +1,32 @@ +# This generates the index for the reports, including generation +# times. + +require 'log' +require 'string-store' +require 'reports' +require 'erb' +require 'report_templates' + +include Reports + +reports = ReportRegister.new + +def safe_mtime(r) + r.path.file? ? r.path.mtime.to_s : "not generated" +end + +template_store = TemplateStringStore.new + +# FIXME: use generate_report() method +erb = ERB.new(template_store.lookup("index.rhtml")) +body = erb.result(binding) +title = "Generation times" + +erb = ERB.new(template_store.lookup("boiler_plate.rhtml")) +txt = erb.result(binding) + +Pathname.new("reports/index.html").open("w") do |f| + f.puts txt +end + + /cvs/lvm2/LVM2/report-generators/unit_test.rb,v --> standard output revision 1.1 --- LVM2/report-generators/unit_test.rb +++ - 2010-07-20 14:38:47.375377000 +0000 @@ -0,0 +1,46 @@ +# Reads the schedule files given on the command line. Runs them and +# generates the reports. + +require 'schedule_file' +require 'pathname' +require 'reports' +require 'erb' +require 'report_templates' + +include ReportTemplates + +schedules = ARGV.map do |f| + p = Pathname.new(f) + Schedule.read(p.dirname, p) +end + +total_passed = 0 +total_failed = 0 + +# We need to make sure the lvm shared libs are in the LD_LIBRARY_PATH +ENV['LD_LIBRARY_PATH'] = `pwd`.strip + "/libdm:" + (ENV['LD_LIBRARY_PATH'] || '') + +schedules.each do |s| + s.run + + s.schedules.each do |t| + if t.status.success? + total_passed += 1 + else + total_failed += 1 + end + end +end + +def mangle(txt) + txt.gsub(/\s+/, '_') +end + +generate_report(:unit_test, binding) + +# now we generate a detail report for each schedule +schedules.each do |s| + s.schedules.each do |t| + generate_report(:unit_detail, binding, Pathname.new("reports/detail_#{mangle(t.desc)}.html")) + end +end /cvs/lvm2/LVM2/report-generators/lib/log.rb,v --> standard output revision 1.1 --- LVM2/report-generators/lib/log.rb +++ - 2010-07-20 14:38:47.484273000 +0000 @@ -0,0 +1,30 @@ +# Merely wraps the logger library with a bit of standard policy. +require 'logger' + +module Log + $log = Logger.new(STDERR) + + def init(io_) + $log = Logger.new(io_) + end +end + +def fatal(*args) + $log.fatal(*args) +end + +def error(*args) + $log.error(*args) +end + +def info(*args) + $log.info(*args) +end + +def warning(*args) + $log.warn(*args) +end + +def debug(*args) + $log.debug(*args) +end /cvs/lvm2/LVM2/report-generators/lib/report_templates.rb,v --> standard output revision 1.1 --- LVM2/report-generators/lib/report_templates.rb +++ - 2010-07-20 14:38:47.575408000 +0000 @@ -0,0 +1,28 @@ +# Policy for the location of report templates +require 'string-store' + +class TemplateStringStore < StringStore + def initialize() + super(['report-generators/templates']) + end +end + +module ReportTemplates + def generate_report(report, bs, dest_path = nil) + include Reports + reports = ReportRegister.new + template_store = TemplateStringStore.new + report = reports.get_report(report) + erb = ERB.new(template_store.lookup(report.template)) + body = erb.result(bs) + title = report.short_desc + + erb = ERB.new(template_store.lookup("boiler_plate.rhtml")) + txt = erb.result(binding) + + dest_path = dest_path.nil? ? report.path : dest_path + dest_path.open("w") do |out| + out.puts txt + end + end +end /cvs/lvm2/LVM2/report-generators/lib/reports.rb,v --> standard output revision 1.1 --- LVM2/report-generators/lib/reports.rb +++ - 2010-07-20 14:38:47.677539000 +0000 @@ -0,0 +1,48 @@ +# Data about the various reports we support +require 'log' +require 'pathname' + +module Reports + Report = Struct.new(:short_desc, :desc, :path, :template) + + class ReportRegister + attr_reader :reports + + private + def add_report(sym, *args) + @reports[sym] = Report.new(*args) + end + + public + def initialize() + @reports = Hash.new + + add_report(:unit_test, + "Unit Tests", + "unit tests", + Pathname.new("reports/unit.html"), + Pathname.new("unit_test.rhtml")) + + add_report(:memcheck, + "Memory Tests", + "unit tests with valgrind memory checking", + Pathname.new("reports/memcheck.html"), + Pathname.new("memcheck.rhtml")) + + add_report(:unit_detail, + "Unit Test Detail", + "unit test detail", + Pathname.new("reports/unit_detail.html"), # FIXME replace this with a lambda + Pathname.new("unit_detail.rhtml")) + end + + def get_report(sym) + raise RuntimeError, "unknown report '#{sym}'" unless @reports.member?(sym) + @reports[sym] + end + + def each(&block) + @reports.each(&block) + end + end +end /cvs/lvm2/LVM2/report-generators/lib/schedule_file.rb,v --> standard output revision 1.1 --- LVM2/report-generators/lib/schedule_file.rb +++ - 2010-07-20 14:38:47.777302000 +0000 @@ -0,0 +1,46 @@ +# Parses the simple colon delimited test schedule files. + +ScheduledTest = Struct.new(:desc, :command_line, :status, :output) + +class Schedule + attr_reader :dir, :schedules + + def initialize(dir, ss) + @dir = dir + @schedules = ss + end + + def run + Dir::chdir(@dir.to_s) do + @schedules.each do |s| + reader, writer = IO.pipe + print "#{s.desc} ... " + pid = spawn(s.command_line, [ STDERR, STDOUT ] => writer) + writer.close + _, s.status = Process::waitpid2(pid) + puts (s.status.success? ? "pass" : "fail") + s.output = reader.read + end + end + end + + def self.read(dir, io) + ss = Array.new + + io.readlines.each do |line| + case line.strip + when /^\#.*/ + next + + when /([^:]+):(.*)/ + ss << ScheduledTest.new($1.strip, $2.strip) + + else + raise RuntimeError, "badly formatted schedule line" + end + end + + Schedule.new(dir, ss) + end +end + /cvs/lvm2/LVM2/report-generators/lib/string-store.rb,v --> standard output revision 1.1 --- LVM2/report-generators/lib/string-store.rb +++ - 2010-07-20 14:38:47.872851000 +0000 @@ -0,0 +1,32 @@ +# Provides a simple way of accessing the contents of files by a symbol +# name. Useful for erb templates. + +require 'pathname' + +class StringStore + attr_accessor :path + + def initialize(p) + @paths = p.nil? ? Array.new : p # FIXME: do we need to copy p ? + end + + def lookup(sym) + files = expansions(sym) + + @paths.each do |p| + files.each do |f| + pn = Pathname.new("#{p}/#{f}") + if pn.file? + return pn.read + end + end + end + + raise RuntimeError, "unknown string entry: #{sym}" + end + + private + def expansions(sym) + ["#{sym}", "#{sym}.txt"] + end +end /cvs/lvm2/LVM2/report-generators/templates/boiler_plate.rhtml,v --> standard output revision 1.1 --- LVM2/report-generators/templates/boiler_plate.rhtml +++ - 2010-07-20 14:38:48.000343000 +0000 @@ -0,0 +1,25 @@ + + + +<%= title %> + + + + + +
+ + +
+ <%= body %> +
+
+ /cvs/lvm2/LVM2/report-generators/templates/index.rhtml,v --> standard output revision 1.1 --- LVM2/report-generators/templates/index.rhtml +++ - 2010-07-20 14:38:48.082931000 +0000 @@ -0,0 +1,17 @@ + + +<% [:unit_test, :memcheck].each do |sym| %> +<% r = reports.get_report(sym) %> + + + + +<% end %> +
ReportGeneration time
+ <% if r.path.file? %> + <%= r.short_desc %> + <% else %> + <%= r.short_desc %> + <% end %> + <%= safe_mtime(r) %>
+ /cvs/lvm2/LVM2/report-generators/templates/memcheck.rhtml,v --> standard output revision 1.1 --- LVM2/report-generators/templates/memcheck.rhtml +++ - 2010-07-20 14:38:48.164010000 +0000 @@ -0,0 +1,30 @@ + + + +
Tests passedTests failed
<%= total_passed %>><%= total_failed %>
+ +<% schedules.each do |s| %> +

<%= s.dir.sub('./unit-tests/', '') %>

+ + + +<% s.schedules.each do |t| %> + + + <% if t.status.success? %> + + <% else %> + + <% end %> + + <% stats = extract_stats(t) %> + + + + + +<% end %> +
TestResultDefinitely lostindirectly lostpossibly loststill reachable
+ <%= t.desc %> + passfail<%= stats.definitely_lost %><%= stats.indirectly_lost %><%= stats.possibly_lost %><%= stats.reachable %>
+<% end %> /cvs/lvm2/LVM2/report-generators/templates/unit_detail.rhtml,v --> standard output revision 1.1 --- LVM2/report-generators/templates/unit_detail.rhtml +++ - 2010-07-20 14:38:48.264240000 +0000 @@ -0,0 +1,37 @@ + + + + + <% if t.status.success? %> + + <% else %> + + <% end %> + +
TestResult
+ <%= t.desc %> + passfail
+ + + + + + +
Command line
+
+<%= t.command_line %>
+  
+
+ + + + + + + +
Output
+
+<%= t.output %>
+  
+
+ /cvs/lvm2/LVM2/report-generators/templates/unit_test.rhtml,v --> standard output revision 1.1 --- LVM2/report-generators/templates/unit_test.rhtml +++ - 2010-07-20 14:38:48.350577000 +0000 @@ -0,0 +1,23 @@ + + + +
Tests passedTests failed
<%= total_passed %>><%= total_failed %>
+ +<% schedules.each do |s| %> +

<%= s.dir.sub('./unit-tests/', '') %>

+ + +<% s.schedules.each do |t| %> + + + <% if t.status.success? %> + + <% else %> + + <% end %> + +<% end %> +
TestResult
+ <%= t.desc %> + passfail
+<% end %> /cvs/lvm2/LVM2/report-generators/test/example.schedule,v --> standard output revision 1.1 --- LVM2/report-generators/test/example.schedule +++ - 2010-07-20 14:38:48.459280000 +0000 @@ -0,0 +1,4 @@ +# This is a comment +description number 1:$TEST_TOOL ls +foo bar: $TEST_TOOL du -hs . + this comment is prefixed with whitespace: $TEST_TOOL date \ No newline at end of file /cvs/lvm2/LVM2/report-generators/test/tc_log.rb,v --> standard output revision 1.1 --- LVM2/report-generators/test/tc_log.rb +++ - 2010-07-20 14:38:48.726055000 +0000 @@ -0,0 +1,26 @@ +require 'test/unit' +require 'stringio' +require 'log' + +class TestLog < Test::Unit::TestCase + include Log + + private + def remove_timestamps(l) + l.gsub(/\[[^\]]*\]/, '') + end + + public + def test_log + StringIO.open do |out| + init(out) + + info("msg1") + warning("msg2") + debug("msg3") + + assert_equal("I, INFO -- : msg1\nW, WARN -- : msg2\nD, DEBUG -- : msg3\n", + remove_timestamps(out.string)) + end + end +end /cvs/lvm2/LVM2/report-generators/test/tc_schedule_file.rb,v --> standard output revision 1.1 --- LVM2/report-generators/test/tc_schedule_file.rb +++ - 2010-07-20 14:38:48.840419000 +0000 @@ -0,0 +1,28 @@ +require 'test/unit' +require 'pathname' +require 'schedule_file' + +class TestScheduleFile < Test::Unit::TestCase + def test_reading + p = Pathname.new("report-generators/test/example.schedule") + p.open do |f| + s = Schedule.read(p.dirname, f) + + assert_equal(3, s.schedules.size) + assert_equal(s.schedules[2].desc, "this comment is prefixed with whitespace") + assert_equal(s.schedules[0].command_line, "$TEST_TOOL ls") + end + end + + def test_running + p = Pathname.new("report-generators/test/example.schedule") + p.open do |f| + s = Schedule.read(p.dirname, f) + s.run + + s.schedules.each do |t| + assert(t.status.success?) + end + end + end +end /cvs/lvm2/LVM2/report-generators/test/tc_string_store.rb,v --> standard output revision 1.1 --- LVM2/report-generators/test/tc_string_store.rb +++ - 2010-07-20 14:38:48.924590000 +0000 @@ -0,0 +1,19 @@ +require 'string-store' +require 'test/unit' + +class TestStringStore < Test::Unit::TestCase + def setup + @ss = StringStore.new(['report-generators/test/strings', + 'report-generators/test/strings/more_strings']) + end + + def test_lookup + assert_equal("Hello, world!\n", @ss.lookup(:test1)) + assert_equal("one\ntwo\nthree", @ss.lookup(:test2)) + assert_equal("lorem\n", @ss.lookup(:test3)) + + assert_raises(RuntimeError) do + @ss.lookup(:unlikely_name) + end + end +end /cvs/lvm2/LVM2/report-generators/test/ts.rb,v --> standard output revision 1.1 --- LVM2/report-generators/test/ts.rb +++ - 2010-07-20 14:38:49.072218000 +0000 @@ -0,0 +1,3 @@ +require 'tc_log' +require 'tc_string_store' +require 'tc_schedule_file' /cvs/lvm2/LVM2/report-generators/test/strings/test1.txt,v --> standard output revision 1.1 --- LVM2/report-generators/test/strings/test1.txt +++ - 2010-07-20 14:38:49.255652000 +0000 @@ -0,0 +1 @@ +Hello, world! /cvs/lvm2/LVM2/report-generators/test/strings/test2,v --> standard output revision 1.1 --- LVM2/report-generators/test/strings/test2 +++ - 2010-07-20 14:38:49.359850000 +0000 @@ -0,0 +1,3 @@ +one +two +three \ No newline at end of file /cvs/lvm2/LVM2/report-generators/test/strings/more_strings/test3.txt,v --> standard output revision 1.1 --- LVM2/report-generators/test/strings/more_strings/test3.txt +++ - 2010-07-20 14:38:49.446703000 +0000 @@ -0,0 +1 @@ +lorem /cvs/lvm2/LVM2/reports/stylesheet.css,v --> standard output revision 1.1 --- LVM2/reports/stylesheet.css +++ - 2010-07-20 14:38:49.588725000 +0000 @@ -0,0 +1,264 @@ +/* I know nothing about css, and am not likely too either since it's + * about bottom on my list of things to learn. So this file has been + * pinched from the Pragmatic Programmers ruby on rails book. - ejt + */ + +/* Global styles */ + +/* START:notice */ +#notice { + border: 2px solid red; + padding: 1em; + margin-bottom: 2em; + background-color: #f0f0f0; + font: bold smaller sans-serif; +} +/* END:notice */ + +/* Styles for admin/list */ + +#product-list .list-title { + color: #244; + font-weight: bold; + font-size: larger; +} + +#product-list .list-image { + width: 60px; + height: 70px; +} + + +#product-list .list-actions { + font-size: x-small; + text-align: right; + padding-left: 1em; +} + +#product-list .list-line-even { + background: #e0f8f8; +} + +#product-list .list-line-odd { + background: #f8b0f8; +} + + +/* Styles for main page */ + +#banner { + background: #9c9; + padding-top: 5px; + padding-bottom: 5px; + border-bottom: 2px solid; + font: small-caps 20px/20px "Times New Roman", serif; + color: #282; + text-align: center; +} + +#banner img { + float: left; +} + +#main { + margin-left: 0em; + padding-top: 4ex; + padding-left: 2em; + background: white; +} + +h1 { + font: 150% sans-serif; + color: #226; + border-bottom: 3px dotted #77d; +} + +/* An entry in the store catalog */ + +#store .entry { + border-bottom: 1px dotted #77d; +} + +#store .title { + font-size: 120%; + font-family: sans-serif; +} + +#store .entry img { + width: 75px; + float: left; +} + + +#store .entry h3 { + margin-bottom: 2px; + color: #227; +} + +#store .entry p { + margin-top: 0px; + margin-bottom: 0.8em; +} + +#store .entry .price-line { +} + +#store .entry .add-to-cart { + position: relative; +} + +#store .entry .price { + color: #44a; + font-weight: bold; + margin-right: 2em; +} + +/* START:inline */ +#store .entry form, #store .entry form div { + display: inline; +} +/* END:inline */ + +/* START:cart */ +/* Styles for the cart in the main page and the sidebar */ + +.cart-title { + font: 120% bold; +} + +.item-price, .total-line { + text-align: right; +} + +.total-line .total-cell { + font-weight: bold; + border-top: 1px solid #595; +} + + +/* Styles for the cart in the sidebar */ + +#cart, #cart table { + font-size: smaller; + color: white; +} + +#cart table { + border-top: 1px dotted #595; + border-bottom: 1px dotted #595; + margin-bottom: 10px; +} +/* END:cart */ + +/* Styles for order form */ + +.depot-form fieldset { + background: #efe; +} + +.depot-form legend { + color: #dfd; + background: #141; + font-family: sans-serif; + padding: 0.2em 1em; +} + +.depot-form label { + width: 5em; + float: left; + text-align: right; + margin-right: 0.5em; + display: block; +} + +.depot-form .submit { + margin-left: 5.5em; +} + +/* The error box */ + +.fieldWithErrors { + padding: 2px; + background-color: red; + display: table; +} + +#errorExplanation { + width: 400px; + border: 2px solid red; + padding: 7px; + padding-bottom: 12px; + margin-bottom: 20px; + background-color: #f0f0f0; +} + +#errorExplanation h2 { + text-align: left; + font-weight: bold; + padding: 5px 5px 5px 15px; + font-size: 12px; + margin: -7px; + background-color: #c00; + color: #fff; +} + +#errorExplanation p { + color: #333; + margin-bottom: 0; + padding: 5px; +} + +#errorExplanation ul li { + font-size: 12px; + list-style: square; +} + +body { + font: normal 75% verdana,arial,helvetica; + color:#000000; +} + +table tr td, table tr th { + font-size: 75%; +} + +table.stripes tr th { + font-weight: bold; + text-align: left; + background: #a0a0a0; +} + +table.stripes tr td { + background: #ccccc0; +} + +td.pass { + color: green; +} + +td.fail { + color: red; + font-weight: bold; +} + +#main { + padding-left: 0em; +} + +#controls { + float: left; + padding-top: 1em; + padding-left: 1em; + padding-right: 1em; + padding-bottom: 1em; + width: 14em; + border-right: 2px solid; +} + +#body { + margin-left: 16em; + padding-top: 4ex; + padding-left: 2em; + background: white; + border-left: 2px solid; +} From thornber@sourceware.org Tue Jul 20 15:17:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 15:17:00 -0000 Subject: LVM2/unit-tests/regex Message-ID: <20100720151719.16978.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 15:17:19 LVM2/unit-tests/regex Update of /cvs/lvm2/LVM2/unit-tests/regex In directory sourceware.org:/tmp/cvs-serv16970/unit-tests/regex Log Message: Directory /cvs/lvm2/LVM2/unit-tests/regex added to the repository From thornber@sourceware.org Tue Jul 20 15:17:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 15:17:00 -0000 Subject: LVM2/unit-tests Message-ID: <20100720151708.16840.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 15:17:08 LVM2/unit-tests Update of /cvs/lvm2/LVM2/unit-tests In directory sourceware.org:/tmp/cvs-serv16833/unit-tests Log Message: Directory /cvs/lvm2/LVM2/unit-tests added to the repository From thornber@sourceware.org Tue Jul 20 15:19:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 15:19:00 -0000 Subject: LVM2 unit-tests/regex/Makefile.in unit-tests/r ... Message-ID: <20100720151900.17616.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 15:18:57 Added files: unit-tests/regex: Makefile.in dev_patterns devices.list matcher_t.c parse_t.c Removed files: old-tests/regex: Makefile.in dev_patterns devices.list matcher_t.c parse_t.c Log message: Move tests from old-tests/regex to unit-tests/regex. unit-tests will contain tests that currently work. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/old-tests/regex/Makefile.in.diff?cvsroot=lvm2&r1=1.7&r2=NONE http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/old-tests/regex/dev_patterns.diff?cvsroot=lvm2&r1=1.1&r2=NONE http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/old-tests/regex/devices.list.diff?cvsroot=lvm2&r1=1.1&r2=NONE http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/old-tests/regex/matcher_t.c.diff?cvsroot=lvm2&r1=1.5&r2=NONE http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/old-tests/regex/parse_t.c.diff?cvsroot=lvm2&r1=1.7&r2=NONE http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/Makefile.in.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/dev_patterns.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/devices.list.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/matcher_t.c.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/parse_t.c.diff?cvsroot=lvm2&r1=NONE&r2=1.1 /cvs/lvm2/LVM2/unit-tests/regex/Makefile.in,v --> standard output revision 1.1 --- LVM2/unit-tests/regex/Makefile.in +++ - 2010-07-20 15:18:59.935408000 +0000 @@ -0,0 +1,37 @@ +# +# Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. +# Copyright (C) 2004-2010 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 + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +top_builddir = @top_builddir@ + +SOURCES=\ + parse_t.c \ + matcher_t.c + +TARGETS=\ + parse_t \ + matcher_t + +include $(top_builddir)/make.tmpl + +INCLUDES += -I$(top_srcdir)/libdm +DM_DEPS = $(top_builddir)/libdm/libdevmapper.so +DM_LIBS = -ldevmapper $(LIBS) + +parse_t: parse_t.o $(DM_DEPS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ parse_t.o $(DM_LIBS) + +matcher_t: matcher_t.o $(DM_DEPS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ matcher_t.o $(DM_LIBS) /cvs/lvm2/LVM2/unit-tests/regex/dev_patterns,v --> standard output revision 1.1 --- LVM2/unit-tests/regex/dev_patterns +++ - 2010-07-20 15:19:00.104209000 +0000 @@ -0,0 +1,2 @@ +"loop/[0-9]+" +"hd[a-d][0-5]+" /cvs/lvm2/LVM2/unit-tests/regex/devices.list,v --> standard output revision 1.1 --- LVM2/unit-tests/regex/devices.list +++ - 2010-07-20 15:19:00.272311000 +0000 @@ -0,0 +1,880 @@ +/dev +/dev/.devfsd +/dev/cpu +/dev/cpu/mtrr +/dev/netlink +/dev/netlink/route +/dev/netlink/skip +/dev/netlink/USERSOCK +/dev/netlink/fwmonitor +/dev/netlink/ARPD +/dev/netlink/ROUTE6 +/dev/netlink/IP6_FW +/dev/netlink/tap0 +/dev/netlink/tap1 +/dev/netlink/tap2 +/dev/netlink/tap3 +/dev/netlink/tap4 +/dev/netlink/tap5 +/dev/netlink/tap6 +/dev/netlink/tap7 +/dev/netlink/tap8 +/dev/netlink/tap9 +/dev/netlink/tap10 +/dev/netlink/tap11 +/dev/netlink/tap12 +/dev/netlink/tap13 +/dev/netlink/tap14 +/dev/netlink/tap15 +/dev/shm +/dev/mem +/dev/kmem +/dev/null +/dev/port +/dev/zero +/dev/full +/dev/random +/dev/urandom +/dev/tty +/dev/console +/dev/vc +/dev/vc/1 +/dev/vc/2 +/dev/vc/3 +/dev/vc/4 +/dev/vc/5 +/dev/vc/6 +/dev/vc/7 +/dev/vc/8 +/dev/vc/9 +/dev/vc/10 +/dev/vc/11 +/dev/vc/12 +/dev/vc/13 +/dev/vc/14 +/dev/vc/15 +/dev/vc/16 +/dev/vc/17 +/dev/vc/18 +/dev/vc/19 +/dev/vc/20 +/dev/vc/21 +/dev/vc/22 +/dev/vc/23 +/dev/vc/24 +/dev/vc/25 +/dev/vc/26 +/dev/vc/27 +/dev/vc/28 +/dev/vc/29 +/dev/vc/30 +/dev/vc/31 +/dev/vc/32 +/dev/vc/33 +/dev/vc/34 +/dev/vc/35 +/dev/vc/36 +/dev/vc/37 +/dev/vc/38 +/dev/vc/39 +/dev/vc/40 +/dev/vc/41 +/dev/vc/42 +/dev/vc/43 +/dev/vc/44 +/dev/vc/45 +/dev/vc/46 +/dev/vc/47 +/dev/vc/48 +/dev/vc/49 +/dev/vc/50 +/dev/vc/51 +/dev/vc/52 +/dev/vc/53 +/dev/vc/54 +/dev/vc/55 +/dev/vc/56 +/dev/vc/57 +/dev/vc/58 +/dev/vc/59 +/dev/vc/60 +/dev/vc/61 +/dev/vc/62 +/dev/vc/63 +/dev/vc/0 +/dev/ptmx +/dev/misc +/dev/misc/psaux +/dev/pty +/dev/pty/m0 +/dev/pty/m1 +/dev/pty/m2 +/dev/pty/m3 +/dev/pty/m4 +/dev/pty/m5 +/dev/pty/m6 +/dev/pty/m7 +/dev/pty/m8 +/dev/pty/m9 +/dev/pty/m10 +/dev/pty/m11 +/dev/pty/m12 +/dev/pty/m13 +/dev/pty/m14 +/dev/pty/m15 +/dev/pty/m16 +/dev/pty/m17 +/dev/pty/m18 +/dev/pty/m19 +/dev/pty/m20 +/dev/pty/m21 +/dev/pty/m22 +/dev/pty/m23 +/dev/pty/m24 +/dev/pty/m25 +/dev/pty/m26 +/dev/pty/m27 +/dev/pty/m28 +/dev/pty/m29 +/dev/pty/m30 +/dev/pty/m31 +/dev/pty/m32 +/dev/pty/m33 +/dev/pty/m34 +/dev/pty/m35 +/dev/pty/m36 +/dev/pty/m37 +/dev/pty/m38 +/dev/pty/m39 +/dev/pty/m40 +/dev/pty/m41 +/dev/pty/m42 +/dev/pty/m43 +/dev/pty/m44 +/dev/pty/m45 +/dev/pty/m46 +/dev/pty/m47 +/dev/pty/m48 +/dev/pty/m49 +/dev/pty/m50 +/dev/pty/m51 +/dev/pty/m52 +/dev/pty/m53 +/dev/pty/m54 +/dev/pty/m55 +/dev/pty/m56 +/dev/pty/m57 +/dev/pty/m58 +/dev/pty/m59 +/dev/pty/m60 +/dev/pty/m61 +/dev/pty/m62 +/dev/pty/m63 +/dev/pty/m64 +/dev/pty/m65 +/dev/pty/m66 +/dev/pty/m67 +/dev/pty/m68 +/dev/pty/m69 +/dev/pty/m70 +/dev/pty/m71 +/dev/pty/m72 +/dev/pty/m73 +/dev/pty/m74 +/dev/pty/m75 +/dev/pty/m76 +/dev/pty/m77 +/dev/pty/m78 +/dev/pty/m79 +/dev/pty/m80 +/dev/pty/m81 +/dev/pty/m82 +/dev/pty/m83 +/dev/pty/m84 +/dev/pty/m85 +/dev/pty/m86 +/dev/pty/m87 +/dev/pty/m88 +/dev/pty/m89 +/dev/pty/m90 +/dev/pty/m91 +/dev/pty/m92 +/dev/pty/m93 +/dev/pty/m94 +/dev/pty/m95 +/dev/pty/m96 +/dev/pty/m97 +/dev/pty/m98 +/dev/pty/m99 +/dev/pty/m100 +/dev/pty/m101 +/dev/pty/m102 +/dev/pty/m103 +/dev/pty/m104 +/dev/pty/m105 +/dev/pty/m106 +/dev/pty/m107 +/dev/pty/m108 +/dev/pty/m109 +/dev/pty/m110 +/dev/pty/m111 +/dev/pty/m112 +/dev/pty/m113 +/dev/pty/m114 +/dev/pty/m115 +/dev/pty/m116 +/dev/pty/m117 +/dev/pty/m118 +/dev/pty/m119 +/dev/pty/m120 +/dev/pty/m121 +/dev/pty/m122 +/dev/pty/m123 +/dev/pty/m124 +/dev/pty/m125 +/dev/pty/m126 +/dev/pty/m127 +/dev/pty/m128 +/dev/pty/m129 +/dev/pty/m130 +/dev/pty/m131 +/dev/pty/m132 +/dev/pty/m133 +/dev/pty/m134 +/dev/pty/m135 +/dev/pty/m136 +/dev/pty/m137 +/dev/pty/m138 +/dev/pty/m139 +/dev/pty/m140 +/dev/pty/m141 +/dev/pty/m142 +/dev/pty/m143 +/dev/pty/m144 +/dev/pty/m145 +/dev/pty/m146 +/dev/pty/m147 +/dev/pty/m148 +/dev/pty/m149 +/dev/pty/m150 +/dev/pty/m151 +/dev/pty/m152 +/dev/pty/m153 +/dev/pty/m154 +/dev/pty/m155 +/dev/pty/m156 +/dev/pty/m157 +/dev/pty/m158 +/dev/pty/m159 +/dev/pty/m160 +/dev/pty/m161 +/dev/pty/m162 +/dev/pty/m163 +/dev/pty/m164 +/dev/pty/m165 +/dev/pty/m166 +/dev/pty/m167 +/dev/pty/m168 +/dev/pty/m169 +/dev/pty/m170 +/dev/pty/m171 +/dev/pty/m172 +/dev/pty/m173 +/dev/pty/m174 +/dev/pty/m175 +/dev/pty/m176 +/dev/pty/m177 +/dev/pty/m178 +/dev/pty/m179 +/dev/pty/m180 +/dev/pty/m181 +/dev/pty/m182 +/dev/pty/m183 +/dev/pty/m184 +/dev/pty/m185 +/dev/pty/m186 +/dev/pty/m187 +/dev/pty/m188 +/dev/pty/m189 +/dev/pty/m190 +/dev/pty/m191 +/dev/pty/m192 +/dev/pty/m193 +/dev/pty/m194 +/dev/pty/m195 +/dev/pty/m196 +/dev/pty/m197 +/dev/pty/m198 +/dev/pty/m199 +/dev/pty/m200 +/dev/pty/m201 +/dev/pty/m202 +/dev/pty/m203 +/dev/pty/m204 +/dev/pty/m205 +/dev/pty/m206 +/dev/pty/m207 +/dev/pty/m208 +/dev/pty/m209 +/dev/pty/m210 +/dev/pty/m211 +/dev/pty/m212 +/dev/pty/m213 +/dev/pty/m214 +/dev/pty/m215 +/dev/pty/m216 +/dev/pty/m217 +/dev/pty/m218 +/dev/pty/m219 +/dev/pty/m220 +/dev/pty/m221 +/dev/pty/m222 +/dev/pty/m223 +/dev/pty/m224 +/dev/pty/m225 +/dev/pty/m226 +/dev/pty/m227 +/dev/pty/m228 +/dev/pty/m229 +/dev/pty/m230 +/dev/pty/m231 +/dev/pty/m232 +/dev/pty/m233 +/dev/pty/m234 +/dev/pty/m235 +/dev/pty/m236 +/dev/pty/m237 +/dev/pty/m238 +/dev/pty/m239 +/dev/pty/m240 +/dev/pty/m241 +/dev/pty/m242 +/dev/pty/m243 +/dev/pty/m244 +/dev/pty/m245 +/dev/pty/m246 +/dev/pty/m247 +/dev/pty/m248 +/dev/pty/m249 +/dev/pty/m250 +/dev/pty/m251 +/dev/pty/m252 +/dev/pty/m253 +/dev/pty/m254 +/dev/pty/m255 +/dev/pts +/dev/pts/0 +/dev/pts/1 +/dev/pts/2 +/dev/pts/3 +/dev/pts/4 +/dev/pts/5 +/dev/pts/6 +/dev/pts/7 +/dev/vcc +/dev/vcc/0 +/dev/vcc/a +/dev/vcc/1 +/dev/vcc/a1 +/dev/vcc/2 +/dev/vcc/a2 +/dev/vcc/3 +/dev/vcc/a3 +/dev/vcc/5 +/dev/vcc/a5 +/dev/vcc/4 +/dev/vcc/a4 +/dev/vcc/6 +/dev/vcc/a6 +/dev/vcc/7 +/dev/vcc/a7 +/dev/tts +/dev/tts/0 +/dev/cua +/dev/cua/0 +/dev/ide +/dev/ide/host0 +/dev/ide/host0/bus0 +/dev/ide/host0/bus0/target0 +/dev/ide/host0/bus0/target0/lun0 +/dev/ide/host0/bus0/target0/lun0/disc +/dev/ide/host0/bus0/target0/lun0/part1 +/dev/ide/host0/bus0/target0/lun0/part2 +/dev/ide/host0/bus0/target0/lun0/part3 +/dev/ide/host0/bus0/target0/lun0/part4 +/dev/ide/host0/bus0/target0/lun0/part5 +/dev/ide/host0/bus0/target0/lun0/part6 +/dev/ide/host0/bus0/target0/lun0/part7 +/dev/ide/host0/bus0/target0/lun0/part8 +/dev/ide/host0/bus0/target1 +/dev/ide/host0/bus0/target1/lun0 +/dev/ide/host0/bus0/target1/lun0/disc +/dev/ide/host0/bus0/target1/lun0/part1 +/dev/ide/host0/bus1 +/dev/ide/host0/bus1/target0 +/dev/ide/host0/bus1/target0/lun0 +/dev/ide/host0/bus1/target0/lun0/disc +/dev/ide/host0/bus1/target0/lun0/part1 +/dev/ide/host0/bus1/target1 +/dev/ide/host0/bus1/target1/lun0 +/dev/discs +/dev/discs/disc0 +/dev/discs/disc1 +/dev/discs/disc2 +/dev/floppy +/dev/floppy/0u1440 +/dev/floppy/0u1680 +/dev/floppy/0u1722 +/dev/floppy/0u1743 +/dev/floppy/0u1760 +/dev/floppy/0u1920 +/dev/floppy/0u1840 +/dev/floppy/0u1600 +/dev/floppy/0u360 +/dev/floppy/0u720 +/dev/floppy/0u820 +/dev/floppy/0u830 +/dev/floppy/0u1040 +/dev/floppy/0u1120 +/dev/floppy/0u800 +/dev/floppy/0 +/dev/loop +/dev/loop/0 +/dev/loop/1 +/dev/loop/2 +/dev/loop/3 +/dev/loop/4 +/dev/loop/5 +/dev/loop/6 +/dev/loop/7 +/dev/cdroms +/dev/sound +/dev/sound/dsp +/dev/sound/dsp1 +/dev/sound/mixer +/dev/sound/midi +/dev/usb +/dev/root +/dev/initctl +/dev/xconsole +/dev/fd +/dev/stdin +/dev/stdout +/dev/stderr +/dev/route +/dev/skip +/dev/USERSOCK +/dev/fwmonitor +/dev/ARPD +/dev/ROUTE6 +/dev/IP6_FW +/dev/tap0 +/dev/tap1 +/dev/tap2 +/dev/tap3 +/dev/tap4 +/dev/tap5 +/dev/tap6 +/dev/tap7 +/dev/tap8 +/dev/tap9 +/dev/tap10 +/dev/tap11 +/dev/tap12 +/dev/tap13 +/dev/tap14 +/dev/tap15 +/dev/tty1 +/dev/tty2 +/dev/tty3 +/dev/tty4 +/dev/tty5 +/dev/tty6 +/dev/tty7 +/dev/tty8 +/dev/tty9 +/dev/tty10 +/dev/tty11 +/dev/tty12 +/dev/tty13 +/dev/tty14 +/dev/tty15 +/dev/tty16 +/dev/tty17 +/dev/tty18 +/dev/tty19 +/dev/tty20 +/dev/tty21 +/dev/tty22 +/dev/tty23 +/dev/tty24 +/dev/tty25 +/dev/tty26 +/dev/tty27 +/dev/tty28 +/dev/tty29 +/dev/tty30 +/dev/tty31 +/dev/tty32 +/dev/tty33 +/dev/tty34 +/dev/tty35 +/dev/tty36 +/dev/tty37 +/dev/tty38 +/dev/tty39 +/dev/tty40 +/dev/tty41 +/dev/tty42 +/dev/tty43 +/dev/tty44 +/dev/tty45 +/dev/tty46 +/dev/tty47 +/dev/tty48 +/dev/tty49 +/dev/tty50 +/dev/tty51 +/dev/tty52 +/dev/tty53 +/dev/tty54 +/dev/tty55 +/dev/tty56 +/dev/tty57 +/dev/tty58 +/dev/tty59 +/dev/tty60 +/dev/tty61 +/dev/tty62 +/dev/tty63 +/dev/tty0 +/dev/psaux +/dev/ptyp0 +/dev/ptyp1 +/dev/ptyp2 +/dev/ptyp3 +/dev/ptyp4 +/dev/ptyp5 +/dev/ptyp6 +/dev/ptyp7 +/dev/ptyp8 +/dev/ptyp9 +/dev/ptypa +/dev/ptypb +/dev/ptypc +/dev/ptypd +/dev/ptype +/dev/ptypf +/dev/ptyq0 +/dev/ptyq1 +/dev/ptyq2 +/dev/ptyq3 +/dev/ptyq4 +/dev/ptyq5 +/dev/ptyq6 +/dev/ptyq7 +/dev/ptyq8 +/dev/ptyq9 +/dev/ptyqa +/dev/ptyqb +/dev/ptyqc +/dev/ptyqd +/dev/ptyqe +/dev/ptyqf +/dev/ptyr0 +/dev/ptyr1 +/dev/ptyr2 +/dev/ptyr3 +/dev/ptyr4 +/dev/ptyr5 +/dev/ptyr6 +/dev/ptyr7 +/dev/ptyr8 +/dev/ptyr9 +/dev/ptyra +/dev/ptyrb +/dev/ptyrc +/dev/ptyrd +/dev/ptyre +/dev/ptyrf +/dev/ptys0 +/dev/ptys1 +/dev/ptys2 +/dev/ptys3 +/dev/ptys4 +/dev/ptys5 +/dev/ptys6 +/dev/ptys7 +/dev/ptys8 +/dev/ptys9 +/dev/ptysa +/dev/ptysb +/dev/ptysc +/dev/ptysd +/dev/ptyse +/dev/ptysf +/dev/ptyt0 +/dev/ptyt1 +/dev/ptyt2 +/dev/ptyt3 +/dev/ptyt4 +/dev/ptyt5 +/dev/ptyt6 +/dev/ptyt7 +/dev/ptyt8 +/dev/ptyt9 +/dev/ptyta +/dev/ptytb +/dev/ptytc +/dev/ptytd +/dev/ptyte +/dev/ptytf +/dev/ptyu0 +/dev/ptyu1 +/dev/ptyu2 +/dev/ptyu3 +/dev/ptyu4 +/dev/ptyu5 +/dev/ptyu6 +/dev/ptyu7 +/dev/ptyu8 +/dev/ptyu9 +/dev/ptyua +/dev/ptyub +/dev/ptyuc +/dev/ptyud +/dev/ptyue +/dev/ptyuf +/dev/ptyv0 +/dev/ptyv1 +/dev/ptyv2 +/dev/ptyv3 +/dev/ptyv4 +/dev/ptyv5 +/dev/ptyv6 +/dev/ptyv7 +/dev/ptyv8 +/dev/ptyv9 +/dev/ptyva +/dev/ptyvb +/dev/ptyvc +/dev/ptyvd +/dev/ptyve +/dev/ptyvf +/dev/ptyw0 +/dev/ptyw1 +/dev/ptyw2 +/dev/ptyw3 +/dev/ptyw4 +/dev/ptyw5 +/dev/ptyw6 +/dev/ptyw7 +/dev/ptyw8 +/dev/ptyw9 +/dev/ptywa +/dev/ptywb +/dev/ptywc +/dev/ptywd +/dev/ptywe +/dev/ptywf +/dev/ptyx0 +/dev/ptyx1 +/dev/ptyx2 +/dev/ptyx3 +/dev/ptyx4 +/dev/ptyx5 +/dev/ptyx6 +/dev/ptyx7 +/dev/ptyx8 +/dev/ptyx9 +/dev/ptyxa +/dev/ptyxb +/dev/ptyxc +/dev/ptyxd +/dev/ptyxe +/dev/ptyxf +/dev/ptyy0 +/dev/ptyy1 +/dev/ptyy2 +/dev/ptyy3 +/dev/ptyy4 +/dev/ptyy5 +/dev/ptyy6 +/dev/ptyy7 +/dev/ptyy8 +/dev/ptyy9 +/dev/ptyya +/dev/ptyyb +/dev/ptyyc +/dev/ptyyd +/dev/ptyye +/dev/ptyyf +/dev/ptyz0 +/dev/ptyz1 +/dev/ptyz2 +/dev/ptyz3 +/dev/ptyz4 +/dev/ptyz5 +/dev/ptyz6 +/dev/ptyz7 +/dev/ptyz8 +/dev/ptyz9 +/dev/ptyza +/dev/ptyzb +/dev/ptyzc +/dev/ptyzd +/dev/ptyze +/dev/ptyzf +/dev/ptya0 +/dev/ptya1 +/dev/ptya2 +/dev/ptya3 +/dev/ptya4 +/dev/ptya5 +/dev/ptya6 +/dev/ptya7 +/dev/ptya8 +/dev/ptya9 +/dev/ptyaa +/dev/ptyab +/dev/ptyac +/dev/ptyad +/dev/ptyae +/dev/ptyaf +/dev/ptyb0 +/dev/ptyb1 +/dev/ptyb2 +/dev/ptyb3 +/dev/ptyb4 +/dev/ptyb5 +/dev/ptyb6 +/dev/ptyb7 +/dev/ptyb8 +/dev/ptyb9 +/dev/ptyba +/dev/ptybb +/dev/ptybc +/dev/ptybd +/dev/ptybe +/dev/ptybf +/dev/ptyc0 +/dev/ptyc1 +/dev/ptyc2 +/dev/ptyc3 +/dev/ptyc4 +/dev/ptyc5 +/dev/ptyc6 +/dev/ptyc7 +/dev/ptyc8 +/dev/ptyc9 +/dev/ptyca +/dev/ptycb +/dev/ptycc +/dev/ptycd +/dev/ptyce +/dev/ptycf +/dev/ptyd0 +/dev/ptyd1 +/dev/ptyd2 +/dev/ptyd3 +/dev/ptyd4 +/dev/ptyd5 +/dev/ptyd6 +/dev/ptyd7 +/dev/ptyd8 +/dev/ptyd9 +/dev/ptyda +/dev/ptydb +/dev/ptydc +/dev/ptydd +/dev/ptyde +/dev/ptydf +/dev/ptye0 +/dev/ptye1 +/dev/ptye2 +/dev/ptye3 +/dev/ptye4 +/dev/ptye5 +/dev/ptye6 +/dev/ptye7 +/dev/ptye8 +/dev/ptye9 +/dev/ptyea +/dev/ptyeb +/dev/ptyec +/dev/ptyed +/dev/ptyee +/dev/ptyef +/dev/vcs +/dev/vcsa +/dev/vcs1 +/dev/vcsa1 +/dev/ttyS0 +/dev/cua0 +/dev/hda +/dev/hda1 +/dev/hda2 +/dev/hda3 +/dev/hda4 +/dev/hda5 +/dev/hda6 +/dev/hda7 +/dev/hda8 +/dev/hdb +/dev/hdb1 +/dev/hdc +/dev/hdc1 +/dev/fd0u1440 +/dev/fd0u1680 +/dev/fd0u1722 +/dev/fd0u1743 +/dev/fd0u1760 +/dev/fd0u1920 +/dev/fd0u1840 +/dev/fd0u1600 +/dev/fd0u360 +/dev/fd0u720 +/dev/fd0u820 +/dev/fd0u830 +/dev/fd0u1040 +/dev/fd0u1120 +/dev/fd0u800 +/dev/fd0 +/dev/loop0 +/dev/loop1 +/dev/loop2 +/dev/loop3 +/dev/loop4 +/dev/loop5 +/dev/loop6 +/dev/loop7 +/dev/dsp +/dev/dsp1 +/dev/mixer +/dev/midi +/dev/lvm +/dev/vg0 +/dev/vg0/group +/dev/vg0/packages +/dev/vg0/photos +/dev/vg0/music +/dev/log +/dev/MAKEDEV +/dev/printer +/dev/vcs2 +/dev/vcsa2 +/dev/vcs3 +/dev/vcsa3 +/dev/vcs5 +/dev/vcsa5 +/dev/vcs4 +/dev/vcsa4 +/dev/vcs6 +/dev/vcsa6 +/dev/nvidia0 +/dev/nvidia1 +/dev/nvidia2 +/dev/nvidia3 +/dev/nvidiactl +/dev/vcs7 +/dev/vcsa7 /cvs/lvm2/LVM2/unit-tests/regex/matcher_t.c,v --> standard output revision 1.1 --- LVM2/unit-tests/regex/matcher_t.c +++ - 2010-07-20 15:19:00.436824000 +0000 @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. + * Copyright (C) 2004-2010 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 "libdevmapper.h" +#include "log.h" + +#include +#include +#include +#include +#include +#include +#include +#include + + +static int _read_spec(const char *file, char ***regex, int *nregex) +{ + char buffer[1024], *start, *ptr; + FILE *fp = fopen(file, "r"); + int asize = 100; + char **rx = dm_malloc(sizeof(*rx) * asize); + int nr = 0; + + if (!fp) + return 0; + + while (fgets(buffer, sizeof(buffer),fp)) { + + /* trim leading whitespace */ + for (ptr = buffer; *ptr && isspace((int) *ptr); ptr++); + + if (!*ptr || *ptr == '#') + continue; + + if (*ptr == '\"') { + ptr++; + start = ptr; + while (*ptr && *ptr != '\"') { + if (*ptr == '\\') + ptr++; + ptr++; + } + + if (!*ptr) { + fprintf(stderr, "Formatting error : " + "No terminating quote\n"); + return 0; + } + + rx[nr] = dm_malloc((ptr - start) + 1); + strncpy(rx[nr], start, ptr - start); + rx[nr][ptr - start] = '\0'; + nr++; + } else { + fprintf(stderr, "%s", ptr); + fprintf(stderr, "Formatting error : \"\" " + "\n"); + return 0; + } + } + + *regex = rx; + *nregex = nr; + return 1; +} + +static void _free_regex(char **regex, int nregex) +{ + int i; + for (i = 0; i < nregex; i++) + dm_free(regex[i]); + + dm_free(regex); +} + +static void _scan_input(struct dm_regex *m, char **regex) +{ + char buffer[256], *ptr; + int r; + + while (fgets(buffer, sizeof(buffer), stdin)) { + if ((ptr = strchr(buffer, '\n'))) + *ptr = '\0'; + + r = dm_regex_match(m, buffer); + + if (r >= 0) + printf("%s : %s\n", buffer, regex[r]); + } +} + +int main(int argc, char **argv) +{ + struct dm_pool *mem; + struct dm_regex *scanner; + char **regex; + int nregex; + int ret = 0; + + if (argc < 2) { + fprintf(stderr, "Usage : %s \n", argv[0]); + exit(1); + } + + dm_log_init_verbose(_LOG_DEBUG); + + if (!(mem = dm_pool_create("match_regex", 10 * 1024))) { + fprintf(stderr, "Couldn't create pool\n"); + ret = 2; + goto err; + } + + if (!_read_spec(argv[1], ®ex, &nregex)) { + fprintf(stderr, "Couldn't read the lex specification\n"); + ret = 3; + goto err; + } + + if (!(scanner = dm_regex_create(mem, (const char **)regex, nregex))) { + fprintf(stderr, "Couldn't build the lexer\n"); + ret = 4; + goto err; + } + + _scan_input(scanner, regex); + _free_regex(regex, nregex); + + err: + dm_pool_destroy(mem); + + return ret; +} /cvs/lvm2/LVM2/unit-tests/regex/parse_t.c,v --> standard output revision 1.1 --- LVM2/unit-tests/regex/parse_t.c +++ - 2010-07-20 15:19:00.626108000 +0000 @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. + * Copyright (C) 2004-2010 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 + */ + +/* hack - using unexported internal function */ +#define DEBUG +#include "regex/parse_rx.c" + +#include +#include + +static void _pretty_print(struct rx_node *rx, int depth) +{ + int i; + for (i = 0; i < depth; i++) + printf(" "); + + /* display info about the node */ + switch (rx->type) { + case CAT: + printf("Cat"); + break; + + case OR: + printf("Or"); + break; + + case STAR: + printf("Star"); + break; + + case PLUS: + printf("Plus"); + break; + + case QUEST: + printf("Quest"); + break; + + case CHARSET: + printf("Charset : "); + for (i = 0; i < 256; i++) { + if (dm_bit(rx->charset, i) && isprint(i)) + printf("%c", (char) i); + } + break; + + default: + printf("Unknown type"); + } + printf("\n"); + + if (rx->left) + _pretty_print(rx->left, depth + 1); + + if (rx->right) + _pretty_print(rx->right, depth + 1); +} + +int main(int argc, char **argv) +{ + struct dm_pool *mem; + struct rx_node *rx; + int regex_print = 0; + int show_nodes = 0; + int regex_arg = 1; + + if (argc == 3 && !strcmp(argv[1], "-r")) { + regex_print++; + regex_arg++; + argc--; + } + + if (argc == 3 && !strcmp(argv[1], "-R")) { + regex_print++; + show_nodes++; + regex_arg++; + argc--; + } + + if (argc != 2) { + fprintf(stderr, "Usage : %s [-r] \n", argv[0]); + exit(0); + } + + dm_log_init_verbose(_LOG_DEBUG); + + if (!(mem = dm_pool_create("parse_regex", 1024))) { + fprintf(stderr, "Couldn't create pool\n"); + exit(1); + } + + if (!(rx = rx_parse_str(mem, argv[regex_arg]))) { + dm_pool_destroy(mem); + fprintf(stderr, "Couldn't parse regex\n"); + exit(1); + } + + if (regex_print) + _regex_print(rx, 0, show_nodes); + else + _pretty_print(rx, 0); + + dm_pool_destroy(mem); + + return 0; +} From thornber@sourceware.org Tue Jul 20 15:21:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 15:21:00 -0000 Subject: LVM2 ./Makefile.in ./configure.in unit-tests/r ... Message-ID: <20100720152134.19409.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 15:21:33 Modified files: . : Makefile.in configure.in Added files: unit-tests/regex: TESTS matcher_t.expected Log message: Wire the regex tests up to the reports Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/Makefile.in.diff?cvsroot=lvm2&r1=1.56&r2=1.57 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.147&r2=1.148 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/TESTS.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/matcher_t.expected.diff?cvsroot=lvm2&r1=NONE&r2=1.1 --- LVM2/Makefile.in 2010/07/20 14:38:44 1.56 +++ LVM2/Makefile.in 2010/07/20 15:21:32 1.57 @@ -135,6 +135,7 @@ .PHONEY: unit-test ruby-test test-programs test-programs: + $(MAKE) unit-tests/regex unit-test: test-programs $(RUBY) report-generators/unit_test.rb $(shell find . -name TESTS) --- LVM2/configure.in 2010/07/20 14:38:44 1.147 +++ LVM2/configure.in 2010/07/20 15:21:32 1.148 @@ -1333,6 +1333,7 @@ test/api/Makefile tools/Makefile udev/Makefile +unit-tests/regex/Makefile ]) AC_OUTPUT /cvs/lvm2/LVM2/unit-tests/regex/TESTS,v --> standard output revision 1.1 --- LVM2/unit-tests/regex/TESTS +++ - 2010-07-20 15:21:33.989435000 +0000 @@ -0,0 +1 @@ +dfa matching:$TEST_TOOL ./matcher_t dev_patterns < devices.list > matcher_t.output && diff -u matcher_t.expected matcher_t.output \ No newline at end of file /cvs/lvm2/LVM2/unit-tests/regex/matcher_t.expected,v --> standard output revision 1.1 --- LVM2/unit-tests/regex/matcher_t.expected +++ - 2010-07-20 15:21:34.143931000 +0000 @@ -0,0 +1,16 @@ +Matcher built with 23 dfa states +/dev/loop/0 : loop/[0-9]+ +/dev/loop/1 : loop/[0-9]+ +/dev/loop/2 : loop/[0-9]+ +/dev/loop/3 : loop/[0-9]+ +/dev/loop/4 : loop/[0-9]+ +/dev/loop/5 : loop/[0-9]+ +/dev/loop/6 : loop/[0-9]+ +/dev/loop/7 : loop/[0-9]+ +/dev/hda1 : hd[a-d][0-5]+ +/dev/hda2 : hd[a-d][0-5]+ +/dev/hda3 : hd[a-d][0-5]+ +/dev/hda4 : hd[a-d][0-5]+ +/dev/hda5 : hd[a-d][0-5]+ +/dev/hdb1 : hd[a-d][0-5]+ +/dev/hdc1 : hd[a-d][0-5]+ From thornber@sourceware.org Tue Jul 20 15:22:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 15:22:00 -0000 Subject: LVM2/unit-tests/datastruct Message-ID: <20100720152222.19745.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 15:22:22 LVM2/unit-tests/datastruct Update of /cvs/lvm2/LVM2/unit-tests/datastruct In directory sourceware.org:/tmp/cvs-serv19737/unit-tests/datastruct Log Message: Directory /cvs/lvm2/LVM2/unit-tests/datastruct added to the repository From thornber@sourceware.org Tue Jul 20 15:25:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 15:25:00 -0000 Subject: LVM2 ./Makefile.in ./configure.in unit-tests/d ... Message-ID: <20100720152540.21033.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 15:25:40 Modified files: . : Makefile.in configure.in Added files: unit-tests/datastruct: Makefile.in TESTS bitset_t.c Log message: Add a unit test for the recent changes to dm_bit_get_next() Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/Makefile.in.diff?cvsroot=lvm2&r1=1.57&r2=1.58 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.148&r2=1.149 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/datastruct/Makefile.in.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/datastruct/TESTS.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/datastruct/bitset_t.c.diff?cvsroot=lvm2&r1=NONE&r2=1.1 --- LVM2/Makefile.in 2010/07/20 15:21:32 1.57 +++ LVM2/Makefile.in 2010/07/20 15:25:39 1.58 @@ -135,7 +135,8 @@ .PHONEY: unit-test ruby-test test-programs test-programs: - $(MAKE) unit-tests/regex + cd unit-tests/regex && $(MAKE) + cd unit-tests/datastruct && $(MAKE) unit-test: test-programs $(RUBY) report-generators/unit_test.rb $(shell find . -name TESTS) --- LVM2/configure.in 2010/07/20 15:21:32 1.148 +++ LVM2/configure.in 2010/07/20 15:25:39 1.149 @@ -1333,6 +1333,7 @@ test/api/Makefile tools/Makefile udev/Makefile +unit-tests/datastruct/Makefile unit-tests/regex/Makefile ]) AC_OUTPUT /cvs/lvm2/LVM2/unit-tests/datastruct/Makefile.in,v --> standard output revision 1.1 --- LVM2/unit-tests/datastruct/Makefile.in +++ - 2010-07-20 15:25:40.539278000 +0000 @@ -0,0 +1,32 @@ +# +# Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. +# Copyright (C) 2004-2010 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 + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +top_builddir = @top_builddir@ + +SOURCES=\ + bitset_t.c + +TARGETS=\ + bitset_t + +include $(top_builddir)/make.tmpl + +INCLUDES += -I$(top_srcdir)/libdm +DM_DEPS = $(top_builddir)/libdm/libdevmapper.so +DM_LIBS = -ldevmapper $(LIBS) + +bitset_t: bitset_t.o $(DM_DEPS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ bitset_t.o $(DM_LIBS) /cvs/lvm2/LVM2/unit-tests/datastruct/TESTS,v --> standard output revision 1.1 --- LVM2/unit-tests/datastruct/TESTS +++ - 2010-07-20 15:25:40.769440000 +0000 @@ -0,0 +1 @@ +bitset iteration:$TEST_TOOL ./bitset_t \ No newline at end of file /cvs/lvm2/LVM2/unit-tests/datastruct/bitset_t.c,v --> standard output revision 1.1 --- LVM2/unit-tests/datastruct/bitset_t.c +++ - 2010-07-20 15:25:40.878828000 +0000 @@ -0,0 +1,40 @@ +#include "libdevmapper.h" + +#include + +enum { + NR_BITS = 137 +}; + +int main(int argc, char **argv) +{ + int i, j, last, first; + dm_bitset_t bs; + struct dm_pool *mem = dm_pool_create("bitset test", 1024); + + assert(mem); + bs = dm_bitset_create(mem, NR_BITS); + + for (i = 0; i < NR_BITS; i++) + assert(!dm_bit(bs, i)); + + for (i = 0, j = 1; i < NR_BITS; i += j, j++) + dm_bit_set(bs, i); + + first = 1; + for (i = 0, j = 1; i < NR_BITS; i += j, j++) { + if (first) { + last = dm_bit_get_first(bs); + first = 0; + } else + last = dm_bit_get_next(bs, last); + + assert(last == i); + } + + assert(dm_bit_get_next(bs, last) == -1); + dm_pool_destroy(mem); + + return 0; +} + From thornber@sourceware.org Tue Jul 20 15:26:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 15:26:00 -0000 Subject: LVM2/unit-tests/datastruct bitset_t.c Message-ID: <20100720152643.22222.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 15:26:43 Modified files: unit-tests/datastruct: bitset_t.c Log message: [UNIT-TESTS] add test for the recent dm_bitset_equal() function Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/datastruct/bitset_t.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2 --- LVM2/unit-tests/datastruct/bitset_t.c 2010/07/20 15:25:39 1.1 +++ LVM2/unit-tests/datastruct/bitset_t.c 2010/07/20 15:26:43 1.2 @@ -6,14 +6,10 @@ NR_BITS = 137 }; -int main(int argc, char **argv) +static void test_get_next(struct dm_pool *mem) { int i, j, last, first; - dm_bitset_t bs; - struct dm_pool *mem = dm_pool_create("bitset test", 1024); - - assert(mem); - bs = dm_bitset_create(mem, NR_BITS); + dm_bitset_t bs = dm_bitset_create(mem, NR_BITS); for (i = 0; i < NR_BITS; i++) assert(!dm_bit(bs, i)); @@ -33,7 +29,56 @@ } assert(dm_bit_get_next(bs, last) == -1); - dm_pool_destroy(mem); +} + +static void bit_flip(dm_bitset_t bs, int bit) +{ + int old = dm_bit(bs, bit); + if (old) + dm_bit_clear(bs, bit); + else + dm_bit_set(bs, bit); +} + +static void test_equal(struct dm_pool *mem) +{ + dm_bitset_t bs1 = dm_bitset_create(mem, NR_BITS); + dm_bitset_t bs2 = dm_bitset_create(mem, NR_BITS); + + int i, j; + for (i = 0, j = 1; i < NR_BITS; i += j, j++) { + dm_bit_set(bs1, i); + dm_bit_set(bs2, i); + } + + assert(dm_bitset_equal(bs1, bs2)); + assert(dm_bitset_equal(bs2, bs1)); + + for (i = 0; i < NR_BITS; i++) { + bit_flip(bs1, i); + assert(!dm_bitset_equal(bs1, bs2)); + assert(!dm_bitset_equal(bs2, bs1)); + + assert(dm_bitset_equal(bs1, bs1)); /* comparing with self */ + bit_flip(bs1, i); + } +} + +int main(int argc, char **argv) +{ + typedef void (*test_fn)(struct dm_pool *); + static test_fn tests[] = { + test_get_next, + test_equal + }; + + int i; + for (i = 0; i < sizeof(tests) / sizeof(*tests); i++) { + struct dm_pool *mem = dm_pool_create("bitset test", 1024); + assert(mem); + tests[i](mem); + dm_pool_destroy(mem); + } return 0; } From thornber@sourceware.org Tue Jul 20 15:28:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 15:28:00 -0000 Subject: LVM2/unit-tests/datastruct bitset_t.c Message-ID: <20100720152822.23145.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 15:28:22 Modified files: unit-tests/datastruct: bitset_t.c Log message: [UNIT-TEST] test for recent dm_bit_and() function Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/datastruct/bitset_t.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3 --- LVM2/unit-tests/datastruct/bitset_t.c 2010/07/20 15:26:43 1.2 +++ LVM2/unit-tests/datastruct/bitset_t.c 2010/07/20 15:28:22 1.3 @@ -64,12 +64,46 @@ } } +static void test_and(struct dm_pool *mem) +{ + dm_bitset_t bs1 = dm_bitset_create(mem, NR_BITS); + dm_bitset_t bs2 = dm_bitset_create(mem, NR_BITS); + dm_bitset_t bs3 = dm_bitset_create(mem, NR_BITS); + + int i, j; + for (i = 0, j = 1; i < NR_BITS; i += j, j++) { + dm_bit_set(bs1, i); + dm_bit_set(bs2, i); + } + + dm_bit_and(bs3, bs1, bs2); + + assert(dm_bitset_equal(bs1, bs2)); + assert(dm_bitset_equal(bs1, bs3)); + assert(dm_bitset_equal(bs2, bs3)); + + dm_bit_clear_all(bs1); + dm_bit_clear_all(bs2); + + for (i = 0; i < NR_BITS; i++) { + if (i % 2) + dm_bit_set(bs1, i); + else + dm_bit_set(bs2, i); + } + + dm_bit_and(bs3, bs1, bs2); + for (i = 0; i < NR_BITS; i++) + assert(!dm_bit(bs3, i)); +} + int main(int argc, char **argv) { typedef void (*test_fn)(struct dm_pool *); static test_fn tests[] = { test_get_next, - test_equal + test_equal, + test_and }; int i; From thornber@sourceware.org Tue Jul 20 15:32:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Tue, 20 Jul 2010 15:32:00 -0000 Subject: LVM2 libdm/libdevmapper.h libdm/regex/matcher. ... Message-ID: <20100720153208.24438.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-20 15:32:07 Modified files: libdm : libdevmapper.h libdm/regex : matcher.c unit-tests/regex: matcher_t.c matcher_t.expected Log message: [REGEX] add a fingerprinting facility to allow test code to compare dfas Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.121&r2=1.122 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/matcher.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/matcher_t.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/matcher_t.expected.diff?cvsroot=lvm2&r1=1.1&r2=1.2 --- LVM2/libdm/libdevmapper.h 2010/07/13 13:51:03 1.121 +++ LVM2/libdm/libdevmapper.h 2010/07/20 15:32:07 1.122 @@ -1007,6 +1007,14 @@ */ int dm_regex_match(struct dm_regex *regex, const char *s); +/* + * This is useful for regression testing only. The idea is if two + * fingerprints are different, then the two dfas are certainly not + * isomorphic. If two fingerprints _are_ the same then it's very likely + * that the dfas are isomorphic. + */ +uint32_t dm_regex_fingerprint(struct dm_regex *regex); + /********************* * reporting functions *********************/ --- LVM2/libdm/regex/matcher.c 2010/04/22 23:09:18 1.6 +++ LVM2/libdm/regex/matcher.c 2010/07/20 15:32:07 1.7 @@ -363,3 +363,126 @@ /* subtract 1 to get back to zero index */ return r - 1; } + +/* + * The next block of code concerns calculating a fingerprint for the dfa. + * + * We're not calculating a minimal dfa in _calculate_state (maybe a future + * improvement). As such it's possible that two non-isomorphic dfas + * recognise the same language. This can only really happen if you start + * with equivalent, but different regexes (for example the simplifier in + * parse_rx.c may have changed). + * + * The code is inefficient; repeatedly searching a singly linked list for + * previously seen nodes. Not worried since this is test code. + */ +struct node_list { + unsigned node_id; + struct dfa_state *node; + struct node_list *next; +}; + +struct printer { + struct dm_pool *mem; + struct node_list *pending; + struct node_list *processed; + unsigned next_index; +}; + +static uint32_t randomise_(uint32_t n) +{ + /* 2^32 - 5 */ + uint32_t const prime = (~0) - 4; + return n * prime; +} + +static int seen_(struct node_list *n, struct dfa_state *node, uint32_t *i) +{ + while (n) { + if (n->node == node) { + *i = n->node_id; + return 1; + } + n = n->next; + } + + return 0; +} + +/* + * Push node if it's not been seen before, returning a unique index. + */ +static uint32_t push_node_(struct printer *p, struct dfa_state *node) +{ + uint32_t i; + if (seen_(p->pending, node, &i) || + seen_(p->processed, node, &i)) + return i; + else { + struct node_list *n = dm_pool_alloc(p->mem, sizeof(*n)); + assert(n); + n->node_id = p->next_index++; + n->node = node; + n->next = p->pending; + p->pending = n; + return n->node_id; + } +} + +/* + * Pop the front node, and fill out it's previously assigned index. + */ +static struct dfa_state *pop_node_(struct printer *p) +{ + struct dfa_state *node = NULL; + + if (p->pending) { + struct node_list *n = p->pending; + p->pending = n->next; + n->next = p->processed; + p->processed = n; + + node = n->node; + } + + return node; +} + +static uint32_t combine_(uint32_t n1, uint32_t n2) +{ + return ((n1 << 8) | (n1 >> 24)) ^ randomise_(n2); +} + +static uint32_t fingerprint_(struct printer *p) +{ + int c; + uint32_t result = 0; + struct dfa_state *node; + + while ((node = pop_node_(p))) { + result = combine_(result, node->final); + for (c = 0; c < 256; c++) + result = combine_(result, + push_node_(p, node->lookup[c])); + } + + return result; +} + +uint32_t dm_regex_fingerprint(struct dm_regex *regex) +{ + uint32_t result; + struct printer p; + struct dm_pool *mem = dm_pool_create("regex fingerprint", 1024); + + assert(mem); + p.mem = mem; + p.pending = NULL; + p.processed = NULL; + p.next_index = 0; + + push_node_(&p, regex->start); + result = fingerprint_(&p); + dm_pool_destroy(mem); + return result; +} --- LVM2/unit-tests/regex/matcher_t.c 2010/07/20 15:18:57 1.1 +++ LVM2/unit-tests/regex/matcher_t.c 2010/07/20 15:32:07 1.2 @@ -135,6 +135,7 @@ goto err; } + printf("fingerprint: %x\n", dm_regex_fingerprint(scanner)); _scan_input(scanner, regex); _free_regex(regex, nregex); --- LVM2/unit-tests/regex/matcher_t.expected 2010/07/20 15:21:33 1.1 +++ LVM2/unit-tests/regex/matcher_t.expected 2010/07/20 15:32:07 1.2 @@ -1,4 +1,5 @@ Matcher built with 23 dfa states +fingerprint: 352b6c4f /dev/loop/0 : loop/[0-9]+ /dev/loop/1 : loop/[0-9]+ /dev/loop/2 : loop/[0-9]+ From thornber@sourceware.org Wed Jul 21 10:00:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Wed, 21 Jul 2010 10:00:00 -0000 Subject: LVM2/reports stylesheet.css Message-ID: <20100721100038.29540.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-21 10:00:38 Modified files: reports : stylesheet.css Log message: [REPORT-GENERATORS] cut down stylsheet.css to what we actually use Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/reports/stylesheet.css.diff?cvsroot=lvm2&r1=1.1&r2=1.2 --- LVM2/reports/stylesheet.css 2010/07/20 14:38:45 1.1 +++ LVM2/reports/stylesheet.css 2010/07/21 10:00:38 1.2 @@ -1,51 +1,4 @@ -/* I know nothing about css, and am not likely too either since it's - * about bottom on my list of things to learn. So this file has been - * pinched from the Pragmatic Programmers ruby on rails book. - ejt - */ - -/* Global styles */ - -/* START:notice */ -#notice { - border: 2px solid red; - padding: 1em; - margin-bottom: 2em; - background-color: #f0f0f0; - font: bold smaller sans-serif; -} -/* END:notice */ - -/* Styles for admin/list */ - -#product-list .list-title { - color: #244; - font-weight: bold; - font-size: larger; -} - -#product-list .list-image { - width: 60px; - height: 70px; -} - - -#product-list .list-actions { - font-size: x-small; - text-align: right; - padding-left: 1em; -} - -#product-list .list-line-even { - background: #e0f8f8; -} - -#product-list .list-line-odd { - background: #f8b0f8; -} - - /* Styles for main page */ - #banner { background: #9c9; padding-top: 5px; @@ -73,146 +26,6 @@ border-bottom: 3px dotted #77d; } -/* An entry in the store catalog */ - -#store .entry { - border-bottom: 1px dotted #77d; -} - -#store .title { - font-size: 120%; - font-family: sans-serif; -} - -#store .entry img { - width: 75px; - float: left; -} - - -#store .entry h3 { - margin-bottom: 2px; - color: #227; -} - -#store .entry p { - margin-top: 0px; - margin-bottom: 0.8em; -} - -#store .entry .price-line { -} - -#store .entry .add-to-cart { - position: relative; -} - -#store .entry .price { - color: #44a; - font-weight: bold; - margin-right: 2em; -} - -/* START:inline */ -#store .entry form, #store .entry form div { - display: inline; -} -/* END:inline */ - -/* START:cart */ -/* Styles for the cart in the main page and the sidebar */ - -.cart-title { - font: 120% bold; -} - -.item-price, .total-line { - text-align: right; -} - -.total-line .total-cell { - font-weight: bold; - border-top: 1px solid #595; -} - - -/* Styles for the cart in the sidebar */ - -#cart, #cart table { - font-size: smaller; - color: white; -} - -#cart table { - border-top: 1px dotted #595; - border-bottom: 1px dotted #595; - margin-bottom: 10px; -} -/* END:cart */ - -/* Styles for order form */ - -.depot-form fieldset { - background: #efe; -} - -.depot-form legend { - color: #dfd; - background: #141; - font-family: sans-serif; - padding: 0.2em 1em; -} - -.depot-form label { - width: 5em; - float: left; - text-align: right; - margin-right: 0.5em; - display: block; -} - -.depot-form .submit { - margin-left: 5.5em; -} - -/* The error box */ - -.fieldWithErrors { - padding: 2px; - background-color: red; - display: table; -} - -#errorExplanation { - width: 400px; - border: 2px solid red; - padding: 7px; - padding-bottom: 12px; - margin-bottom: 20px; - background-color: #f0f0f0; -} - -#errorExplanation h2 { - text-align: left; - font-weight: bold; - padding: 5px 5px 5px 15px; - font-size: 12px; - margin: -7px; - background-color: #c00; - color: #fff; -} - -#errorExplanation p { - color: #333; - margin-bottom: 0; - padding: 5px; -} - -#errorExplanation ul li { - font-size: 12px; - list-style: square; -} - body { font: normal 75% verdana,arial,helvetica; color:#000000; From thornber@sourceware.org Wed Jul 21 11:52:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Wed, 21 Jul 2010 11:52:00 -0000 Subject: LVM2/unit-tests/regex TESTS matcher_t.expected ... Message-ID: <20100721115247.16903.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-21 11:52:46 Modified files: unit-tests/regex: TESTS Added files: unit-tests/regex: matcher_t.expected2 random_regexes Log message: [REGEX] another matcher_t test with a larger set of regexes, only interested in the fingerprint Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/matcher_t.expected2.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/random_regexes.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/TESTS.diff?cvsroot=lvm2&r1=1.1&r2=1.2 /cvs/lvm2/LVM2/unit-tests/regex/matcher_t.expected2,v --> standard output revision 1.1 --- LVM2/unit-tests/regex/matcher_t.expected2 +++ - 2010-07-21 11:52:46.907122000 +0000 @@ -0,0 +1,2 @@ +Matcher built with 447 dfa states +fingerprint: eed8ceb8 /cvs/lvm2/LVM2/unit-tests/regex/random_regexes,v --> standard output revision 1.1 --- LVM2/unit-tests/regex/random_regexes +++ - 2010-07-21 11:52:46.992980000 +0000 @@ -0,0 +1,100 @@ +"(((a?)(([Ub]*)|z))((([qr]|X)+)([Qn]*)))+" +"[HZejtuw]*" +"((B|s)*)|(((([Fv]l)(N+))(([el]|C)(tJ)))?)" +"((([Ma]?)|(t*))*)|((([cm]E)|(M?))|(([BE][EV])|([Qj][Mh])))" +"(((([bw]*)|([IO]*))((zK)*))|(((pU)|(i|q))|((z?)|([HL]?))))*" +"((([Pt]?)|[Tr])?)((Hq)*)" +"[HOXcfgikosvwxz]" +"[BCEFGHNPTUWfjlprsy]" +"((((aD)*)|([Xo]+))+)(([HKn](([Eq]|[JQ])(I*)))*)" +"([LNWYeghv]|e)*" +"(((y(L*))*)|((([EP]+)(W+))*))*" +"U*" +"((((R+)(W|[Qr]))|([py]+))+)([LM]*)" +"(([DOjx](D(b?)))|([Ke]*))*" +"((([ls](c|[FT]))*)([JS]*))*" +"((l?)|(([Gz]+)|(D*)))*" +"[ABgjn]" +"(((q|[dg])?)|([Uk]*))((([Fl]?)|([Ry]+))|(([IR]|c)|(T?)))" +"((([an]|P)|[Jw])((a*)|(m*)))*" +"((((R[ht])(h+))?)|(([pz](n?))+))+" +"(((([Dc]b)([Sp][Ii]))|((k|F)*))|[Uiovz])*" +"[Res]*" +"[Zl]|a" +"^[ANZdf]$" +"[En]|(((Q+)(U+))([pt]*))" +"[ADEIMQUWXZhklrsvz]" +"(((S(y*))*)|(j*))*" +"n*" +"[NUau]*" +"((((Z*)(D|[Nd]))|(([np]|B)+))|(([Xy][Fi])*))+" +"((([EZ]?)|(d[HR]))*)((([Hg]|q)(P+))*)" +"q" +"((m*)|(p|B))|((((x?)|(t+))(([Sb][PX])(O|[HM])))+)" +"((((A*)(z[RS]))*)|(((z+)(Q*))+))*" +"(((M*)([Uu]*))+)|[Uk]" +"[imv]" +"[GLSchtw](([Yw]((F[Dd])|([Tw]+)))?)" +"([MOZj]*)(S|[Wknr])" +"((G|q)*)[BHKN]" +"((((NW)|([Ao]?))|((l|[UV])+))+)|((i|(z*))*)" +"((((Z+)|([IR]?))|(L*))|([JKQ]+))+" +"([Bdin](S*))+" +"[HLNSTp]*" +"(((J*)([Bq]|[Yu]))*)|([Kv]*)" +"(((([BJ]|[Zy])(wI))*)(y*))+" +"(((hF)+)|(H*))*" +"((([QU][Pj])([GQ]?))+)|[PWo]" +"(((([cq][BX])?)|((f[DI])*))*)(([GM]*)[SVYr])" +"(([Zt]*)|((qx)|(([BV]+)(f?))))*" +"[ILWYhsx]*" +"(([Uy]*)|[sv])|([NSc]*)" +"((c*)|([JUfhy]?))+" +"(((q*)([So]*))(((g[jq])(j?))+))*" +"((b+)|(((T+)([fw]T))?))*" +"((([DS]?)|([Th]|u))(Q*))*" +"[FKLX]|((([fw](L?))(([gq]*)|(O?)))?)" +"((([HZ]+)u)*)|[APWijn]" +"(e*)|(((v?)|((J+)(Hb)))?)" +"(e|((w+)f))*" +"[BEHKPQVdelnqy]" +"((((B|N)(s*))|[Rr])(((g?)|([rv]+))+))+" +"(((s*)|(K*))([AP]G))*" +"[CELTp]" +"(([Fq]?)|([Al]+))*" +"((((r?)|(y[jx]))|([mp]*))+)|((B(S*))*)" +"((([Eq]+)|(Y[ds]))|(x|(i|[Ku])))[IJNrvy]" +"((([NO]*)[Ix])+)([Jenq]+)" +"(((([HP]*)(j|y))*)[Ylqvy])*" +"[PTv]+" +"[AINSZhpx]|([EOYZ]*)" +"([ABCFQv]*)((([Zx]|h)+)|([ej]*))" +"((([pr]*)|(([Dq]|p)|(H?)))?)([NRUXmoq]*)" +"(([er]*)|([mx]*))(((nV)([am]?))+)" +"[BHPRlpu]" +"(((([Ah]|[tx])|(e|[uy]))?)((([fl]+)([Vz]|v))*))*" +"[AGdm]" +"(((K*)^(O*)$)|(B?))*" +"((([Ks]|[Ka])*)|([FSTab]?))?" +"(([kw]+)[ei])(([Hy]*)(([Mc]*)|(G|f)))" +"((((e*)|(Zf))|(R|[nq]))((([Jz]v)([Rj]+))+))*" +"(((a?)|(e?))(([Uc]*)(S+)))*" +"((((E+)([MZ]?))+)|(((s|[Az])|z)*))?" +"((((i[MO])*)|((LH)*))|(((BA)|([AI]+))|[Ug]))*" +"[EGHILcho]*" +"(((Z[vw])?)((z|g)+))(((H|U)([iv]Q))|([qw]?))" +"(([ehmr]|((L[Uw])*))+)((a+)I)" +"[EKNSWYagj](((v|[TX])|([Uk]+))*)" +"(((R[Mo])|(O*))|([Fm]|([qw]*)))((m*)|((S|[Ki])?))" +"((((kP)|c)?)((([do]+)|([Gi]?))*))*" +"((^(B|W)$|([Ww]+))([no]*))|((([iv]?)|(M*))|((x|L)?))" +"[AEGPRSbcfhsy]" +"[Wbcf]|((([MO]?)|([NT]|m))(([Oo]?)([Wg]*)))" +"(((YZ)*)[PQVei])*" +"[GJKYt][AEGWdegmnt]" +"^[CDEGJKNUVYZagkv]$" +"([DPWbx]*)|(((q|B)|(P|u))((M[Bq])*))" +"[FHIJRTVYZdiorsuvz]*" +"([MWoqvz]*)|^(l*)" +"(((I|[Rx])*)((X[Mf])([Xa]L)))([Ha]|([HY]*))" +"(((l|[Sd])*)((([Ix]+)|([XY]?))(Z*)))+" --- LVM2/unit-tests/regex/TESTS 2010/07/20 15:21:33 1.1 +++ LVM2/unit-tests/regex/TESTS 2010/07/21 11:52:46 1.2 @@ -1 +1,2 @@ -dfa matching:$TEST_TOOL ./matcher_t dev_patterns < devices.list > matcher_t.output && diff -u matcher_t.expected matcher_t.output \ No newline at end of file +dfa matching:$TEST_TOOL ./matcher_t dev_patterns < devices.list > matcher_t.output && diff -u matcher_t.expected matcher_t.output +dfa matching:$TEST_TOOL ./matcher_t random_regexes < /dev/null > matcher_t.output && diff -u matcher_t.expected2 matcher_t.output \ No newline at end of file From thornber@sourceware.org Wed Jul 21 11:58:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Wed, 21 Jul 2010 11:58:00 -0000 Subject: LVM2/libdm/regex matcher.c parse_rx.c parse_rx.h Message-ID: <20100721115853.19342.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-21 11:58:50 Modified files: libdm/regex : matcher.c parse_rx.c parse_rx.h Log message: [REGEX] reduce the number of charset nodes that are produced Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/matcher.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/parse_rx.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/parse_rx.h.diff?cvsroot=lvm2&r1=1.3&r2=1.4 --- LVM2/libdm/regex/matcher.c 2010/07/20 15:32:07 1.7 +++ LVM2/libdm/regex/matcher.c 2010/07/21 11:58:49 1.8 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. + * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. * * This file is part of the device-mapper userspace tools. @@ -32,8 +32,11 @@ struct dm_regex { /* Instance variables for the lexer */ struct dfa_state *start; unsigned num_nodes; + unsigned num_charsets; int nodes_entered; struct rx_node **nodes; + int charsets_entered; + struct rx_node **charsets; struct dm_pool *scratch, *mem; }; @@ -50,6 +53,33 @@ return r; } +static unsigned _count_charsets(struct rx_node *rx) +{ + if (rx->type == CHARSET) + return 1; + + return (rx->left ? _count_charsets(rx->left) : 0) + + (rx->right ? _count_charsets(rx->right) : 0); +} + +static void _enumerate_charsets_internal(struct rx_node *rx, unsigned *i) +{ + if (rx->type == CHARSET) + rx->charset_index = (*i)++; + else { + if (rx->left) + _enumerate_charsets_internal(rx->left, i); + if (rx->right) + _enumerate_charsets_internal(rx->right, i); + } +} + +static void _enumerate_charsets(struct rx_node *rx) +{ + unsigned i = 0; + _enumerate_charsets_internal(rx, &i); +} + static void _fill_table(struct dm_regex *m, struct rx_node *rx) { assert((rx->type != OR) || (rx->left && rx->right)); @@ -61,6 +91,8 @@ _fill_table(m, rx->right); m->nodes[m->nodes_entered++] = rx; + if (rx->type == CHARSET) + m->charsets[m->charsets_entered++] = rx; } static void _create_bitsets(struct dm_regex *m) @@ -69,9 +101,9 @@ for (i = 0; i < m->num_nodes; i++) { struct rx_node *n = m->nodes[i]; - n->firstpos = dm_bitset_create(m->scratch, m->num_nodes); - n->lastpos = dm_bitset_create(m->scratch, m->num_nodes); - n->followpos = dm_bitset_create(m->scratch, m->num_nodes); + n->firstpos = dm_bitset_create(m->scratch, m->num_charsets); + n->lastpos = dm_bitset_create(m->scratch, m->num_charsets); + n->followpos = dm_bitset_create(m->scratch, m->num_charsets); } } @@ -85,7 +117,7 @@ c1 = rx->left; c2 = rx->right; - if (dm_bit(rx->charset, TARGET_TRANS)) + if (rx->type == CHARSET && dm_bit(rx->charset, TARGET_TRANS)) rx->final = final++; switch (rx->type) { @@ -125,8 +157,8 @@ break; case CHARSET: - dm_bit_set(rx->firstpos, i); - dm_bit_set(rx->lastpos, i); + dm_bit_set(rx->firstpos, rx->charset_index); + dm_bit_set(rx->lastpos, rx->charset_index); rx->nullable = 0; break; @@ -141,23 +173,21 @@ */ switch (rx->type) { case CAT: - for (j = 0; j < m->num_nodes; j++) { - if (dm_bit(c1->lastpos, j)) { - struct rx_node *n = m->nodes[j]; + for (j = 0; j < m->num_charsets; j++) { + struct rx_node *n = m->charsets[j]; + if (dm_bit(c1->lastpos, j)) dm_bit_union(n->followpos, - n->followpos, c2->firstpos); - } + n->followpos, c2->firstpos); } break; case PLUS: case STAR: - for (j = 0; j < m->num_nodes; j++) { - if (dm_bit(rx->lastpos, j)) { - struct rx_node *n = m->nodes[j]; + for (j = 0; j < m->num_charsets; j++) { + struct rx_node *n = m->charsets[j]; + if (dm_bit(rx->lastpos, j)) dm_bit_union(n->followpos, - n->followpos, rx->firstpos); - } + n->followpos, rx->firstpos); } break; } @@ -189,7 +219,7 @@ static int _calc_states(struct dm_regex *m, struct rx_node *rx) { - unsigned iwidth = (m->num_nodes / DM_BITS_PER_INT) + 1; + unsigned iwidth = (m->num_charsets / DM_BITS_PER_INT) + 1; struct ttree *tt = ttree_create(m->scratch, iwidth); struct state_queue *h, *t, *tmp; struct dfa_state *dfa, *ldfa; @@ -199,9 +229,26 @@ if (!tt) return_0; - if (!(bs = dm_bitset_create(m->scratch, m->num_nodes))) + if (!(bs = dm_bitset_create(m->scratch, m->num_charsets))) return_0; + /* build some char maps */ + dm_bitset_t charmap[256]; + for (a = 0; a < 256; a++) { + charmap[a] = dm_bitset_create(m->scratch, m->num_charsets); + if (!charmap[a]) + return_0; + } + + for (i = 0; i < m->num_nodes; i++) { + struct rx_node *n = m->nodes[i]; + if (n->type == CHARSET) { + for (a = dm_bit_get_first(n->charset); + a >= 0; a = dm_bit_get_next(n->charset, a)) + dm_bit_set(charmap[a], n->charset_index); + } + } + /* create first state */ dfa = _create_dfa_state(m->mem); m->start = dfa; @@ -209,8 +256,9 @@ /* prime the queue */ h = t = _create_state_queue(m->scratch, dfa, rx->firstpos); + dm_bitset_t dfa_copy = dm_bitset_create(m->scratch, m->num_charsets); while (h) { - int elems, j, idx[h->bits[0]]; + int elems, idx[h->bits[0]]; /* pop state off front of the queue */ dfa = h->s; @@ -227,18 +275,18 @@ idx[elems++] = i; for (a = 0; a < 256; a++) { + dm_bit_and(dfa_copy, charmap[a], dfa_bits); + /* iterate through all the states in firstpos */ - for (j = 0; j < elems; j++) { - i = idx[j]; - if (dm_bit(m->nodes[i]->charset, a)) { - if (a == TARGET_TRANS) - dfa->final = m->nodes[i]->final; - - dm_bit_union(bs, bs, - m->nodes[i]->followpos); - set_bits = 1; - } - } + for (i = dm_bit_get_first(dfa_copy); + i >= 0; i = dm_bit_get_next(dfa_copy, i)) { + if (a == TARGET_TRANS) + dfa->final = m->charsets[i]->final; + + dm_bit_union(bs, bs, + m->charsets[i]->followpos); + set_bits = 1; + } if (set_bits) { ldfa = ttree_lookup(tt, bs + 1); @@ -314,11 +362,16 @@ m->mem = mem; m->scratch = scratch; m->num_nodes = _count_nodes(rx); + m->num_charsets = _count_charsets(rx); + _enumerate_charsets(rx); m->nodes = dm_pool_alloc(scratch, sizeof(*m->nodes) * m->num_nodes); - if (!m->nodes) goto_bad; + m->charsets = dm_pool_alloc(scratch, sizeof(*m->charsets) * m->num_charsets); + if (!m->charsets) + goto_bad; + _fill_table(m, rx); _create_bitsets(m); _calc_functions(m); --- LVM2/libdm/regex/parse_rx.c 2010/04/22 23:09:18 1.11 +++ LVM2/libdm/regex/parse_rx.c 2010/07/21 11:58:49 1.12 @@ -284,7 +284,7 @@ struct rx_node *n = dm_pool_zalloc(mem, sizeof(*n)); if (n) { - if (!(n->charset = dm_bitset_create(mem, 256))) { + if (type == CHARSET && !(n->charset = dm_bitset_create(mem, 256))) { dm_pool_free(mem, n); return NULL; } --- LVM2/libdm/regex/parse_rx.h 2010/04/22 23:09:18 1.3 +++ LVM2/libdm/regex/parse_rx.h 2010/07/21 11:58:49 1.4 @@ -41,6 +41,7 @@ struct rx_node *left, *right; /* used to build the dfa for the toker */ + unsigned charset_index; int nullable, final; dm_bitset_t firstpos; dm_bitset_t lastpos; From thornber@sourceware.org Wed Jul 21 12:00:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Wed, 21 Jul 2010 12:00:00 -0000 Subject: LVM2 libdm/regex/matcher.c unit-tests/regex/ma ... Message-ID: <20100721120054.20328.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-21 12:00:53 Modified files: libdm/regex : matcher.c unit-tests/regex: matcher_t.expected matcher_t.expected2 Log message: [REGEX] factor _calc_state() out of _calc_states() Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/matcher.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/matcher_t.expected.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/regex/matcher_t.expected2.diff?cvsroot=lvm2&r1=1.1&r2=1.2 --- LVM2/libdm/regex/matcher.c 2010/07/21 11:58:49 1.8 +++ LVM2/libdm/regex/matcher.c 2010/07/21 12:00:53 1.9 @@ -38,6 +38,13 @@ int charsets_entered; struct rx_node **charsets; struct dm_pool *scratch, *mem; + + /* stuff for on the fly dfa calculation */ + dm_bitset_t charmap[256]; + dm_bitset_t dfa_copy; + struct ttree *tt; + dm_bitset_t bs; + struct state_queue *h, *t; }; static int _count_nodes(struct rx_node *rx) @@ -217,26 +224,60 @@ return r; } +static void _calc_state(struct dm_regex *m, struct state_queue *h, int a) +{ + int set_bits = 0, i; + struct dfa_state *dfa = h->s; + dm_bitset_t dfa_bits = h->bits; + dm_bit_and(m->dfa_copy, m->charmap[a], dfa_bits); + + /* iterate through all the states in firstpos */ + for (i = dm_bit_get_first(m->dfa_copy); i >= 0; i = dm_bit_get_next(m->dfa_copy, i)) { + if (a == TARGET_TRANS) + dfa->final = m->charsets[i]->final; + + dm_bit_union(m->bs, m->bs, m->charsets[i]->followpos); + set_bits = 1; + } + + if (set_bits) { /* FIXME: this is always true */ + struct state_queue *tmp; + struct dfa_state *ldfa = ttree_lookup(m->tt, m->bs + 1); + if (!ldfa) { + /* push */ + ldfa = _create_dfa_state(m->mem); + ttree_insert(m->tt, m->bs + 1, ldfa); + tmp = _create_state_queue(m->scratch, ldfa, m->bs); + if (!m->h) + m->h = m->t = tmp; + else { + m->t->next = tmp; + m->t = tmp; + } + } + + dfa->lookup[a] = ldfa; + dm_bit_clear_all(m->bs); + } +} + static int _calc_states(struct dm_regex *m, struct rx_node *rx) { unsigned iwidth = (m->num_charsets / DM_BITS_PER_INT) + 1; - struct ttree *tt = ttree_create(m->scratch, iwidth); - struct state_queue *h, *t, *tmp; - struct dfa_state *dfa, *ldfa; - int i, a, set_bits = 0, count = 0; - dm_bitset_t bs, dfa_bits; + struct dfa_state *dfa; + int i, a; - if (!tt) + m->tt = ttree_create(m->scratch, iwidth); + if (!m->tt) return_0; - if (!(bs = dm_bitset_create(m->scratch, m->num_charsets))) + if (!(m->bs = dm_bitset_create(m->scratch, m->num_charsets))) return_0; /* build some char maps */ - dm_bitset_t charmap[256]; for (a = 0; a < 256; a++) { - charmap[a] = dm_bitset_create(m->scratch, m->num_charsets); - if (!charmap[a]) + m->charmap[a] = dm_bitset_create(m->scratch, m->num_charsets); + if (!m->charmap[a]) return_0; } @@ -245,76 +286,31 @@ if (n->type == CHARSET) { for (a = dm_bit_get_first(n->charset); a >= 0; a = dm_bit_get_next(n->charset, a)) - dm_bit_set(charmap[a], n->charset_index); + dm_bit_set(m->charmap[a], n->charset_index); } } /* create first state */ dfa = _create_dfa_state(m->mem); m->start = dfa; - ttree_insert(tt, rx->firstpos + 1, dfa); + ttree_insert(m->tt, rx->firstpos + 1, dfa); /* prime the queue */ - h = t = _create_state_queue(m->scratch, dfa, rx->firstpos); - dm_bitset_t dfa_copy = dm_bitset_create(m->scratch, m->num_charsets); - while (h) { - int elems, idx[h->bits[0]]; + m->h = m->t = _create_state_queue(m->scratch, dfa, rx->firstpos); + m->dfa_copy = dm_bitset_create(m->scratch, m->num_charsets); + /* keep processing until there's nothing in the queue */ + struct state_queue *s; + while ((s = m->h)) { /* pop state off front of the queue */ - dfa = h->s; - dfa_bits = h->bits; - h = h->next; + m->h = m->h->next; /* iterate through all the inputs for this state */ - dm_bit_clear_all(bs); - - /* Cache list of locations of bits */ - elems = 0; - for (i = dm_bit_get_first(dfa_bits); - i >= 0; i = dm_bit_get_next(dfa_bits, i)) - idx[elems++] = i; - - for (a = 0; a < 256; a++) { - dm_bit_and(dfa_copy, charmap[a], dfa_bits); - - /* iterate through all the states in firstpos */ - for (i = dm_bit_get_first(dfa_copy); - i >= 0; i = dm_bit_get_next(dfa_copy, i)) { - if (a == TARGET_TRANS) - dfa->final = m->charsets[i]->final; - - dm_bit_union(bs, bs, - m->charsets[i]->followpos); - set_bits = 1; - } - - if (set_bits) { - ldfa = ttree_lookup(tt, bs + 1); - if (!ldfa) { - /* push */ - ldfa = _create_dfa_state(m->mem); - ttree_insert(tt, bs + 1, ldfa); - tmp = - _create_state_queue(m->scratch, - ldfa, bs); - if (!h) - h = t = tmp; - else { - t->next = tmp; - t = tmp; - } - - count++; - } - - dfa->lookup[a] = ldfa; - set_bits = 0; - dm_bit_clear_all(bs); - } - } + dm_bit_clear_all(m->bs); + for (a = 0; a < 256; a++) + _calc_state(m, s, a); } - log_debug("Matcher built with %d dfa states", count); return 1; } --- LVM2/unit-tests/regex/matcher_t.expected 2010/07/20 15:32:07 1.2 +++ LVM2/unit-tests/regex/matcher_t.expected 2010/07/21 12:00:53 1.3 @@ -1,4 +1,3 @@ -Matcher built with 23 dfa states fingerprint: 352b6c4f /dev/loop/0 : loop/[0-9]+ /dev/loop/1 : loop/[0-9]+ --- LVM2/unit-tests/regex/matcher_t.expected2 2010/07/21 11:52:46 1.1 +++ LVM2/unit-tests/regex/matcher_t.expected2 2010/07/21 12:00:53 1.2 @@ -1,2 +1 @@ -Matcher built with 447 dfa states fingerprint: eed8ceb8 From thornber@sourceware.org Wed Jul 21 12:02:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Wed, 21 Jul 2010 12:02:00 -0000 Subject: LVM2/libdm/regex matcher.c Message-ID: <20100721120251.13584.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-21 12:02:51 Modified files: libdm/regex : matcher.c Log message: [REGEX] remove the state_queue structure. Instead we just have a 'next' field in the dfa_state. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/matcher.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10 --- LVM2/libdm/regex/matcher.c 2010/07/21 12:00:53 1.9 +++ LVM2/libdm/regex/matcher.c 2010/07/21 12:02:51 1.10 @@ -19,14 +19,10 @@ #include "assert.h" struct dfa_state { + struct dfa_state *next; int final; - struct dfa_state *lookup[256]; -}; - -struct state_queue { - struct dfa_state *s; dm_bitset_t bits; - struct state_queue *next; + struct dfa_state *lookup[256]; }; struct dm_regex { /* Instance variables for the lexer */ @@ -44,7 +40,7 @@ dm_bitset_t dfa_copy; struct ttree *tt; dm_bitset_t bs; - struct state_queue *h, *t; + struct dfa_state *h, *t; }; static int _count_nodes(struct rx_node *rx) @@ -206,29 +202,20 @@ return dm_pool_zalloc(mem, sizeof(struct dfa_state)); } -static struct state_queue *_create_state_queue(struct dm_pool *mem, - struct dfa_state *dfa, - dm_bitset_t bits) +static struct dfa_state *_create_state_queue(struct dm_pool *mem, + struct dfa_state *dfa, + dm_bitset_t bits) { - struct state_queue *r = dm_pool_alloc(mem, sizeof(*r)); - - if (!r) { - stack; - return NULL; - } - - r->s = dfa; - r->bits = dm_bitset_create(mem, bits[0]); /* first element is the size */ - dm_bit_copy(r->bits, bits); - r->next = 0; - return r; + dfa->bits = dm_bitset_create(mem, bits[0]); /* first element is the size */ + dm_bit_copy(dfa->bits, bits); + dfa->next = 0; + return dfa; } -static void _calc_state(struct dm_regex *m, struct state_queue *h, int a) +static void _calc_state(struct dm_regex *m, struct dfa_state *dfa, int a) { int set_bits = 0, i; - struct dfa_state *dfa = h->s; - dm_bitset_t dfa_bits = h->bits; + dm_bitset_t dfa_bits = dfa->bits; dm_bit_and(m->dfa_copy, m->charmap[a], dfa_bits); /* iterate through all the states in firstpos */ @@ -241,7 +228,7 @@ } if (set_bits) { /* FIXME: this is always true */ - struct state_queue *tmp; + struct dfa_state *tmp; struct dfa_state *ldfa = ttree_lookup(m->tt, m->bs + 1); if (!ldfa) { /* push */ @@ -300,7 +287,7 @@ m->dfa_copy = dm_bitset_create(m->scratch, m->num_charsets); /* keep processing until there's nothing in the queue */ - struct state_queue *s; + struct dfa_state *s; while ((s = m->h)) { /* pop state off front of the queue */ m->h = m->h->next; From thornber@sourceware.org Wed Jul 21 12:09:00 2010 From: thornber@sourceware.org (thornber@sourceware.org) Date: Wed, 21 Jul 2010 12:09:00 -0000 Subject: LVM2/libdm libdevmapper.h regex/matcher.c Message-ID: <20100721120913.9343.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: thornber@sourceware.org 2010-07-21 12:09:13 Modified files: libdm : libdevmapper.h libdm/regex : matcher.c Log message: [REGEX] calculate dfa states on demand Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.122&r2=1.123 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/matcher.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11 --- LVM2/libdm/libdevmapper.h 2010/07/20 15:32:07 1.122 +++ LVM2/libdm/libdevmapper.h 2010/07/21 12:09:12 1.123 @@ -1012,6 +1012,8 @@ * fingerprints are different, then the two dfas are certainly not * isomorphic. If two fingerprints _are_ the same then it's very likely * that the dfas are isomorphic. + * + * This function must be called before any matching is done. */ uint32_t dm_regex_fingerprint(struct dm_regex *regex); --- LVM2/libdm/regex/matcher.c 2010/07/21 12:02:51 1.10 +++ LVM2/libdm/regex/matcher.c 2010/07/21 12:09:13 1.11 @@ -209,6 +209,7 @@ dfa->bits = dm_bitset_create(mem, bits[0]); /* first element is the size */ dm_bit_copy(dfa->bits, bits); dfa->next = 0; + dfa->final = -1; return dfa; } @@ -227,7 +228,7 @@ set_bits = 1; } - if (set_bits) { /* FIXME: this is always true */ + if (set_bits) { struct dfa_state *tmp; struct dfa_state *ldfa = ttree_lookup(m->tt, m->bs + 1); if (!ldfa) { @@ -285,20 +286,28 @@ /* prime the queue */ m->h = m->t = _create_state_queue(m->scratch, dfa, rx->firstpos); m->dfa_copy = dm_bitset_create(m->scratch, m->num_charsets); + return 1; +} + +/* + * Forces all the dfa states to be calculated up front, ie. what + * _calc_states() used to do before we switched to calculating on demand. + */ +static void _force_states(struct dm_regex *m) +{ + int a; /* keep processing until there's nothing in the queue */ struct dfa_state *s; - while ((s = m->h)) { - /* pop state off front of the queue */ - m->h = m->h->next; - - /* iterate through all the inputs for this state */ - dm_bit_clear_all(m->bs); - for (a = 0; a < 256; a++) - _calc_state(m, s, a); - } + while ((s = m->h)) { + /* pop state off front of the queue */ + m->h = m->h->next; - return 1; + /* iterate through all the inputs for this state */ + dm_bit_clear_all(m->bs); + for (a = 0; a < 256; a++) + _calc_state(m, s, a); + } } struct dm_regex *dm_regex_create(struct dm_pool *mem, const char **patterns, @@ -308,17 +317,12 @@ int i; size_t len = 0; struct rx_node *rx; - struct dm_pool *scratch = dm_pool_create("regex matcher", 10 * 1024); struct dm_regex *m; + struct dm_pool *scratch = mem; - if (!scratch) + if (!(m = dm_pool_alloc(mem, sizeof(*m)))) return_NULL; - if (!(m = dm_pool_alloc(mem, sizeof(*m)))) { - dm_pool_destroy(scratch); - return_NULL; - } - memset(m, 0, sizeof(*m)); /* join the regexps together, delimiting with zero */ @@ -359,26 +363,31 @@ _create_bitsets(m); _calc_functions(m); _calc_states(m, rx); - dm_pool_destroy(scratch); - m->scratch = NULL; - return m; bad: - dm_pool_destroy(scratch); dm_pool_free(mem, m); return NULL; } -static struct dfa_state *_step_matcher(int c, struct dfa_state *cs, int *r) +static struct dfa_state *_step_matcher(struct dm_regex *m, int c, struct dfa_state *cs, int *r) { - if (!(cs = cs->lookup[(unsigned char) c])) + struct dfa_state *ns; + + if (!(ns = cs->lookup[(unsigned char) c])) + _calc_state(m, cs, c); + + if (!(ns = cs->lookup[(unsigned char) c])) return NULL; - if (cs->final && (cs->final > *r)) - *r = cs->final; + // yuck, we have to special case the target trans + if (ns->final == -1) + _calc_state(m, ns, TARGET_TRANS); - return cs; + if (ns->final && (ns->final > *r)) + *r = ns->final; + + return ns; } int dm_regex_match(struct dm_regex *regex, const char *s) @@ -386,14 +395,15 @@ struct dfa_state *cs = regex->start; int r = 0; - if (!(cs = _step_matcher(HAT_CHAR, cs, &r))) + dm_bit_clear_all(regex->bs); + if (!(cs = _step_matcher(regex, HAT_CHAR, cs, &r))) goto out; for (; *s; s++) - if (!(cs = _step_matcher(*s, cs, &r))) + if (!(cs = _step_matcher(regex, *s, cs, &r))) goto out; - _step_matcher(DOLLAR_CHAR, cs, &r); + _step_matcher(regex, DOLLAR_CHAR, cs, &r); out: /* subtract 1 to get back to zero index */ @@ -496,7 +506,7 @@ struct dfa_state *node; while ((node = pop_node_(p))) { - result = combine_(result, node->final); + result = combine_(result, node->final < 0 ? 0 : node->final); for (c = 0; c < 256; c++) result = combine_(result, push_node_(p, node->lookup[c])); @@ -511,6 +521,8 @@ struct printer p; struct dm_pool *mem = dm_pool_create("regex fingerprint", 1024); + _force_states(regex); + assert(mem); p.mem = mem; p.pending = NULL; From agk@sourceware.org Wed Jul 21 12:54:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 21 Jul 2010 12:54:00 -0000 Subject: LVM2 configure Message-ID: <20100721125422.27913.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-21 12:54:22 Modified files: . : configure Log message: update configure Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.135&r2=1.136 --- LVM2/configure 2010/07/13 13:51:01 1.135 +++ LVM2/configure 2010/07/21 12:54:21 1.136 @@ -651,6 +651,7 @@ UDEV_RULES UDEV_PC UDEV_LIBS +TESTING STATIC_LINK STATICDIR SNAPSHOTS @@ -711,6 +712,8 @@ MSGFMT LVM2CMD_LIB LVM2APP_LIB +VALGRIND +RUBY19 GENPNG GENHTML LCOV @@ -835,6 +838,7 @@ enable_debug with_optimisation enable_profiling +enable_testing enable_devmapper enable_udev_sync enable_udev_rules @@ -1531,6 +1535,7 @@ --enable-cmirrord enable the cluster mirror log daemon --enable-debug enable debugging --enable-profiling gather gcov profiling data + --enable-testing enable testing targets in the makefile --disable-devmapper disable LVM2 device-mapper interaction --enable-udev_sync enable synchronisation with udev processing --enable-udev_rules install rule files needed for udev synchronisation @@ -14298,6 +14303,107 @@ fi ################################################################################ +{ $as_echo "$as_me:$LINENO: checking whether to enable unit testing" >&5 +$as_echo_n "checking whether to enable unit testing... " >&6; } +# Check whether --enable-testing was given. +if test "${enable_testing+set}" = set; then + enableval=$enable_testing; TESTING=$enableval +else + TESTING=no +fi + +{ $as_echo "$as_me:$LINENO: result: $TESTING" >&5 +$as_echo "$TESTING" >&6; } + +if test "$TESTING" = yes; then + # Extract the first word of "ruby1.9", so it can be a program name with args. +set dummy ruby1.9; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_RUBY19+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $RUBY19 in + [\\/]* | ?:[\\/]*) + ac_cv_path_RUBY19="$RUBY19" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_RUBY19="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +RUBY19=$ac_cv_path_RUBY19 +if test -n "$RUBY19"; then + { $as_echo "$as_me:$LINENO: result: $RUBY19" >&5 +$as_echo "$RUBY19" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "valgrind", so it can be a program name with args. +set dummy valgrind; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_VALGRIND+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $VALGRIND in + [\\/]* | ?:[\\/]*) + ac_cv_path_VALGRIND="$VALGRIND" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_VALGRIND="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +VALGRIND=$ac_cv_path_VALGRIND +if test -n "$VALGRIND"; then + { $as_echo "$as_me:$LINENO: result: $VALGRIND" >&5 +$as_echo "$VALGRIND" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test -z "$RUBY19" -o -z "$VALGRIND"; then + { { $as_echo "$as_me:$LINENO: error: ruby1.9 and valgrind are required for testing" >&5 +$as_echo "$as_me: error: ruby1.9 and valgrind are required for testing" >&2;} + { (exit 1); exit 1; }; } + fi +fi + +################################################################################ { $as_echo "$as_me:$LINENO: checking whether to use device-mapper" >&5 $as_echo_n "checking whether to use device-mapper... " >&6; } # Check whether --enable-devmapper was given. @@ -17919,8 +18025,9 @@ + ################################################################################ -ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile doc/Makefile doc/example.conf include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/snapshot/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/lvm2_monitoring_init_red_hat scripts/Makefile test/Makefile test/api/Makefile tools/Makefile udev/Makefile" +ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile doc/Makefile doc/example.conf include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/snapshot/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/lvm2_monitoring_init_red_hat scripts/Makefile test/Makefile test/api/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -18556,6 +18663,8 @@ "test/api/Makefile") CONFIG_FILES="$CONFIG_FILES test/api/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "udev/Makefile") CONFIG_FILES="$CONFIG_FILES udev/Makefile" ;; + "unit-tests/datastruct/Makefile") CONFIG_FILES="$CONFIG_FILES unit-tests/datastruct/Makefile" ;; + "unit-tests/regex/Makefile") CONFIG_FILES="$CONFIG_FILES unit-tests/regex/Makefile" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} From jbrassow@sourceware.org Wed Jul 21 13:40:00 2010 From: jbrassow@sourceware.org (jbrassow@sourceware.org) Date: Wed, 21 Jul 2010 13:40:00 -0000 Subject: LVM2 ./WHATS_NEW lib/metadata/mirror.c lib/mir ... Message-ID: <20100721134024.11008.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2010-07-21 13:40:22 Modified files: . : WHATS_NEW lib/metadata : mirror.c lib/mirror : mirrored.c libdm : libdevmapper.h libdm-file.c Log message: It's not enough to check for the kernel module in the case of cluster mirrors, we must also check that the log daemon (cmirrord) is running. The log module can be auto-loaded, but the daemon cannot be "auto-started". Failing to check for the daemon produces cryptic messages that customers have a hard time deciphering. (The system messages do report that the log daemon is not running, but people don't seem to find this message easily.) Here are examples of what is printed when the module is available, but the log daemon has not been started. [root@bp-01 LVM2]# lvcreate -m1 -l1 -n lv vg Shared cluster mirrors are not available. [root@bp-01 LVM2]# lvcreate -m1 -l1 -n lv vg -v Setting logging type to disk Finding volume group "vg" Archiving volume group "vg" metadata (seqno 3). Creating logical volume lv Executing: /sbin/modprobe dm-log-userspace Cluster mirror log daemon is not running Shared cluster mirrors are not available. Creating volume group backup "/etc/lvm/backup/vg" (seqno 4). Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1668&r2=1.1669 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.127&r2=1.128 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.72&r2=1.73 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.123&r2=1.124 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-file.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12 --- LVM2/WHATS_NEW 2010/07/13 22:24:39 1.1668 +++ LVM2/WHATS_NEW 2010/07/21 13:40:21 1.1669 @@ -1,5 +1,6 @@ Version 2.02.71 - =============================== + Check if cluster log daemon is running before allowing cmirror create. Check if LV with specified name already exists when splitting a mirror. Fix suspend/resume logic for LVs resulting from splitting a mirror. Switch cmirrord and clvmd to use dm_create_lockfile. --- LVM2/lib/metadata/mirror.c 2010/07/13 22:24:39 1.127 +++ LVM2/lib/metadata/mirror.c 2010/07/21 13:40:22 1.128 @@ -81,6 +81,36 @@ } /* + * cluster_mirror_is_available + * + * Check if the proper kernel module and log daemon are running. + * Caller should check for 'vg_is_clustered(lv->vg)' before making + * this call. + * + * Returns: 1 if available, 0 otherwise + */ +static int cluster_mirror_is_available(struct logical_volume *lv) +{ + unsigned attr = 0; + struct cmd_context *cmd = lv->vg->cmd; + const struct segment_type *segtype; + + if (!(segtype = get_segtype_from_string(cmd, "mirror"))) + return_0; + + if (!segtype->ops->target_present) + return_0; + + if (!segtype->ops->target_present(lv->vg->cmd, NULL, &attr)) + return_0; + + if (!(attr & MIRROR_LOG_CLUSTERED)) + return 0; + + return 1; +} + +/* * Returns the number of mirrors of the LV */ uint32_t lv_mirror_count(const struct logical_volume *lv) @@ -1940,6 +1970,12 @@ return 0; } + if (vg_is_clustered(lv->vg) && !(lv->status & ACTIVATE_EXCL) && + !cluster_mirror_is_available(lv)) { + log_error("Shared cluster mirrors are not available."); + return 0; + } + /* For corelog mirror, activation code depends on * the global mirror_in_sync status. As we are adding * a new mirror, it should be set as 'out-of-sync' --- LVM2/lib/mirror/mirrored.c 2010/07/09 15:34:45 1.72 +++ LVM2/lib/mirror/mirrored.c 2010/07/21 13:40:22 1.73 @@ -519,6 +519,19 @@ _mirror_attributes |= MIRROR_LOG_CLUSTERED; } else if (module_present(cmd, "log-userspace")) _mirror_attributes |= MIRROR_LOG_CLUSTERED; + + if (!(_mirror_attributes & MIRROR_LOG_CLUSTERED)) + log_verbose("Cluster mirror log module is not available"); + + /* + * The cluster mirror log daemon must be running, + * otherwise, the kernel module will fail to make + * contact. + */ + if (!dm_daemon_is_running(CMIRRORD_PIDFILE)) { + log_verbose("Cluster mirror log daemon is not running"); + _mirror_attributes &= ~MIRROR_LOG_CLUSTERED; + } } *attributes = _mirror_attributes; } --- LVM2/libdm/libdevmapper.h 2010/07/21 12:09:12 1.123 +++ LVM2/libdm/libdevmapper.h 2010/07/21 13:40:22 1.124 @@ -988,6 +988,13 @@ */ int dm_create_lockfile(const char* lockfile); +/* + * Query whether a daemon is running based on its lockfile + * + * Returns: 1 if running, 0 if not + */ +int dm_daemon_is_running(const char* lockfile); + /********************* * regular expressions *********************/ --- LVM2/libdm/libdm-file.c 2010/07/13 13:51:03 1.11 +++ LVM2/libdm/libdm-file.c 2010/07/21 13:40:22 1.12 @@ -166,3 +166,29 @@ return 0; } + +int dm_daemon_is_running(const char* lockfile) +{ + int fd; + struct flock lock; + + if((fd = open(lockfile, O_RDONLY)) < 0) + return 0; + + lock.l_type = F_WRLCK; + lock.l_start = 0; + lock.l_whence = SEEK_SET; + lock.l_len = 0; + if (fcntl(fd, F_GETLK, &lock) < 0) { + log_error("Cannot check lock status of lockfile [%s], error was [%s]", + lockfile, strerror(errno)); + if (close(fd)) + stack; + return 0; + } + + if (close(fd)) + stack; + + return (lock.l_type == F_UNLCK) ? 0 : 1; +} From mornfall@sourceware.org Wed Jul 21 14:12:00 2010 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Wed, 21 Jul 2010 14:12:00 -0000 Subject: LVM2/test t-pvcreate-operation-md.sh Message-ID: <20100721141248.14596.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2010-07-21 14:12:48 Modified files: test : t-pvcreate-operation-md.sh Log message: Don't fail t-pvcreate-operation-md if mdadm is broken. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvcreate-operation-md.sh.diff?cvsroot=lvm2&r1=1.6&r2=1.7 --- LVM2/test/t-pvcreate-operation-md.sh 2010/05/24 15:28:45 1.6 +++ LVM2/test/t-pvcreate-operation-md.sh 2010/07/21 14:12:47 1.7 @@ -35,7 +35,7 @@ # sleeps offer hack to defeat: 'md: md127 still in use' # see: https://bugzilla.redhat.com/show_bug.cgi?id=509908#c25 sleep 2 - mdadm --stop $mddev + mdadm --stop $mddev || true if [ -b "$mddev" ]; then # mdadm doesn't always cleanup the device node sleep 2 From jbrassow@sourceware.org Wed Jul 21 15:21:00 2010 From: jbrassow@sourceware.org (jbrassow@sourceware.org) Date: Wed, 21 Jul 2010 15:21:00 -0000 Subject: LVM2/lib/mirror mirrored.c Message-ID: <20100721152125.8173.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2010-07-21 15:21:25 Modified files: lib/mirror : mirrored.c Log message: Building without the '--enable-cmirrord' option means that CMIRRORD_PIDFILE is not defined. This makes the build fail. Therefore, we need to conditionalize the check for cmirrord based on if CMIRRORD_PIDFILE is defined. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.73&r2=1.74 --- LVM2/lib/mirror/mirrored.c 2010/07/21 13:40:22 1.73 +++ LVM2/lib/mirror/mirrored.c 2010/07/21 15:21:24 1.74 @@ -528,10 +528,15 @@ * otherwise, the kernel module will fail to make * contact. */ +#ifdef CMIRRORD_PIDFILE if (!dm_daemon_is_running(CMIRRORD_PIDFILE)) { log_verbose("Cluster mirror log daemon is not running"); _mirror_attributes &= ~MIRROR_LOG_CLUSTERED; } +#else + log_verbose("Cluster mirror log daemon not included in build"); + _mirror_attributes &= ~MIRROR_LOG_CLUSTERED; +#endif } *attributes = _mirror_attributes; } From wysochanski@sourceware.org Wed Jul 21 19:44:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Wed, 21 Jul 2010 19:44:00 -0000 Subject: LVM2 lib/report/columns.h ./WHATS_NEW Message-ID: <20100721194428.6019.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-21 19:44:25 Modified files: lib/report : columns.h . : WHATS_NEW Log message: Clarify help text for vg_mda_count. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/columns.h.diff?cvsroot=lvm2&r1=1.41&r2=1.42 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1669&r2=1.1670 --- LVM2/lib/report/columns.h 2010/06/28 20:37:23 1.41 +++ LVM2/lib/report/columns.h 2010/07/21 19:44:25 1.42 @@ -112,7 +112,7 @@ FIELD(VGS, vg, NUM, "#SN", cmd, 3, snapcount, "snap_count", "Number of snapshots.") FIELD(VGS, vg, NUM, "Seq", seqno, 3, uint32, "vg_seqno", "Revision number of internal metadata. Incremented whenever it changes.") FIELD(VGS, vg, STR, "VG Tags", tags, 7, tags, "vg_tags", "Tags, if any.") -FIELD(VGS, vg, NUM, "#VMda", cmd, 5, vgmdas, "vg_mda_count", "Number of metadata areas in use by this VG.") +FIELD(VGS, vg, NUM, "#VMda", cmd, 5, vgmdas, "vg_mda_count", "Number of metadata areas on this VG.") FIELD(VGS, vg, NUM, "#VMdaUse", cmd, 8, vgmdasused, "vg_mda_used_count", "Number of metadata areas in use on this VG.") FIELD(VGS, vg, NUM, "VMdaFree", cmd, 9, vgmdafree, "vg_mda_free", "Free metadata area space for this VG in current units.") FIELD(VGS, vg, NUM, "VMdaSize", cmd, 9, vgmdasize, "vg_mda_size", "Size of smallest metadata area for this VG in current units.") --- LVM2/WHATS_NEW 2010/07/21 13:40:21 1.1669 +++ LVM2/WHATS_NEW 2010/07/21 19:44:25 1.1670 @@ -1,8 +1,10 @@ Version 2.02.71 - =============================== + Clarify help text for vg_mda_count. Check if cluster log daemon is running before allowing cmirror create. Check if LV with specified name already exists when splitting a mirror. Fix suspend/resume logic for LVs resulting from splitting a mirror. + Update pvcreate, {pv|vg}change, and lvm.conf man pages about metadataignore. Switch cmirrord and clvmd to use dm_create_lockfile. Allow clvmd pidfile to be configurable. Update comments about memory handling in lvm2app.h. From wysochanski@sourceware.org Mon Jul 26 19:03:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Mon, 26 Jul 2010 19:03:00 -0000 Subject: LVM2/tools vgchange.c Message-ID: <20100726190329.19464.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-26 19:03:29 Modified files: tools : vgchange.c Log message: Remove unneeded "active" variable in vgchange_monitoring(). Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.109&r2=1.110 --- LVM2/tools/vgchange.c 2010/07/09 15:34:48 1.109 +++ LVM2/tools/vgchange.c 2010/07/26 19:03:29 1.110 @@ -160,9 +160,9 @@ static int _vgchange_monitoring(struct cmd_context *cmd, struct volume_group *vg) { - int active, monitored; + int monitored; - if ((active = lvs_in_vg_activated(vg)) && + if (lvs_in_vg_activated(vg) && dmeventd_monitor_mode() != DMEVENTD_MONITOR_IGNORE) { monitored = _monitor_lvs_in_vg(cmd, vg, dmeventd_monitor_mode()); log_print("%d logical volume(s) in volume group " From jbrassow@sourceware.org Mon Jul 26 20:31:00 2010 From: jbrassow@sourceware.org (jbrassow@sourceware.org) Date: Mon, 26 Jul 2010 20:31:00 -0000 Subject: LVM2/doc lvm_fault_handling.txt Message-ID: <20100726203154.32752.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2010-07-26 20:31:54 Added files: doc : lvm_fault_handling.txt Log message: Initial import of document describing LVM's policies surrounding device faults/failures. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/doc/lvm_fault_handling.txt.diff?cvsroot=lvm2&r1=NONE&r2=1.1 /cvs/lvm2/LVM2/doc/lvm_fault_handling.txt,v --> standard output revision 1.1 --- LVM2/doc/lvm_fault_handling.txt +++ - 2010-07-26 20:31:54.280508000 +0000 @@ -0,0 +1,221 @@ +LVM device fault handling +========================= + +Introduction +------------ +This document is to serve as the definitive source for information +regarding the policies and procedures surrounding device failures +in LVM. It codifies LVM's responses to device failures as well as +the responsibilities of administrators. + +Device failures can be permanent or transient. A permanent failure +is one where a device becomes inaccessible and will never be +revived. A transient failure is a failure that can be recovered +from (e.g. a power failure, intermittent network outage, block +relocation, etc). The policies for handling both types of failures +is described herein. + +Available Operations During a Device Failure +-------------------------------------------- +When there is a device failure, LVM behaves somewhat differently because +only a subset of the available devices will be found for the particular +volume group. The number of operations available to the administrator +is diminished. It is not possible to create new logical volumes while +PVs cannot be accessed, for example. Operations that create, convert, or +resize logical volumes are disallowed, such as: +- lvcreate +- lvresize +- lvreduce +- lvextend +- lvconvert (unless '--repair' is used) +Operations that activate, deactivate, remove, report, or repair logical +volumes are allowed, such as: +- lvremove +- vgremove (will remove all LVs, but not the VG until consistent) +- pvs +- vgs +- lvs +- lvchange -a [yn] +- vgchange -a [yn] +Operations specific to the handling of failed devices are allowed and +are as follows: + +- 'vgreduce --removemissing ': This action is designed to remove + the reference of a failed device from the LVM metadata stored on the + remaining devices. If there are (portions of) logical volumes on the + failed devices, the ability of the operation to proceed will depend + on the type of logical volumes found. If an image (i.e leg or side) + of a mirror is located on the device, that image/leg of the mirror + is eliminated along with the failed device. The result of such a + mirror reduction could be a no-longer-redundant linear device. If + a linear, stripe, or snapshot device is located on the failed device + the command will not proceed without a '--force' option. The result + of using the '--force' option is the entire removal and complete + loss of the non-redundant logical volume. Once this operation is + complete, the volume group will again have a complete and consistent + view of the devices it contains. Thus, all operations will be + permitted - including creation, conversion, and resizing operations. + +- 'lvconvert --repair ': This action is designed specifically + to operate on mirrored logical volumes. It is used on logical volumes + individually and does not remove the faulty device from the volume + group. If, for example, a failed device happened to contain the + images of four distinct mirrors, it would be necessary to run + 'lvconvert --repair' on each of them. The ultimate result is to leave + the faulty device in the volume group, but have no logical volumes + referencing it. In addition to removing mirror images that reside + on failed devices, 'lvconvert --repair' can also replace the failed + device if there are spare devices available in the volume group. The + user is prompted whether to simply remove the failed portions of the + mirror or to also allocate a replacement, if run from the command-line. + Optionally, the '--use-policies' flag can be specified which will + cause the operation not to prompt the user, but instead respect + the policies outlined in the LVM configuration file - usually, + /etc/lvm/lvm.conf. Once this operation is complete, mirrored logical + volumes will be consistent and I/O will be allowed to continue. + However, the volume group will still be inconsistent - due to the + refernced-but-missing device/PV - and operations will still be + restricted to the aformentioned actions until either the device is + restored or 'vgreduce --removemissing' is run. + +Device Revival (transient failures): +------------------------------------ +During a device failure, the above section describes what limitations +a user can expect. However, if the device returns after a period of +time, what to expect will depend on what has happened during the time +period when the device was failed. If no automated actions (described +below) or user actions were necessary or performed, then no change in +operations or logical volume layout will occur. However, if an +automated action or one of the aforementioned repair commands was +manually run, the returning device will be perceived as having stale +LVM metadata. In this case, the user can expect to see a warning +concerning inconsistent metadata. The metadata on the returning +device will be automatically replaced with the latest copy of the +LVM metadata - restoring consistency. Note, while most LVM commands +will automatically update the metadata on a restored devices, the +following possible exceptions exist: +- pvs (when it does not read/update VG metadata) + +Automated Target Response to Failures: +-------------------------------------- +The only LVM target type (i.e. "personality") that has an automated +response to failures is a mirrored logical volume. The other target +types (linear, stripe, snapshot, etc) will simply propagate the failure. +[A snapshot becomes invalid if its underlying device fails, but the +origin will remain valid - presuming the origin device has not failed.] +There are three types of errors that a mirror can suffer - read, write, +and resynchronization errors. Each is described in depth below. + +Mirror read failures: +If a mirror is 'in-sync' (i.e. all images have been initialized and +are identical), a read failure will only produce a warning. Data is +simply pulled from one of the other images and the fault is recorded. +Sometimes - like in the case of bad block relocation - read errors can +be recovered from by the storage hardware. Therefore, it is up to the +user to decide whether to reconfigure the mirror and remove the device +that caused the error. Managing the composition of a mirror is done with +'lvconvert' and removing a device from a volume group can be done with +'vgreduce'. + +If a mirror is not 'in-sync', a read failure will produce an I/O error. +This error will propagate all the way up to the applications above the +logical volume (e.g. the file system). No automatic intervention will +take place in this case either. It is up to the user to decide what +can be done/salvaged in this senario. If the user is confident that the +images of the mirror are the same (or they are willing to simply attempt +to retreive whatever data they can), 'lvconvert' can be used to eliminate +the failed image and proceed. + +Mirror resynchronization errors: +A resynchronization error is one that occurs when trying to initialize +all mirror images to be the same. It can happen due to a failure to +read the primary image (the image considered to have the 'good' data), or +due to a failure to write the secondary images. This type of failure +only produces a warning, and it is up to the user to take action in this +case. If the error is transient, the user can simply reactivate the +mirrored logical volume to make another attempt at resynchronization. +If attempts to finish resynchronization fail, 'lvconvert' can be used to +remove the faulty device from the mirror. + +TODO... +Some sort of response to this type of error could be automated. +Since this document is the definitive source for how to handle device +failures, the process should be defined here. If the process is defined +but not implemented, it should be noted as such. One idea might be to +make a single attempt to suspend/resume the mirror in an attempt to +redo the sync operation that failed. On the other hand, if there is +a permanent failure, it may simply be best to wait for the user or the +automated response that is sure to follow from a write failure. +...TODO + +Mirror write failures: +When a write error occurs on a mirror constituent device, an attempt +to handle the failure is automatically made. This is done by calling +'lvconvert --repair --use-policies'. The policies implied by this +command are set in the LVM configuration file. They are: +- mirror_log_fault_policy: This defines what action should be taken + if the device containing the log fails. The available options are + "remove" and "allocate". Either of these options will cause the + faulty log device to be removed from the mirror. The "allocate" + policy will attempt the further action of trying to replace the + failed disk log by using space that might be available in the + volume group. If the allocation fails (or the "remove" policy + is specified), the mirror log will be maintained in memory. Should + the machine be rebooted or the logical volume deactivated, a + complete resynchronization of the mirror will be necessary upon + the follow activation - such is the nature of a mirror with a 'core' + log. The default policy for handling log failures is "allocate". + The service disruption incurred by replacing the failed log is + negligible, while the benefits of having persistent log is + pronounced. +- mirror_image_fault_policy: This defines what action should be taken + if a device containing an image fails. Again, the available options + are "remove" and "allocate". Both of these options will cause the + faulty image device to be removed - adjusting the logical volume + accordingly. For example, if one image of a 2-way mirror fails, the + mirror will be converted to a linear device. If one image of a + 3-way mirror fails, the mirror will be converted to a 2-way mirror. + The "allocate" policy takes the further action of trying to replace + the failed image using space that is available in the volume group. + Replacing a failed mirror image will incure the cost of + resynchronizing - degrading the performance of the mirror. The + default policy for handling an image failure is "remove". This + allows the mirror to still function, but gives the administrator the + choice of when to incure the extra performance costs of replacing + the failed image. + +TODO... +The appropriate time to take permanent corrective action on a mirror +should be driven by policy. There should be a directive that takes +a time or percentage argument. Something like the following: +- mirror_fault_policy_WHEN = "10sec"/"10%" +A time value would signal the amount of time to wait for transient +failures to resolve themselves. The percentage value would signal the +amount a mirror could become out-of-sync before the faulty device is +removed. + +A mirror cannot be used unless /some/ corrective action is taken, +however. One option is to replace the failed mirror image with an +error target, forgo the use of 'handle_errors', and simply let the +out-of-sync regions accumulate and be tracked by the log. Mirrors +that have more than 2 images would have to "stack" to perform the +tracking, as each failed image would have to be associated with a +log. If the failure is transient, the device would replace the +error target that was holding its spot and the log that was tracking +the deltas would be used to quickly restore the portions that changed. + +One unresolved issue with the above scheme is how to know which +regions of the mirror are out-of-sync when a problem occurs. When +a write failure occurs in the kernel, the log will contain those +regions that are not in-sync. If the log is a disk log, that log +could continue to be used to track differences. However, if the +log was a core log - or if the log device failed at the same time +as an image device - there would be no way to determine which +regions are out-of-sync to begin with as we start to track the +deltas for the failed image. I don't have a solution for this +problem other than to only be able to handle errors in this way +if conditions are right. These issues will have to be ironed out +before proceeding. This could be another case, where it is better +to handle failures in the kernel by allowing the kernel to store +updates in various metadata areas. +...TODO From mornfall@sourceware.org Tue Jul 27 20:05:00 2010 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Tue, 27 Jul 2010 20:05:00 -0000 Subject: LVM2 tools/vgck.c test/t-activate-missing.sh . ... Message-ID: <20100727200530.12111.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2010-07-27 20:05:30 Modified files: tools : vgck.c test : t-activate-missing.sh . : WHATS_NEW Added files: test : t-nomda-missing.sh Log message: Make vgck warn about missing PVs. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgck.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-nomda-missing.sh.diff?cvsroot=lvm2&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-activate-missing.sh.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1670&r2=1.1671 --- LVM2/tools/vgck.c 2010/07/09 15:34:48 1.26 +++ LVM2/tools/vgck.c 2010/07/27 20:05:29 1.27 @@ -31,6 +31,12 @@ return ECMD_FAILED; } + if (vg_missing_pv_count(vg)) { + log_error("The volume group is missing %d physical volumes.", + vg_missing_pv_count(vg)); + return ECMD_FAILED; + } + return ECMD_PROCESSED; } /cvs/lvm2/LVM2/test/t-nomda-missing.sh,v --> standard output revision 1.1 --- LVM2/test/t-nomda-missing.sh +++ - 2010-07-27 20:05:30.660682000 +0000 @@ -0,0 +1,73 @@ +#!/bin/bash + +. ./test-utils.sh + +prepare_devs 4 +pvcreate $dev1 $dev2 +pvcreate --metadatacopies 0 $dev3 $dev4 +vgcreate $vg $dev1 $dev2 $dev3 $dev4 + +lvcreate -l1 -n linear1 $vg $dev1 +lvcreate -l1 -n linear2 $vg $dev2 +lvcreate -l2 -n linear12 $vg $dev1:4 $dev2:4 + +lvcreate -l1 -n origin1 $vg $dev1 +lvcreate -s $vg/origin1 -l1 -n s_napshot2 $dev2 + +lvcreate -l1 -m1 -n mirror12 --mirrorlog core $vg $dev1 $dev2 +lvcreate -l1 -m1 -n mirror123 $vg $dev1 $dev2 $dev3 + +vgchange -a n $vg +disable_dev $dev1 +not vgchange -a y $vg +not vgck $vg + +check inactive $vg linear1 +check active $vg linear2 +check inactive $vg origin1 +check inactive $vg s_napshot2 +check inactive $vg linear12 +check inactive $vg mirror12 +check inactive $vg mirror123 + +vgchange -a n $vg +enable_dev $dev1 +disable_dev $dev2 +not vgchange -a y $vg +not vgck $vg + +check active $vg linear1 +check inactive $vg linear2 +check inactive $vg linear12 +check inactive $vg origin1 +check inactive $vg s_napshot2 +check inactive $vg mirror12 +check inactive $vg mirror123 + +vgchange -a n $vg +enable_dev $dev2 +disable_dev $dev3 +not vgchange -a y $vg +not vgck $vg + +check active $vg origin1 +check active $vg s_napshot2 +check active $vg linear1 +check active $vg linear2 +check active $vg linear12 +check inactive $vg mirror123 +check active $vg mirror12 + +vgchange -a n $vg +enable_dev $dev3 +disable_dev $dev4 +vgchange -a y $vg +not vgck $vg + +check active $vg origin1 +check active $vg s_napshot2 +check active $vg linear1 +check active $vg linear2 +check active $vg linear12 +check active $vg mirror12 +check active $vg mirror123 --- LVM2/test/t-activate-missing.sh 2010/05/12 06:02:28 1.1 +++ LVM2/test/t-activate-missing.sh 2010/07/27 20:05:29 1.2 @@ -24,6 +24,7 @@ vgchange -a n $vg disable_dev $dev1 not vgchange -a y $vg +not vgck $vg check inactive $vg linear1 check active $vg linear2 @@ -37,6 +38,7 @@ enable_dev $dev1 disable_dev $dev2 not vgchange -a y $vg +not vgck $vg check active $vg linear1 check inactive $vg linear2 @@ -50,6 +52,7 @@ enable_dev $dev2 disable_dev $dev3 not vgchange -a y $vg +not vgck $vg check active $vg origin1 check active $vg s_napshot2 @@ -63,6 +66,7 @@ enable_dev $dev3 disable_dev $dev4 vgchange -a y $vg +not vgck $vg check active $vg origin1 check active $vg s_napshot2 --- LVM2/WHATS_NEW 2010/07/21 19:44:25 1.1670 +++ LVM2/WHATS_NEW 2010/07/27 20:05:30 1.1671 @@ -1,5 +1,6 @@ Version 2.02.71 - =============================== + Make vgck warn about missing PVs. Clarify help text for vg_mda_count. Check if cluster log daemon is running before allowing cmirror create. Check if LV with specified name already exists when splitting a mirror. From mornfall@sourceware.org Tue Jul 27 21:08:00 2010 From: mornfall@sourceware.org (mornfall@sourceware.org) Date: Tue, 27 Jul 2010 21:08:00 -0000 Subject: LVM2/test t-nomda-missing.sh Message-ID: <20100727210833.14082.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: mornfall@sourceware.org 2010-07-27 21:08:33 Modified files: test : t-nomda-missing.sh Log message: Do not create a clustered volume group in t-nomda-missing. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-nomda-missing.sh.diff?cvsroot=lvm2&r1=1.1&r2=1.2 --- LVM2/test/t-nomda-missing.sh 2010/07/27 20:05:29 1.1 +++ LVM2/test/t-nomda-missing.sh 2010/07/27 21:08:32 1.2 @@ -5,7 +5,7 @@ prepare_devs 4 pvcreate $dev1 $dev2 pvcreate --metadatacopies 0 $dev3 $dev4 -vgcreate $vg $dev1 $dev2 $dev3 $dev4 +vgcreate -c n $vg $dev1 $dev2 $dev3 $dev4 lvcreate -l1 -n linear1 $vg $dev1 lvcreate -l1 -n linear2 $vg $dev2 From agk@sourceware.org Tue Jul 27 21:56:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 27 Jul 2010 21:56:00 -0000 Subject: LVM2/libdm libdm-file.c Message-ID: <20100727215615.11638.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-27 21:56:14 Modified files: libdm : libdm-file.c Log message: Fix dm_create_lockfile error paths - incorrectly unlinked in-use lockfile. (Jan Friesse) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-file.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13 --- LVM2/libdm/libdm-file.c 2010/07/21 13:40:22 1.12 +++ LVM2/libdm/libdm-file.c 2010/07/27 21:56:14 1.13 @@ -104,21 +104,29 @@ lock.l_start = 0; lock.l_whence = SEEK_SET; lock.l_len = 0; +retry_fcntl: if (fcntl(fd, F_SETLK, &lock) < 0) { - if (errno != EACCES && errno != EAGAIN) + switch (errno) { + case EINTR: + goto retry_fcntl; + break; + case EACCES: + case EAGAIN: log_error("Cannot lock lockfile [%s], error was [%s]", lockfile, strerror(errno)); - else + break; + default: log_error("process is already running"); + } - goto fail; + goto fail_close; } if (ftruncate(fd, 0) < 0) { log_error("Cannot truncate pidfile [%s], error was [%s]", lockfile, strerror(errno)); - goto fail; + goto fail_close_unlink; } memset(buffer, 0, sizeof(buffer)); @@ -131,7 +139,7 @@ log_error("Cannot write pid to pidfile [%s], error was [%s]", lockfile, strerror(errno)); - goto fail; + goto fail_close_unlink; } if ((write_out == 0) || (write_out < bufferlen)) { @@ -139,30 +147,31 @@ "[%" PRIsize_t "] bytes, expected [%" PRIsize_t "]\n", lockfile, write_out, bufferlen); - goto fail; + goto fail_close_unlink; } if ((value = fcntl(fd, F_GETFD, 0)) < 0) { log_error("Cannot get close-on-exec flag from pidfile [%s], " "error was [%s]", lockfile, strerror(errno)); - goto fail; + goto fail_close_unlink; } value |= FD_CLOEXEC; if (fcntl(fd, F_SETFD, value) < 0) { log_error("Cannot set close-on-exec flag from pidfile [%s], " "error was [%s]", lockfile, strerror(errno)); - goto fail; + goto fail_close_unlink; } return 1; -fail: - if (close(fd)) - stack; +fail_close_unlink: if (unlink(lockfile)) stack; +fail_close: + if (close(fd)) + stack; return 0; } From agk@sourceware.org Tue Jul 27 21:57:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 27 Jul 2010 21:57:00 -0000 Subject: LVM2 WHATS_NEW WHATS_NEW_DM Message-ID: <20100727215737.12389.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-27 21:57:37 Modified files: . : WHATS_NEW WHATS_NEW_DM Log message: . Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1671&r2=1.1672 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.395&r2=1.396 --- LVM2/WHATS_NEW 2010/07/27 20:05:30 1.1671 +++ LVM2/WHATS_NEW 2010/07/27 21:57:37 1.1672 @@ -1,8 +1,12 @@ Version 2.02.71 - =============================== + Document LVM fault handling in doc/lvm_fault_handling.txt. Make vgck warn about missing PVs. Clarify help text for vg_mda_count. Check if cluster log daemon is running before allowing cmirror create. + Add unit-tests dir. + Add configure --enable-testing and reports and report-generators dirs. + Correct LV list order used by lvconvert when splitting a mirror. Check if LV with specified name already exists when splitting a mirror. Fix suspend/resume logic for LVs resulting from splitting a mirror. Update pvcreate, {pv|vg}change, and lvm.conf man pages about metadataignore. @@ -14,9 +18,9 @@ Remove unnecessary includes in liblvm files. Use __attribute__ consistently throughout. Fix redundant declarations and always compile with -Wredundant-decls. + Fix possible hang when all mirror images of a mirrored log fail. Pass metadataignore to pv_create, pv_setup, _mda_setup, and add_mda. Init mda->list in mda_copy. - Fix possible hang when all mirror images of a mirrored log fail. Do not log backtrace in valid _lv_resume() code path. Cleanup help strings in configure.in. Prompt if metadataignore with vgextend or pvchange would adjust vg_mda_copies. --- LVM2/WHATS_NEW_DM 2010/07/13 13:51:01 1.395 +++ LVM2/WHATS_NEW_DM 2010/07/27 21:57:37 1.396 @@ -2,6 +2,10 @@ =============================== Switch dmeventd to use dm_create_lockfile and drop duplicate code. Add dm_create_lockfile to libdm to handle pidfiles for all daemons. + Replace lookup with next in struct dfa_state & calculate states on demand. + Improve the regex matcher, reducing the number of charset nodes used. + Add dm_regex_fingerprint to facilitate regex testing. + Skip ffs(0) in _test_word in bitset functions. Use "nowatch" udev rule for inappropriate devices. Version 1.02.52 - 6th July 2010 From agk@sourceware.org Tue Jul 27 22:52:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Tue, 27 Jul 2010 22:52:00 -0000 Subject: LVM2 VERSION VERSION_DM WHATS_NEW WHATS_NEW_DM Message-ID: <20100727225220.29286.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-27 22:52:19 Modified files: . : VERSION VERSION_DM WHATS_NEW WHATS_NEW_DM Log message: pre-release Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION.diff?cvsroot=lvm2&r1=1.246&r2=1.247 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION_DM.diff?cvsroot=lvm2&r1=1.57&r2=1.58 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1672&r2=1.1673 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.396&r2=1.397 --- LVM2/VERSION 2010/07/07 02:37:28 1.246 +++ LVM2/VERSION 2010/07/27 22:52:19 1.247 @@ -1 +1 @@ -2.02.71(2)-cvs (2010-07-07) +2.02.71(2)-cvs (2010-07-27) --- LVM2/VERSION_DM 2010/07/07 02:37:28 1.57 +++ LVM2/VERSION_DM 2010/07/27 22:52:19 1.58 @@ -1 +1 @@ -1.02.53-cvs (2010-07-07) +1.02.53-cvs (2010-07-27) --- LVM2/WHATS_NEW 2010/07/27 21:57:37 1.1672 +++ LVM2/WHATS_NEW 2010/07/27 22:52:19 1.1673 @@ -1,5 +1,5 @@ -Version 2.02.71 - -=============================== +Version 2.02.71 - 27th July 2010 +================================ Document LVM fault handling in doc/lvm_fault_handling.txt. Make vgck warn about missing PVs. Clarify help text for vg_mda_count. --- LVM2/WHATS_NEW_DM 2010/07/27 21:57:37 1.396 +++ LVM2/WHATS_NEW_DM 2010/07/27 22:52:19 1.397 @@ -1,5 +1,5 @@ -Version 1.02.53 - -=============================== +Version 1.02.53 - 27th July 2010 +================================ Switch dmeventd to use dm_create_lockfile and drop duplicate code. Add dm_create_lockfile to libdm to handle pidfiles for all daemons. Replace lookup with next in struct dfa_state & calculate states on demand. From prajnoha@sourceware.org Wed Jul 28 10:30:00 2010 From: prajnoha@sourceware.org (prajnoha@sourceware.org) Date: Wed, 28 Jul 2010 10:30:00 -0000 Subject: LVM2/libdm/ioctl libdm-iface.c Message-ID: <20100728103029.30900.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: prajnoha@sourceware.org 2010-07-28 10:30:29 Modified files: libdm/ioctl : libdm-iface.c Log message: Revert unsuccessful table load preparation in combined "create, load and resume" scenario. There was missing "revert" call in _create_and_load_v4 fn while the preparation for table load ends up with failure in create/load/resume sequence. Otherwise we could end up with a device being created, but not table-loaded nor resumed. Even though the table is not loaded and the device is not resumed at this stage, we still need to synchronize with udev when calling the revert "remove" ioctl - there's still a remove uevent generated! The "revert" code does exactly that. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-iface.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77 --- LVM2/libdm/ioctl/libdm-iface.c 2010/06/23 12:54:46 1.76 +++ LVM2/libdm/ioctl/libdm-iface.c 2010/07/28 10:30:28 1.77 @@ -1655,14 +1655,16 @@ if (!(task = dm_task_create(DM_DEVICE_RELOAD))) { log_error("Failed to create device-mapper task struct"); _udev_complete(dmt); - return 0; + r = 0; + goto revert; } /* Copy across relevant fields */ if (dmt->dev_name && !dm_task_set_name(task, dmt->dev_name)) { dm_task_destroy(task); _udev_complete(dmt); - return 0; + r = 0; + goto revert; } task->read_only = dmt->read_only; From agk@sourceware.org Wed Jul 28 10:44:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 28 Jul 2010 10:44:00 -0000 Subject: LVM2 WHATS_NEW_DM Message-ID: <20100728104431.6788.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-28 10:44:30 Modified files: . : WHATS_NEW_DM Log message: . Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.397&r2=1.398 --- LVM2/WHATS_NEW_DM 2010/07/27 22:52:19 1.397 +++ LVM2/WHATS_NEW_DM 2010/07/28 10:44:29 1.398 @@ -1,5 +1,6 @@ Version 1.02.53 - 27th July 2010 ================================ + Revert failed table load preparation after "create, load and resume". Switch dmeventd to use dm_create_lockfile and drop duplicate code. Add dm_create_lockfile to libdm to handle pidfiles for all daemons. Replace lookup with next in struct dfa_state & calculate states on demand. From agk@sourceware.org Wed Jul 28 11:49:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 28 Jul 2010 11:49:00 -0000 Subject: LVM2 VERSION VERSION_DM WHATS_NEW WHATS_NEW_DM Message-ID: <20100728114943.14440.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-28 11:49:42 Modified files: . : VERSION VERSION_DM WHATS_NEW WHATS_NEW_DM Log message: day+1 Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION.diff?cvsroot=lvm2&r1=1.247&r2=1.248 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION_DM.diff?cvsroot=lvm2&r1=1.58&r2=1.59 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1673&r2=1.1674 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.398&r2=1.399 --- LVM2/VERSION 2010/07/27 22:52:19 1.247 +++ LVM2/VERSION 2010/07/28 11:49:42 1.248 @@ -1 +1 @@ -2.02.71(2)-cvs (2010-07-27) +2.02.71(2)-cvs (2010-07-28) --- LVM2/VERSION_DM 2010/07/27 22:52:19 1.58 +++ LVM2/VERSION_DM 2010/07/28 11:49:42 1.59 @@ -1 +1 @@ -1.02.53-cvs (2010-07-27) +1.02.53-cvs (2010-07-28) --- LVM2/WHATS_NEW 2010/07/27 22:52:19 1.1673 +++ LVM2/WHATS_NEW 2010/07/28 11:49:42 1.1674 @@ -1,4 +1,4 @@ -Version 2.02.71 - 27th July 2010 +Version 2.02.71 - 28th July 2010 ================================ Document LVM fault handling in doc/lvm_fault_handling.txt. Make vgck warn about missing PVs. --- LVM2/WHATS_NEW_DM 2010/07/28 10:44:29 1.398 +++ LVM2/WHATS_NEW_DM 2010/07/28 11:49:42 1.399 @@ -1,4 +1,4 @@ -Version 1.02.53 - 27th July 2010 +Version 1.02.53 - 28th July 2010 ================================ Revert failed table load preparation after "create, load and resume". Switch dmeventd to use dm_create_lockfile and drop duplicate code. From agk@sourceware.org Wed Jul 28 12:20:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 28 Jul 2010 12:20:00 -0000 Subject: LVM2 report-generators/memcheck.rb report-gene ... Message-ID: <20100728122047.13367.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-28 12:20:41 Modified files: report-generators: memcheck.rb title_page.rb unit_test.rb report-generators/lib: log.rb report_templates.rb reports.rb schedule_file.rb string-store.rb report-generators/test: tc_log.rb tc_schedule_file.rb tc_string_store.rb ts.rb test : check.sh harness.c harness.sh not.c t-activate-missing.sh t-activate-partial.sh t-lvconvert-mirror-basic-0.sh t-lvconvert-mirror-basic-1.sh t-lvconvert-mirror-basic-2.sh t-lvconvert-mirror-basic-3.sh t-lvconvert-mirror-basic.sh t-nomda-missing.sh t-snapshots-of-mirrors.sh t-vgsplit-stacked.sh unit-tests/datastruct: bitset_t.c Log message: add copyright notices to new files Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/memcheck.rb.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/title_page.rb.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/unit_test.rb.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/lib/log.rb.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/lib/report_templates.rb.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/lib/reports.rb.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/lib/schedule_file.rb.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/lib/string-store.rb.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/test/tc_log.rb.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/test/tc_schedule_file.rb.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/test/tc_string_store.rb.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/report-generators/test/ts.rb.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/check.sh.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/harness.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/harness.sh.diff?cvsroot=lvm2&r1=1.5&r2=1.6 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/not.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-activate-missing.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-activate-partial.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvconvert-mirror-basic-0.sh.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvconvert-mirror-basic-1.sh.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvconvert-mirror-basic-2.sh.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvconvert-mirror-basic-3.sh.diff?cvsroot=lvm2&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvconvert-mirror-basic.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-nomda-missing.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-snapshots-of-mirrors.sh.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-vgsplit-stacked.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/unit-tests/datastruct/bitset_t.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4 --- LVM2/report-generators/memcheck.rb 2010/07/20 14:38:44 1.1 +++ LVM2/report-generators/memcheck.rb 2010/07/28 12:20:38 1.2 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + # Reads the schedule files given on the command line. Runs them and # generates the reports. --- LVM2/report-generators/title_page.rb 2010/07/20 14:38:44 1.1 +++ LVM2/report-generators/title_page.rb 2010/07/28 12:20:38 1.2 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + # This generates the index for the reports, including generation # times. --- LVM2/report-generators/unit_test.rb 2010/07/20 14:38:44 1.1 +++ LVM2/report-generators/unit_test.rb 2010/07/28 12:20:38 1.2 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + # Reads the schedule files given on the command line. Runs them and # generates the reports. --- LVM2/report-generators/lib/log.rb 2010/07/20 14:38:45 1.1 +++ LVM2/report-generators/lib/log.rb 2010/07/28 12:20:40 1.2 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + # Merely wraps the logger library with a bit of standard policy. require 'logger' --- LVM2/report-generators/lib/report_templates.rb 2010/07/20 14:38:45 1.1 +++ LVM2/report-generators/lib/report_templates.rb 2010/07/28 12:20:40 1.2 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + # Policy for the location of report templates require 'string-store' --- LVM2/report-generators/lib/reports.rb 2010/07/20 14:38:45 1.1 +++ LVM2/report-generators/lib/reports.rb 2010/07/28 12:20:40 1.2 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + # Data about the various reports we support require 'log' require 'pathname' --- LVM2/report-generators/lib/schedule_file.rb 2010/07/20 14:38:45 1.1 +++ LVM2/report-generators/lib/schedule_file.rb 2010/07/28 12:20:40 1.2 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + # Parses the simple colon delimited test schedule files. ScheduledTest = Struct.new(:desc, :command_line, :status, :output) --- LVM2/report-generators/lib/string-store.rb 2010/07/20 14:38:45 1.1 +++ LVM2/report-generators/lib/string-store.rb 2010/07/28 12:20:40 1.2 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + # Provides a simple way of accessing the contents of files by a symbol # name. Useful for erb templates. --- LVM2/report-generators/test/tc_log.rb 2010/07/20 14:38:45 1.1 +++ LVM2/report-generators/test/tc_log.rb 2010/07/28 12:20:40 1.2 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + require 'test/unit' require 'stringio' require 'log' --- LVM2/report-generators/test/tc_schedule_file.rb 2010/07/20 14:38:45 1.1 +++ LVM2/report-generators/test/tc_schedule_file.rb 2010/07/28 12:20:40 1.2 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + require 'test/unit' require 'pathname' require 'schedule_file' --- LVM2/report-generators/test/tc_string_store.rb 2010/07/20 14:38:45 1.1 +++ LVM2/report-generators/test/tc_string_store.rb 2010/07/28 12:20:40 1.2 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + require 'string-store' require 'test/unit' --- LVM2/report-generators/test/ts.rb 2010/07/20 14:38:45 1.1 +++ LVM2/report-generators/test/ts.rb 2010/07/28 12:20:40 1.2 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + require 'tc_log' require 'tc_string_store' require 'tc_schedule_file' --- LVM2/test/check.sh 2010/05/12 10:08:35 1.5 +++ LVM2/test/check.sh 2010/07/28 12:20:41 1.6 @@ -1,5 +1,15 @@ #!/bin/bash +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + # check.sh: assert various things about volumes # USAGE --- LVM2/test/harness.c 2010/05/12 11:23:16 1.12 +++ LVM2/test/harness.c 2010/07/28 12:20:41 1.13 @@ -1,3 +1,17 @@ +/* + * Copyright (C) 2010 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 #include #include --- LVM2/test/harness.sh 2008/11/04 14:37:51 1.5 +++ LVM2/test/harness.sh 2010/07/28 12:20:41 1.6 @@ -1,5 +1,15 @@ #!/bin/sh +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + tests="$@" test -z "$tests" && tests=`echo t-*.sh` --- LVM2/test/not.c 2010/05/12 05:55:42 1.4 +++ LVM2/test/not.c 2010/07/28 12:20:41 1.5 @@ -1,3 +1,17 @@ +/* + * Copyright (C) 2010 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 #include #include --- LVM2/test/t-activate-missing.sh 2010/07/27 20:05:29 1.2 +++ LVM2/test/t-activate-missing.sh 2010/07/28 12:20:41 1.3 @@ -1,5 +1,15 @@ #!/bin/bash +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + # Test activation behaviour with devices missing. # - snapshots and their origins are only activated together; if one fails, both # fail --- LVM2/test/t-activate-partial.sh 2010/06/30 14:01:39 1.3 +++ LVM2/test/t-activate-partial.sh 2010/07/28 12:20:41 1.4 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + . ./test-utils.sh aux prepare_vg 3 @@ -17,4 +27,4 @@ vgchange -a y --partial $vg # check vgremove -vgremove -f $vg \ No newline at end of file +vgremove -f $vg --- LVM2/test/t-lvconvert-mirror-basic-0.sh 2010/05/12 13:15:38 1.1 +++ LVM2/test/t-lvconvert-mirror-basic-0.sh 2010/07/28 12:20:41 1.2 @@ -1,2 +1,12 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + . ./t-lvconvert-mirror-basic.sh test_many 0 --- LVM2/test/t-lvconvert-mirror-basic-1.sh 2010/05/12 13:15:38 1.1 +++ LVM2/test/t-lvconvert-mirror-basic-1.sh 2010/07/28 12:20:41 1.2 @@ -1,2 +1,12 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + . ./t-lvconvert-mirror-basic.sh test_many 1 --- LVM2/test/t-lvconvert-mirror-basic-2.sh 2010/05/12 13:15:38 1.1 +++ LVM2/test/t-lvconvert-mirror-basic-2.sh 2010/07/28 12:20:41 1.2 @@ -1,2 +1,12 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + . ./t-lvconvert-mirror-basic.sh test_many 2 --- LVM2/test/t-lvconvert-mirror-basic-3.sh 2010/05/12 13:15:38 1.1 +++ LVM2/test/t-lvconvert-mirror-basic-3.sh 2010/07/28 12:20:41 1.2 @@ -1,2 +1,12 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + . ./t-lvconvert-mirror-basic.sh test_many 3 --- LVM2/test/t-lvconvert-mirror-basic.sh 2010/06/28 19:13:33 1.3 +++ LVM2/test/t-lvconvert-mirror-basic.sh 2010/07/28 12:20:41 1.4 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + . ./test-utils.sh log_name_to_count() --- LVM2/test/t-nomda-missing.sh 2010/07/27 21:08:32 1.2 +++ LVM2/test/t-nomda-missing.sh 2010/07/28 12:20:41 1.3 @@ -1,5 +1,15 @@ #!/bin/bash +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + . ./test-utils.sh prepare_devs 4 --- LVM2/test/t-snapshots-of-mirrors.sh 2010/03/26 22:15:44 1.4 +++ LVM2/test/t-snapshots-of-mirrors.sh 2010/07/28 12:20:41 1.5 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + . ./test-utils.sh prepare_vg 4 --- LVM2/test/t-vgsplit-stacked.sh 2010/04/07 14:46:27 1.3 +++ LVM2/test/t-vgsplit-stacked.sh 2010/07/28 12:20:41 1.4 @@ -1,3 +1,13 @@ +# Copyright (C) 2010 Red Hat, Inc. All rights reserved. +# +# 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 + . ./test-utils.sh prepare_lvmconf '[ "a/dev\/mirror/", "a/dev\/mapper\/.*$/", "a/dev\/LVMTEST/", "r/.*/" ]' --- LVM2/unit-tests/datastruct/bitset_t.c 2010/07/20 15:28:22 1.3 +++ LVM2/unit-tests/datastruct/bitset_t.c 2010/07/28 12:20:41 1.4 @@ -1,3 +1,17 @@ +/* + * Copyright (C) 2010 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 "libdevmapper.h" #include From agk@sourceware.org Wed Jul 28 13:55:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 28 Jul 2010 13:55:00 -0000 Subject: LVM2 ./Makefile.in ./VERSION ./WHATS_NEW ./con ... Message-ID: <20100728135548.16522.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-28 13:55:43 Modified files: . : Makefile.in VERSION WHATS_NEW configure configure.in daemons/clvmd : clvm.h clvmd.c clvmd.h lib/misc : configure.h.in Log message: Change clvmd to communicate with lvm via a socket in /var/run/lvm. (mbroz) https://bugzilla.redhat.com/show_bug.cgi?id=614248 [CVE-2010-2526] Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/Makefile.in.diff?cvsroot=lvm2&r1=1.58&r2=1.59 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION.diff?cvsroot=lvm2&r1=1.248&r2=1.249 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1674&r2=1.1675 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.136&r2=1.137 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.149&r2=1.150 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvm.h.diff?cvsroot=lvm2&r1=1.8&r2=1.9 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.73&r2=1.74 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.h.diff?cvsroot=lvm2&r1=1.11&r2=1.12 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/configure.h.in.diff?cvsroot=lvm2&r1=1.25&r2=1.26 --- LVM2/Makefile.in 2010/07/20 15:25:39 1.58 +++ LVM2/Makefile.in 2010/07/28 13:55:42 1.59 @@ -84,6 +84,7 @@ $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_BACKUP_DIR) $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_CACHE_DIR) $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_LOCK_DIR) + $(INSTALL_ROOT_DIR) $(DESTDIR)$(DEFAULT_RUN_DIR) $(INSTALL_ROOT_DATA) /dev/null $(DESTDIR)$(DEFAULT_CACHE_DIR)/.cache install_initscripts: --- LVM2/VERSION 2010/07/28 11:49:42 1.248 +++ LVM2/VERSION 2010/07/28 13:55:42 1.249 @@ -1 +1 @@ -2.02.71(2)-cvs (2010-07-28) +2.02.72(2)-cvs (2010-07-28) --- LVM2/WHATS_NEW 2010/07/28 11:49:42 1.1674 +++ LVM2/WHATS_NEW 2010/07/28 13:55:42 1.1675 @@ -1,3 +1,9 @@ +Version 2.02.72 - 28th July 2010 [CVE-2010-2526] +================================================= + Change clvmd to communicate with lvm2 via a socket in /var/run/lvm. + Return controlled error if clvmd is run by non-root user. + Add configure --default-run-dir for /var/run/lvm. + Version 2.02.71 - 28th July 2010 ================================ Document LVM fault handling in doc/lvm_fault_handling.txt. --- LVM2/configure 2010/07/21 12:54:21 1.136 +++ LVM2/configure 2010/07/28 13:55:42 1.137 @@ -863,6 +863,7 @@ with_udevdir with_dmeventd_pidfile with_dmeventd_path +with_default_run_dir with_default_system_dir with_default_archive_subdir with_default_backup_subdir @@ -1599,6 +1600,7 @@ dmeventd pidfile [/var/run/dmeventd.pid] --with-dmeventd-path=PATH dmeventd path [EPREFIX/sbin/dmeventd] + --with-default-run-dir=DIR Default run directory [/var/run/lvm] --with-default-system-dir=DIR default LVM system directory [/etc/lvm] --with-default-archive-subdir=SUBDIR @@ -17816,6 +17818,21 @@ fi + + + +# Check whether --with-default-run-dir was given. +if test "${with_default_run_dir+set}" = set; then + withval=$with_default_run_dir; DEFAULT_RUN_DIR="$withval" +else + DEFAULT_RUN_DIR="/var/run/lvm" +fi + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_RUN_DIR "$DEFAULT_RUN_DIR" +_ACEOF + + ################################################################################ # Check whether --with-default-system-dir was given. --- LVM2/configure.in 2010/07/20 15:25:39 1.149 +++ LVM2/configure.in 2010/07/28 13:55:42 1.150 @@ -1127,6 +1127,13 @@ [Path to dmeventd binary.]) fi +AH_TEMPLATE(DEFAULT_RUN_DIR, [Name of default run directory.]) +AC_ARG_WITH(default-run-dir, + [ --with-default-run-dir=DIR Default run directory [[/var/run/lvm]] ], + [ DEFAULT_RUN_DIR="$withval" ], + [ DEFAULT_RUN_DIR="/var/run/lvm" ]) +AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR,["$DEFAULT_RUN_DIR"] ) + ################################################################################ dnl -- various defaults AC_ARG_WITH(default-system-dir, --- LVM2/daemons/clvmd/clvm.h 2010/04/20 14:07:38 1.8 +++ LVM2/daemons/clvmd/clvm.h 2010/07/28 13:55:43 1.9 @@ -22,6 +22,8 @@ #ifndef _CLVM_H #define _CLVM_H +#include "configure.h" + struct clvm_header { uint8_t cmd; /* See below */ uint8_t flags; /* See below */ @@ -45,9 +47,8 @@ #define CLVMD_FLAG_SYSTEMLV 2 /* Data in system LV under my node name */ #define CLVMD_FLAG_NODEERRS 4 /* Reply has errors in node-specific portion */ -/* Name of the local socket to communicate between libclvm and clvmd */ -//static const char CLVMD_SOCKNAME[]="/var/run/clvmd"; -static const char CLVMD_SOCKNAME[] = "\0clvmd"; +/* Name of the local socket to communicate between lvm and clvmd */ +static const char CLVMD_SOCKNAME[]= DEFAULT_RUN_DIR "/clvmd.sock"; /* Internal commands & replies */ #define CLVMD_CMD_REPLY 1 --- LVM2/daemons/clvmd/clvmd.c 2010/07/13 13:51:02 1.73 +++ LVM2/daemons/clvmd/clvmd.c 2010/07/28 13:55:43 1.74 @@ -123,6 +123,7 @@ static int process_reply(const struct clvm_header *msg, int msglen, const char *csid); static int open_local_sock(void); +static void close_local_sock(int local_socket); static int check_local_clvmd(void); static struct local_client *find_client(int clientid); static void main_loop(int local_sock, int cmd_timeout); @@ -276,6 +277,23 @@ unlink(CLVMD_PIDFILE); } +/* + * clvmd require dm-ioctl capability for operation + */ +static void check_permissions() +{ + if (getuid() || geteuid()) { + log_error("Cannot run as a non-root user."); + + /* + * Fail cleanly here if not run as root, instead of failing + * later when attempting a root-only operation + * Preferred exit code from an initscript for this. + */ + exit(4); + } +} + int main(int argc, char *argv[]) { int local_sock; @@ -305,9 +323,11 @@ exit(0); case 'R': + check_permissions(); return refresh_clvmd(1)==1?0:1; case 'S': + check_permissions(); return restart_clvmd(clusterwide_opt)==1?0:1; case 'C': @@ -353,6 +373,8 @@ } } + check_permissions(); + /* Setting debug options on an existing clvmd */ if (debug_opt && !check_local_clvmd()) { @@ -521,6 +543,7 @@ /* Do some work */ main_loop(local_sock, cmd_timeout); + close_local_sock(local_sock); destroy_lvm(); return 0; @@ -864,7 +887,6 @@ closedown: clops->cluster_closedown(); - close(local_sock); } static __attribute__ ((noreturn)) void wait_for_child(int c_pipe, int timeout) @@ -1963,20 +1985,30 @@ return ret; } +static void close_local_sock(int local_socket) +{ + if (local_socket != -1 && close(local_socket)) + stack; + + if (CLVMD_SOCKNAME[0] != '\0' && unlink(CLVMD_SOCKNAME)) + stack; +} /* Open the local socket, that's the one we talk to libclvm down */ static int open_local_sock() { - int local_socket; + int local_socket = -1; struct sockaddr_un sockaddr; + mode_t old_mask; + + close_local_sock(local_socket); + old_mask = umask(0077); /* Open local socket */ - if (CLVMD_SOCKNAME[0] != '\0') - unlink(CLVMD_SOCKNAME); local_socket = socket(PF_UNIX, SOCK_STREAM, 0); if (local_socket < 0) { log_error("Can't create local socket: %m"); - return -1; + goto error; } /* Set Close-on-exec & non-blocking */ @@ -1989,18 +2021,19 @@ sockaddr.sun_family = AF_UNIX; if (bind(local_socket, (struct sockaddr *) &sockaddr, sizeof(sockaddr))) { log_error("can't bind local socket: %m"); - close(local_socket); - return -1; + goto error; } if (listen(local_socket, 1) != 0) { log_error("listen local: %m"); - close(local_socket); - return -1; + goto error; } - if (CLVMD_SOCKNAME[0] != '\0') - chmod(CLVMD_SOCKNAME, 0600); + umask(old_mask); return local_socket; +error: + close_local_sock(local_socket); + umask(old_mask); + return -1; } void process_message(struct local_client *client, const char *buf, int len, --- LVM2/daemons/clvmd/clvmd.h 2007/08/17 11:51:23 1.11 +++ LVM2/daemons/clvmd/clvmd.h 2010/07/28 13:55:43 1.12 @@ -20,9 +20,6 @@ #define CLVMD_MINOR_VERSION 2 #define CLVMD_PATCH_VERSION 1 -/* Name of the cluster LVM admin lock */ -#define ADMIN_LOCK_NAME "CLVMD_ADMIN" - /* Default time (in seconds) we will wait for all remote commands to execute before declaring them dead */ #define DEFAULT_CMD_TIMEOUT 60 --- LVM2/lib/misc/configure.h.in 2010/07/13 13:51:03 1.25 +++ LVM2/lib/misc/configure.h.in 2010/07/28 13:55:43 1.26 @@ -35,6 +35,9 @@ /* Name of default locking directory. */ #undef DEFAULT_LOCK_DIR +/* Name of default run directory. */ +#undef DEFAULT_RUN_DIR + /* Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes. */ #undef DEFAULT_SI_UNIT_CONSISTENCY From agk@sourceware.org Wed Jul 28 14:01:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 28 Jul 2010 14:01:00 -0000 Subject: LVM2 ./WHATS_NEW daemons/clvmd/clvmd-singlenod ... Message-ID: <20100728140142.453.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-28 14:01:41 Modified files: . : WHATS_NEW daemons/clvmd : clvmd-singlenode.c clvmd.c Log message: Never use clvmd singlenode unless explicitly requested with -Isinglenode. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1675&r2=1.1676 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-singlenode.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.74&r2=1.75 --- LVM2/WHATS_NEW 2010/07/28 13:55:42 1.1675 +++ LVM2/WHATS_NEW 2010/07/28 14:01:40 1.1676 @@ -3,6 +3,7 @@ Change clvmd to communicate with lvm2 via a socket in /var/run/lvm. Return controlled error if clvmd is run by non-root user. Add configure --default-run-dir for /var/run/lvm. + Never use clvmd singlenode unless explicitly requested with -Isinglenode. Version 2.02.71 - 28th July 2010 ================================ --- LVM2/daemons/clvmd/clvmd-singlenode.c 2010/06/21 15:56:58 1.4 +++ LVM2/daemons/clvmd/clvmd-singlenode.c 2010/07/28 14:01:41 1.5 @@ -26,17 +26,29 @@ #include #include -static const char SINGLENODE_CLVMD_SOCKNAME[] = "\0singlenode_clvmd"; +static const char SINGLENODE_CLVMD_SOCKNAME[] = DEFAULT_RUN_DIR "/clvmd_singlenode.sock"; static int listen_fd = -1; +static void close_comms() +{ + if (listen_fd != -1 && close(listen_fd)) + stack; + (void)unlink(SINGLENODE_CLVMD_SOCKNAME); + listen_fd = -1; +} + static int init_comms() { struct sockaddr_un addr; + mode_t old_mask; + + close_comms(); + old_mask = umask(0077); listen_fd = socket(PF_UNIX, SOCK_STREAM, 0); if (listen_fd < 0) { DEBUGLOG("Can't create local socket: %s\n", strerror(errno)); - return -1; + goto error; } /* Set Close-on-exec */ fcntl(listen_fd, F_SETFD, 1); @@ -48,16 +60,19 @@ if (bind(listen_fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { DEBUGLOG("Can't bind local socket: %s\n", strerror(errno)); - close(listen_fd); - return -1; + goto error; } if (listen(listen_fd, 10) < 0) { DEBUGLOG("Can't listen local socket: %s\n", strerror(errno)); - close(listen_fd); - return -1; + goto error; } + umask(old_mask); return 0; +error: + umask(old_mask); + close_comms(); + return -1; } static int _init_cluster(void) @@ -74,7 +89,7 @@ static void _cluster_closedown(void) { - close(listen_fd); + close_comms(); DEBUGLOG("cluster_closedown\n"); destroy_lvhash(); --- LVM2/daemons/clvmd/clvmd.c 2010/07/28 13:55:43 1.74 +++ LVM2/daemons/clvmd/clvmd.c 2010/07/28 14:01:41 1.75 @@ -479,7 +479,7 @@ #endif #ifdef USE_SINGLENODE if (!clops) - if ((cluster_iface == IF_AUTO || cluster_iface == IF_SINGLENODE) && (clops = init_singlenode_cluster())) { + if (cluster_iface == IF_SINGLENODE && (clops = init_singlenode_cluster())) { max_csid_len = SINGLENODE_CSID_LEN; max_cluster_message = SINGLENODE_MAX_CLUSTER_MESSAGE; max_cluster_member_name_len = MAX_CLUSTER_MEMBER_NAME_LEN; From agk@sourceware.org Wed Jul 28 21:58:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Wed, 28 Jul 2010 21:58:00 -0000 Subject: LVM2 VERSION VERSION_DM WHATS_NEW WHATS_NEW_DM Message-ID: <20100728215808.23551.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-28 21:58:08 Modified files: . : VERSION VERSION_DM WHATS_NEW WHATS_NEW_DM Log message: post-release Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION.diff?cvsroot=lvm2&r1=1.249&r2=1.250 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/VERSION_DM.diff?cvsroot=lvm2&r1=1.59&r2=1.60 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1676&r2=1.1677 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.399&r2=1.400 --- LVM2/VERSION 2010/07/28 13:55:42 1.249 +++ LVM2/VERSION 2010/07/28 21:58:08 1.250 @@ -1 +1 @@ -2.02.72(2)-cvs (2010-07-28) +2.02.73(2)-cvs (2010-07-28) --- LVM2/VERSION_DM 2010/07/28 11:49:42 1.59 +++ LVM2/VERSION_DM 2010/07/28 21:58:08 1.60 @@ -1 +1 @@ -1.02.53-cvs (2010-07-28) +1.02.54-cvs (2010-07-28) --- LVM2/WHATS_NEW 2010/07/28 14:01:40 1.1676 +++ LVM2/WHATS_NEW 2010/07/28 21:58:08 1.1677 @@ -1,3 +1,6 @@ +Version 2.02.73 - +================================ + Version 2.02.72 - 28th July 2010 [CVE-2010-2526] ================================================= Change clvmd to communicate with lvm2 via a socket in /var/run/lvm. --- LVM2/WHATS_NEW_DM 2010/07/28 11:49:42 1.399 +++ LVM2/WHATS_NEW_DM 2010/07/28 21:58:08 1.400 @@ -1,3 +1,6 @@ +Version 1.02.54 - +================================ + Version 1.02.53 - 28th July 2010 ================================ Revert failed table load preparation after "create, load and resume". From wysochanski@sourceware.org Fri Jul 30 16:47:00 2010 From: wysochanski@sourceware.org (wysochanski@sourceware.org) Date: Fri, 30 Jul 2010 16:47:00 -0000 Subject: LVM2/lib/metadata metadata.c Message-ID: <20100730164728.27658.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: wysochanski@sourceware.org 2010-07-30 16:47:27 Modified files: lib/metadata : metadata.c Log message: Remove irrelevant comments relating to vg_mda_copies. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.389&r2=1.390 --- LVM2/lib/metadata/metadata.c 2010/07/09 16:57:44 1.389 +++ LVM2/lib/metadata/metadata.c 2010/07/30 16:47:27 1.390 @@ -1199,11 +1199,6 @@ int vg_set_mda_copies(struct volume_group *vg, uint32_t mda_copies) { - /* FIXME: add checks, etc, and set the value */ - /* - * FIXME: Before we set a larger value, we may need to - * enable some mdas on PVS - */ vg->mda_copies = mda_copies; /* FIXME Use log_verbose when this is due to specific cmdline request. */ From taka@sourceware.org Fri Jul 30 17:50:00 2010 From: taka@sourceware.org (taka@sourceware.org) Date: Fri, 30 Jul 2010 17:50:00 -0000 Subject: LVM2 ./WHATS_NEW tools/lvconvert.c Message-ID: <20100730175017.23464.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: taka@sourceware.org 2010-07-30 17:50:16 Modified files: . : WHATS_NEW tools : lvconvert.c Log message: Fix wrong number of mirror log at allocate policy With mirror_log_fault_policy of 'remove' and mirror_image_fault_policy of 'allocate', the log type of the mirror volume is converted from 'disk' or 'mirrored' to 'core' when all mirror legs but one in a mirror volume broke. Keep new_log_count as a number of valid log devices by using log_count variable for a temporary usage in the first phase of error recovery in _lvconvert_mirrors_repair(). Signed-off-by: Takahiro Yasui Reviewed-by: Petr Rockai Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1677&r2=1.1678 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.140&r2=1.141 --- LVM2/WHATS_NEW 2010/07/28 21:58:08 1.1677 +++ LVM2/WHATS_NEW 2010/07/30 17:50:15 1.1678 @@ -1,5 +1,6 @@ Version 2.02.73 - ================================ + Fix wrong number of mirror log at allocate policy Version 2.02.72 - 28th July 2010 [CVE-2010-2526] ================================================= --- LVM2/tools/lvconvert.c 2010/07/13 22:04:36 1.140 +++ LVM2/tools/lvconvert.c 2010/07/30 17:50:16 1.141 @@ -1237,25 +1237,27 @@ if (!(lp->failed_pvs = _failed_pv_list(lv->vg))) return_0; + log_count = new_log_count; + /* * We must adjust the log first, or the entire mirror * will get stuck during a suspend. */ - if (!_lv_update_mirrored_log(lv, lp->failed_pvs, new_log_count)) + if (!_lv_update_mirrored_log(lv, lp->failed_pvs, log_count)) return 0; if (lp->mirrors == 1) - new_log_count = 0; + log_count = 0; if (failed_mirrors) { if (!lv_remove_mirrors(cmd, lv, failed_mirrors, - new_log_count ? 0U : 1U, + log_count ? 0U : 1U, _is_partial_lv, NULL, 0)) return 0; } if (!_lv_update_log_type(cmd, lp, lv, lp->failed_pvs, - new_log_count)) + log_count)) return 0; if (!_reload_lv(cmd, lv)) From agk@sourceware.org Sat Jul 31 00:43:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Sat, 31 Jul 2010 00:43:00 -0000 Subject: LVM2 WHATS_NEW configure configure.in Message-ID: <20100731004342.789.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-31 00:43:42 Modified files: . : WHATS_NEW configure configure.in Log message: Fix configure to supply DEFAULT_RUN_DIR to Makefiles. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1678&r2=1.1679 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.diff?cvsroot=lvm2&r1=1.137&r2=1.138 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/configure.in.diff?cvsroot=lvm2&r1=1.150&r2=1.151 --- LVM2/WHATS_NEW 2010/07/30 17:50:15 1.1678 +++ LVM2/WHATS_NEW 2010/07/31 00:43:41 1.1679 @@ -1,5 +1,6 @@ Version 2.02.73 - ================================ + Fix configure to supply DEFAULT_RUN_DIR to Makefiles. Fix wrong number of mirror log at allocate policy Version 2.02.72 - 28th July 2010 [CVE-2010-2526] --- LVM2/configure 2010/07/28 13:55:42 1.137 +++ LVM2/configure 2010/07/31 00:43:41 1.138 @@ -691,6 +691,7 @@ DMEVENTD DL_LIBS DEVMAPPER +DEFAULT_RUN_DIR DEFAULT_LOCK_DIR DEFAULT_CACHE_SUBDIR DEFAULT_BACKUP_SUBDIR @@ -18043,6 +18044,7 @@ + ################################################################################ ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile doc/Makefile doc/example.conf include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/snapshot/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/lvm2_monitoring_init_red_hat scripts/Makefile test/Makefile test/api/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile" --- LVM2/configure.in 2010/07/28 13:55:42 1.150 +++ LVM2/configure.in 2010/07/31 00:43:42 1.151 @@ -1232,6 +1232,7 @@ AC_SUBST(DEFAULT_BACKUP_SUBDIR) AC_SUBST(DEFAULT_CACHE_SUBDIR) AC_SUBST(DEFAULT_LOCK_DIR) +AC_SUBST(DEFAULT_RUN_DIR) AC_SUBST(DEVMAPPER) AC_SUBST(DLM_CFLAGS) AC_SUBST(DLM_LIBS) From agk@sourceware.org Sat Jul 31 14:14:00 2010 From: agk@sourceware.org (agk@sourceware.org) Date: Sat, 31 Jul 2010 14:14:00 -0000 Subject: LVM2 WHATS_NEW make.tmpl.in Message-ID: <20100731141400.16913.qmail@sourceware.org> CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2010-07-31 14:13:59 Modified files: . : WHATS_NEW make.tmpl.in Log message: Drop explicit 'Base' version from exported symbols. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1679&r2=1.1680 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/make.tmpl.in.diff?cvsroot=lvm2&r1=1.106&r2=1.107 --- LVM2/WHATS_NEW 2010/07/31 00:43:41 1.1679 +++ LVM2/WHATS_NEW 2010/07/31 14:13:59 1.1680 @@ -1,5 +1,6 @@ Version 2.02.73 - ================================ + Drop explicit 'Base' version from exported symbols. Fix configure to supply DEFAULT_RUN_DIR to Makefiles. Fix wrong number of mirror log at allocate policy --- LVM2/make.tmpl.in 2010/07/20 14:38:44 1.106 +++ LVM2/make.tmpl.in 2010/07/31 14:13:59 1.107 @@ -366,7 +366,7 @@ ) > $@ .export.sym: .exported_symbols_generated - set -e; (echo "Base {"; echo " global:"; \ + set -e; (echo "{"; echo " global:"; \ sed "s/^/ /;s/$$/;/" < $<; \ echo " local:"; echo " *;"; echo "};") > $@