1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-18 10:04:20 +03:00

active: fix compilation without devmapper

Better support for compilation without device-mapper.
This commit is contained in:
Zdenek Kabelac 2020-09-28 18:56:58 +02:00
parent 4cd356b26b
commit bd0d4de4e2
4 changed files with 40 additions and 37 deletions

View File

@ -185,8 +185,8 @@ void set_activation(int act, int silent)
if (warned || !act) if (warned || !act)
return; return;
log_error("Compiled without libdevmapper support. " log_warn("WARNING: Compiled without libdevmapper support. "
"Can't enable activation."); "Can't enable activation.");
warned = 1; warned = 1;
} }
@ -221,23 +221,13 @@ int lv_info(struct cmd_context *cmd, const struct logical_volume *lv, int use_la
{ {
return 0; return 0;
} }
int lv_info_by_lvid(struct cmd_context *cmd, const char *lvid_s, int use_layer, int lv_info_with_seg_status(struct cmd_context *cmd,
struct lvinfo *info, int with_open_count, int with_read_ahead) const struct lv_segment *lv_seg,
{
return 0;
}
int lv_info_with_seg_status(struct cmd_context *cmd, const struct logical_volume *lv,
const struct lv_segment *lv_seg, int use_layer,
struct lv_with_info_and_seg_status *status, struct lv_with_info_and_seg_status *status,
int with_open_count, int with_read_ahead) int with_open_count, int with_read_ahead)
{ {
return 0; return 0;
} }
int lv_status(struct cmd_context *cmd, const struct lv_segment *lv_seg,
int use_layer, struct lv_seg_status *lv_seg_status)
{
return 0;
}
int lv_cache_status(const struct logical_volume *cache_lv, int lv_cache_status(const struct logical_volume *cache_lv,
struct lv_status_cache **status) struct lv_status_cache **status)
{ {
@ -284,6 +274,10 @@ int lv_raid_message(const struct logical_volume *lv, const char *msg)
{ {
return 0; return 0;
} }
int lv_writecache_message(const struct logical_volume *lv, const char *msg)
{
return 0;
}
int lv_thin_pool_status(const struct logical_volume *lv, int flush, int lv_thin_pool_status(const struct logical_volume *lv, int flush,
struct lv_status_thin_pool **thin_pool_status) struct lv_status_thin_pool **thin_pool_status)
{ {
@ -298,6 +292,15 @@ int lv_thin_device_id(const struct logical_volume *lv, uint32_t *device_id)
{ {
return 0; return 0;
} }
int lv_vdo_pool_status(const struct logical_volume *lv, int flush,
struct lv_status_vdo **vdo_status)
{
return 0;
}
int lv_vdo_pool_percent(const struct logical_volume *lv, dm_percent_t *percent)
{
return 0;
}
int lvs_in_vg_activated(const struct volume_group *vg) int lvs_in_vg_activated(const struct volume_group *vg)
{ {
return 0; return 0;

View File

@ -8010,10 +8010,10 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
return NULL; return NULL;
} }
/* Does LV need to be zeroed? */ /* Does LV need to be zeroed? */
if (lp->zero && !seg_is_thin(lp)) { if (lp->zero) {
log_error("Can't wipe start of new LV without using " log_warn("WARNING: Skipping zeroing and wipping, compiled without activation support.");
"device-mapper kernel driver."); lp->zero = 0;
return NULL; lp->wipe_signatures = 0;
} }
} }

View File

@ -545,8 +545,8 @@ int update_pool_lv(struct logical_volume *lv, int activate)
} }
if (!lv_is_active(lv)) { if (!lv_is_active(lv)) {
(void) init_dmeventd_monitor(monitored); (void) init_dmeventd_monitor(monitored);
log_error("Cannot activate thin pool %s, perhaps skipped in lvm.conf volume_list?", log_error("Cannot activate thin pool %s%s", display_lvname(lv),
display_lvname(lv)); activation() ? ", perhaps skipped in lvm.conf volume_list?" : ".");
return 0; return 0;
} }
} else } else

View File

@ -25,10 +25,6 @@
#include "lib/metadata/metadata.h" #include "lib/metadata/metadata.h"
#include "lib/metadata/lv_alloc.h" #include "lib/metadata/lv_alloc.h"
static int _raid_target_present(struct cmd_context *cmd,
const struct lv_segment *seg __attribute__((unused)),
unsigned *attributes);
static void _raid_display(const struct lv_segment *seg) static void _raid_display(const struct lv_segment *seg)
{ {
unsigned s; unsigned s;
@ -240,6 +236,22 @@ static int _raid_text_export(const struct lv_segment *seg, struct formatter *f)
return _raid_text_export_raid(seg, f); return _raid_text_export_raid(seg, f);
} }
static int _raid_target_status_compatible(const char *type)
{
return (strstr(type, "raid") != NULL);
}
static void _raid_destroy(struct segment_type *segtype)
{
free((void *) segtype->dso);
free(segtype);
}
#ifdef DEVMAPPER_SUPPORT
static int _raid_target_present(struct cmd_context *cmd,
const struct lv_segment *seg __attribute__((unused)),
unsigned *attributes);
static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)), static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
struct dm_pool *mem __attribute__((unused)), struct dm_pool *mem __attribute__((unused)),
struct cmd_context *cmd __attribute__((unused)), struct cmd_context *cmd __attribute__((unused)),
@ -357,18 +369,6 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
return add_areas_line(dm, seg, node, 0u, seg->area_count); return add_areas_line(dm, seg, node, 0u, seg->area_count);
} }
static int _raid_target_status_compatible(const char *type)
{
return (strstr(type, "raid") != NULL);
}
static void _raid_destroy(struct segment_type *segtype)
{
free((void *) segtype->dso);
free(segtype);
}
#ifdef DEVMAPPER_SUPPORT
static int _raid_target_percent(void **target_state, static int _raid_target_percent(void **target_state,
dm_percent_t *percent, dm_percent_t *percent,
struct dm_pool *mem, struct dm_pool *mem,
@ -569,9 +569,9 @@ static struct segtype_handler _raid_ops = {
.text_import_area_count = _raid_text_import_area_count, .text_import_area_count = _raid_text_import_area_count,
.text_import = _raid_text_import, .text_import = _raid_text_import,
.text_export = _raid_text_export, .text_export = _raid_text_export,
.add_target_line = _raid_add_target_line,
.target_status_compatible = _raid_target_status_compatible, .target_status_compatible = _raid_target_status_compatible,
#ifdef DEVMAPPER_SUPPORT #ifdef DEVMAPPER_SUPPORT
.add_target_line = _raid_add_target_line,
.target_percent = _raid_target_percent, .target_percent = _raid_target_percent,
.target_present = _raid_target_present, .target_present = _raid_target_present,
.check_transient_status = _raid_transient_status, .check_transient_status = _raid_transient_status,