Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Connect.xml | 6 ++++++
src/connect.c | 30 ++++++++++++++++++++++++++++++
tests/test_connect.py | 14 ++++++++++++++
3 files changed, 50 insertions(+)
diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml
index f41acd2..d3871b3 100644
--- a/data/org.libvirt.Connect.xml
+++ b/data/org.libvirt.Connect.xml
@@ -308,6 +308,12 @@
<arg name="uuid" type="s" direction="in"/>
<arg name="storagePool" type="o"
direction="out"/>
</method>
+ <method name="StorageVolLookupByKey">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See
https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolLookup...
+ <arg name="key" type="s" direction="in"/>
+ <arg name="storageVol" type="o"
direction="out"/>
+ </method>
<signal name="DomainEvent">
<annotation name="org.gtk.GDBus.DocString"
value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEven...
diff --git a/src/connect.c b/src/connect.c
index 1090e3e..c526808 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -1544,6 +1544,35 @@ virtDBusConnectStoragePoolLookupByUUID(GVariant *inArgs,
*outArgs = g_variant_new("(o)", path);
}
+static void
+virtDBusConnectStorageVolLookupByKey(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(virStorageVol) storageVol = NULL;
+ g_autofree gchar *path = NULL;
+ const gchar *key;
+
+ g_variant_get(inArgs, "(s)", &key);