1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-12-24 16:23:50 +03:00

Compare commits

..

46 Commits

Author SHA1 Message Date
Marian Csontos
cf06d942b8 test: api subdirectory is needed in PATH by pytest 2015-11-02 14:16:46 +01:00
Marian Csontos
83d3cc76f3 test: Run pytest with installed libs 2015-11-02 12:52:30 +01:00
Marian Csontos
89574055f7 spec: Add python bindings 2015-11-02 12:42:32 +01:00
Alasdair G Kergon
7831a65091 post-release 2015-10-31 01:35:47 +00:00
Alasdair G Kergon
15a97cc610 pre-release 2015-10-30 15:34:00 +00:00
Peter Rajnoha
3f1c63c812 WHATS_NEW: reporting commands and -o-/-o+ extension 2015-10-30 15:50:35 +01:00
Peter Rajnoha
dd52721b68 commands: update command help for -o|--options for reporting commands 2015-10-30 15:47:56 +01:00
Peter Rajnoha
7f125c1116 man: pvs/vgs/lvs and -o+, -o-, -o# 2015-10-30 15:47:56 +01:00
Peter Rajnoha
5b04eda93f tests: add report-fields.sh test 2015-10-30 15:47:56 +01:00
Peter Rajnoha
77c31d0c39 report: support "-o #field_name1,field_name2,..." 2015-10-30 15:47:56 +01:00
Peter Rajnoha
baf320455b report: recognize known prefix when processing "-o -field_name1,field_name2,..." 2015-10-30 15:47:56 +01:00
Peter Rajnoha
bb4d3fa7a7 report: add report_get_field_prefix function 2015-10-30 15:47:56 +01:00
Peter Rajnoha
3e18b101a0 report: support "-o -field_name1,field_name2,...." 2015-10-30 15:47:56 +01:00
Peter Rajnoha
df190dcfa5 report: make report options defined by "-o" groupable
Also, besides making "-o" groupable, use string lists to store
lists of options temporarily while processing all instances of
the "-o" group.
2015-10-30 15:47:56 +01:00
Peter Rajnoha
e149fe7fdf refactor: move code detecting report options to a separate function 2015-10-30 15:47:56 +01:00
Peter Rajnoha
77605457e7 str_list: add str_list_destroy function
The str_list_destroy function may be called to cleanup memory when
the list is not used anymore and the list itself was not allocated
from the memory pool.
2015-10-30 15:47:56 +01:00
Peter Rajnoha
0d5b1294f0 str_list: add str_list_to_str and str_to_str_list functions
The str_list_to_str and str_to_str_list are helper functions to
convert string list to a single string and vice versa.
2015-10-30 15:47:56 +01:00
Peter Rajnoha
097d14e64e str_list: also allow memory allocation without memory pool 2015-10-30 15:47:55 +01:00
David Teigland
17196103e0 New entries for pvs related fixes. 2015-10-30 09:05:21 -05:00
Peter Rajnoha
ccfc09f79b metadata: format_text: also count with calculated mda size of 0
When checking minimum mda size, make sure the mda_size after alignment
and calculation is more than 0 - if there's no place for an MDA at the
end of the disk, the _text_pv_add_metadata_area does not try to add it
there and it returns (because we already have the MDA at the start of
the disk at least).
2015-10-30 12:02:34 +01:00
Peter Rajnoha
9a3b64e81a tests: add test for minimum mda size 2015-10-30 10:02:00 +01:00
Peter Rajnoha
c2e88d1107 metadata: format_text: better check for metadata overlap
Actually, we don't need extra condition as introduced in commit
00348c0a63. We should fix the last
condition:

  (mdac->rlocn.size >= mdah->size)

...which should be:

  (MDA_HEADER_SIZE + (rlocn ? rlocn->size : 0) + mdac->rlocn.size >= mdah->size))

Where the "mdac" is new metadata, the "rlocn" is old metadata.

So the main problem with the previous condition was that it
didn't count in MDA_HEADER_SIZE properly (and possible existing
metadata - the "rlocn"). This could have caused the error state
where metadata in ring buffer overlap to not be hit.

Replace the new condition introduced in 00348c0a63
with the improved one for the condition that existed there
already but it was just incomplete.
2015-10-30 08:57:34 +01:00
Peter Rajnoha
406d8ff332 WHATS_NEW: recent commits 2015-10-29 16:50:09 +01:00
Peter Rajnoha
00348c0a63 metadata: format_text: check VG metadata do not overlap themselves
We're already checking whether old and new meta do not overlap in
ring buffer (as we need to keep both old and new meta during vg_write
up until vg_commit).

We also need to check whether the new metadata do not overlap
themselves in case we don't have old metadata yet (...because
we're in vgcreate). This could happen if we're creating a VG so
that the very first metadata written are long enough that it wraps
themselves in metadata ring buffer.

Although we limited the minimum metadata area size better with the
previous commit ccb8da404d which
makes the initial VG metadata overlap in ring buffer to be less
probable, the risk of hitting this overlap condition is still there
if we still manage to generate big enough metadata somehow.

For example, users can provide many and/or long VG tags during vgcreate
so that the VG metadata is long enough to start to wrap in the ring
buffer again...
2015-10-29 16:46:41 +01:00
Peter Rajnoha
ccb8da404d metadata: format_text: check metadata area size is at least MDA_SIZE_MIN 2015-10-29 16:00:32 +01:00
Zdenek Kabelac
28e54032c0 tests: update test for resize
Drop already tested 'threshold & create' which is in
lvextend-thin-full.sh

Count with now match faster 'dmeventd' wakeup on watermark
as it's now nearly instant after crossing threshold value.
2015-10-29 15:11:16 +01:00
Ondrej Kozina
bca55c9b20 tests: replace invalid use of 'fail' with 'die' 2015-10-29 13:30:29 +01:00
Zdenek Kabelac
f104a81932 tests: let pass bigger readahead
If the underlaying device has actually bigger read-ahead settings,
let it pass.
But anyway switch to 512 strip-size to get really high R-A sector count.
2015-10-29 12:39:07 +01:00
Zdenek Kabelac
3720eb63be tests: fix wrong line has been commented 2015-10-29 12:39:07 +01:00
Zdenek Kabelac
8b5525383f tests: no point in using should
lvmetad does not support lvm1 - so expect failure.
2015-10-29 12:39:07 +01:00
Zdenek Kabelac
f58c634103 cleanup: error is not a WARNING
Drop 'WARNING' from error message.
It's plain error message leading to command failure.
2015-10-29 12:38:59 +01:00
Zdenek Kabelac
175119fdcd cleanup: remove thin low_water_mark from metadata
This option could never have been printed in lvm2 metadata, so it could
be safely removed as it could have been set only as 0.

These configurable setting is supported via metadata profile.
2015-10-29 12:14:20 +01:00
Zdenek Kabelac
33a8a2febf cleanup: use same type 2015-10-29 12:14:20 +01:00
Zdenek Kabelac
f32f0bd2a7 cleanup: easier error messages 2015-10-29 12:14:20 +01:00
Zdenek Kabelac
99237f0908 thin: enable usage of kernel low_water_mark
Now with correctly functioning dmeventd enable usage of
low_water_mark for faster reaction on pool's threshold.

When user select e.g. 80% as a threshold value,
dmeventd doesn't need to wait 10 seconds till monitoring
timer expires, but nearly instantly resizes thin-pool
to fit bellow threshold.
2015-10-29 12:14:20 +01:00
Zdenek Kabelac
099466939e thin: dmeventd plugin check number of failures
If plugin's lvm command execution fails too often (>10 times),
there is no point to torture system more then necessary, just log
and drop monitoring in this case.
2015-10-29 12:14:20 +01:00
Peter Rajnoha
b3c81d02c9 revert: 3d03e504cd: message about VG metadata size vs. PV mda size
The message needs refinement - it's not correct in all situations.
2015-10-29 11:10:48 +01:00
David Teigland
5886ff64eb pvs: don't treat duplicate PVs as missed
The recent addition to check for PVs that were
missed during the first iteration of processing
was unintentionally catching duplicate PVs because
duplicates were not removed from the all_devices
list when the primary dev was processed.

Also change a message from warn back to verbose.
2015-10-27 12:03:57 -05:00
David Teigland
a4418b34c1 vgs, lvs: ignore error if VG is removed
If a VG is removed between the time that 'vgs'
or 'lvs' (with no args) creates the list of VGs
and the time that it reads the VG to process it,
then ignore the removed VG; don't report an error
that it could not be found, since it wasn't named
by the command.
2015-10-27 10:52:01 -05:00
Alasdair G Kergon
65ec00ce20 device: Tidy DASD CDL format detection code. 2015-10-27 15:27:52 +00:00
Zdenek Kabelac
6e1e0e8813 tests: using matching type
Compare time_t.
2015-10-27 16:00:10 +01:00
Zdenek Kabelac
4159680a0e tests: use more SKIP
Speed-up check_lvmpolld.
2015-10-27 16:00:09 +01:00
Zdenek Kabelac
76cff10a73 tests: avoid reading utils when skipping
Save even more CPU/time and avoid reading utils, when skipping test.
2015-10-27 16:00:09 +01:00
Marian Csontos
1af2ab10d0 cleanup: snapshots of snapshots message
No plans to support thick snapshost of snapshots.
2015-10-27 11:42:48 +01:00
Lidong Zhong
729f489009 pvcreate: don't support unpartitioned DASD devices with CDL formatted
The former patch(dab3ebce4c) is a little bit strict. For example, it is
OK to create PV on unpartitioned DASD devices with LDL formatted. So
after lvm version containing the patch, LVs created on those devices
could not be found.

Signed-off-by: Lidong Zhong <lzhong@suse.com>
2015-10-27 11:42:47 +01:00
Zdenek Kabelac
5d76bdcdbd dmeventd: event string parser handles empty field
Improve event string parser to avoid unneeded alloc+free.

Daemon talk function uses '-' to mark NULL/missing field.
So restore the NULL pointer back on parser.

This should have made old tools like 'dmevent_tool' work again.
As now 'uuid' or 'dso' could become NULL and then be
properly used in _want_registered_device() function.

Since lvm2 always fill these parameters, this change should
have no effect on lvm2.
2015-10-27 11:42:40 +01:00
211 changed files with 1142 additions and 528 deletions

View File

@@ -1 +1 @@
2.02.133(2)-git (2015-09-22)
2.02.134(2)-git (2015-10-30)

View File

@@ -1 +1 @@
1.02.110-git (2015-09-22)
1.02.111-git (2015-10-30)

View File

@@ -1,5 +1,17 @@
Version 2.02.133 -
======================================
Version 2.02.134 -
====================================
Version 2.02.133 - 30th October 2015
====================================
Support repeated -o|--options for reporting commands.
Support -o- and -o# for reporting commands to remove and compact fields.
Fix missing PVs from pvs output if vgremove is run concurrently.
Remove unwanted error message when running pvs/vgs/lvs and vgremove at once.
Check newly created VG's metadata do not overlap in metadata ring buffer.
Check metadata area size is at least the minimum size defined for the format.
Thin pool targets uses low_water_mark from profile.
Dropping 'yet' from error of unsupported thick snapshot of snapshots.
Do not support unpartitioned DASD devices with CDL formatted with pvcreate.
For thins use flush for suspend only when volume size is reduced.
Enable code which detects the need of flush during suspend.
Ensure --use-policy will resize volume to fit below threshold.

View File

@@ -1,5 +1,10 @@
Version 1.02.110 -
======================================
Version 1.02.111 -
====================================
Version 1.02.110 - 30th October 2015
====================================
Disable thin monitoring plugin when it fails too often (>10 times).
Fix/restore parsing of empty field '-' when processing dmeventd event.
Enhance dm_tree_node_size_changed() to recognize size reduction.
Support exit on idle for dmenventd (1 hour).
Add support to allow unmonitor device from plugin itself.

View File

@@ -473,34 +473,48 @@ static int _pthread_create_smallstack(pthread_t *t, void *(*fun)(void *), void *
/*
* Fetch a string off src and duplicate it into *ptr.
* Pay attention to zero-length strings.
* Pay attention to zero-length and 'empty' strings ('-').
*/
/* FIXME? move to libdevmapper to share with the client lib (need to
make delimiter a parameter then) */
static int _fetch_string(char **ptr, char **src, const int delimiter)
{
int ret = 0;
int ret = 1;
char *p;
size_t len;
*ptr = NULL; /* Empty field returns NULL pointer */
if ((p = strchr(*src, delimiter)))
*p = 0;
if ((*ptr = dm_strdup(*src))) {
if ((len = strlen(*ptr)))
*src += len;
else {
dm_free(*ptr);
*ptr = NULL;
if ((*src)[0] == '-') {
/* Could be empty field '-', handle without allocation */
if ((*src)[1] == '\0') {
(*src)++;
goto out;
} else if ((*src)[1] == delimiter) {
(*src) += 2;
goto out;
}
(*src)++;
ret = 1;
}
if (p)
*p = delimiter;
if ((p = strchr(*src, delimiter))) {
if (*src < p) {
*p = 0; /* Temporary exit with \0 */
if (!(*ptr = dm_strdup(*src))) {
log_error("Failed to fetch item %s.", *src);
ret = 0; /* Allocation fail */
}
*p = delimiter;
*src = p;
}
(*src)++; /* Skip delmiter, next field */
} else if ((len = strlen(*src))) {
/* No delimiter, item ends with '\0' */
if (!(*ptr = dm_strdup(*src))) {
log_error("Failed to fetch last item %s.", *src);
ret = 0; /* Fail */
}
*src += len + 1;
}
out:
return ret;
}

View File

@@ -18,6 +18,7 @@
#include <sys/wait.h>
#include <stdarg.h>
#include <pthread.h>
/* TODO - move this mountinfo code into library to be reusable */
#ifdef __linux__
@@ -36,6 +37,8 @@
#define UMOUNT_COMMAND "/bin/umount"
#define MAX_FAILS (10)
#define THIN_DEBUG 0
struct dso_state {
@@ -44,6 +47,7 @@ struct dso_state {
int data_percent_check;
uint64_t known_metadata_size;
uint64_t known_data_size;
unsigned fails;
char cmd_str[1024];
};
@@ -157,7 +161,7 @@ static int _run(const char *cmd, ...)
argv = alloca(sizeof(const char *) * (argc + 1));
argv[0] = cmd;
va_start(ap, cmd);
va_start(ap, cmd);
while ((argv[++i] = va_arg(ap, const char *)));
va_end(ap);
@@ -245,7 +249,9 @@ static void _use_policy(struct dm_task *dmt, struct dso_state *state)
log_error("Failed to extend thin pool %s.",
dm_task_get_name(dmt));
_umount(dmt);
}
state->fails++;
} else
state->fails = 0;
}
void process_event(struct dm_task *dmt,
@@ -270,7 +276,7 @@ void process_event(struct dm_task *dmt,
if (event & DM_EVENT_DEVICE_ERROR) {
/* Error -> no need to check and do instant resize */
_use_policy(dmt, state);
return;
goto out;
}
dm_get_next_target(dmt, next, &start, &length, &target_type, &params);
@@ -338,6 +344,13 @@ void process_event(struct dm_task *dmt,
out:
if (tps)
dm_pool_free(state->mem, tps);
if (state->fails >= MAX_FAILS) {
log_warn("WARNING: Dropping monitoring of %s. "
"lvm2 command fails too often (%u times in raw).",
device, state->fails);
pthread_kill(pthread_self(), SIGALRM);
}
}
int register_device(const char *device,

View File

@@ -62,6 +62,7 @@ SOURCES =\
device/dev-swap.c \
device/dev-type.c \
device/dev-luks.c \
device/dev-dasd.c \
display/display.c \
error/errseg.c \
unknown/unknown.c \

2
lib/cache/lvmetad.c vendored
View File

@@ -1331,7 +1331,7 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev,
log_warn("WARNING: Ignoring obsolete format of metadata (%s) on device %s when using lvmetad",
baton.fid->fmt->name, dev_name(dev));
else
log_error("WARNING: Ignoring obsolete format of metadata (%s) on device %s when using lvmetad",
log_error("Ignoring obsolete format of metadata (%s) on device %s when using lvmetad.",
baton.fid->fmt->name, dev_name(dev));
lvmcache_fmt(info)->ops->destroy_instance(baton.fid);

View File

@@ -16,11 +16,14 @@
#include "lib.h"
#include "str_list.h"
#include <ctype.h>
struct dm_list *str_list_create(struct dm_pool *mem)
{
struct dm_list *sl;
if (!(sl = dm_pool_alloc(mem, sizeof(struct dm_list)))) {
if (!(sl = mem ? dm_pool_alloc(mem, sizeof(struct dm_list))
: dm_malloc(sizeof(struct dm_list)))) {
log_errno(ENOMEM, "str_list allocation failed");
return NULL;
}
@@ -37,7 +40,8 @@ static int _str_list_add_no_dup_check(struct dm_pool *mem, struct dm_list *sll,
if (!str)
return_0;
if (!(sln = dm_pool_alloc(mem, sizeof(*sln))))
if (!(sln = mem ? dm_pool_alloc(mem, sizeof(*sln))
: dm_malloc(sizeof(*sln))))
return_0;
sln->str = str;
@@ -158,3 +162,101 @@ int str_list_lists_equal(const struct dm_list *sll, const struct dm_list *sll2)
return 1;
}
char *str_list_to_str(struct dm_pool *mem, const struct dm_list *list,
const char *delim)
{
size_t delim_len = strlen(delim);
unsigned list_size = dm_list_size(list);
struct dm_str_list *sl;
char *str, *p;
size_t len = 0;
unsigned i = 0;
dm_list_iterate_items(sl, list)
len += strlen(sl->str);
if (list_size > 1)
len += ((list_size - 1) * delim_len);
str = mem ? dm_pool_alloc(mem, len+1) : dm_malloc(len+1);
if (!str) {
log_error("str_list_to_str: string allocation failed.");
return NULL;
}
str[len] = '\0';
p = str;
dm_list_iterate_items(sl, list) {
len = strlen(sl->str);
memcpy(p, sl->str, len);
p += len;
if (++i != list_size) {
memcpy(p, delim, delim_len);
p += delim_len;
}
}
return str;
}
struct dm_list *str_to_str_list(struct dm_pool *mem, const char *str,
const char *delim, int ignore_multiple_delim)
{
size_t delim_len = strlen(delim);
struct dm_list *list;
const char *p1, *p2, *next;
char *str_item;
size_t len;
if (!(list = str_list_create(mem))) {
log_error("str_to_str_list: string list allocation failed.");
return NULL;
}
p1 = p2 = str;
while (*p1) {
if (!(p2 = strstr(p1, delim)))
next = p2 = str + strlen(str);
else
next = p2 + delim_len;
len = p2 - p1;
str_item = mem ? dm_pool_alloc(mem, len+1) : dm_malloc(len+1);
if (!str_item) {
log_error("str_to_str_list: string list item allocation failed.");
goto bad;
}
memcpy(str_item, p1, len);
str_item[len] = '\0';
if (!str_list_add_no_dup_check(mem, list, str_item))
goto_bad;
if (ignore_multiple_delim) {
while (!strncmp(next, delim, delim_len))
next += delim_len;
}
p1 = next;
}
return list;
bad:
if (mem)
dm_pool_free(mem, list);
return NULL;
}
void str_list_destroy(struct dm_list *list, int deallocate_strings)
{
struct dm_str_list *sl, *tmp_sl;
dm_list_iterate_items_safe(sl, tmp_sl, list) {
dm_list_del(&sl->list);
if (deallocate_strings)
dm_free((char *)sl->str);
dm_free(sl);
}
dm_free(list);
}

View File

@@ -30,5 +30,9 @@ int str_list_match_list(const struct dm_list *sll, const struct dm_list *sll2, c
int str_list_lists_equal(const struct dm_list *sll, const struct dm_list *sll2);
int str_list_dup(struct dm_pool *mem, struct dm_list *sllnew,
const struct dm_list *sllold);
char *str_list_to_str(struct dm_pool *mem, const struct dm_list *list, const char *delim);
struct dm_list *str_to_str_list(struct dm_pool *mem, const char *str, const char *delim, int ignore_multiple_delim);
/* Only for lists which were *not* allocated from the mem pool! */
void str_list_destroy(struct dm_list *list, int deallocate_strings);
#endif

111
lib/device/dev-dasd.c Normal file
View File

@@ -0,0 +1,111 @@
/*
* Copyright (C) 2015 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 Lesser General Public License v.2.1.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "lib.h"
#include "metadata.h"
#include "dev-type.h"
#include <sys/ioctl.h>
#ifdef __linux__
/*
* Interface taken from kernel header arch/s390/include/uapi/asm/dasd.h
*/
/*
* Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
* Copyright IBM Corp. 1999, 2000
* EMC Symmetrix ioctl Copyright EMC Corporation, 2008
* Author.........: Nigel Hislop <hislop_nigel@emc.com>
*/
#define DASD_IOCTL_LETTER 'D'
#define DASD_API_VERSION 6
/*
* struct dasd_information2_t
* represents any data about the device, which is visible to userspace.
* including foramt and featueres.
*/
typedef struct dasd_information2_t {
unsigned int devno; /* S/390 devno */
unsigned int real_devno; /* for aliases */
unsigned int schid; /* S/390 subchannel identifier */
unsigned int cu_type : 16; /* from SenseID */
unsigned int cu_model : 8; /* from SenseID */
unsigned int dev_type : 16; /* from SenseID */
unsigned int dev_model : 8; /* from SenseID */
unsigned int open_count;
unsigned int req_queue_len;
unsigned int chanq_len; /* length of chanq */
char type[4]; /* from discipline.name, 'none' for unknown */
unsigned int status; /* current device level */
unsigned int label_block; /* where to find the VOLSER */
unsigned int FBA_layout; /* fixed block size (like AIXVOL) */
unsigned int characteristics_size;
unsigned int confdata_size;
char characteristics[64]; /* from read_device_characteristics */
char configuration_data[256]; /* from read_configuration_data */
unsigned int format; /* format info like formatted/cdl/ldl/... */
unsigned int features; /* dasd features like 'ro',... */
unsigned int reserved0; /* reserved for further use ,... */
unsigned int reserved1; /* reserved for further use ,... */
unsigned int reserved2; /* reserved for further use ,... */
unsigned int reserved3; /* reserved for further use ,... */
unsigned int reserved4; /* reserved for further use ,... */
unsigned int reserved5; /* reserved for further use ,... */
unsigned int reserved6; /* reserved for further use ,... */
unsigned int reserved7; /* reserved for further use ,... */
} dasd_information2_t;
#define DASD_FORMAT_CDL 2
/* Get information on a dasd device (enhanced) */
#define BIODASDINFO2 _IOR(DASD_IOCTL_LETTER,3,dasd_information2_t)
/*
* End of included interface.
*/
int dasd_is_cdl_formatted(struct device *dev)
{
int ret = 0;
dasd_information2_t dasd_info2;
if (!dev_open_readonly(dev))
return_0;
if (ioctl(dev->fd, BIODASDINFO2, &dasd_info2)) {
log_sys_error("ioctl BIODASDINFO2", dev_name(dev));
goto out;
}
if (dasd_info2.format == DASD_FORMAT_CDL)
ret = 1;
out:
if (!dev_close(dev))
stack;
return ret;
}
#else
int dasd_is_cdl_formatted(struct device *dev)
{
return 0;
}
#endif

View File

@@ -363,7 +363,7 @@ static int _native_dev_is_partitioned(struct dev_types *dt, struct device *dev)
return 0;
/* Unpartitioned DASD devices are not supported. */
if (MAJOR(dev->dev) == dt->dasd_major)
if ((MAJOR(dev->dev) == dt->dasd_major) && dasd_is_cdl_formatted(dev))
return 1;
if (!dev_open_readonly_quiet(dev)) {

View File

@@ -59,6 +59,7 @@ int major_is_scsi_device(struct dev_types *dt, int major);
int dev_is_md(struct device *dev, uint64_t *sb);
int dev_is_swap(struct device *dev, uint64_t *signature);
int dev_is_luks(struct device *dev, uint64_t *signature);
int dasd_is_cdl_formatted(struct device *dev);
/* Signature wiping. */
#define TYPE_LVM1_MEMBER 0x001

View File

@@ -654,12 +654,9 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
if ((new_wrap && old_wrap) ||
(rlocn && (new_wrap || old_wrap) && (new_end > rlocn->offset)) ||
(mdac->rlocn.size >= mdah->size)) {
log_error("VG %s metadata too large: size of metadata to write "
"is %" PRIu64 " bytes while PV metadata area size "
"on %s is %" PRIu64 " bytes.",
vg->name, mdac->rlocn.size,
dev_name(mdac->area.dev), mdah->size);
(MDA_HEADER_SIZE + (rlocn ? rlocn->size : 0) + mdac->rlocn.size >= mdah->size)) {
log_error("VG %s metadata too large for circular buffer",
vg->name);
goto out;
}
@@ -2149,7 +2146,6 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
goto bad;
}
/* Otherwise, give up and take any usable space. */
/* FIXME: We should probably check for some minimum MDA size here. */
else
mda_size = limit - mda_start;
@@ -2246,6 +2242,12 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
mda_size, limit_name, limit);
if (mda_size) {
if (mda_size < MDA_SIZE_MIN) {
log_error("Metadata area size too small: %" PRIu64" bytes. "
"It must be at least %u bytes.", mda_size, MDA_SIZE_MIN);
goto bad;
}
/* Wipe metadata area with zeroes. */
if (!dev_set((struct device *) pv->dev, mda_start,
(size_t) ((mda_size > wipe_size) ?

View File

@@ -7388,8 +7388,6 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
first_seg(lv)->chunk_size = lp->chunk_size;
first_seg(lv)->zero_new_blocks = lp->zero ? 1 : 0;
first_seg(lv)->discards = lp->discards;
/* FIXME: use lowwatermark via lvm.conf global for all thinpools ? */
first_seg(lv)->low_water_mark = 0;
if (!recalculate_pool_chunk_size_with_dev_hints(lv, lp->passed_args,
lp->thin_chunk_size_calc_policy)) {
stack;

View File

@@ -454,7 +454,6 @@ struct lv_segment {
struct lv_segment_area *meta_areas; /* For RAID */
struct logical_volume *metadata_lv; /* For thin_pool */
uint64_t transaction_id; /* For thin_pool, thin */
uint64_t low_water_mark; /* For thin_pool */
unsigned zero_new_blocks; /* For thin_pool */
thin_discards_t discards; /* For thin_pool */
struct dm_list thin_messages; /* For thin_pool */

View File

@@ -216,7 +216,7 @@ int thin_pool_feature_supported(const struct logical_volume *lv, int feature)
int pool_below_threshold(const struct lv_segment *pool_seg)
{
dm_percent_t percent;
int threshold = DM_PERCENT_1 *
dm_percent_t threshold = DM_PERCENT_1 *
find_config_tree_int(pool_seg->lv->vg->cmd, activation_thin_pool_autoextend_threshold_CFG,
lv_config_profile(pool_seg->lv));

View File

@@ -3396,6 +3396,21 @@ void *report_init_for_selection(struct cmd_context *cmd,
cmd);
}
const char *report_get_field_prefix(report_type_t report_type_id)
{
const struct dm_report_object_type *report_types, *report_type;
report_types = report_type_id & DEVTYPES ? _devtypes_report_types
: _report_types;
for (report_type = report_types; report_type->id; report_type++) {
if (report_type_id & report_type->id)
return report_type->prefix;
}
return "";
}
/*
* Create a row of data for an object
*/

View File

@@ -71,6 +71,7 @@ void *report_init(struct cmd_context *cmd, const char *format, const char *keys,
int quoted, int columns_as_rows, const char *selection);
void *report_init_for_selection(struct cmd_context *cmd, report_type_t *report_type,
const char *selection);
const char *report_get_field_prefix(report_type_t report_type);
int report_for_selection(struct cmd_context *cmd,
struct selection_handle *sh,
struct physical_volume *pv,

View File

@@ -118,10 +118,6 @@ static int _thin_pool_text_import(struct lv_segment *seg,
else if (!set_pool_discards(&seg->discards, discards_str))
return SEG_LOG_ERROR("Discards option unsupported for");
if (dm_config_has_node(sn, "low_water_mark") &&
!dm_config_get_uint64(sn, "low_water_mark", &seg->low_water_mark))
return SEG_LOG_ERROR("Could not read low_water_mark");
if ((seg->chunk_size < DM_THIN_MIN_DATA_BLOCK_SIZE) ||
(seg->chunk_size > DM_THIN_MAX_DATA_BLOCK_SIZE))
return SEG_LOG_ERROR("Unsupported value %u for chunk_size",
@@ -169,9 +165,6 @@ static int _thin_pool_text_export(const struct lv_segment *seg, struct formatter
return 0;
}
if (seg->low_water_mark)
outf(f, "low_water_mark = %" PRIu64, seg->low_water_mark);
if (seg->zero_new_blocks)
outf(f, "zero_new_blocks = 1");
@@ -266,6 +259,8 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
struct lvinfo info;
uint64_t transaction_id = 0;
unsigned attr;
uint64_t low_water_mark;
int threshold;
if (!_thin_target_present(cmd, NULL, &attr))
return_0;
@@ -277,27 +272,37 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
if (!(attr & THIN_FEATURE_BLOCK_SIZE) &&
(seg->chunk_size & (seg->chunk_size - 1))) {
log_error("Thin pool target does not support %uKiB chunk size "
"(needs kernel >= 3.6).", seg->chunk_size / 2);
log_error("Thin pool target does not support %s chunk size (needs"
" kernel >= 3.6).", display_size(cmd, seg->chunk_size));
return 0;
}
if (!(metadata_dlid = build_dm_uuid(mem, seg->metadata_lv, NULL))) {
log_error("Failed to build uuid for metadata LV %s.",
seg->metadata_lv->name);
display_lvname(seg->metadata_lv));
return 0;
}
if (!(pool_dlid = build_dm_uuid(mem, seg_lv(seg, 0), NULL))) {
log_error("Failed to build uuid for pool LV %s.",
seg_lv(seg, 0)->name);
display_lvname(seg_lv(seg, 0)));
return 0;
}
threshold = find_config_tree_int(seg->lv->vg->cmd,
activation_thin_pool_autoextend_threshold_CFG,
lv_config_profile(seg->lv));
if (threshold < 50)
threshold = 50;
if (threshold < 100)
low_water_mark = (len * threshold + 99) / 100;
else
low_water_mark = len;
if (!dm_tree_node_add_thin_pool_target(node, len,
seg->transaction_id,
metadata_dlid, pool_dlid,
seg->chunk_size, seg->low_water_mark,
seg->chunk_size, low_water_mark,
seg->zero_new_blocks ? 0 : 1))
return_0;

View File

@@ -37,7 +37,7 @@ lvdisplay \(em display attributes of a logical volume
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o | \-\-options
.RI [ + ] Field [ ,Field ...]]
.RI [ + | \- | # ] Field [ ,Field ...]]
.RB [ \-O | \-\-sort
.RI [ + | \- ] Key1 [ , [ + | \- ] Key2 ...]]
.RB [ \-P | \-\-partial ]

View File

@@ -16,7 +16,7 @@ lvs \(em report information about logical volumes
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o | \-\-options
.RI [ + ] Field [, Field ]]
.RI [ + | \- | # ] Field [, Field ]]
.RB [ \-O | \-\-sort
.RI [ + | \- ] Key1 [,[ + | \- ] Key2 [,...]]]
.RB [ \-P | \-\-partial ]
@@ -76,8 +76,13 @@ Suppress the suffix on output sizes. Use with \fB\-\-units\fP
(except h and H) if processing the output.
.TP
.BR \-o ", " \-\-options
Comma-separated ordered list of columns. Precede the list with '\fI+\fP'
to append to the default selection of columns instead of replacing it.
Comma-separated ordered list of columns.
.IP
Precede the list with '\fI+\fP' to append to the current list
of columns, '\fI-\fP' to remove from the current list of columns
or '\fI#\fP' to compact given columns. The \fI\-o\fP option can
be repeated, providing several lists. These lists are evaluated
from left to right.
.IP
Use \fB\-o lv_all\fP to select all logical volume columns,
and \fB\-o seg_all\fP

View File

@@ -37,7 +37,7 @@ pvdisplay \- display attributes of a physical volume
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o | \-\-options
.RI [ + ] Field [ ,Field ...]]
.RI [ + | \- | # ] Field [ ,Field ...]]
.RB [ \-O | \-\-sort
.RI [ + | \- ] Key1 [ , [ + | \- ] Key2 ...
.RI ]]

View File

@@ -16,7 +16,7 @@ pvs \(em report information about physical volumes
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o | \-\-options
.RI [ + ] Field [ ,Field ...]]
.RI [ + | \- | # ] Field [ ,Field ...]]
.RB [ \-O | \-\-sort
.RI [ + | \- ] Key1 [ , [ + | \- ] Key2 ...]]
.RB [ \-P | \-\-partial ]
@@ -65,8 +65,13 @@ Suppress the suffix on output sizes. Use with \fB\-\-units\fP
(except h and H) if processing the output.
.TP
.BR \-o ", " \-\-options
Comma-separated ordered list of columns. Precede the list with '\fI+\fP'
to append to the default selection of columns.
Comma-separated ordered list of columns.
.IP
Precede the list with '\fI+\fP' to append to the current list
of columns, '\fI-\fP' to remove from the current list of columns
or '\fI#\fP' to compact given columns. The \fI\-o\fP option can
be repeated, providing several lists. These lists are evaluated
from left to right.
.IP
Use \fB-o pv_all\fP to select all physical volume columns,
and \fB-o pvseg_all\fP to select all Physical Volume segment columns.

View File

@@ -37,7 +37,7 @@ vgdisplay \(em display attributes of volume groups
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o|\-\-options
.RI [ + ] Field1 [ ,Field2 ...]]
.RI [ + | \- | # ] Field1 [ ,Field2 ...]]
.RB [ \-O | \-\-sort
.RI [ + | \- ] Key1 [ , [ + | \- ] Key2 ...]]
.RB [ \-P | \-\-partial ]

View File

@@ -16,7 +16,7 @@ vgs \(em report information about volume groups
.RB [ \-\-noheadings ]
.RB [ \-\-nosuffix ]
.RB [ \-o | \-\-options
.RI [ + ] Field1 [ ,Field2 ...]]
.RI [ + | \- | # ] Field1 [ ,Field2 ...]]
.RB [ \-O | \-\-sort
.RI [ + | \- ] Key1 [ , [ + | \- ] Key2 ...]]
.RB [ \-P | \-\-partial ]
@@ -63,8 +63,13 @@ Suppress the suffix on output sizes. Use with \fB\-\-units\fP
(except h and H) if processing the output.
.TP
.BR \-o ", " \-\-options
Comma-separated ordered list of columns. Precede the list with '+' to append
to the default selection of columns.
Comma-separated ordered list of columns.
.IP
Precede the list with '\fI+\fP' to append to the current list
of columns, '\fI-\fP' to remove from the current list of columns
or '\fI#\fP' to compact given columns. The \fI\-o\fP option can
be repeated, providing several lists. These lists are evaluated
from left to right.
.IP
Use \fB\-o vg_all\fP to select all volume group columns.
.IP

View File

@@ -1,3 +1,22 @@
%with default-dm-run-dir %{_default_dm_run_dir}
%with default-run-dir %{_default_run_dir}
%with default-pid-dir %{_default_pid_dir}
%with default-locking-dir %{_default_locking_dir}
%with usrlibdir %{_libdir}
%enableif 1 lvm1_fallback
%enableif 1 fsadm
%with pool internal
%with user
%with group
%with device-uid 0
%with device-gid 6
%with device-mode 0660
%enableif 1 pkgconfig
%enableif 1 applib
%enableif 1 cmdlib
%enableif 1 dmeventd
%enableif 1 write_install
%with udevdir %{_udevdir}
%enableif %{enable_cmirror} cmirrord
%enableif %{enable_udev} udev_sync
@@ -11,28 +30,22 @@
%enableif %{enable_lockd_dlm} lockd-dlm
%enableif %{enable_lockd_sanlock} lockd-sanlock
%endif
%enableif %{enable_python} python-bindings
%enableif %{enable_python} applib
%build
%configure \
--with-default-dm-run-dir=%{_default_dm_run_dir} \
--with-default-run-dir=%{_default_run_dir} \
--with-default-pid-dir=%{_default_pid_dir} \
--with-default-locking-dir=%{_default_locking_dir} \
--with-usrlibdir=%{_libdir} \
--enable-lvm1_fallback \
--enable-fsadm \
--with-pool=internal \
--with-user= \
--with-group= \
--with-device-uid=0 \
--with-device-gid=6 \
--with-device-mode=0660 \
--enable-pkgconfig \
--enable-applib \
--enable-cmdlib \
--enable-dmeventd \
--enable-write_install \
%{configure_flags}
%if %{enable_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
pushd %{py3dir}
%configure %{configure_flags} PYTHON=/usr/bin/python3 PYTHON_CONFIG=/usr/bin/python3-config
make %{?_smp_mflags}
popd
%endif
%configure %{configure_flags}
make %{?_smp_mflags}
%{?extra_build_commands}
@@ -50,6 +63,11 @@ make install_initscripts DESTDIR=$RPM_BUILD_ROOT
%if %{enable_testsuite}
make -C test install DESTDIR=$RPM_BUILD_ROOT
%endif
%if %{enable_python3}
pushd %{py3dir}
make -C python install DESTDIR=$RPM_BUILD_ROOT
popd
%endif
# when building an src.rpm from freestanding specfiles
test -e %{_sourcedir}/source.inc || cp source.inc build.inc packages.inc macros.inc %{_sourcedir}

View File

@@ -410,6 +410,60 @@ fi
%endif
##############################################################################
# Python bindings
##############################################################################
%if %{enable_python}
%package python-libs
Summary: Python module to access LVM
License: LGPLv2
Group: Development/Libraries
Provides: python-lvm = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
%description python-libs
Python module to allow the creation and use of LVM
logical volumes, physical volumes, and volume groups.
%files python-libs
%{python_sitearch}/*
%endif
%if %{enable_python3}
%package python3-libs
Summary: Python 3 module to access LVM
License: LGPLv2
Group: Development/Libraries
Provides: python3-lvm = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
%description python3-libs
Python 3 module to allow the creation and use of LVM
logical volumes, physical volumes, and volume groups.
%files python3-libs
%{python3_sitearch}/*
%endif
##############################################################################
# Testsuite subpackage
##############################################################################
%if %{enable_testsuite}
%package testsuite
Summary: LVM2 Testsuite
License: LGPLv2
Group: Development
%description testsuite
An extensive functional testsuite for LVM2.
%files testsuite
%defattr(-,root,root,-)
%{_datadir}/lvm2-testsuite/
%{_libexecdir}/lvm2-testsuite/
%{_bindir}/lvm2-testsuite
%endif
##############################################################################
# Device-mapper subpackages
##############################################################################
@@ -571,18 +625,3 @@ the device-mapper event library.
%{_includedir}/libdevmapper-event.h
%{_libdir}/pkgconfig/devmapper-event.pc
%if %{enable_testsuite}
%package testsuite
Summary: LVM2 Testsuite
License: LGPLv2
Group: Development
%description testsuite
An extensive functional testsuite for LVM2.
%files testsuite
%defattr(-,root,root,-)
%{_datadir}/lvm2-testsuite/
%{_libexecdir}/lvm2-testsuite/
%{_bindir}/lvm2-testsuite
%endif

View File

@@ -5,6 +5,9 @@
%global enable_profiling 0
%global enable_testsuite 1
%global enable_python 1
# Off by default - <= does not work well with or:
%global enable_python3 0
%global enable_udev 1
%global enable_systemd 1
%global enable_cmirror 1
@@ -65,6 +68,25 @@
##############################################################
%if %{rhel} == 5
%global enable_python 0
%endif
%if %{rhel} >= 8 || %{fedora} >= 20
%global enable_python3 1
%endif
%if %{enable_python}
%global buildreq_python2_devel python2-devel
%global buildreq_python_setuptools python-setuptools
%endif
%if %{enable_python3}
%global buildreq_python3_devel python3-devel
%global buildreq_python_setuptools python-setuptools
%endif
##############################################################
%if %{fedora} == 16 || %{rhel} == 6
%global enable_systemd 0
@@ -143,6 +165,9 @@ BuildRequires: pkgconfig
%maybe BuildRequires: %{?buildreq_cluster}
%maybe BuildRequires: %{?buildreq_lockd_dlm}
%maybe BuildRequires: %{?buildreq_lockd_sanlock}
%maybe BuildRequires: %{?buildreq_python2_devel}
%maybe BuildRequires: %{?buildreq_python3_devel}
%maybe BuildRequires: %{?buildreq_python_setuptools}
%description
LVM2 includes all of the support for handling read/write operations on

View File

@@ -270,7 +270,7 @@ lib/paths-installed: lib/paths-common
$(RM) $@-t
cat lib/paths-common > $@-t
echo 'installed_testsuite=1' >> $@-t
echo 'export PATH=@libexecdir@/lvm2-testsuite:@datadir@/lvm2-testsuite/lib:$$PATH' >> $@-t
echo 'export PATH=@libexecdir@/lvm2-testsuite:@datadir@/lvm2-testsuite/lib:@datadir@/lvm2-testsuite/api:$$PATH' >> $@-t
mv $@-t $@
lib/paths: lib/paths-common

View File

@@ -11,6 +11,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SKIP_WITH_LVMPOLLD=1
. lib/inittest
aux prepare_vg 1

View File

@@ -11,6 +11,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SKIP_WITH_LVMPOLLD=1
. lib/inittest
aux prepare_devs 2

View File

@@ -11,6 +11,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SKIP_WITH_LVMPOLLD=1
. lib/inittest
aux kernel_at_least 2 6 33 || skip

View File

@@ -11,8 +11,13 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SKIP_WITH_LVMETAD=1
SKIP_WITH_CLVMD=1
. lib/inittest
aux prepare_dmeventd
#
# TODO:
# lvm2app is not yet capable to respect many lvm.conf options
@@ -25,20 +30,21 @@
# gdb -ex r --args python FULL_PATH/lvm2/test/api/python_lvm_unit.py -v TestLvm.test_lv_active_inactive
#Locate the python binding library to use.
python_lib=$(find $abs_top_builddir -name lvm.so)
# Unable to test python bindings if library not available
test -n "$python_lib" || skip
if [[ -n $abs_top_builddir ]]; then
python_lib=$(find $abs_top_builddir -name lvm.so)
# Unable to test python bindings if library not available
test -n "$python_lib" || skip "lvm2-python-libs not built"
test -e LOCAL_CLVMD && skip
test -e LOCAL_LVMETAD && skip
aux prepare_dmeventd
export PYTHONPATH=$(dirname $python_lib):$PYTHONPATH
elif rpm -q lvm2-python-libs &>/dev/null; then
true
else
skip "lvm2-python-libs neither built nor installed"
fi
#If you change this change the unit test case too.
aux prepare_pvs 6
export PYTHONPATH=$(dirname $python_lib):$PYTHONPATH
#Setup which devices the unit test can use.
export PY_UNIT_PVS=$(cat DEVICES)

View File

@@ -11,6 +11,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest

View File

@@ -9,6 +9,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SKIP_WITH_LVMPOLLD=1
. lib/inittest
aux prepare_vg 2

View File

@@ -82,7 +82,7 @@
#include "configure.h"
/* Timeout for the whole test suite in hours */
static const unsigned TEST_SUITE_TIMEOUT = 4;
static const time_t TEST_SUITE_TIMEOUT = 4;
#ifndef BRICK_SHELLTEST_H
#define BRICK_SHELLTEST_H

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (C) 2011-2012 Red Hat, Inc. All rights reserved.
# Copyright (C) 2011-2015 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
@@ -9,6 +9,11 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
initskip() {
test "$#" -eq 0 || echo "TEST SKIPPED: $@"
exit 200
}
# sanitize the environment
LANG=C
LC_ALL=C
@@ -20,19 +25,22 @@ TESTNAME=${0##*/}
PS4='#${BASH_SOURCE[0]##*/}:${LINENO}+ '
export TESTNAME PS4
unset CDPATH
# grab some common utilities
. lib/utils
if test -n "$LVM_TEST_FLAVOUR"; then
. lib/flavour-$LVM_TEST_FLAVOUR
fi
test -n "$SKIP_WITHOUT_CLVMD" && test "$LVM_TEST_LOCKING" -ne 3 && skip
test -n "$SKIP_WITHOUT_LVMETAD" && test -z "$LVM_TEST_LVMETAD" && skip
test -n "$SKIP_WITH_LVMPOLLD" && test -n "$LVM_TEST_LVMPOLLD" && skip
test -n "$SKIP_WITHOUT_CLVMD" && test "$LVM_TEST_LOCKING" -ne 3 && initskip
test -n "$SKIP_WITH_CLVMD" && test "$LVM_TEST_LOCKING" -eq 3 && initskip
test -n "$SKIP_WITHOUT_LVMETAD" && test -z "$LVM_TEST_LVMETAD" && initskip
test -n "$SKIP_WITH_LVMETAD" && test -n "$LVM_TEST_LVMETAD" && initskip
test -n "$SKIP_WITH_LVMPOLLD" && test -n "$LVM_TEST_LVMPOLLD" && initskip
unset CDPATH
# grab some common utilities
. lib/utils
TESTOLDPWD=$(pwd)
COMMON_PREFIX="LVMTEST"

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
lvm version

View File

@@ -14,9 +14,9 @@
# to improve code coverage
#
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_pvs 5
get_devs

View File

@@ -13,12 +13,12 @@
# test support of thin discards
#
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
#
# Main
#

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_dmeventd

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
flatten() {
cat > flatten.config

View File

@@ -11,9 +11,9 @@
# Basic usage of zero target
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
which md5sum || skip

View File

@@ -10,11 +10,10 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
test_description='Exercise fsadm filesystem resize'
SKIP_WITH_LVMPOLLD=1
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
aux prepare_vg 1 100
# set to "skip" to avoid testing given fs and test warning result

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_vg 3 12

View File

@@ -13,9 +13,9 @@
# tests functionality of lvs, pvs, vgs, *display tools
#
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_devs 5
get_devs

View File

@@ -10,12 +10,11 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
test_description='test some blocking / non-blocking multi-vg operations'
SKIP_WITH_CLVMD=1
SKIP_WITH_LVMPOLLD=1
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
test -e LOCAL_CLVMD && skip
aux prepare_devs 3
pvcreate "$dev1" "$dev2"
vgcreate $vg "$dev1" "$dev2"

View File

@@ -12,9 +12,9 @@
# Test parallel use of lvm commands and check locks aren't dropped
# RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1049296
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
which mkfs.ext3 || skip
which fsck || skip

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux have_cache 1 3 0 || skip
aux prepare_vg 3

View File

@@ -9,13 +9,12 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
# FIXME RESYNC doesn't work in cluster with exclusive activation
# seriously broken!
test -e LOCAL_CLVMD && skip
SKIP_WITH_CLVMD=1
SKIP_WITH_LVMPOLLD=1
. lib/inittest
aux prepare_dmeventd
aux prepare_vg 3

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux have_raid 1 3 2 || skip

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_vg 4

View File

@@ -9,6 +9,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SKIP_WITH_LVMPOLLD=1
. lib/inittest
# Writemostly has been in every version since the begining

View File

@@ -13,8 +13,6 @@ TEST_RAID=raid10
. shell/lvchange-raid.sh
test -e LOCAL_LVMPOLLD && skip
aux have_raid 1 5 2 || skip
run_types raid10 -m 1 -i 2 "$dev1" "$dev2" "$dev3" "$dev4"

View File

@@ -13,8 +13,6 @@ TEST_RAID=raid456
. shell/lvchange-raid.sh
test -e LOCAL_LVMPOLLD && skip
aux raid456_replace_works || skip
aux have_raid 1 5 2 || skip

View File

@@ -11,9 +11,9 @@
# test activation race for raid's --syncaction check
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
# Proper mismatch count 1.5.2+ upstream, 1.3.5 < x < 1.4.0 in RHEL6
aux have_raid 1 3 5 &&

View File

@@ -9,12 +9,12 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
aux have_thin 1 0 0 || skip
aux prepare_pvs 3

View File

@@ -11,9 +11,9 @@
# Exercise usage of stacked cache volume using raid volume
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux have_cache 1 3 0 || skip
aux have_raid 1 0 0 || skip

View File

@@ -11,9 +11,9 @@
# Exercise conversion of cache and cache pool
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux have_cache 1 8 0 || skip

View File

@@ -11,9 +11,9 @@
# Exercise usage of stacked cache volume used in thin pool volumes
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux have_cache 1 3 0 || skip
aux have_thin 1 0 0 || skip

View File

@@ -11,9 +11,9 @@
# Exercise conversion of cache and cache pool
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux have_cache 1 3 0 || skip

View File

@@ -317,7 +317,7 @@ lvremove -ff $vg
# to get synced
lvcreate -l2 -n $lv1 $vg
lvconvert --type mirror -i1 -m1 $vg/$lv1 | tee out
grep -e "$vg/$lv1: Converted:" out || fail "Missing sync info in foreground mode"
grep -e "$vg/$lv1: Converted:" out || die "Missing sync info in foreground mode"
lvremove -ff $vg
vgremove -ff $vg

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux have_raid 1 3 0 || skip

View File

@@ -10,12 +10,13 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# disable lvmetad logging as it bogs down test systems
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
get_image_pvs() {
local d
local images

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
get_image_pvs() {
local d

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
get_image_pvs() {
local d

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
which mkfs.ext2 || skip
aux mirror_recovery_works || skip

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
which mkfs.ext3 || skip
aux have_raid 1 3 0 || skip

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux have_raid 1 3 0 || skip
aux raid456_replace_works || skip

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_vg 5
aux lvmconf 'allocation/maximise_cling = 0' \

View File

@@ -12,9 +12,10 @@
# Test repairing of broken thin pool on raid
SKIP_WITH_LVMPOLLD=1
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
aux have_thin 1 0 0 || skip
aux have_raid 1 4 0 || skip

View File

@@ -12,9 +12,9 @@
# Test repairing of broken thin pool metadata
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
which mkfs.ext2 || skip

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_dmeventd
aux mirror_recovery_works || skip

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux mirror_recovery_works || skip
aux prepare_vg 5

View File

@@ -12,9 +12,9 @@
# Test various supported conversion of snapshot
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_pvs 1

View File

@@ -12,12 +12,12 @@
# Test conversion to thin external origin
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
which mkfs.ext2 || skip
which fsck || skip

View File

@@ -10,12 +10,12 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
aux have_thin 1 0 0 || skip
aux have_raid 1 4 0 || skip

View File

@@ -10,12 +10,12 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
prepare_lvs() {
lvremove -f $vg
lvcreate -L10M -n $lv1 $vg

View File

@@ -11,9 +11,9 @@
# Exercise creation of cache and raids
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux have_cache 1 3 0 || skip
aux have_raid 1 0 0 || skip

View File

@@ -14,9 +14,9 @@
# Full CLI uses --type
# Shorthand CLI uses -H | --cache
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux have_cache 1 3 0 || skip

View File

@@ -11,9 +11,9 @@
# 'Exercise some lvcreate diagnostics'
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
# FIXME update test to make something useful on <16T
aux can_use_16T || skip

View File

@@ -11,13 +11,12 @@
# 'Exercise some lvcreate diagnostics'
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
# FIXME update test to make something useful on <16T
aux can_use_16T || skip
aux have_raid 1 3 0 || skip
aux prepare_vg 5

View File

@@ -11,9 +11,9 @@
# 'Exercise some lvcreate diagnostics'
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
# FIXME update test to make something useful on <16T
aux can_use_16T || skip

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_vg 5 80
aux lvmconf 'allocation/maximise_cling = 0' \

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_vg 2

View File

@@ -11,9 +11,9 @@
# 'Exercise some lvcreate diagnostics'
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
cleanup_lvs() {
lvremove -ff $vg

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_pvs 3
aux lvmconf 'allocation/maximise_cling = 0' \

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
lv_devices() {
test $3 -eq $(get lv_devices $1/$2 | wc -w)

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
lv_devices() {
test $3 -eq $(get lv_devices $1/$2 | wc -w)

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_vg 3

View File

@@ -11,9 +11,9 @@
# 'Exercise signature wiping during lvcreate'
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
init_lv_() {
mkswap "$DM_DEV_DIR/$vg/$lv1"

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_pvs

View File

@@ -9,9 +9,9 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. lib/inittest
SKIP_WITH_LVMPOLLD=1
test -e LOCAL_LVMPOLLD && skip
. lib/inittest
aux prepare_vg 9

View File

@@ -13,12 +13,12 @@
# test currently needs to drop
# 'return NULL' in _lv_create_an_lv after log_error("Can't create %s without using "
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
aux have_thin 1 0 0 || skip
# Test --poolmetadatasize range

View File

@@ -12,12 +12,12 @@
# Test unaligned size of external origin and thin pool chunk size
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
which cmp || skip
#

View File

@@ -12,12 +12,12 @@
# Test creation of thin snapshots using external origin
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
which mkfs.ext2 || skip
which fsck || skip

View File

@@ -13,12 +13,12 @@
# test support for non-power-of-2 thin chunk size
#
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
#
# Main
#

View File

@@ -10,12 +10,12 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
check_lv_field_modules_()
{
mod=$1

View File

@@ -13,12 +13,12 @@
# test currently needs to drop
# 'return NULL' in _lv_create_an_lv after log_error("Can't create %s without using "
SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
. lib/inittest
test -e LOCAL_LVMPOLLD && skip
check_lv_field_modules_()
{
mod=$1

Some files were not shown because too many files have changed in this diff Show More