New version

- Do not try to get object path of NULL in vgreduce (vpodzime)
This commit is contained in:
Vratislav Podzimek 2016-03-09 10:40:07 +01:00
parent 72f6586925
commit 72cd5062ea
2 changed files with 50 additions and 1 deletions

View File

@ -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 <vpodzime@redhat.com> - 1.4-4
- Do not try to get object path of NULL in vgreduce (vpodzime)
* Tue Mar 1 2016 Peter Robinson <pbrobinson@fedoraproject.org> 1.4-3
- Depend on python3-gobject-base not python3-gobject so as to not pull in X components

43
vgreduce_null_pv.patch Normal file
View File

@ -0,0 +1,43 @@
From 8ee82578de78dceaa1bdeb3e757a84ca527df065 Mon Sep 17 00:00:00 2001
From: Vratislav Podzimek <vpodzime@redhat.com>
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 <vpodzime@redhat.com>
---
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