Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Domain.xml | 6 ++++++
src/domain.c | 25 +++++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 5c08756..60d01d4 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -349,6 +349,12 @@
value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUndefineFla...
<arg name="flags" type="u" direction="in"/>
</method>
+ <method name="UpdateDevice">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainUpdateDevic...
+ <arg name="xml" type="s" direction="in"/>
+ <arg name="flags" type="u" direction="in"/>
+ </method>
<signal name="DeviceAdded">
<annotation name="org.gtk.GDBus.DocString"
value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEven...
diff --git a/src/domain.c b/src/domain.c
index 1cca5df..b1343aa 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -1741,6 +1741,30 @@ virtDBusDomainUndefine(GVariant *inArgs,
virtDBusUtilSetLastVirtError(error);
}
+static void
+virtDBusDomainUpdateDevice(GVariant *inArgs,
+ GUnixFDList *inFDs G_GNUC_UNUSED,
+ const gchar *objectPath,
+ gpointer userData,
+ GVariant **outArgs G_GNUC_UNUSED,
+ GUnixFDList **outFDs G_GNUC_UNUSED,
+ GError **error)
+{
+ virtDBusConnect *connect = userData;
+ g_autoptr(virDomain) domain = NULL;
+ const gchar *xml;
+ guint flags;
+
+ g_variant_get(inArgs, "(&su)", &xml, &flags);
+
+ domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
+ if (!domain)
+ return;
+
+ if (virDomainUpdateDeviceFlags(domain, xml, flags) < 0)
+ virtDBusUtilSetLastVirtError(error);
+}
+
static virtDBusGDBusPropertyTable virtDBusDomainPropertyTable[] = {
{ "Active", virtDBusDomainGetActive, NULL },
{ "Autostart", virtDBusDomainGetAutostart, virtDBusDomainSetAutostart },
@@ -1806,6 +1830,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = {
{ "Shutdown", virtDBusDomainShutdown },
{ "Suspend", virtDBusDomainSuspend },
{ "Undefine", virtDBusDomainUndefine },
+ { "UpdateDevice", virtDBusDomainUpdateDevice },
{ 0 }
};
--
2.15.0