]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agolvmpolld.8.in: hide origin of lvmpolld man page
Ondrej Kozina [Thu, 14 May 2015 16:43:50 +0000 (18:43 +0200)]
lvmpolld.8.in: hide origin of lvmpolld man page

:)

9 years agolvmpolld-client.c: explain known return codes
Ondrej Kozina [Thu, 14 May 2015 14:44:31 +0000 (16:44 +0200)]
lvmpolld-client.c: explain known return codes

lvmpolld returns few well known return codes. Explain
these to users and suggest reading lvmpolld log files
for more details

9 years agolvmpolld: label known return codes
Ondrej Kozina [Thu, 14 May 2015 13:53:29 +0000 (15:53 +0200)]
lvmpolld: label known return codes

so that lvmpolld-client can decode and describe these
return codes properly

9 years agolibdaemon: fprintf(stderr...) -> ERROR()
Ondrej Kozina [Thu, 14 May 2015 13:50:16 +0000 (15:50 +0200)]
libdaemon: fprintf(stderr...) -> ERROR()

log data structures are ready. so why not pass
error messages through ERROR()

9 years agolibdaemon: suggest daemon already running
Ondrej Kozina [Thu, 14 May 2015 13:43:43 +0000 (15:43 +0200)]
libdaemon: suggest daemon already running

when dm_creat_lockfile fails, it's probably due to
another instance is holding the same pid file...

9 years agoconfig: thin_pool_chunk_size_policy should be commented
David Teigland [Fri, 15 May 2015 16:43:56 +0000 (11:43 -0500)]
config: thin_pool_chunk_size_policy should be commented

It is commented in existing example.conf, so leave
that as it was.

9 years agoconfig: thin_pool_chunk_size_policy is not undefined
David Teigland [Fri, 15 May 2015 16:37:16 +0000 (11:37 -0500)]
config: thin_pool_chunk_size_policy is not undefined

The default policy setting does not depend on any
system/kernel values.

9 years agoman: missed y|n for wipesignatures
Zdenek Kabelac [Fri, 15 May 2015 15:43:15 +0000 (17:43 +0200)]
man: missed y|n for wipesignatures

9 years agoconfig: add comments to match current example.conf
David Teigland [Thu, 14 May 2015 21:08:50 +0000 (16:08 -0500)]
config: add comments to match current example.conf

Use CFG_DEFAULT_COMMENTED and CFG_DEFAULT_UNDEFINED to
replicate the existing comments in example.conf.

Fix host_list to be cfg_array.

UNDEFINED is only used if the value depends on other
system/kernel values outside of lvm.  The most common
case is when dm-thin or dm-cache have built-in default
settings in the kernel, and lvm will use those built-in
default values unless the corresponding lvm config setting
is set.

COMMENTED is used to comment out the default setting in
lvm.conf.  The effect is that if the LVM version is
upgraded, and the new version of LVM has new built-in
default values, the new defaults are used by LVM unless
the previous default value was set (uncommented) in lvm.conf.

9 years agolibdm: new dm_task_get_info with internal_suspend
Zdenek Kabelac [Fri, 15 May 2015 13:29:46 +0000 (15:29 +0200)]
libdm: new dm_task_get_info with internal_suspend

Introduce new implmentation of dm_task_get_info() function
with support for reading internal_suspend.
.
This time it is done in a 'versioned' way.

We keep the old fashion dm_task_get_info(Base) to implement
the old behavior of 1.02.95 libdm code.

libdm version 1.02.96 introduced 'macro' wrapper
dm_task_get_info_with_deferred_remove with new implementation
of dm_task_get_info() - we cannot do anything else then to
provide compatible version of this symbol.

Now in version 1.02.97 we add new versioned implementation of
dm_task_get_info(DM_1_02_97) symbol.

This has the effect that i.e. rpm build will finaly resolve proper
dependency on a new symbol - so it will be no longer possible,
to build a new binary and use old library
(rpm -q --provides will show libdevmapper.so.1.02(DM_1_02_97)(64bit))

Also the history is now tracked. If a new function is added (or
reimplemented), it needs to be placed in proper file,
so it could be exported with right versioning symbol.
File .exported_symbols.Base should and any existing older DM
should be treated as read-only after a release.

Also - only libdm has been currently enhanced with versioned .Base
file, as soon as other libs (liblvm, libdevmapper-event) needs changes
they should also get their exported symbol files - meanwhile
make.tmpl handles both cases.

9 years agolvm.conf: add more information to the comment header
David Teigland [Thu, 14 May 2015 15:52:24 +0000 (10:52 -0500)]
lvm.conf: add more information to the comment header

9 years agoconfig: description can refer to etc location
David Teigland [Thu, 14 May 2015 14:47:42 +0000 (09:47 -0500)]
config: description can refer to etc location

9 years agoconfig: avoid configurable description text
David Teigland [Thu, 14 May 2015 14:25:48 +0000 (09:25 -0500)]
config: avoid configurable description text

It's just simpler to avoid configurable values in
the description text by rewording to avoid them.

9 years agonix: socat for f18, nc for f17
Zdenek Kabelac [Thu, 14 May 2015 13:01:01 +0000 (15:01 +0200)]
nix: socat for f18, nc for f17

Use common f17_f18 and add extras for f17 and f18

9 years agomakefiles: disable po file targes
Zdenek Kabelac [Thu, 14 May 2015 12:18:36 +0000 (14:18 +0200)]
makefiles: disable po file targes

po targets are not correct - so disable them for now.

9 years agomakefiles: use srcdir
Zdenek Kabelac [Thu, 14 May 2015 12:17:33 +0000 (14:17 +0200)]
makefiles: use srcdir

Use -I$(srcdir) as that's what we really want here.
For %.pot use all includes.

9 years agonix: drop util-linux
Zdenek Kabelac [Thu, 14 May 2015 09:45:37 +0000 (11:45 +0200)]
nix: drop util-linux

Doesn't appear on centos???

9 years agonix: add more packages
Zdenek Kabelac [Thu, 14 May 2015 09:42:33 +0000 (11:42 +0200)]
nix: add more packages

9 years agospec: package old sysv initscript for lvmpolld
Zdenek Kabelac [Thu, 14 May 2015 09:27:52 +0000 (11:27 +0200)]
spec: package old sysv initscript for lvmpolld

9 years agonix: add pkgconfig
Zdenek Kabelac [Thu, 14 May 2015 09:15:20 +0000 (11:15 +0200)]
nix: add pkgconfig

Install for better config

9 years agotests: respect @CONFDIR@/machine-id
Zdenek Kabelac [Thu, 14 May 2015 08:51:34 +0000 (10:51 +0200)]
tests: respect @CONFDIR@/machine-id

Obtain location of machine-id.

NOTE: lvmconfig cannot dump 'life' value - should be fixed.

9 years agotests: do not use |&
Zdenek Kabelac [Thu, 14 May 2015 08:20:24 +0000 (10:20 +0200)]
tests: do not use |&

Bash 3.2  doesn't understand this syntax (i.e. RHEL5).
And it's even better - reports syntax error and return success.

9 years agonix: socat is quite new package
Zdenek Kabelac [Thu, 14 May 2015 07:49:54 +0000 (09:49 +0200)]
nix: socat is quite new package

Install 'nc' on older systems.
Test suite handles both.

9 years agoconf: system_id_source is referencing CONFDIR
Zdenek Kabelac [Thu, 14 May 2015 08:50:21 +0000 (10:50 +0200)]
conf: system_id_source is referencing CONFDIR

Since we allow to configure /etc in configure and compile-in
dir for /etc we need to properly advertise this location later.

9 years agomakefiles: protect CFLAGS
Zdenek Kabelac [Wed, 13 May 2015 21:43:50 +0000 (23:43 +0200)]
makefiles: protect CFLAGS

When CFLAGS and LDFLAGS are passed into - protect them,
and avoid even recursive subdir 'extension' of them.

9 years agomakefiles: assign vars before include
Zdenek Kabelac [Wed, 13 May 2015 21:42:17 +0000 (23:42 +0200)]
makefiles: assign vars before include

Before we include, set INCLUDE and TARGETS.
Extend CFLAGS after include.

9 years agomakefiles: drop DEBUG mangling
Zdenek Kabelac [Wed, 13 May 2015 19:33:17 +0000 (21:33 +0200)]
makefiles: drop DEBUG mangling

DEBUG is already set through make.tmpl.

9 years agoconfigure: set optimize flags when CFLAGS is unset
Zdenek Kabelac [Wed, 13 May 2015 19:30:20 +0000 (21:30 +0200)]
configure: set optimize flags when CFLAGS is unset

If we are given CFLAGS - preserve user's request and avoid placing
just -O2 there.

9 years agoconfigure: preserve CXX/CFLAGS
Zdenek Kabelac [Wed, 13 May 2015 19:23:24 +0000 (21:23 +0200)]
configure: preserve CXX/CFLAGS

AC_PROG_CC
AC_PROG_CXX

Does not preserve CFLAGS CXXFLAGS

9 years agonix: fix socat package name
Zdenek Kabelac [Wed, 13 May 2015 19:22:08 +0000 (21:22 +0200)]
nix: fix socat package name

9 years agomakefiles: use fullpath when in assign
Zdenek Kabelac [Wed, 13 May 2015 13:43:55 +0000 (15:43 +0200)]
makefiles: use fullpath when in assign

We need to put full path right in the assign moment,
otherwise command:

make rpm rpmbuild=/my/tmp/dir

cannot work as one would have expected.

9 years agomakefiles: testclient is not valid target
Zdenek Kabelac [Wed, 13 May 2015 12:22:46 +0000 (14:22 +0200)]
makefiles: testclient is not valid target

9 years agomakefiles: drop way too generic deps
Zdenek Kabelac [Wed, 13 May 2015 12:22:18 +0000 (14:22 +0200)]
makefiles: drop way too generic deps

9 years agolibdaemon: Fix socket reuse error paths.
Alasdair G Kergon [Wed, 13 May 2015 12:42:09 +0000 (13:42 +0100)]
libdaemon: Fix socket reuse error paths.

Invert S_ISSOCK validation.
Fail instead of replacing a symlink with a new socket.
After failure, skip calling fcntl with invalid socket_fd.

9 years agoconfigure: start to use AS_IF
Zdenek Kabelac [Tue, 12 May 2015 12:46:36 +0000 (14:46 +0200)]
configure: start to use AS_IF

9 years agonix: more base packages
Zdenek Kabelac [Tue, 12 May 2015 12:33:14 +0000 (14:33 +0200)]
nix: more base packages

9 years agospec: packaging polld
Zdenek Kabelac [Wed, 13 May 2015 11:14:54 +0000 (13:14 +0200)]
spec: packaging polld

Package lvmpolld

Drop legacy SysV init subpackage.

9 years agolvmpolld: dump cleanup
Ondrej Kozina [Tue, 12 May 2015 15:05:45 +0000 (17:05 +0200)]
lvmpolld: dump cleanup

9 years agolvmpolld-client.c: use lvmpolld debug class where appropriate
Ondrej Kozina [Tue, 12 May 2015 14:28:42 +0000 (16:28 +0200)]
lvmpolld-client.c: use lvmpolld debug class where appropriate

9 years agotests: remove forgotten -vvvv option
Ondrej Kozina [Tue, 12 May 2015 14:00:08 +0000 (16:00 +0200)]
tests: remove forgotten -vvvv option

9 years agolibdm-common.c: remove trailing whitespace
Ondrej Kozina [Tue, 12 May 2015 13:28:38 +0000 (15:28 +0200)]
libdm-common.c: remove trailing whitespace

9 years agolvmpolld-client.c: be more specific about fallback on error
Ondrej Kozina [Tue, 12 May 2015 13:34:45 +0000 (15:34 +0200)]
lvmpolld-client.c: be more specific about fallback on error

if client fails to contact lvmpolld it fallbacks to using classical
polldaemon. Be more specific and give some hints to users what went
possibly wrong

9 years agonew debug class for lvmpolld client code
Ondrej Kozina [Tue, 12 May 2015 13:26:26 +0000 (15:26 +0200)]
new debug class for lvmpolld client code

9 years agolvmpolld.8.in: clarify the timeout parameter
Ondrej Kozina [Tue, 12 May 2015 08:20:39 +0000 (10:20 +0200)]
lvmpolld.8.in: clarify the timeout parameter

Remove references to systemd native service. Now
the libdaemon supports shutdown on idle no matter
the init process implementation installed.

9 years agolibdaemon: shutdown on idle also in non-systemd environment
Ondrej Kozina [Tue, 12 May 2015 07:37:19 +0000 (09:37 +0200)]
libdaemon: shutdown on idle also in non-systemd environment

9 years agotests: ndev by default
Zdenek Kabelac [Mon, 11 May 2015 18:04:35 +0000 (20:04 +0200)]
tests: ndev by default

9 years agoconfigure: spec.inc is generated at build
Zdenek Kabelac [Tue, 12 May 2015 10:07:44 +0000 (12:07 +0200)]
configure: spec.inc is generated at build

Collect all needed info at runtime for spec.inc

9 years agomakefiles: use LN_S
Zdenek Kabelac [Mon, 11 May 2015 19:47:39 +0000 (21:47 +0200)]
makefiles: use LN_S

9 years agomakefiles: runtime spec.inc
Zdenek Kabelac [Mon, 11 May 2015 19:48:11 +0000 (21:48 +0200)]
makefiles: runtime spec.inc

Support  CLEAN_DIRS
Var for rpmbuilddir
Use LN_S
Generate spec.inc at runtime for 'make rpm'.

9 years agotests: remove forgotten set -v in aux
Ondrej Kozina [Mon, 11 May 2015 16:49:24 +0000 (18:49 +0200)]
tests: remove forgotten set -v in aux

9 years agolvmpolld: by default spawn lvpoll cmd with -An
Ondrej Kozina [Mon, 11 May 2015 13:22:18 +0000 (15:22 +0200)]
lvmpolld: by default spawn lvpoll cmd with -An

9 years agolvmpolld: set use counters properly in lvmpolld_store
Ondrej Kozina [Mon, 11 May 2015 12:19:11 +0000 (14:19 +0200)]
lvmpolld: set use counters properly in lvmpolld_store

set active_polling_count to zero in pdst_init fn

9 years agolib/polldaemon.h: remove trailing whitespace
Ondrej Kozina [Mon, 11 May 2015 11:39:16 +0000 (13:39 +0200)]
lib/polldaemon.h: remove trailing whitespace

9 years agolvmdump.sh: print out lvmpolld service status
Ondrej Kozina [Mon, 11 May 2015 11:31:43 +0000 (13:31 +0200)]
lvmdump.sh: print out lvmpolld service status

9 years agotests: split flavours
Zdenek Kabelac [Mon, 11 May 2015 15:30:23 +0000 (17:30 +0200)]
tests: split flavours

Remove duplicate flavour-udev-lvmetad-lvmpolld
and put them 1-per-line.

9 years agonix: now some files are generate so keep them
Zdenek Kabelac [Mon, 11 May 2015 15:29:21 +0000 (17:29 +0200)]
nix: now some files are generate so keep them

more tweaks ahead

9 years agovgimport: fall back when lvmetad is not running
David Teigland [Mon, 11 May 2015 14:28:47 +0000 (09:28 -0500)]
vgimport: fall back when lvmetad is not running

If lvmetad is configured, but not running,
vgimport would not fall back and run without
lvmetad, but would report an error about
requiring lvmetad.

9 years agotests: typo in aux
Zdenek Kabelac [Mon, 11 May 2015 14:14:24 +0000 (16:14 +0200)]
tests: typo in aux

Ooops editor grabbed q in test.

9 years agomakefiles: move clean
Zdenek Kabelac [Mon, 11 May 2015 14:08:58 +0000 (16:08 +0200)]
makefiles: move clean

Move clean: target below, so it's not a default target to execute.

9 years agomakefile: cleanup after build
Zdenek Kabelac [Mon, 11 May 2015 13:52:11 +0000 (15:52 +0200)]
makefile: cleanup after build

Provide cleaning rules for build dir and release tgz.

9 years agotests: disable lvmetad and lvmpolld
Zdenek Kabelac [Mon, 11 May 2015 13:45:34 +0000 (15:45 +0200)]
tests: disable lvmetad and lvmpolld

Since now we enable those by default when compiled with those daemons,
explicitely disable them in tests when needed.

Alphabetically sort configurables.

9 years agospec: now generated
Zdenek Kabelac [Mon, 11 May 2015 12:30:54 +0000 (14:30 +0200)]
spec: now generated

9 years agomakefiles: dist and rpm target
Zdenek Kabelac [Mon, 11 May 2015 12:28:55 +0000 (14:28 +0200)]
makefiles: dist and rpm target

Basic support for upstream 'build' of rpm packages.
Make spec file generated.

2 new simple targets:

make dist  - create LVM2.MAJOR.MINOR.PATCHLEVEL.tgz  from git files.

make rpm   - some generic rpmbuilder using spec files.
             Create packages in build/ subdir.
             DO NOT USE created rpms in any distribution!

9 years agospec: writable instalation
Zdenek Kabelac [Mon, 11 May 2015 11:51:49 +0000 (13:51 +0200)]
spec: writable instalation

rpmbuild needs writable binaries (for debug symbol extraction)

9 years agoconfigure: use_lvmetad/polld configurable
Zdenek Kabelac [Mon, 11 May 2015 11:49:41 +0000 (13:49 +0200)]
configure: use_lvmetad/polld configurable

Configure provides proper settings for
use_lvmetad  and use_lvmpolld  conf setttings.

When the build of polld & lvmetad, these settings
are enabled by default unless explicitelly disabled
with --disable-use-lvmetad/--disable-use-lvmpolld.

9 years agometadata: use log_debug_metadata instead of general log_debug for BA debug messages
Peter Rajnoha [Mon, 11 May 2015 09:07:53 +0000 (11:07 +0200)]
metadata: use log_debug_metadata instead of general log_debug for BA debug messages

9 years agotests: missed conversion
Zdenek Kabelac [Sat, 9 May 2015 07:15:29 +0000 (09:15 +0200)]
tests: missed conversion

Assuming it should test same number as other functions.

9 years agotests: avoid clobering dmesg
Zdenek Kabelac [Fri, 8 May 2015 20:43:06 +0000 (22:43 +0200)]
tests: avoid clobering dmesg

Restore old harness access to /dev/kmsg.

9 years agocleanup: drop extra test for NULL
Zdenek Kabelac [Fri, 8 May 2015 21:01:32 +0000 (23:01 +0200)]
cleanup: drop extra test for NULL

vg cannot be NULL here - it's been already used in the code above.

9 years agocleanup: remove extraneous parentheses
Zdenek Kabelac [Fri, 8 May 2015 20:58:00 +0000 (22:58 +0200)]
cleanup: remove extraneous parentheses

9 years agolvmpolld: Add standalone polldaemon.
Ondrej Kozina [Fri, 8 May 2015 23:59:18 +0000 (00:59 +0100)]
lvmpolld: Add standalone polldaemon.

See doc/lvmpolld_overview.txt

9 years agolvmcache: set device in label when switching devs V2
David Teigland [Fri, 8 May 2015 22:10:53 +0000 (17:10 -0500)]
lvmcache: set device in label when switching devs V2

This is an alternative/equivalent to commit
ca67cf84df6015c990618de3dc45c0b87eee75ce

The problem (wrong label->dev after a new preferred
duplicate device is chosen) was isolated to the lvmetad
case (non-lvmetad worked fine), and this fixes the problem
by setting the new label->dev in the lvmetad-specific
code rather than in the general lvmcache code.

9 years agolvmcache: set device in label when switching devs
David Teigland [Fri, 8 May 2015 19:38:26 +0000 (14:38 -0500)]
lvmcache: set device in label when switching devs

When using lvmetad, the reporter code was not reporting
the new preferred device because the new preferred dev
was not being set in the label struct.

9 years agotests: better filter
Zdenek Kabelac [Fri, 8 May 2015 18:44:43 +0000 (20:44 +0200)]
tests: better filter

Filter $PREFIX rather then just LVMTEST.

9 years agotests: missing vg
Zdenek Kabelac [Fri, 8 May 2015 17:17:00 +0000 (19:17 +0200)]
tests: missing vg

9 years agotoollib: avoid repeated lvmetad vg_lookup
David Teigland [Tue, 5 May 2015 21:24:50 +0000 (16:24 -0500)]
toollib: avoid repeated lvmetad vg_lookup

In process_each_{vg,lv,pv} when no vgname args are given,
the first step is to get a list of all vgid/vgname on the
system.  This is exactly what lvmetad returns from a
vg_list request.  The current code is doing a vg_lookup
on each VG after the vg_list and populating lvmcache with
the info for each VG.  These preliminary vg_lookup's are
unnecessary, because they will be done again when the
processing functions call vg_read.  This patch eliminates
the initial round of vg_lookup's, which can roughly cut in
half the number of lvmetad requests and save a lot of extra work.

9 years agolvmcache: choose preferred device once
David Teigland [Wed, 6 May 2015 19:49:44 +0000 (14:49 -0500)]
lvmcache: choose preferred device once

Once the preferred duplicate devices have been set in
lvmcache, don't attempt to pick preferred duplicates
again.

9 years agolvmcache: update lvmcache with alternate device
David Teigland [Tue, 5 May 2015 19:02:43 +0000 (14:02 -0500)]
lvmcache: update lvmcache with alternate device

When there are duplicate PVs, and one device
replaces another in lvmcache, use label_read
to update lvmcache for the new device.

9 years agodebug: extra validation of passed segment
Zdenek Kabelac [Thu, 7 May 2015 12:04:22 +0000 (14:04 +0200)]
debug: extra validation of passed segment

Always check if passed segment really is correct cache segment.
(Avoids derefernce of possibly NULL seg->pool_lv).

9 years agodebug: tracing error path
Zdenek Kabelac [Thu, 7 May 2015 10:37:15 +0000 (12:37 +0200)]
debug: tracing error path

9 years agodebug: show sys errors
Zdenek Kabelac [Thu, 7 May 2015 09:38:43 +0000 (11:38 +0200)]
debug: show sys errors

9 years agocleanup: use 64bit ulongs
Zdenek Kabelac [Thu, 7 May 2015 09:17:36 +0000 (11:17 +0200)]
cleanup: use 64bit ulongs

Use 64bit arithmetics for all numbers (Coverity).

9 years agocleanup: cast minor to dev_t
Zdenek Kabelac [Thu, 7 May 2015 09:03:48 +0000 (11:03 +0200)]
cleanup: cast minor to dev_t

Let the arithmetic run with a single dev_t type (Coverity).

9 years agocleanup: indent mismatch
Zdenek Kabelac [Thu, 7 May 2015 09:00:23 +0000 (11:00 +0200)]
cleanup: indent mismatch

Aling break (Coverity).

9 years agocleanup: drop unneeded header file
Zdenek Kabelac [Thu, 7 May 2015 08:58:35 +0000 (10:58 +0200)]
cleanup: drop unneeded header file

Does not resolves any symbols (Coverity).

9 years agocleanup: drop unneeded int test
Zdenek Kabelac [Thu, 7 May 2015 08:54:55 +0000 (10:54 +0200)]
cleanup: drop unneeded int test

Testing int  region_size > INT32_MAX is always false
so drop the test (Coverity).

9 years agoformat1: check for lvm1_system_id
Zdenek Kabelac [Thu, 7 May 2015 11:09:43 +0000 (13:09 +0200)]
format1: check for lvm1_system_id

As in the code above in this function continue to check for
lvm1_system_id pointer existance before dereferencing it
(Coverity).

9 years agoformat_text: properly validate PV size for restore
Zdenek Kabelac [Thu, 7 May 2015 09:08:49 +0000 (11:08 +0200)]
format_text: properly validate PV size for restore

Use 64bit arithmentic for PV size calculation (Coverity).

Also remove sector shift for compared PV size, since all
values are already held in sectors.

This fixes validatio of PV size when restoring PV
from vg metadata backup file.

9 years agopvcreate: fix test for wiping status
Zdenek Kabelac [Thu, 7 May 2015 10:10:20 +0000 (12:10 +0200)]
pvcreate: fix test for wiping status

Commit ed420fb6917162ed17af69a9a0ec9ae26e61e209 changed
paramet wiped to be a pointer, but missed to switch
to test pointer dereferenced value and instead always
checked 'pointer'.

9 years agolvmcache: copy just 32bytes
Zdenek Kabelac [Thu, 7 May 2015 09:28:22 +0000 (11:28 +0200)]
lvmcache: copy just 32bytes

Copy only bytes which fits.

vginfo->vgid  is  [ID_LEN + 1]
vgsummary->vgid has only [ID_LEN]

Reported by Coverity.

9 years agoman: Fix recursive lvm-config man page.
Alasdair G Kergon [Thu, 7 May 2015 11:07:40 +0000 (12:07 +0100)]
man: Fix recursive lvm-config man page.

9 years agoPython: Improve lv property test coverage
Tony Asleson [Tue, 5 May 2015 18:48:52 +0000 (13:48 -0500)]
Python: Improve lv property test coverage

Improve the python unit test case to cover all of the properties of a LV and
the properties of a LV segment.

In addition we also add a 'tag' to the lv so that we can retrieve it
using the 'lv_tags' property to ensure that this works as expected.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agolvm2app: Correct missing string properties
Tony Asleson [Mon, 4 May 2015 20:20:55 +0000 (15:20 -0500)]
lvm2app: Correct missing string properties

Synopsis: STR_LIST needs to be treated as STR for properties.

For any lvm property that was internally 'typed' as a string list we were failing
to return a string in the property API.  This was due to the fact that for the
properties to work the value needs to either be evaulated as a string or a
number.  This change corrects the macro used to build the memory array of
structures so that the string bitfield is set as needed to ensure that the value
is a string.

https://bugzilla.redhat.com/show_bug.cgi?id=1139920

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agopython: Check for NULL value before constructing string property
Tony Asleson [Mon, 4 May 2015 20:19:48 +0000 (15:19 -0500)]
python: Check for NULL value before constructing string property

When retrieving a property value that is a string, if the character pointer in C
was NULL, we would segfault.  This change checks for non-null before creating a
python string representation.  In the case where the character pointer is NULL
we will return a python 'None' for the value.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agopython: Build correct python value for numerical property
Tony Asleson [Mon, 4 May 2015 19:55:00 +0000 (14:55 -0500)]
python: Build correct python value for numerical property

With the lvm2app C API adding the ability to determine when a property is
signed we can then use this information to construct the correct representation
of the number for python which will maintain value and sign.  Previously, we
only represented the numbers in python as positive integers.

Python long type exceeds the range for unsigned and signed integers, we just
need to use the appropriate parsing code to build correctly.

Python part of the fix for:
https://bugzilla.redhat.com/show_bug.cgi?id=838257

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agolvm2app: Add signed numerical property values
Tony Asleson [Mon, 4 May 2015 19:51:41 +0000 (14:51 -0500)]
lvm2app: Add signed numerical property values

Currently lvm2app properties have the following structure:

typedef struct lvm_property_value {
        uint32_t is_settable:1;
        uint32_t is_string:1;
        uint32_t is_integer:1;
        uint32_t is_valid:1;
        uint32_t padding:28;
        union {
                const char *string;
                uint64_t integer;
        } value;
} lvm_property_value_t;

which assumes that numerical values were in the range of 0 to 2**64-1.  However,
some of the properties were 'signed', like LV major/minor numbers and some
reserved values for properties that represent percentages.  Thus when the
values were retrieved they were in two's complement notation.  So for a -1
major number the API user would get a value of 18446744073709551615.  The
API user could cast the returned value to an int64_t to handle this, but that
requires the API developer to look at the source code and determine when it
should be done.

This change modifies the return property structure to:

typedef struct lvm_property_value {
        uint32_t is_settable:1;
        uint32_t is_string:1;
        uint32_t is_integer:1;
        uint32_t is_valid:1;
        uint32_t is_signed:1;
        uint32_t padding:27;
        union {
                const char *string;
                uint64_t integer;
                int64_t signed_integer;
        } value;
} lvm_property_value_t;

With this addition the API user can interrogate that the value is numerical,
(is_integer = 1) and subsequently check if it's signed (is_signed = 1) too.
If signed, then the API developer should use the union's signed_integer to
avoid casting.

This change maintains backwards compatibility as the structure size remains
unchanged and integer value remains unchanged.  Only the additional bit
taken from the pad is utilized.

Bugzilla reference:
https://bugzilla.redhat.com/show_bug.cgi?id=838257

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agotests: do not restart lvmetad when not necessary
Ondrej Kozina [Wed, 6 May 2015 13:20:11 +0000 (15:20 +0200)]
tests: do not restart lvmetad when not necessary

overlooked pvmove-restart test during cleanup

9 years agoWHATS_NEW: update for recent changes
Ondrej Kozina [Tue, 5 May 2015 17:35:52 +0000 (19:35 +0200)]
WHATS_NEW: update for recent changes

commits:
bda26acf70e92232b1ed644dba6b44ecbff2a058
76a0dffe6f4869de9ca457119c9d7ced837d4e0b

9 years agopolldaemon: make wait_for_single_lv public
Ondrej Kozina [Fri, 10 Apr 2015 14:36:50 +0000 (16:36 +0200)]
polldaemon: make wait_for_single_lv public

referenced by new lvpoll command after lvmpolld
gets merged.

9 years agopolldaemon: introduce _nanosleep function
Ondrej Kozina [Fri, 10 Apr 2015 14:31:28 +0000 (16:31 +0200)]
polldaemon: introduce _nanosleep function

querying future lvmpolld with zero wait time is highly undesirable
and can cause serious performance drop of the future daemon. The new
wrapper function may avoid immediate return from syscal by
introducing minimal wait time on demand.

This page took 0.072134 seconds and 5 git commands to generate.