f35c182
From df13becf4eaaa541ba56f0a30dd31a54d7b00e9c Mon Sep 17 00:00:00 2001
f35c182
From: Vratislav Podzimek <vpodzime@redhat.com>
f35c182
Date: Thu, 15 Sep 2016 14:56:10 +0200
f35c182
Subject: [PATCH] Make sure all object paths are passed and extracted as such
f35c182
f35c182
The type signature for a DBus object path is "o". Now that the LVM DBus API
f35c182
properly sets types of its accepted and returned values, we can finally safely
f35c182
use the signature in all expected places.
f35c182
f35c182
(cherry picked from commit e8117786aad76773d96b9a8d977e53077535b9bc)
f35c182
Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com>
f35c182
---
f35c182
 src/plugins/lvm-dbus.c | 14 +++++++-------
f35c182
 1 file changed, 7 insertions(+), 7 deletions(-)
f35c182
f35c182
diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c
f35c182
index 9500dcb..1276548 100644
f35c182
--- a/src/plugins/lvm-dbus.c
f35c182
+++ b/src/plugins/lvm-dbus.c
f35c182
@@ -711,7 +711,7 @@ static BDLVMPVdata* get_pv_data_from_props (GVariant *props, GError **error) {
f35c182
     g_variant_dict_lookup (&dict, "PeStart", "t", &(data->pe_start));
f35c182
 
f35c182
     /* returns an object path for the VG */
f35c182
-    g_variant_dict_lookup (&dict, "Vg", "s", &value);
f35c182
+    g_variant_dict_lookup (&dict, "Vg", "o", &value);
f35c182
     if (g_strcmp0 (value, "/") == 0) {
f35c182
         /* no VG, the PV is not part of any VG */
f35c182
         g_variant_dict_clear (&dict);
f35c182
@@ -1152,10 +1152,10 @@ gboolean bd_lvm_pvmove (gchar *src, gchar *dest, GError **error) {
f35c182
         g_free (src_path);
f35c182
         return FALSE;
f35c182
     }
f35c182
-    g_variant_get (prop, "s", &vg_obj_path);
f35c182
+    g_variant_get (prop, "o", &vg_obj_path);
f35c182
 
f35c182
     g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
f35c182
-    g_variant_builder_add_value (&builder, g_variant_new ("s", src_path));
f35c182
+    g_variant_builder_add_value (&builder, g_variant_new ("o", src_path));
f35c182
     g_variant_builder_add_value (&builder, g_variant_new ("(tt)", (guint64) 0, (guint64) 0));
f35c182
     if (dest) {
f35c182
         dest_var = g_variant_new ("(ott)", dest_path, (guint64) 0, (guint64) 0);
f35c182
@@ -2367,7 +2367,7 @@ gboolean bd_lvm_cache_attach (gchar *vg_name, gchar *data_lv, gchar *cache_pool_
f35c182
     if (!lv_obj_path)
f35c182
         return FALSE;
f35c182
     g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
f35c182
-    g_variant_builder_add_value (&builder, g_variant_new ("s", lv_obj_path));
f35c182
+    g_variant_builder_add_value (&builder, g_variant_new ("o", lv_obj_path));
f35c182
     params = g_variant_builder_end (&builder);
f35c182
     g_variant_builder_clear (&builder);
f35c182
 
f35c182
@@ -2476,7 +2476,7 @@ gchar* bd_lvm_cache_pool_name (gchar *vg_name, gchar *cached_lv, GError **error)
f35c182
     g_free (lv_spec);
f35c182
     if (!prop)
f35c182
         return NULL;
f35c182
-    g_variant_get (prop, "s", &pool_obj_path);
f35c182
+    g_variant_get (prop, "o", &pool_obj_path);
f35c182
     prop = get_object_property (pool_obj_path, LV_CMN_INTF, "Name", error);
f35c182
     g_free (pool_obj_path);
f35c182
     if (!prop)
f35c182
@@ -2650,7 +2650,7 @@ gchar* bd_lvm_data_lv_name (gchar *vg_name, gchar *lv_name, GError **error) {
f35c182
         g_clear_error (error);
f35c182
         return NULL;
f35c182
     }
f35c182
-    g_variant_get (prop, "s", &obj_path);
f35c182
+    g_variant_get (prop, "o", &obj_path);
f35c182
     g_variant_unref (prop);
f35c182
 
f35c182
     if (g_strcmp0 (obj_path, "/") == 0) {
f35c182
@@ -2699,7 +2699,7 @@ gchar* bd_lvm_metadata_lv_name (gchar *vg_name, gchar *lv_name, GError **error)
f35c182
         g_clear_error (error);
f35c182
         return NULL;
f35c182
     }
f35c182
-    g_variant_get (prop, "s", &obj_path);
f35c182
+    g_variant_get (prop, "o", &obj_path);
f35c182
     g_variant_unref (prop);
f35c182
 
f35c182
     if (g_strcmp0 (obj_path, "/") == 0) {
f35c182
-- 
f35c182
2.7.4
f35c182