1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00
Commit Graph

193 Commits

Author SHA1 Message Date
Alasdair G Kergon
ee3cfa4184 python: Add bindings for liblvm2app.
Use configure --enable-python_bindings to generate them.

Note that the Makefiles do not yet control the owner or permissions of
the two new files on installation.
2012-10-12 02:08:47 +01:00
Peter Rajnoha
c68c157573 setvbuf: reopen only valid fd
We should check whether the fd is opened before trying to reopen it.
For example, the stdin is closed in test/lib/harness.c causing the
test suite to fail.
2012-08-27 13:07:07 +02:00
Alasdair G Kergon
438e0050df config: add silent mode
Accept -q as the short form of --quiet.
Suppress non-essential standard output if -q is given twice.
Treat log/silent in lvm.conf as equivalent to -qq.
Review all log_print messages and change some to
log_print_unless_silent.

When silent, the following commands still produce output:
dumpconfig, lvdisplay, lvmdiskscan, lvs, pvck, pvdisplay,
pvs, version, vgcfgrestore -l, vgdisplay, vgs.
[Needs checking.]

Non-essential messages are shifted from log level 4 to log level 5
for syslog and lvm2_log_fn purposes.
2012-08-25 20:35:48 +01:00
Zdenek Kabelac
286cd2006b cleanup: drop unneeded included header files
This headers were not resolving anything used for compiled .c files.
Remove unused util.c file.
2012-08-23 14:37:20 +02:00
Peter Rajnoha
9a96f930a7 configure: run directory configuration cleanup
There were several hard-coded values for run directory around the code.
Also, some tools are DM specific only, others are LVM specific and there
was no distinction made here before. With this patch applied, we have
this cleaned up a bit (subsystem in brackets, defaults in parentheses):

          [common] configurable PID_DIR     (/var/run)

 lvm      [lvm]    configurable RUN_DIR     (/var/run/lvm)
                   configurable locking dir (/var/lock/lvm)

 clvmd    [lvm]    configurable pid file    (PID_DIR/clvmd.pid)
                   socket                   (RUN_DIR/clvmd.sock)

 lvmetad  [lvm]    configurable pid file    (PID_DIR/lvmetad.pid)
                   socket                   (RUN_DIR/lvmetad.socket)

 dm       [dm]     configurable DM_RUN_DIR  (/var/run)

 cmirrord [dm]     configurable pid file    (PID_DIR/cmirrord.pid)

 dmeventd [dm]     configurable pid file    (PID_DIR/dmeventd.pid)
                   server fifo              (DM_RUN_DIR/dmeventd-server)
                   client fifo              (DM_RUN_DIR/dmeventd-client)

The changes briefly:
  - added configure --with-default-pid-dir
  - added configure --with-default-dm-run-dir
  - added configure --with-lvmetad-pidfile
  - by default, using one common pid directory for everything
    (only lvmetad was not following this before)
2012-06-27 12:11:47 +02:00
Alasdair G Kergon
05fb515863 veritysetup: Remove code as now in cryptsetup.
The veritysetup code has moved to the cryptsetup package.
  http://code.google.com/p/cryptsetup/
2012-06-11 16:12:20 +01:00
Alasdair G Kergon
a2a37f8fee More .gitignore files for an in-source-tree build.
Tell git to ignore files generated by a build inside the source tree.
2012-06-08 16:34:43 +01:00
Peter Rajnoha
06738cac05 Remove unsupported udev_get_dev_path libudev call used for checking udev dir.
With latest changes in the udev, some deprecated functions were removed
from libudev amongst which there was the "udev_get_dev_path" function
we used to compare a device directory used in udev and directore set in
libdevmapper. The "/dev" is hardcoded in udev now (udev version >= 183).

Amongst other changes and from packager's point of view, it's also
important to note that the libudev development library ("libudev-devel")
could now be a part of the systemd development library ("systemd-devel")
because of the udev + systemd merge.
2012-05-29 08:09:10 +00:00
Alasdair Kergon
3d962ed68f First veritysetup version using configure --with-veritysetup. 2012-03-24 01:59:59 +00:00
Zdenek Kabelac
f61cacad16 Add --with-thin-check configure option
If specified - use given path without test (Path could be empty)
If autodetection is in use - check for command in available PATH.
2012-03-14 17:09:00 +00:00
Zdenek Kabelac
f194dabb09 Just space moving
Don't leave space on EOL.
2012-03-02 22:58:23 +00:00
Jonathan Earl Brassow
62e38da133 Allow cluster mirrors to handle the absence of the checkpoint lib (libSaCkpt).
The OpenAIS checkpoint library is going away; therefore, cmirrord must
operate without it.  The algorithms the handle the timing of when to send
a checkpoint, the determination of what to send, and which ongoing cluster
requests are relevent with respect to the checkpoints are unaffected.  We
need only replace the functions that actually perform the storing/transmitting
and retrieving/receiving of the checkpoint data.  Rather than store the
checkpoint data in an OpenAIS checkpoint file, we simply transmit it along
with the message that notifies the incoming node that the checkpoint is
ready.
2012-02-29 21:15:34 +00:00
Alasdair Kergon
2c806677ba Add LVMETAD_SUPPORT 2012-02-28 18:20:58 +00:00
Zdenek Kabelac
8918bf2430 Add some log_sys_errors to close() call 2012-02-27 11:28:47 +00:00
Peter Rajnoha
c64d7cd381 autoreconf 2012-02-15 11:20:12 +00:00
Zdenek Kabelac
9278655de1 Some fixmes
'len' calculation is unused ?
Unreachable code could be removed or moved upward ?
2012-02-08 12:57:15 +00:00
Zdenek Kabelac
5dfd775384 Ensure strncpy() function always ends with '\0'
Since last character needs to be \0 for string,
pass buffer size smaller by 1 byte.
2012-02-08 11:05:04 +00:00
Zdenek Kabelac
dfb679e5c7 Avoid warning for small pv_min_size
Do not print warning for pv_min_size set in range between 512KB and 2MB.
2012-02-01 13:42:18 +00:00
Alasdair Kergon
b6d7a48480 Automatically detect whether corosync clvmd needs to use confdb or cmap. (fabio) 2012-01-31 21:21:53 +00:00
Mike Snitzer
23e34c729b Differentiate between snapshot status of "Invalid" and "Merge failed". 2012-01-20 22:02:04 +00:00
Zdenek Kabelac
dc964ab0d3 Thin uses _tdata instead of _tpool for data LV
Switch to different suffix and keep -tpool reserved for overlay device name.
2011-11-03 14:38:36 +00:00
Peter Rajnoha
9fa1d30a1c Add activation/retry_deactivation to lvm.conf to retry deactivation of an LV. 2011-09-22 17:39:56 +00:00
Zdenek Kabelac
ce840163c0 Revert patch
Caller of exec must report log_error when rstatus is passed.
2011-09-19 18:38:43 +00:00
Zdenek Kabelac
4eeff46bf2 Use log_error instead of log_verbose when executed command fails 2011-09-19 14:54:23 +00:00
Zdenek Kabelac
5f3f06db66 Move debug message
so it does not look like we are executing command in the middle of
critical_section in log trace.
2011-09-19 12:48:02 +00:00
Alasdair Kergon
afadb4628e tdata->tpool 2011-09-06 15:38:44 +00:00
Alasdair Kergon
9ac61d2ba2 lvcreate parsing for thin provisioning.
The rest is incomplete so this isn't usable yet.
2011-09-06 00:26:42 +00:00
Zdenek Kabelac
4ea01630ae Match the prototype old-style declaration 2011-09-01 13:30:11 +00:00
Petr Rockai
e59e2f7c3c Move the core of the lib/config/config.c functionality into libdevmapper,
leaving behind the LVM-specific parts of the code (convenience wrappers that
handle `struct device` and `struct cmd_context`, basically). A number of
functions have been renamed (in addition to getting a dm_ prefix) -- namely,
all of the config interface now has a dm_config_ prefix.
2011-08-30 14:55:15 +00:00
Zdenek Kabelac
3ba4a19510 Initial code layout for thin provisioning target
Only registers init_thin_segtype

Option --with-thin=internal needed for compilation.
For now useful only for developememt!
2011-08-24 08:27:49 +00:00
Zdenek Kabelac
cf98c05082 Add detect_internal_vg_cache_corruption to lvm.conf
Add config option to enable crc checking of VG structures.
Currently it's disabled by default.

For the internal test-suite this check it is enabled.

Note: In the case the internal error is detected, debug build with
compile option DEBUG_ENFORCE_POOL_LOCKING helps to catch the source
of the problem.
2011-08-11 17:46:13 +00:00
Alasdair Kergon
13db59839c autoreconf 2011-08-09 18:14:48 +00:00
Zdenek Kabelac
586f310618 Remove meaningless const type qualifiers on cast type
Static analyzis noticed we do not really need them - so removing.
2011-08-04 14:30:51 +00:00
Jonathan Earl Brassow
cac52ca4ce Add basic RAID segment type(s) support.
Implementation described in doc/lvm2-raid.txt.

Basic support includes:
- ability to create RAID 1/4/5/6 arrays
- ability to delete RAID arrays
- ability to display RAID arrays
Notable missing features (not included in this patch):
- ability to clean-up/repair failures
- ability to convert RAID segment types
- ability to monitor RAID segment types
2011-08-02 22:07:20 +00:00
Alasdair Kergon
2243718fae Add framework for validation of ioctls. Doesn't do any checks yet.
dmsetup --checks
libdevmapper: dm_task_enable_checks()
lvm.conf: activation/checks=1
2011-07-01 14:09:19 +00:00
Peter Rajnoha
afc8a3b104 Fix create_temp_name to replace any '/' found in the hostname with '?'.
There's a possibility someone will use the '/' in the hostname. Since we
generate a temporary file name (path) including the hostname, any '/' would
be ambiguous.

We can always set such hostname using 'sethostname' from unistd.h. But the
'hostname' command already includes the check and removes the '/' char.
However, some old versions still allow that.
See: https://bugzilla.redhat.com/show_bug.cgi?id=711445.

Since this is only a temporary name and the possibility of this error is
quite negligible, we don't need any complex escape sequence here, just a
simple char replace.
2011-06-08 08:49:53 +00:00
Alasdair Kergon
2c56f60db4 Set pv_min_size to 2048KB to exclude floppy drives.
Previously was 512.
2011-04-28 17:33:34 +00:00
Peter Rajnoha
edcda01a1e Obtain device list from udev by default if LVM2 is compiled with udev support.
Also, add a new 'obtain_device_list_from_udev' setting to lvm.conf with which
we can turn this feature on or off if needed.

If set, the cache of block device nodes with all associated symlinks
will be constructed out of the existing udev database content.
This avoids using and opening any inapplicable non-block devices or
subdirectories found in the device directory. This setting is applied
to udev-managed device directory only, other directories will be scanned
fully. LVM2 needs to be compiled with udev support for this setting to
take effect. N.B. Any device node or symlink not managed by udev in
udev directory will be ignored with this setting on.
2011-04-22 12:05:32 +00:00
Peter Rajnoha
40059f18d9 Move common libudev code to lvm-wrappers.[ch].
...so we can use it throughout.
2011-04-22 11:59:59 +00:00
Zdenek Kabelac
a1eba521e3 Fix some unmatching sign comparation gcc warnings
Simple replacement for unsigned type - usually in for() loops.
2011-04-08 14:40:18 +00:00
Zdenek Kabelac
e42cb2f892 Newer gcc doesn't need this trick
In fact it now generates an opposite warning about using undefined variable.
2011-04-08 14:11:40 +00:00
Zdenek Kabelac
aaf92617b0 Fix -Wold-style-definition gcc warnings 2011-03-29 20:30:05 +00:00
Zdenek Kabelac
612e606392 Revert this commit
This buffer allocation must have been problem somewhere else.
(as sizeof() already has the 'extra' '\0' included).
For now reverting this commit.
2011-03-13 23:18:30 +00:00
Zdenek Kabelac
c9c1730705 Fix buffer allocation size for uuid string
We have 3 components and traling '\0' so allocate proper room for all of them.
Problem was nicely hidden by allocation from pool and allocation aligment
offset - so to trigger real problem with this one is actually hard.
2011-03-13 22:57:51 +00:00
Zdenek Kabelac
794e94fe16 Replace PV_MIN_SIZE with function pv_min_size()
Add configurable option to define minimal size of
of block device usable as a PV.

pv_min_size() is added to lvm-globals and it's being
initialized through _process_config.

Macro PV_MIN_SIZE is unused and removed.

New define DEFAULT_PV_MIN_SIZE_KB is added to lvm-global
and unlike PV_MIN_SIZE it uses KB units.

Should help users with various slow devices attached to the system,
which cannot be easily filtered out (like FDD on /dev/sdX):
https://bugzilla.redhat.com/show_bug.cgi?id=644578
2011-02-18 14:11:22 +00:00
Zdenek Kabelac
2fdd451b19 Fix CRC32 calculation on big endian CPU
Fix regresion from 2.02.75 speedup - so currently crc32 is a little bit
more complicated on big-endian CPU as the uint32_t needs to be shifted
on here.
2011-02-08 12:41:08 +00:00
Zdenek Kabelac
d0df875d48 Add configure option --with-device-nodes-on
Make configurable default behaviour how to deal with device node creates.
With udev system natural options should be  'resume'.
For older systems where user expect there is node in /dev/mapper immediately
after  dmsetup create --notable  -  use 'create'

FIXME:
Code needs fixing passing this flag through udev cookie.
2011-02-04 22:17:54 +00:00
Zdenek Kabelac
a5c6acf22a Skip NULL check before dm_free
dm_free checks for NULL itself.
2011-01-28 10:16:04 +00:00
Alasdair Kergon
cef065f63f Fix lvchange --test to exit cleanly. 2011-01-24 14:19:05 +00:00
Zdenek Kabelac
b1b38215ba Add exec_cmd paramater sync_needed
As sync_local_dev_names() cannot be called within activation context,
add new parametr which allows to select if the sync call is needed
before executing new command.
2011-01-13 14:51:32 +00:00