diff --git a/libblockdev.spec b/libblockdev.spec index 87edf8c..4ea6469 100644 --- a/libblockdev.spec +++ b/libblockdev.spec @@ -1,11 +1,13 @@ Name: libblockdev Version: 1.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A library for low-level manipulation with block devices License: LGPLv2+ URL: https://github.com/rhinstaller/libblockdev Source0: https://github.com/rhinstaller/libblockdev/archive/%{name}-%{version}.tar.gz +Patch0: vgreduce_null_pv.patch + BuildRequires: glib2-devel BuildRequires: gobject-introspection-devel BuildRequires: cryptsetup-devel @@ -329,6 +331,7 @@ A meta-package that pulls all the libblockdev plugins as dependencies. %prep %setup -q -n %{name}-%{version} +%patch0 -p1 %build %configure @@ -504,6 +507,9 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm} %files plugins-all %changelog +* Wed Mar 9 2016 Vratislav Podzimek - 1.4-4 +- Do not try to get object path of NULL in vgreduce (vpodzime) + * Tue Mar 1 2016 Peter Robinson 1.4-3 - Depend on python3-gobject-base not python3-gobject so as to not pull in X components diff --git a/vgreduce_null_pv.patch b/vgreduce_null_pv.patch new file mode 100644 index 0000000..1ed4db3 --- /dev/null +++ b/vgreduce_null_pv.patch @@ -0,0 +1,43 @@ +From 8ee82578de78dceaa1bdeb3e757a84ca527df065 Mon Sep 17 00:00:00 2001 +From: Vratislav Podzimek +Date: Wed, 9 Mar 2016 10:33:47 +0100 +Subject: [PATCH] Do not try to get object path of NULL in vgreduce + +If no PV is given, we shouldn't try to get its object path. + +Signed-off-by: Vratislav Podzimek +--- + src/plugins/lvm-dbus.c | 10 ++++++---- + tests/lvm_dbus_tests.py | 4 ++++ + tests/lvm_test.py | 4 ++++ + 3 files changed, 14 insertions(+), 4 deletions(-) + +diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c +index a8e5231..a508b3f 100644 +--- a/src/plugins/lvm-dbus.c ++++ b/src/plugins/lvm-dbus.c +@@ -1364,14 +1364,16 @@ gboolean bd_lvm_vgreduce (gchar *vg_name, gchar *device, GError **error) { + GVariant *params = NULL; + GVariant *extra = NULL; + +- pv = get_object_path (device, error); +- if (!pv) +- return FALSE; ++ if (device) { ++ pv = get_object_path (device, error); ++ if (!pv) ++ return FALSE; ++ } + +- pv_var = g_variant_new ("o", pv); + g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE); + if (device) { + /* do not remove missing */ ++ pv_var = g_variant_new ("o", pv); + g_variant_builder_add_value (&builder, g_variant_new_boolean (FALSE)); + g_variant_builder_add_value (&builder, g_variant_new_array (NULL, &pv_var, 1)); + params = g_variant_builder_end (&builder); + +-- +2.5.0 +