Commit ea3f1311 authored by Katerina Koukiou's avatar Katerina Koukiou

Implement NWFilterLookupByUUID method for Connect Interface

Signed-off-by: default avatarKaterina Koukiou <kkoukiou@redhat.com>
Reviewed-by: Jano Tomko's avatarJán Tomko <jtomko@redhat.com>
parent 76f16c85
......@@ -214,6 +214,12 @@
<arg name="name" type="s" direction="in"/>
<arg name="nwfilter" type="o" direction="out"/>
</method>
<method name="NWFilterLookupByUUID">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-nwfilter.html#virNWFilterLookupByUUIDString"/>
<arg name="uuid" type="s" direction="in"/>
<arg name="nwfilter" type="o" direction="out"/>
</method>
<method name="NodeGetCPUMap">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetCPUMap"/>
......
......@@ -1076,6 +1076,34 @@ virtDBusConnectNWFilterLookupByName(GVariant *inArgs,
*outArgs = g_variant_new("(o)", path);
}
static void
virtDBusConnectNWFilterLookupByUUID(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(virNWFilter) nwfilter = NULL;
g_autofree gchar *path = NULL;
const gchar *uuidstr;
g_variant_get(inArgs, "(&s)", &uuidstr);
if (!virtDBusConnectOpen(connect, error))
return;
nwfilter = virNWFilterLookupByUUIDString(connect->connection, uuidstr);
if (!nwfilter)
return virtDBusUtilSetLastVirtError(error);
path = virtDBusUtilBusPathForVirNWFilter(nwfilter, connect->nwfilterPath);
*outArgs = g_variant_new("(o)", path);
}
static void
virtDBusConnectNodeGetCPUMap(GVariant *inArgs,
GUnixFDList *inFDs G_GNUC_UNUSED,
......@@ -1553,6 +1581,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethodTable[] = {
{ "NetworkLookupByUUID", virtDBusConnectNetworkLookupByUUID },
{ "NWFilterDefineXML", virtDBusConnectNWFilterDefineXML },
{ "NWFilterLookupByName", virtDBusConnectNWFilterLookupByName },
{ "NWFilterLookupByUUID", virtDBusConnectNWFilterLookupByUUID },
{ "NodeGetCPUMap", virtDBusConnectNodeGetCPUMap },
{ "NodeGetCPUStats", virtDBusConnectNodeGetCPUStats },
{ "NodeGetFreeMemory", virtDBusConnectNodeGetFreeMemory },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment