1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-04-30 22:50:45 +03:00

Add --maps to pvdisplay.

Modified original patch from David Robinson <zxvdr.au@gmail.com>.
This commit is contained in:
Dave Wysochanski 2007-05-30 20:43:09 +00:00
parent f224389af3
commit 4baa42be1c
4 changed files with 34 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.26 -
=================================
Add --maps feature to pvdisplay, showing PE to LE mappings.
Fix vgcfgrestore man pg to show mandatory VG name and remove LVM1 options.
Fix vgrename man page to include UUID and be consistent with lvrename.
Add (experimental) OpenAIS support to clvmd.

View File

@ -258,6 +258,36 @@ void pvdisplay_colons(struct physical_volume *pv)
return;
}
void pvdisplay_segments(struct physical_volume *pv)
{
struct pv_segment *seg;
log_print("--- Segments ---");
list_iterate_items(seg, &pv->segments) {
if (seg->len == pv->pe_count)
continue;
log_print("Physical extent %u to %u:",
seg->pe, seg->pe + seg->len - 1);
if (seg->lvseg) {
log_print(" Type\t\t%s",
seg->lvseg->segtype->ops->name(seg->lvseg));
log_print(" Logical volume\t%s%s/%s",
seg->lvseg->lv->vg->cmd->dev_dir,
seg->lvseg->lv->vg->name,
seg->lvseg->lv->name);
log_print(" Logical extents\t%d to %d",
seg->lvseg->le, seg->lvseg->le +
seg->lvseg->len - 1);
} else
log_print(" FREE");
}
log_print(" ");
return;
}
/* FIXME Include label fields */
void pvdisplay_full(struct cmd_context *cmd, struct physical_volume *pv,
void *handle __attribute((unused)))

View File

@ -31,6 +31,7 @@ char *display_uuid(char *uuidstr);
void display_stripe(const struct lv_segment *seg, uint32_t s, const char *pre);
void pvdisplay_colons(struct physical_volume *pv);
void pvdisplay_segments(struct physical_volume *pv);
void pvdisplay_full(struct cmd_context *cmd, struct physical_volume *pv,
void *handle);
int pvdisplay_short(struct cmd_context *cmd, struct volume_group *vg,

View File

@ -71,8 +71,8 @@ static int _pvdisplay_single(struct cmd_context *cmd,
pvdisplay_full(cmd, pv, handle);
if (!arg_count(cmd, maps_ARG))
goto out;
if (arg_count(cmd, maps_ARG))
pvdisplay_segments(pv);
out:
if (pv->vg_name)