All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Hide merging snapshots from "lvs" command.
@ 2009-10-01 21:26 Mike Snitzer
  2010-02-17 15:51 ` Petr Rockai
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Snitzer @ 2009-10-01 21:26 UTC (permalink / raw)
  To: lvm-devel

Hide merging snapshots from "lvs" command. The prefix "snapshot" is reserved
and names with this prefix cannot be created by the user, so this change is
safe.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>

---
 tools/toollib.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: lvm2/tools/toollib.c
===================================================================
--- lvm2.orig/tools/toollib.c
+++ lvm2/tools/toollib.c
@@ -119,7 +119,8 @@ int process_each_lv_in_vg(struct cmd_con
 	}
 
 	dm_list_iterate_items(lvl, &vg->lvs) {
-		if (lvl->lv->status & SNAPSHOT)
+		/* Names starting with "snapshot" are reserved */
+		if (!strncmp(lvl->lv->name, "snapshot", strlen("snapshot")))
 			continue;
 
 		if (lv_is_virtual_origin(lvl->lv) && !arg_count(cmd, all_ARG))



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Hide merging snapshots from "lvs" command.
  2009-10-01 21:26 [PATCH] Hide merging snapshots from "lvs" command Mike Snitzer
@ 2010-02-17 15:51 ` Petr Rockai
  2010-02-17 16:26   ` Mike Snitzer
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Rockai @ 2010-02-17 15:51 UTC (permalink / raw)
  To: lvm-devel

Hi,

Mike Snitzer <snitzer@redhat.com> writes:
> Hide merging snapshots from "lvs" command. The prefix "snapshot" is reserved
> and names with this prefix cannot be created by the user, so this change is
> safe.
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Reviewed-by: Mike Snitzer <snitzer@redhat.com>
>
> ---
>  tools/toollib.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> Index: lvm2/tools/toollib.c
> ===================================================================
> --- lvm2.orig/tools/toollib.c
> +++ lvm2/tools/toollib.c
> @@ -119,7 +119,8 @@ int process_each_lv_in_vg(struct cmd_con
>  	}
>  
>  	dm_list_iterate_items(lvl, &vg->lvs) {
> -		if (lvl->lv->status & SNAPSHOT)
> +		/* Names starting with "snapshot" are reserved */
> +		if (!strncmp(lvl->lv->name, "snapshot", strlen("snapshot")))
>  			continue;
>  
>  		if (lv_is_virtual_origin(lvl->lv) && !arg_count(cmd, all_ARG))

This seems to have fallen through the cracks. Please check in if still
relevant (the patch is not present in current CVS as far as I can tell).

Yours,
   Petr.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Hide merging snapshots from "lvs" command.
  2010-02-17 15:51 ` Petr Rockai
@ 2010-02-17 16:26   ` Mike Snitzer
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Snitzer @ 2010-02-17 16:26 UTC (permalink / raw)
  To: lvm-devel

On Wed, Feb 17 2010 at 10:51am -0500,
Petr Rockai <prockai@redhat.com> wrote:

> Hi,
> 
> Mike Snitzer <snitzer@redhat.com> writes:
> > Hide merging snapshots from "lvs" command. The prefix "snapshot" is reserved
> > and names with this prefix cannot be created by the user, so this change is
> > safe.
> >
> > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> > Reviewed-by: Mike Snitzer <snitzer@redhat.com>
> >
> > ---
> >  tools/toollib.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > Index: lvm2/tools/toollib.c
> > ===================================================================
> > --- lvm2.orig/tools/toollib.c
> > +++ lvm2/tools/toollib.c
> > @@ -119,7 +119,8 @@ int process_each_lv_in_vg(struct cmd_con
> >  	}
> >  
> >  	dm_list_iterate_items(lvl, &vg->lvs) {
> > -		if (lvl->lv->status & SNAPSHOT)
> > +		/* Names starting with "snapshot" are reserved */
> > +		if (!strncmp(lvl->lv->name, "snapshot", strlen("snapshot")))
> >  			continue;
> >  
> >  		if (lv_is_virtual_origin(lvl->lv) && !arg_count(cmd, all_ARG))
> 
> This seems to have fallen through the cracks. Please check in if still
> relevant (the patch is not present in current CVS as far as I can tell).

It isn't needed, I eliminated the rename of the merging snapshot LV name
to 'snapshotX' as it proved unnecessary/undesirable.

The merging snapshot is hidden (!lv_is_visible()); lvs -a will display
it though:

# lvconvert -b --merge test/testlv1_snap
  Merging of volume testlv1_snap started.
# lvs
  LV      VG   Attr   LSize Origin Snap%  Move Log Copy%  Convert
  testlv1 test Owi-a- 4.00g         13.37                        
# lvs -a
  LV             VG   Attr   LSize Origin  Snap%  Move Log Copy%
  Convert
  testlv1        test Owi-a- 4.00g          10.59                        
  [testlv1_snap] test Swi--- 1.00g testlv1                               

Thanks for following up though!

Mike



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-17 16:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01 21:26 [PATCH] Hide merging snapshots from "lvs" command Mike Snitzer
2010-02-17 15:51 ` Petr Rockai
2010-02-17 16:26   ` Mike Snitzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.