1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

dev_manager: only support status for cache segment at the moment

When getting status for LV segment types, we need to be sure
that proper segment is selected for the status ioctl.

When reporting fields that require status ioctl,
the "_choose_lv_segment_for_status_report" fn in tools/reporter.c
must be completed properly to choose the proper segment for all
the LV types (at the moment, it just takes the first LV segment
by default).

This works fine with cache LVs surely. The other segment types
need more auditing. We use this status ioctl only for cache status
fields at the moment only, so restrict it to the cache only.

Once the _choose_lv_segment_for_status_report is completed
properly, release the restriction in _get_segment_status_from_target_params.
This commit is contained in:
Peter Rajnoha 2014-11-11 14:55:58 +01:00
parent 8121074fda
commit 9704515c1e

View File

@ -112,10 +112,14 @@ static int _get_segment_status_from_target_params(const char *target_name,
{
struct segment_type *segtype;
/* FIXME: linear is also represented as striped with stripe count 1.
We're not reporting linear or striped status anyway, so
just skip the error here till this is properly resolved.*/
if (!strcmp(target_name, "linear") || !strcmp(target_name, "striped"))
/*
* TODO: Add support for other segment types too!
* The segment to report status for must be properly
* selected for all the other types - mainly make sure
* linear/striped, old snapshots and raids have proper
* segment selected for status!
*/
if (strcmp(target_name, "cache"))
return 1;
segtype = get_segtype_from_string(seg_status->seg->lv->vg->cmd, target_name);