[Libguestfs] [PATCH] daemon: lvm: Ignore LVs with the activationskip flag set (RHBZ#1306666).
Pino Toscano
ptoscano at redhat.com
Fri Feb 12 14:33:51 UTC 2016
On Friday 12 February 2016 13:44:19 Richard W.M. Jones wrote:
> When listing logical volumes, ignore the ones which don't get
> activated automatically. No /dev/VG/LV device node is created for
> these ones which confuses APIs that attempt to do 'guestfs_lvs'
> followed by opening the device node. Note that 'guestfs_lvs_full' is
> unaffected by this change.
> ---
> daemon/lvm.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/daemon/lvm.c b/daemon/lvm.c
> index 8bef4d5..529e20d 100644
> --- a/daemon/lvm.c
> +++ b/daemon/lvm.c
> @@ -157,6 +157,10 @@ filter_convert_old_lvs_output (char *out)
> if (lv_attr[0] == 't')
> goto skip_line;
>
> + /* Ignore activationskip (RHBZ#1306666). */
> + if (strlen (lv_attr) >= 10 && lv_attr[9] == 'k')
> + goto skip_line;
> +
> /* Ignore "unknown device" message (RHBZ#1054761). */
> if (STRNEQ (p, "unknown device")) {
> char buf[256];
> @@ -260,7 +264,7 @@ do_lvs (void)
> r = command (&out, &err,
> str_lvm, "lvs",
> "-o", "vg_name,lv_name",
> - "-S", "lv_role=public",
> + "-S", "lv_role=public && lv_active=active",
> "--noheadings",
> "--separator", "/", NULL);
> if (r == -1) {
LGTM.
Thanks,
--
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20160212/258c52cd/attachment.sig>
More information about the Libguestfs
mailing list