From 2dab3c2e8f05101f4147744a6bf0f29fe59920b2 Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones Date: Feb 12 2016 16:06:13 +0000 Subject: Fix failure when disk contains LV with activationskip=yes Upstream commit 2e16e3e99 (RHBZ#1306666). --- diff --git a/0001-daemon-lvm-Ignore-LVs-with-the-activationskip-flag-s.patch b/0001-daemon-lvm-Ignore-LVs-with-the-activationskip-flag-s.patch new file mode 100644 index 0000000..4363650 --- /dev/null +++ b/0001-daemon-lvm-Ignore-LVs-with-the-activationskip-flag-s.patch @@ -0,0 +1,42 @@ +From 2e16e3e99324112845446c82b6a6e8b3e652e10d Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 12 Feb 2016 13:41:26 +0000 +Subject: [PATCH] daemon: lvm: Ignore LVs with the activationskip flag set + (RHBZ#1306666). + +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) { +-- +2.5.0 + diff --git a/libguestfs.spec b/libguestfs.spec index 07b329a..dc4739c 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -14,13 +14,16 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 Version: 1.32.2 -Release: 1%{?dist} +Release: 2%{?dist} License: LGPLv2+ # Source and patches. URL: http://libguestfs.org/ Source0: http://libguestfs.org/download/1.32-stable/%{name}-%{version}.tar.gz +# Upstream commit 2e16e3e99 for RHBZ#1306666. +Patch1: 0001-daemon-lvm-Ignore-LVs-with-the-activationskip-flag-s.patch + # Basic build requirements: BuildRequires: perl(Pod::Simple) BuildRequires: perl(Pod::Man) @@ -1314,6 +1317,10 @@ rm ocaml/html/.gitignore %changelog +* Fri Feb 12 2016 Richard W.M. Jones - 1:1.32.2-2 +- Fix failure when disk contains LV with activationskip=yes + Upstream commit 2e16e3e99 (RHBZ#1306666). + * Fri Jan 29 2016 Richard W.M. Jones - 1:1.32.2-1 - New upstream version 1.32.2.