New version
- Explicitly cast number constants for GVariants (vpodzime)
This commit is contained in:
parent
626044f659
commit
eb29bb48f7
87
cast_numbers.patch
Normal file
87
cast_numbers.patch
Normal file
@ -0,0 +1,87 @@
|
||||
From 5e4095722244d989a6a594a933c314a633c4bfd2 Mon Sep 17 00:00:00 2001
|
||||
From: Vratislav Podzimek <vpodzime@redhat.com>
|
||||
Date: Thu, 25 Aug 2016 16:26:28 +0200
|
||||
Subject: [PATCH] Explicitly cast number constants for GVariants
|
||||
|
||||
Otherwise they may become really weird numbers.
|
||||
|
||||
(cherry-picked from commit 4222a693a1b709aa8a243b6eeda376eb9d79d56a)
|
||||
|
||||
Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com>
|
||||
---
|
||||
src/plugins/lvm-dbus.c | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c
|
||||
index 8303fe1..844e36e 100644
|
||||
--- a/src/plugins/lvm-dbus.c
|
||||
+++ b/src/plugins/lvm-dbus.c
|
||||
@@ -1156,9 +1156,9 @@ gboolean bd_lvm_pvmove (gchar *src, gchar *dest, GError **error) {
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
|
||||
g_variant_builder_add_value (&builder, g_variant_new ("s", src_path));
|
||||
- g_variant_builder_add_value (&builder, g_variant_new ("(tt)", 0, 0));
|
||||
+ g_variant_builder_add_value (&builder, g_variant_new ("(tt)", (guint64) 0, (guint64) 0));
|
||||
if (dest) {
|
||||
- dest_var = g_variant_new ("(ott)", dest_path, 0, 0);
|
||||
+ dest_var = g_variant_new ("(ott)", dest_path, (guint64) 0, (guint64) 0);
|
||||
g_variant_builder_add_value (&builder, g_variant_new_array (NULL, &dest_var, 1));
|
||||
} else {
|
||||
type = g_variant_type_new ("a(ott)");
|
||||
@@ -1372,7 +1372,7 @@ gboolean bd_lvm_vgrename (gchar *old_vg_name, gchar *new_vg_name, GError **error
|
||||
* Returns: whether the VG was successfully activated or not
|
||||
*/
|
||||
gboolean bd_lvm_vgactivate (gchar *vg_name, GError **error) {
|
||||
- GVariant *params = g_variant_new ("(t)", 0);
|
||||
+ GVariant *params = g_variant_new ("(t)", (guint64) 0);
|
||||
call_lvm_obj_method_sync (vg_name, VG_INTF, "Activate", params, NULL, error);
|
||||
return ((*error) == NULL);
|
||||
}
|
||||
@@ -1385,7 +1385,7 @@ gboolean bd_lvm_vgactivate (gchar *vg_name, GError **error) {
|
||||
* Returns: whether the VG was successfully deactivated or not
|
||||
*/
|
||||
gboolean bd_lvm_vgdeactivate (gchar *vg_name, GError **error) {
|
||||
- GVariant *params = g_variant_new ("(t)", 0);
|
||||
+ GVariant *params = g_variant_new ("(t)", (guint64) 0);
|
||||
call_lvm_obj_method_sync (vg_name, VG_INTF, "Deactivate", params, NULL, error);
|
||||
return ((*error) == NULL);
|
||||
}
|
||||
@@ -1609,7 +1609,7 @@ gboolean bd_lvm_lvcreate (gchar *vg_name, gchar *lv_name, guint64 size, gchar *t
|
||||
g_variant_builder_clear (&builder);
|
||||
return FALSE;
|
||||
}
|
||||
- g_variant_builder_add_value (&builder, g_variant_new ("(ott)", path, 0, 0));
|
||||
+ g_variant_builder_add_value (&builder, g_variant_new ("(ott)", path, (guint64) 0, (guint64) 0));
|
||||
}
|
||||
pvs = g_variant_builder_end (&builder);
|
||||
g_variant_builder_clear (&builder);
|
||||
@@ -1723,7 +1723,7 @@ gboolean bd_lvm_lvresize (gchar *vg_name, gchar *lv_name, guint64 size, GError *
|
||||
* Returns: whether the @vg_name/@lv_name LV was successfully activated or not
|
||||
*/
|
||||
gboolean bd_lvm_lvactivate (gchar *vg_name, gchar *lv_name, gboolean ignore_skip, GError **error) {
|
||||
- GVariant *params = g_variant_new ("(t)", 0);
|
||||
+ GVariant *params = g_variant_new ("(t)", (guint64) 0);
|
||||
GVariantBuilder builder;
|
||||
GVariant *extra = NULL;
|
||||
|
||||
@@ -1747,7 +1747,7 @@ gboolean bd_lvm_lvactivate (gchar *vg_name, gchar *lv_name, gboolean ignore_skip
|
||||
* Returns: whether the @vg_name/@lv_name LV was successfully deactivated or not
|
||||
*/
|
||||
gboolean bd_lvm_lvdeactivate (gchar *vg_name, gchar *lv_name, GError **error) {
|
||||
- GVariant *params = g_variant_new ("(t)", 0);
|
||||
+ GVariant *params = g_variant_new ("(t)", (guint64) 0);
|
||||
call_lv_method_sync (vg_name, lv_name, "Deactivate", params, NULL, error);
|
||||
return (*error == NULL);
|
||||
}
|
||||
@@ -2109,7 +2109,7 @@ gboolean bd_lvm_thsnapshotcreate (gchar *vg_name, gchar *origin_name, gchar *sna
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
|
||||
g_variant_builder_add_value (&builder, g_variant_new ("s", snapshot_name));
|
||||
- g_variant_builder_add_value (&builder, g_variant_new ("t", 0));
|
||||
+ g_variant_builder_add_value (&builder, g_variant_new ("t", (guint64) 0));
|
||||
params = g_variant_builder_end (&builder);
|
||||
g_variant_builder_clear (&builder);
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,11 +1,13 @@
|
||||
Name: libblockdev
|
||||
Version: 1.9
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?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: cast_numbers.patch
|
||||
|
||||
BuildRequires: glib2-devel
|
||||
BuildRequires: gobject-introspection-devel
|
||||
BuildRequires: cryptsetup-devel
|
||||
@ -375,6 +377,7 @@ A meta-package that pulls all the libblockdev plugins as dependencies.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
%configure
|
||||
@ -572,6 +575,9 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
|
||||
%files plugins-all
|
||||
|
||||
%changelog
|
||||
* Mon Aug 29 2016 Vratislav Podzimek <vpodzime@redhat.com> - 1.9-2
|
||||
- Explicitly cast number constants for GVariants (vpodzime)
|
||||
|
||||
* Wed Jul 27 2016 Vratislav Podzimek <vpodzime@redhat.com> - 1.9-1
|
||||
- Add functions for creating thin/cache pools from existing LVs (vpodzime)
|
||||
- Add the new mpath_get_members() function to the docs (vpodzime)
|
||||
|
Loading…
Reference in New Issue
Block a user