diff --git a/daemon/lvm.c b/daemon/lvm.c index 093e68258..d3892fe77 100644 --- a/daemon/lvm.c +++ b/daemon/lvm.c @@ -863,9 +863,11 @@ lv_canonical (const char *device, char **ret) /* Test if a device is a logical volume (RHBZ#619793). */ int -do_is_lv (const char *device) +do_is_lv (const mountable_t *mountable) { - return lv_canonical (device, NULL); + if (mountable->type != MOUNTABLE_DEVICE) + return 0; + return lv_canonical (mountable->device, NULL); } /* Return canonical name of LV to caller (RHBZ#638899). */ diff --git a/generator/actions.ml b/generator/actions.ml index 78d0a7359..25108a2cd 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -9103,7 +9103,7 @@ I keys." }; { defaults with name = "is_lv"; added = (1, 5, 3); - style = RBool "lvflag", [Device "device"], []; + style = RBool "lvflag", [Mountable "mountable"], []; proc_nr = Some 264; tests = [ InitBasicFSonLVM, Always, TestResultTrue ( @@ -9111,9 +9111,9 @@ I keys." }; InitBasicFSonLVM, Always, TestResultFalse ( [["is_lv"; "/dev/sda1"]]), [] ]; - shortdesc = "test if device is a logical volume"; + shortdesc = "test if mountable is a logical volume"; longdesc = "\ -This command tests whether C is a logical volume, and +This command tests whether C is a logical volume, and returns true iff this is the case." }; { defaults with