master - conf: update profile templates for recent changes
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b88b75f55f54bf...
Commit: b88b75f55f54bf07780d389a750bc899f7bed8a9
Parent: 437b17964cfe8fc73fe224589c62c47f2b2665dc
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Feb 11 13:22:31 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Feb 11 13:22:31 2015 +0100
conf: update profile templates for recent changes
---
conf/command_profile_template.profile.in | 1 +
conf/metadata_profile_template.profile.in | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/conf/command_profile_template.profile.in b/conf/command_profile_template.profile.in
index 0c1e6f0..402e30c 100644
--- a/conf/command_profile_template.profile.in
+++ b/conf/command_profile_template.profile.in
@@ -18,6 +18,7 @@ global {
lvdisplay_shows_full_device_path=0
}
report {
+ compact_output=0
aligned=1
buffered=1
headings=1
diff --git a/conf/metadata_profile_template.profile.in b/conf/metadata_profile_template.profile.in
index 81633b2..b08d32c 100644
--- a/conf/metadata_profile_template.profile.in
+++ b/conf/metadata_profile_template.profile.in
@@ -16,7 +16,7 @@ allocation {
thin_pool_zero=1
thin_pool_discards="passdown"
thin_pool_chunk_size_policy="generic"
-# thin_pool_chunk_size=64
+# thin_pool_chunk_size=128
}
activation {
thin_pool_autoextend_threshold=100
9 years, 3 months
master - man: reference -S/--select in {vg, lv, pv}change, {vg, lv}remove, {vg, lv, pv}display and vg{import, export} man pages
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=437b17964cfe8f...
Commit: 437b17964cfe8fc73fe224589c62c47f2b2665dc
Parent: bc1bb7f8c5cd38bdebe18ebbee270882a4ee82d3
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Feb 11 10:03:37 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Feb 11 10:04:21 2015 +0100
man: reference -S/--select in {vg,lv,pv}change, {vg,lv}remove, {vg,lv,pv}display and vg{import,export} man pages
---
man/lvchange.8.in | 3 ++-
man/lvdisplay.8.in | 8 ++++----
man/lvm.8.in | 5 +++--
man/lvremove.8.in | 3 ++-
man/pvchange.8.in | 2 ++
man/pvdisplay.8.in | 8 ++++----
man/vgchange.8.in | 2 ++
man/vgdisplay.8.in | 8 ++++----
man/vgexport.8.in | 3 ++-
man/vgimport.8.in | 3 ++-
man/vgremove.8.in | 3 ++-
11 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index bb5bea5..fbae953 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -68,11 +68,12 @@ lvchange \(em change attributes of a logical volume
.RB [ \-r | \-\-readahead
.RI { ReadAheadSectors | auto | none }]
.RB [ \-\-refresh ]
+.RB [ \-S | \-\-select
+.IR Selection ]
.RB [ \-t | \-\-test ]
.RB [ \-v | \-\-verbose ]
.RB [ \-Z | \-\-zero
.RI { y | n }]
-.I LogicalVolumePath
.RI [ LogicalVolumePath ...]
.SH DESCRIPTION
lvchange allows you to change the attributes of a logical volume
diff --git a/man/lvdisplay.8.in b/man/lvdisplay.8.in
index 3232853..ed1d3f7 100644
--- a/man/lvdisplay.8.in
+++ b/man/lvdisplay.8.in
@@ -14,12 +14,13 @@ lvdisplay \(em display attributes of a logical volume
.RB [ \-\-maps ]
.RB [ \-\-nosuffix ]
.RB [ \-P | \-\-partial ]
+.RB [ \-S | \-\-select
+.IR Selection ]
.RB [ \-\-units
.IR hHbBsSkKmMgGtTpPeE ]
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
-.RI [ VolumeGroupName | LogicalVolume { Name | Path }
-.RI [ VolumeGroupName | LogicalVolume { Name | Path }\ ...]]
+.RI [ VolumeGroupName | LogicalVolume { Name | Path }\ ...]
.br
.B lvdisplay
@@ -50,8 +51,7 @@ lvdisplay \(em display attributes of a logical volume
.IR hHbBsSkKmMgGtTpPeE ]
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
-.RI [ VolumeGroupName | LogicalVolume { Name | Path }
-.RI [ VolumeGroupName | LogicalVolume { Name | Path }\ ...]]
+.RI [ VolumeGroupName | LogicalVolume { Name | Path }\ ...]
.SH DESCRIPTION
lvdisplay allows you to see the attributes of a logical volume
like size, read/write status, snapshot information etc.
diff --git a/man/lvm.8.in b/man/lvm.8.in
index f87729e..7bc4c6b 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -210,8 +210,9 @@ match the original followed by \fBvgcfgrestore\fP(8).
.BR \-S ", " \-\-select " " \fISelection
For reporting commands, display only rows that match selection criteria.
All rows are displayed with the additional "selected" column (\fB-o selected\fP)
-showing 1 if the row matches the Selection and 0 otherwise.
-See \fBSELECTION CRITERIA\fP section of this man page for more
+showing 1 if the row matches the Selection and 0 otherwise. For non-reporting
+commands which process LVM entities, the selection can be used to match items
+to process. See \fBSELECTION CRITERIA\fP section of this man page for more
information about the way the selection criteria are constructed.
.TP
.BR \-M ", " \-\-metadatatype " " \fIType
diff --git a/man/lvremove.8.in b/man/lvremove.8.in
index 8426cac..8cf1bf3 100644
--- a/man/lvremove.8.in
+++ b/man/lvremove.8.in
@@ -9,12 +9,13 @@ lvremove \(em remove a logical volume
.IR ProfileName ]
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-\-help ]
+.RB [ \-S | \-\-select
+.IR Selection ]
.RB [ \-t | \-\-test ]
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
.RB [ \-f | \-\-force ]
.RB [ \-\-noudevsync ]
-.IR LogicalVolume { Name | Path }
.RI [ LogicalVolume { Name | Path }...]
.SH DESCRIPTION
lvremove removes one or more logical volumes.
diff --git a/man/pvchange.8.in b/man/pvchange.8.in
index 606b1dd..5c5b809 100644
--- a/man/pvchange.8.in
+++ b/man/pvchange.8.in
@@ -16,6 +16,8 @@ pvchange \(em change attributes of a physical volume
.RB [ \-\-metadataignore
.RI { y | n }]
.RB [ \-h | \-? | \-\-help ]
+.RB [ \-S | \-\-select
+.IR Selection ]
.RB [ \-t | \-\-test ]
.RB [ \-v | \-\-verbose ]
.RB [ \-a | \-\-all ]
diff --git a/man/pvdisplay.8.in b/man/pvdisplay.8.in
index 70c9bfc..c1232d6 100644
--- a/man/pvdisplay.8.in
+++ b/man/pvdisplay.8.in
@@ -13,13 +13,14 @@ pvdisplay \- display attributes of a physical volume
.RB [ \-\-maps ]
.RB [ \-\-nosuffix ]
.RB [ \-s | \-\-short ]
+.RB [ \-S | \-\-select
+.IR Selection ]
.RB [ \-\-units
.IR hsbkmgtHKMGT ]
.RB [ \-v [ v ]| \-\-verbose
.RB [ \-\-verbose ]]
.RB [ \-\-version ]
-.RI [ PhysicalVolumePath
-.RI [ PhysicalVolumePath ...]]
+.RI [ PhysicalVolumePath ...]
.br
.br
@@ -50,8 +51,7 @@ pvdisplay \- display attributes of a physical volume
.RB [ \-v [ v ]| \-\-verbose
.RB [ \-\-verbose ]]
.RB [ \-\-version ]
-.RI [ PhysicalVolumePath
-.RI [ PhysicalVolumePath ...]]
+.RI [ PhysicalVolumePath ...]
.SH DESCRIPTION
pvdisplay allows you to see the attributes of one or more physical volumes
like size, physical extent size, space used for the volume group descriptor
diff --git a/man/vgchange.8.in b/man/vgchange.8.in
index dcd1faf..5014300 100644
--- a/man/vgchange.8.in
+++ b/man/vgchange.8.in
@@ -45,6 +45,8 @@ vgchange \(em change attributes of a volume group
.RB [ \-P | \-\-partial ]
.RB [ \-s | \-\-physicalextentsize
.IR PhysicalExtentSize [ bBsSkKmMgGtTpPeE ]]
+.RB [ \-S | \-\-select
+.IR Selection ]
.RB [ \-\-refresh ]
.RB [ \-t | \-\-test ]
.RB [ \-v | \-\-verbose ]
diff --git a/man/vgdisplay.8.in b/man/vgdisplay.8.in
index 1e472d3..172dba4 100644
--- a/man/vgdisplay.8.in
+++ b/man/vgdisplay.8.in
@@ -8,6 +8,8 @@ vgdisplay \(em display attributes of volume groups
.RB [ \-\-commandprofile
.IR ProfileName ]
.RB [ \-s | \-\-short ]
+.RB [ \-S | \-\-select
+.IR Selection ]
.RB [ \-v | \-\-verbose ]
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-\-help ]
@@ -18,8 +20,7 @@ vgdisplay \(em display attributes of volume groups
.RB [ \-\-units
.IR hHbBsSkKmMgGtTpPeE ]
.RB [ \-\-version ]
-.RI [ VolumeGroupName
-.RI [ VolumeGroupName ...]]
+.RI [ VolumeGroupName ...]
.br
.br
@@ -49,8 +50,7 @@ vgdisplay \(em display attributes of volume groups
.IR hHbBsSkKmMgGtTpPeE ]
.RB [ \-v | \-\-verbose ]
.RB [ \-\-version ]
-.RI [ VolumeGroupName
-.RI [ VolumeGroupName ...]]
+.RI [ VolumeGroupName ...]
.SH DESCRIPTION
vgdisplay allows you to see the attributes of
.I VolumeGroupName
diff --git a/man/vgexport.8.in b/man/vgexport.8.in
index 2b31618..94a3e32 100644
--- a/man/vgexport.8.in
+++ b/man/vgexport.8.in
@@ -8,8 +8,9 @@ vgexport \- make volume groups unknown to the system
.IR ProfileName ]
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-? | \-\-help ]
+.RB [ \-S | \-\-select
+.IR Selection ]
.RB [ \-v | \-\-verbose ]
-.I VolumeGroupName
.RI [ VolumeGroupName ...]
.SH DESCRIPTION
vgexport allows you to make the inactive
diff --git a/man/vgimport.8.in b/man/vgimport.8.in
index 31378f4..3a8a230 100644
--- a/man/vgimport.8.in
+++ b/man/vgimport.8.in
@@ -6,8 +6,9 @@ vgimport \(em make exported volume groups known to the system
.RB [ \-a | \-\-all ]
.RB [ \-d | \-\-debug ]
.RB [ \-h | \-? | \-\-help ]
+.RB [ \-S | \-\-select
+.IR Selection ]
.RB [ \-v | \-\-verbose ]
-.I VolumeGroupName
.RI [ VolumeGroupName ...]
.SH DESCRIPTION
vgimport allows you to make a Volume Group that was previously
diff --git a/man/vgremove.8.in b/man/vgremove.8.in
index 10a431f..082c1f3 100644
--- a/man/vgremove.8.in
+++ b/man/vgremove.8.in
@@ -9,9 +9,10 @@ vgremove \(em remove a volume group
.RB [ \-f | \-\-force ]
.RB [ \-h | \-? | \-\-help ]
.RB [ \-\-noudevsync ]
+.RB [ \-S | \-\-select
+.IR Selection ]
.RB [ \-t | \-\-test ]
.RB [ \-v | \-\-verbose ]
-.I VolumeGroupName
.RI [ VolumeGroupName ...]
.SH DESCRIPTION
vgremove allows you to remove one or more volume groups.
9 years, 3 months
master - toollib: select: issue an error message for failed VG/LV/PV selection
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bc1bb7f8c5cd38...
Commit: bc1bb7f8c5cd38bdebe18ebbee270882a4ee82d3
Parent: 3505e88b18edfc60bb06ffccab8dd91f69356c2d
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Feb 11 09:36:09 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Feb 11 09:36:09 2015 +0100
toollib: select: issue an error message for failed VG/LV/PV selection
---
tools/toollib.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index a452676..bdf6494 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1639,8 +1639,10 @@ int select_match_vg(struct cmd_context *cmd, struct processing_handle *handle,
sh->orig_report_type = VGS;
- if (!report_for_selection(sh, NULL, vg, NULL))
- return_0;
+ if (!report_for_selection(sh, NULL, vg, NULL)) {
+ log_error("Selection failed for VG %s.", vg->name);
+ return 0;
+ }
sh->orig_report_type = 0;
*selected = sh->selected;
@@ -1660,8 +1662,10 @@ int select_match_lv(struct cmd_context *cmd, struct processing_handle *handle,
sh->orig_report_type = LVS;
- if (!report_for_selection(sh, NULL, vg, lv))
- return_0;
+ if (!report_for_selection(sh, NULL, vg, lv)) {
+ log_error("Selection failed for LV %s.", lv->name);
+ return 0;
+ }
sh->orig_report_type = 0;
*selected = sh->selected;
@@ -1681,8 +1685,10 @@ int select_match_pv(struct cmd_context *cmd, struct processing_handle *handle,
sh->orig_report_type = PVS;
- if (!report_for_selection(sh, pv, vg, NULL))
- return_0;
+ if (!report_for_selection(sh, pv, vg, NULL)) {
+ log_error("Selection failed for PV %s.", dev_name(pv->dev));
+ return 0;
+ }
sh->orig_report_type = 0;
*selected = sh->selected;
9 years, 3 months
master - man: dumpconfig: mention LVM_COMMAND_PROFILE env var and add more references to --mergedconfig option
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3505e88b18edfc...
Commit: 3505e88b18edfc60bb06ffccab8dd91f69356c2d
Parent: 801e47e089ae8e1a09164556536d49af555df734
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Feb 11 09:21:08 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Feb 11 09:34:19 2015 +0100
man: dumpconfig: mention LVM_COMMAND_PROFILE env var and add more references to --mergedconfig option
The LVM_COMMAND_PROFILE env var is new - mention it in dumpconfig's
man page.
Also, dumpconfig always displays the top of the config cascade.
To display all the config found in the cascade merged (just like
it's used during LVM command processing), --mergedconfig option
must be used - this one's already described in that man page,
just make sure it's clear and add reference for this option also
in --profile/--commandprofile/--metadataprofile description.
---
man/lvm-dumpconfig.8.in | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/man/lvm-dumpconfig.8.in b/man/lvm-dumpconfig.8.in
index 844f8ac..04afce9 100644
--- a/man/lvm-dumpconfig.8.in
+++ b/man/lvm-dumpconfig.8.in
@@ -103,7 +103,8 @@ See also \fBlvm.conf\fP(5) for more info about \fBconfig cascade\fP.
.BI \-\-commandprofile " ProfileName"
Use \fBProfileName\fP to override existing configuration.
This configuration is then applied for dumpconfig command itself.
-See also \fBlvm.conf\fP(5) for more info about \fBconfig cascade\fP.
+See also \fB\-\-mergedconfig\fP option and \fBlvm.conf\fP(5) for
+more info about \fBconfig cascade\fP.
.TP
.BI \-\-profile " ProfileName"
@@ -115,12 +116,14 @@ applied for dumpconfig command itself.
Use \fBProfileName\fP to override existing configuration.
The configuration defined in metadata profile has no effect for
dumpconfig command itself, the dumpconfig dumps the configuration only.
-See also \fBlvm.conf\fP(5) for more info about \fBconfig cascade\fP.
+See also \fB\-\-mergedconfig\fP option and \fBlvm.conf\fP(5) for more
+info about \fBconfig cascade\fP.
.TP
.B \-\-mergedconfig
When the dumpconfig command is run with the \fB\-\-config\fP option
-and/or \fB\-\-commandprofile\fP, \fB\-\-profile\fP, \fB\-\-metadataprofile\fP
+and/or \fB\-\-commandprofile\fP (or using \fBLVM_COMMAND_PROFILE\fP
+environment variable), \fB\-\-profile\fP, \fB\-\-metadataprofile\fP
option, merge all the contents of the \fBconfig cascade\fP before dumping it.
Without the \fB\-\-mergeconfig\fP option used, only the configuration at
the front of the cascade is dumped. See also \fBlvm.conf\fP(5) for more
9 years, 3 months
master - NIX: Drop Fedora 16 builds.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=801e47e089ae8e...
Commit: 801e47e089ae8e1a09164556536d49af555df734
Parent: 79dc8f5ddd89fd54897347167163c5176b6f7511
Author: Petr Rockai <me(a)mornfall.net>
AuthorDate: Tue Feb 10 17:26:32 2015 +0100
Committer: Petr Rockai <me(a)mornfall.net>
CommitterDate: Tue Feb 10 17:27:10 2015 +0100
NIX: Drop Fedora 16 builds.
---
nix/default.nix | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/nix/default.nix b/nix/default.nix
index 919e9c9..08193c8 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -348,8 +348,6 @@ let
fc18_i386 = { arch = "i386" ; image = "fedora18"; };
fc17_x86_64 = { arch = "x86_64"; image = "fedora17"; };
fc17_i386 = { arch = "i386" ; image = "fedora17"; };
- fc16_x86_64 = { arch = "x86_64"; image = "fedora16"; };
- fc16_i386 = { arch = "i386" ; image = "fedora16"; };
fc18u_x86_64 = { arch = "x86_64"; image = "fedora18u"; };
fc18u_i386 = { arch = "i386"; image = "fedora18u"; };
9 years, 3 months
master - NIX: Adjust lists of extra RPMs to install.
by Petr Rockai
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=79dc8f5ddd89fd...
Commit: 79dc8f5ddd89fd54897347167163c5176b6f7511
Parent: a8b45b7a4c512137be1c919b6d247e2fe889edb4
Author: Petr Rockai <me(a)mornfall.net>
AuthorDate: Tue Feb 10 17:26:02 2015 +0100
Committer: Petr Rockai <me(a)mornfall.net>
CommitterDate: Tue Feb 10 17:27:10 2015 +0100
NIX: Adjust lists of extra RPMs to install.
---
nix/default.nix | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/nix/default.nix b/nix/default.nix
index 0a45bab..919e9c9 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -303,26 +303,25 @@ let
"perl-GD" # for lcov
"kernel"
];
+ fedora_common = [ "fedora-release" "dlm-devel" "corosynclib-devel" ];
centos63 = [ "clusterlib-devel" "openaislib-devel" "cman" "libudev-devel" "valgrind-devel" ];
centos64 = centos63;
centos65 = centos64;
- fedora16 = [ "clusterlib-devel" "openaislib-devel" "cman" "systemd-devel" "libudev-devel" ];
- fedora17 = [ "dlm-devel" "corosynclib-devel" "device-mapper-persistent-data"
- "dlm" "systemd-devel" "perl-Digest-MD5" "libudev-devel" ];
+ centos70 = fedora20;
+
+ fedora17 = fedora18 ++ [ "libudev-devel" ];
- fedora18 = [ "dlm-devel" "corosynclib-devel" "device-mapper-persistent-data"
+ fedora18 = [ "fedora-release" "dlm-devel" "corosynclib-devel" "device-mapper-persistent-data"
"dlm" "systemd-devel" "perl-Digest-MD5" ];
fedora18u = fedora18;
- fedora19 = [ "dlm-devel" "dlm" "corosynclib-devel" "perl-Digest-MD5" "systemd-devel" "procps-ng"
- "valgrind-devel" ];
+ fedora19 = [ "fedora-release" "dlm-devel" "dlm" "corosynclib-devel" "perl-Digest-MD5" "systemd-devel"
+ "procps-ng" "valgrind-devel" ];
fedora19u = fedora19;
fedora20 = fedora19;
fedora20u = fedora20;
- centos70 = fedora20;
-
rawhide = fedora20;
} // over.install_rpms;
9 years, 3 months
master - test: Fix harness not building on RHEL5
by Marian Csontos
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a8b45b7a4c5121...
Commit: a8b45b7a4c512137be1c919b6d247e2fe889edb4
Parent: 7f2eebf519c039eea4d8d4f41fd44b04182093f2
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Tue Feb 10 14:51:45 2015 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Tue Feb 10 17:02:01 2015 +0100
test: Fix harness not building on RHEL5
---
test/lib/brick-shelltest.h | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h
index 99e6639..335ef85 100644
--- a/test/lib/brick-shelltest.h
+++ b/test/lib/brick-shelltest.h
@@ -431,7 +431,13 @@ struct FileSink : FdSink {
void sync( bool force ) {
if ( fd < 0 && !killed ) {
+#ifdef O_CLOEXEC
fd = open( file.c_str(), O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644 );
+#else
+ fd = open( file.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0644 );
+ if ( fcntl( fd, F_SETFD, FD_CLOEXEC ) < 0 )
+ perror("failed to set FD_CLOEXEC on file");
+#endif
if ( fd < 0 )
killed = true;
}
@@ -463,7 +469,7 @@ struct Source {
virtual void reset() {}
- virtual int fd_set( fd_set *set ) {
+ virtual int fd_set_( fd_set *set ) {
if ( fd >= 0 ) {
FD_SET( fd, set );
return fd;
@@ -482,10 +488,16 @@ struct FileSource : Source {
std::string file;
FileSource( std::string n ) : Source( -1 ), file( n ) {}
- int fd_set( ::fd_set * ) { return -1; } /* reading a file is always non-blocking */
+ int fd_set_( ::fd_set * ) { return -1; } /* reading a file is always non-blocking */
void sync( Sink *s ) {
if ( fd < 0 ) {
+#ifdef O_CLOEXEC
fd = open( file.c_str(), O_RDONLY | O_CLOEXEC | O_NONBLOCK );
+#else
+ fd = open( file.c_str(), O_RDONLY | O_NONBLOCK );
+ if ( fcntl( fd, F_SETFD, FD_CLOEXEC ) < 0 )
+ perror("failed to set FD_CLOEXEC on file");
+#endif
if ( fd >= 0 )
lseek( fd, 0, SEEK_END );
}
@@ -505,8 +517,6 @@ struct KMsg : Source {
void reset() {
#ifdef __unix
- int sz;
-
if ( dev_kmsg() ) {
if ( (fd = open("/dev/kmsg", O_RDONLY | O_NONBLOCK)) < 0 ) {
if (errno != ENOENT) /* Older kernels (<3.5) do not support /dev/kmsg */
@@ -589,11 +599,11 @@ struct IO : Sink {
sources.clear();
}
- int fd_set( fd_set *set ) {
+ int fd_set_( fd_set *set ) {
int max = -1;
for ( Sources::iterator i = sources.begin(); i != sources.end(); ++i )
- max = std::max( (*i)->fd_set( set ), max );
+ max = std::max( (*i)->fd_set_( set ), max );
return max + 1;
}
@@ -755,7 +765,7 @@ struct TestCase {
fd_set set;
FD_ZERO( &set );
- int nfds = io.fd_set( &set );
+ int nfds = io.fd_set_( &set );
wait.tv_sec = 0;
wait.tv_usec = 500000; /* timeout 0.5s */
9 years, 3 months
master - select: initialize selection handle for process_each_* fns with initial report type
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7f2eebf519c039...
Commit: 7f2eebf519c039eea4d8d4f41fd44b04182093f2
Parent: 80cca53611d3603c12db08ddc1b25bfd6b874436
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Feb 10 13:46:37 2015 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Feb 10 16:10:17 2015 +0100
select: initialize selection handle for process_each_* fns with initial report type
This is a followup patch for previous patchset that enables selection in
process_each_* fns to fix an issue where field prefixes are not
automatically used for fields in selection criteria.
Use initial report type that matches the intention of each process_each_* functions:
- _process_pvs_in_vg - PVS
- process_each_vg - VGS
- process_each_lv and process_each_lv_in_vg - LVS
This is not normally needed for the selection handle init, BUT we would
miss the field prefix matching, e.g.
lvchange -ay -S 'name=lvol0'
The "name" above would not work if we didn't initialize reporting with
the LVS type at its start. If we pass proper init type, reporting code
can deduce the prefix automatically ("lv_name" in this case).
This report type is then changed further based on what selection criteria we
have. When doing pure selection, not report output, the final report type
is purely based on combination of this initial report type and report types
of the fields used in selection criteria.
---
tools/pvchange.c | 2 +-
tools/toollib.c | 12 +++++++-----
tools/toollib.h | 3 ++-
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/tools/pvchange.c b/tools/pvchange.c
index b164509..1788620 100644
--- a/tools/pvchange.c
+++ b/tools/pvchange.c
@@ -170,7 +170,7 @@ int pvchange(struct cmd_context *cmd, int argc, char **argv)
/* FIXME: use process_each_pv for pvchange. */
if (!(handle = init_processing_handle(cmd)) ||
- (handle->internal_report_for_select && !init_selection_handle(cmd, handle))) {
+ (handle->internal_report_for_select && !init_selection_handle(cmd, handle, PVS))) {
log_error("Failed to initialize processing handle.");
r = ECMD_FAILED;
goto out;
diff --git a/tools/toollib.c b/tools/toollib.c
index 34286e3..a452676 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1594,7 +1594,8 @@ struct processing_handle *init_processing_handle(struct cmd_context *cmd)
return handle;
}
-int init_selection_handle(struct cmd_context *cmd, struct processing_handle *handle)
+int init_selection_handle(struct cmd_context *cmd, struct processing_handle *handle,
+ report_type_t initial_report_type)
{
struct selection_handle *sh;
@@ -1603,6 +1604,7 @@ int init_selection_handle(struct cmd_context *cmd, struct processing_handle *han
return 0;
}
+ sh->report_type = initial_report_type;
if (!(sh->selection_rh = report_init_for_selection(cmd, &sh->report_type,
arg_str_value(cmd, select_ARG, NULL)))) {
dm_pool_free(cmd->mem, sh);
@@ -1841,7 +1843,7 @@ int process_each_vg(struct cmd_context *cmd, int argc, char **argv,
goto_out;
if (handle->internal_report_for_select && !handle->selection_handle &&
- !init_selection_handle(cmd, handle))
+ !init_selection_handle(cmd, handle, VGS))
goto_out;
ret = _process_vgnameid_list(cmd, flags, &vgnameids_to_process,
@@ -1887,7 +1889,7 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
}
if (handle->internal_report_for_select && !handle->selection_handle &&
- !init_selection_handle(cmd, handle)) {
+ !init_selection_handle(cmd, handle, LVS)) {
ret_max = ECMD_FAILED;
goto_out;
}
@@ -2216,7 +2218,7 @@ int process_each_lv(struct cmd_context *cmd, int argc, char **argv, uint32_t fla
goto_out;
if (handle->internal_report_for_select && !handle->selection_handle &&
- !init_selection_handle(cmd, handle))
+ !init_selection_handle(cmd, handle, LVS))
goto_out;
/*
@@ -2455,7 +2457,7 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
}
if (handle->internal_report_for_select && !handle->selection_handle &&
- !init_selection_handle(cmd, handle)) {
+ !init_selection_handle(cmd, handle, PVS)) {
ret_max = ECMD_FAILED;
goto_out;
}
diff --git a/tools/toollib.h b/tools/toollib.h
index 4050117..3a2c5f8 100644
--- a/tools/toollib.h
+++ b/tools/toollib.h
@@ -138,7 +138,8 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
process_single_lv_fn_t process_single_lv);
struct processing_handle *init_processing_handle(struct cmd_context *cmd);
-int init_selection_handle(struct cmd_context *cmd, struct processing_handle *handle);
+int init_selection_handle(struct cmd_context *cmd, struct processing_handle *handle,
+ report_type_t initial_report_type);
void destroy_processing_handle(struct cmd_context *cmd, struct processing_handle *handle,
int deallocate_handle_root);
9 years, 3 months
master - tools: allow -S|--select for vgexport and vgimport
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=80cca53611d360...
Commit: 80cca53611d3603c12db08ddc1b25bfd6b874436
Parent: b93f586954f05147822128b3bf25f668656d2769
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Dec 12 12:03:34 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Feb 10 16:10:17 2015 +0100
tools: allow -S|--select for vgexport and vgimport
---
WHATS_NEW | 1 +
tools/commands.h | 6 ++++--
tools/vgexport.c | 6 +++---
tools/vgimport.c | 6 +++---
4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index b9566f8..314cfd8 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.117 -
====================================
+ Add support for -S/--select to vgexport and vgimport.
Add support for -S/--select to vgdisplay, lvdisplay and pvdisplay without -C.
Add support for -S/--select to vgremove and lvremove.
Add support for -S/--select to vgchange,lvchange and pvchange.
diff --git a/tools/commands.h b/tools/commands.h
index f8984d1..5221f79 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -1091,11 +1091,12 @@ xx(vgexport,
"\t[--commandprofile ProfileName]\n"
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
+ "\t[-S|--select Selection]\n"
"\t[-v|--verbose]\n"
"\t[--version]\n"
"\tVolumeGroupName [VolumeGroupName...]\n",
- all_ARG, test_ARG)
+ all_ARG, select_ARG, test_ARG)
xx(vgextend,
"Add physical volumes to a volume group",
@@ -1129,12 +1130,13 @@ xx(vgimport,
"\t[-d|--debug]\n"
"\t[-f|--force]\n"
"\t[-h|--help]\n"
+ "\t[-S|--select Selection]\n"
"\t[-t|--test]\n"
"\t[-v|--verbose]\n"
"\t[--version]\n"
"\tVolumeGroupName...\n",
- all_ARG, force_ARG, test_ARG)
+ all_ARG, force_ARG, select_ARG, test_ARG)
xx(vgmerge,
"Merge volume groups",
diff --git a/tools/vgexport.c b/tools/vgexport.c
index aeff612..d4be3c7 100644
--- a/tools/vgexport.c
+++ b/tools/vgexport.c
@@ -51,12 +51,12 @@ bad:
int vgexport(struct cmd_context *cmd, int argc, char **argv)
{
- if (!argc && !arg_count(cmd, all_ARG)) {
- log_error("Please supply volume groups or use -a for all.");
+ if (!argc && !arg_count(cmd, all_ARG) && !arg_is_set(cmd, select_ARG)) {
+ log_error("Please supply volume groups or use -S for selection or use -a for all.");
return EINVALID_CMD_LINE;
}
- if (argc && arg_count(cmd, all_ARG)) {
+ if (arg_count(cmd, all_ARG) && (argc || arg_is_set(cmd, select_ARG))) {
log_error("No arguments permitted when using -a for all.");
return EINVALID_CMD_LINE;
}
diff --git a/tools/vgimport.c b/tools/vgimport.c
index 857f4a9..d5ca7c3 100644
--- a/tools/vgimport.c
+++ b/tools/vgimport.c
@@ -58,12 +58,12 @@ bad:
int vgimport(struct cmd_context *cmd, int argc, char **argv)
{
- if (!argc && !arg_count(cmd, all_ARG)) {
- log_error("Please supply volume groups or use -a for all.");
+ if (!argc && !arg_count(cmd, all_ARG) && !arg_is_set(cmd, select_ARG)) {
+ log_error("Please supply volume groups or -S for selection or use -a for all.");
return EINVALID_CMD_LINE;
}
- if (argc && arg_count(cmd, all_ARG)) {
+ if (arg_count(cmd, all_ARG) && (argc || arg_is_set(cmd, select_ARG))) {
log_error("No arguments permitted when using -a for all.");
return EINVALID_CMD_LINE;
}
9 years, 3 months
master - tools: allow -S|--select for vgdisplay, lvdisplay and pvdisplay without -C
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b93f586954f051...
Commit: b93f586954f05147822128b3bf25f668656d2769
Parent: 00744b053f395be79ab1cb80fdf7342548aa79e2
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Dec 12 10:20:15 2014 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Feb 10 16:09:40 2015 +0100
tools: allow -S|--select for vgdisplay, lvdisplay and pvdisplay without -C
We already allowed -S|--select with {vg,lv,pv}display -C (which
was then equal to {vg,lv,pv}s command. Since we support selection
in toolib now, we can support -S also without using -C in *display
commands now.
---
WHATS_NEW | 1 +
tools/commands.h | 3 +++
tools/lvdisplay.c | 1 -
tools/pvdisplay.c | 1 -
tools/vgdisplay.c | 1 -
5 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 7fa7d3c..b9566f8 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.117 -
====================================
+ Add support for -S/--select to vgdisplay, lvdisplay and pvdisplay without -C.
Add support for -S/--select to vgremove and lvremove.
Add support for -S/--select to vgchange,lvchange and pvchange.
Add infrastructure to support selection for non-reporting tools.
diff --git a/tools/commands.h b/tools/commands.h
index 63dbb2a..f8984d1 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -369,6 +369,7 @@ xx(lvdisplay,
"\t[--nosuffix]\n"
"\t[-P|--partial]\n"
"\t[--readonly]\n"
+ "\t[-S|--select Selection]\n"
"\t[--units hHbBsSkKmMgGtTpPeE]\n"
"\t[-v|--verbose]\n"
"\t[--version]\n"
@@ -747,6 +748,7 @@ xx(pvdisplay,
"\t[-m|--maps]\n"
"\t[--nosuffix]\n"
"\t[--readonly]\n"
+ "\t[-S|--select Selection]\n"
"\t[-s|--short]\n"
"\t[--units hHbBsSkKmMgGtTpPeE]\n"
"\t[-v|--verbose]\n"
@@ -1049,6 +1051,7 @@ xx(vgdisplay,
"\t[--nosuffix]\n"
"\t[-P|--partial]\n"
"\t[--readonly]\n"
+ "\t[-S|--select Selection]\n"
"\t[--units hHbBsSkKmMgGtTpPeE]\n"
"\t[--version]\n"
"\t[VolumeGroupName [VolumeGroupName...]]\n"
diff --git a/tools/lvdisplay.c b/tools/lvdisplay.c
index 6b1540f..7d900cc 100644
--- a/tools/lvdisplay.c
+++ b/tools/lvdisplay.c
@@ -46,7 +46,6 @@ int lvdisplay(struct cmd_context *cmd, int argc, char **argv)
arg_count(cmd, binary_ARG) ||
arg_count(cmd, noheadings_ARG) ||
arg_count(cmd, options_ARG) ||
- arg_count(cmd, select_ARG) ||
arg_count(cmd, separator_ARG) ||
arg_count(cmd, sort_ARG) ||
arg_count(cmd, unbuffered_ARG)) {
diff --git a/tools/pvdisplay.c b/tools/pvdisplay.c
index 94a3bbf..2763889 100644
--- a/tools/pvdisplay.c
+++ b/tools/pvdisplay.c
@@ -77,7 +77,6 @@ int pvdisplay(struct cmd_context *cmd, int argc, char **argv)
arg_count(cmd, binary_ARG) ||
arg_count(cmd, noheadings_ARG) ||
arg_count(cmd, options_ARG) ||
- arg_count(cmd, select_ARG) ||
arg_count(cmd, separator_ARG) ||
arg_count(cmd, sort_ARG) ||
arg_count(cmd, unbuffered_ARG)) {
diff --git a/tools/vgdisplay.c b/tools/vgdisplay.c
index 3c34727..5e5ceda 100644
--- a/tools/vgdisplay.c
+++ b/tools/vgdisplay.c
@@ -66,7 +66,6 @@ int vgdisplay(struct cmd_context *cmd, int argc, char **argv)
arg_count(cmd, binary_ARG) ||
arg_count(cmd, noheadings_ARG) ||
arg_count(cmd, options_ARG) ||
- arg_count(cmd, select_ARG) ||
arg_count(cmd, separator_ARG) ||
arg_count(cmd, sort_ARG) || arg_count(cmd, unbuffered_ARG)) {
log_error("Incompatible options selected");
9 years, 3 months