Commit 77f8b24e authored by Katerina Koukiou's avatar Katerina Koukiou

Implement Name property for NWFilter Interface

Signed-off-by: default avatarKaterina Koukiou <>
Reviewed-by: Jano Tomko's avatarJán Tomko <>
parent 5565b453
......@@ -3,5 +3,10 @@
<node name="/org/libvirt/nwfilter">
<interface name="org.libvirt.NWFilter">
<property name="Name" type="s" access="read">
<annotation name="org.gtk.GDBus.DocString"
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/>
......@@ -3,7 +3,50 @@
#include <libvirt/libvirt.h>
static virNWFilterPtr
virtDBusNWFilterGetVirNWFilter(virtDBusConnect *connect,
const gchar *objectPath,
GError **error)
virNWFilterPtr nwfilter;
if (virtDBusConnectOpen(connect, error) < 0)
return NULL;
nwfilter = virtDBusUtilVirNWFilterFromBusPath(connect->connection,
if (!nwfilter) {
return NULL;
return nwfilter;
static void
virtDBusNWFilterGetName(const gchar *objectPath,
gpointer userData,
GVariant **value,
GError **error)
virtDBusConnect *connect = userData;
g_autoptr(virNWFilter) nwfilter = NULL;
const gchar *name;
nwfilter = virtDBusNWFilterGetVirNWFilter(connect, objectPath, error);
if (!nwfilter)
name = virNWFilterGetName(nwfilter);
if (!name)
return virtDBusUtilSetLastVirtError(error);
*value = g_variant_new("s", name);
static virtDBusGDBusPropertyTable virtDBusNWFilterPropertyTable[] = {
{ "Name", virtDBusNWFilterGetName, NULL },
{ 0 }
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