[libvirt] [dbus PATCH 2/9] Add Domain prefix to CreateXML method, test and related functions.

Katerina Koukiou kkoukiou at redhat.com
Fri Apr 6 11:20:27 UTC 2018


This method is domain specific and should be clear from the naming,
so that we can later define *CreateXML methods for other entities.

Signed-off-by: Katerina Koukiou <kkoukiou at redhat.com>
---
 data/org.libvirt.Connect.xml |  2 +-
 src/connect.c                | 16 ++++++++--------
 test/test_connect.py         |  4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml
index 6aa07f6..c29076d 100644
--- a/data/org.libvirt.Connect.xml
+++ b/data/org.libvirt.Connect.xml
@@ -13,7 +13,7 @@
       <arg name="flags" type="u" direction="in"/>
       <arg name="domains" type="ao" direction="out"/>
     </method>
-    <method name="CreateXML">
+    <method name="DomainCreateXML">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateXML"/>
       <arg name="xml" type="s" direction="in"/>
diff --git a/src/connect.c b/src/connect.c
index 85c85ee..3715d25 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -150,13 +150,13 @@ virtDBusConnectListDomains(GVariant *inArgs,
 }
 
 static void
-virtDBusConnectCreateXML(GVariant *inArgs,
-                         GUnixFDList *inFDs G_GNUC_UNUSED,
-                         const gchar *objectPath G_GNUC_UNUSED,
-                         gpointer userData,
-                         GVariant **outArgs,
-                         GUnixFDList **outFDs G_GNUC_UNUSED,
-                         GError **error)
+virtDBusConnectDomainCreateXML(GVariant *inArgs,
+                               GUnixFDList *inFDs G_GNUC_UNUSED,
+                               const gchar *objectPath G_GNUC_UNUSED,
+                               gpointer userData,
+                               GVariant **outArgs,
+                               GUnixFDList **outFDs G_GNUC_UNUSED,
+                               GError **error)
 {
     virtDBusConnect *connect = userData;
     g_autoptr(virDomain) domain = NULL;
@@ -393,7 +393,7 @@ static virtDBusGDBusPropertyTable virtDBusConnectPropertyTable[] = {
 
 static virtDBusGDBusMethodTable virtDBusConnectMethodTable[] = {
     { "ListDomains", virtDBusConnectListDomains },
-    { "CreateXML", virtDBusConnectCreateXML },
+    { "DomainCreateXML", virtDBusConnectDomainCreateXML },
     { "DefineXML", virtDBusConnectDefineXML },
     { "DomainLookupByID", virtDBusDomainLookupByID },
     { "DomainLookupByName", virtDBusDomainLookupByName },
diff --git a/test/test_connect.py b/test/test_connect.py
index 5436a29..2b2031d 100755
--- a/test/test_connect.py
+++ b/test/test_connect.py
@@ -28,14 +28,14 @@ class TestConnect(libvirttest.BaseTestClass):
             # ensure the path exists by calling Introspect on it
             domain.Introspect(dbus_interface=dbus.INTROSPECTABLE_IFACE)
 
-    def test_create(self):
+    def test_connect_domain_create_xml(self):
         def domain_started(path, _event):
             assert isinstance(path, dbus.ObjectPath)
             self.loop.quit()
 
         self.connect.connect_to_signal('DomainEvent', domain_started, arg1='Started')
 
-        path = self.connect.CreateXML(self.minimal_domain_xml, 0)
+        path = self.connect.DomainCreateXML(self.minimal_domain_xml, 0)
         assert isinstance(path, dbus.ObjectPath)
 
         self.main_loop()
-- 
2.15.0




More information about the libvir-list mailing list