]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus: Fix standard method argument names
authorMiika Karanki <miika.karanki@vaisala.com>
Tue, 23 Nov 2021 15:23:01 +0000 (17:23 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 23 Nov 2021 18:46:56 +0000 (19:46 +0100)
The argument names of methods under org.freedesktop.DBus.Properties and
org.freedesktop.DBus.Introspectable interfaces are specifies in D-Bus
specification[1]. They are:

  org.freedesktop.DBus.Introspectable.Introspect (out STRING xml_data)
  org.freedesktop.DBus.Properties.Get (in STRING interface_name,
                                       in STRING property_name,
                                       out VARIANT value);
  org.freedesktop.DBus.Properties.Set (in STRING interface_name,
                                       in STRING property_name,
                                       in VARIANT value);
  org.freedesktop.DBus.Properties.GetAll (in STRING interface_name,
                                          out DICT<STRING,VARIANT> props);

sd-bus is using different argument names in the introspection document.
Usually this is not a problem but in case something tries to map the
argument names based on the introspection document to the position of
the arguments in the method call, then using names different than the
ones specified in the D-Bus specification is confusing.

So fix the names to match the D-Bus specification.

[1] https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-introspectable

man/vtable-example.xml
src/libsystemd/sd-bus/bus-introspect.c

index dc5fac4f26744007b69ec93b17b486bd84a42dd4..891b375a4b24b799efffce2360c8b0df8ec35d43 100644 (file)
  </interface>
  <interface name="org.freedesktop.DBus.Introspectable">
   <method name="Introspect">
-   <arg name="data" type="s" direction="out"/>
+   <arg name="xml_data" type="s" direction="out"/>
   </method>
  </interface>
  <interface name="org.freedesktop.DBus.Properties">
   <method name="Get">
-   <arg name="interface" direction="in" type="s"/>
-   <arg name="property" direction="in" type="s"/>
+   <arg name="interface_name" direction="in" type="s"/>
+   <arg name="property_name" direction="in" type="s"/>
    <arg name="value" direction="out" type="v"/>
   </method>
   <method name="GetAll">
-   <arg name="interface" direction="in" type="s"/>
-   <arg name="properties" direction="out" type="a{sv}"/>
+   <arg name="interface_name" direction="in" type="s"/>
+   <arg name="props" direction="out" type="a{sv}"/>
   </method>
   <method name="Set">
-   <arg name="interface" direction="in" type="s"/>
-   <arg name="property" direction="in" type="s"/>
+   <arg name="interface_name" direction="in" type="s"/>
+   <arg name="property_name" direction="in" type="s"/>
    <arg name="value" direction="in" type="v"/>
   </method>
   <signal name="PropertiesChanged">
-   <arg type="s" name="interface"/>
+   <arg type="s" name="interface_name"/>
    <arg type="a{sv}" name="changed_properties"/>
    <arg type="as" name="invalidated_properties"/>
   </signal>
index 866fca7acb822855e2a2d166b09289bc92961ad9..b9ef6af631cb7298983b9c9a6a8c30581453edeb 100644 (file)
 #define BUS_INTROSPECT_INTERFACE_INTROSPECTABLE                      \
         " <interface name=\"org.freedesktop.DBus.Introspectable\">\n"   \
         "  <method name=\"Introspect\">\n"                              \
-        "   <arg name=\"data\" type=\"s\" direction=\"out\"/>\n"        \
+        "   <arg name=\"xml_data\" type=\"s\" direction=\"out\"/>\n"    \
         "  </method>\n"                                                 \
         " </interface>\n"
 
 #define BUS_INTROSPECT_INTERFACE_PROPERTIES                          \
         " <interface name=\"org.freedesktop.DBus.Properties\">\n"       \
         "  <method name=\"Get\">\n"                                     \
-        "   <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n"    \
-        "   <arg name=\"property\" direction=\"in\" type=\"s\"/>\n"     \
+        "   <arg name=\"interface_name\" direction=\"in\" type=\"s\"/>\n" \
+        "   <arg name=\"property_name\" direction=\"in\" type=\"s\"/>\n" \
         "   <arg name=\"value\" direction=\"out\" type=\"v\"/>\n"       \
         "  </method>\n"                                                 \
         "  <method name=\"GetAll\">\n"                                  \
-        "   <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n"    \
-        "   <arg name=\"properties\" direction=\"out\" type=\"a{sv}\"/>\n" \
+        "   <arg name=\"interface_name\" direction=\"in\" type=\"s\"/>\n" \
+        "   <arg name=\"props\" direction=\"out\" type=\"a{sv}\"/>\n"   \
         "  </method>\n"                                                 \
         "  <method name=\"Set\">\n"                                     \
-        "   <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n"    \
-        "   <arg name=\"property\" direction=\"in\" type=\"s\"/>\n"     \
+        "   <arg name=\"interface_name\" direction=\"in\" type=\"s\"/>\n" \
+        "   <arg name=\"property_name\" direction=\"in\" type=\"s\"/>\n" \
         "   <arg name=\"value\" direction=\"in\" type=\"v\"/>\n"        \
         "  </method>\n"                                                 \
         "  <signal name=\"PropertiesChanged\">\n"                       \
-        "   <arg type=\"s\" name=\"interface\"/>\n"                     \
+        "   <arg type=\"s\" name=\"interface_name\"/>\n"                \
         "   <arg type=\"a{sv}\" name=\"changed_properties\"/>\n"        \
         "   <arg type=\"as\" name=\"invalidated_properties\"/>\n"       \
         "  </signal>\n"                                                 \