Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Domain.xml | 5 +++++
src/domain.c | 24 ++++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 0b23e75..48b8a95 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -124,6 +124,11 @@
<arg name="flags" type="u" direction="in"/>
<arg name="managedSaveImage" type="b"
direction="out"/>
</method>
+ <method name="InjectNMI">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInjectNMI&q...
+ <arg name="flags" type="u" direction="in"/>
+ </method>
<method name="ManagedSave">
<annotation name="org.gtk.GDBus.DocString"
value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainManagedSave...
diff --git a/src/domain.c b/src/domain.c
index 0c8e1ce..9197755 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -752,6 +752,29 @@ virtDBusDomainHasManagedSaveImage(GVariant *inArgs,
*outArgs = g_variant_new("(b)", managedSaveImage);
}
+static void
+virtDBusDomainInjectNMI(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;
+ guint flags;
+
+ g_variant_get(inArgs, "(u)", &flags);
+
+ domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
+ if (!domain)
+ return;
+
+ if (virDomainInjectNMI(domain, flags) < 0)
+ virtDBusUtilSetLastVirtError(error);
+}
+
static void
virtDBusDomainManagedSave(GVariant *inArgs,
GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -1192,6 +1215,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = {
{ "GetVcpus", virtDBusDomainGetVcpus },
{ "GetXMLDesc", virtDBusDomainGetXMLDesc },
{ "HasManagedSaveImage", virtDBusDomainHasManagedSaveImage },
+ { "InjectNMI", virtDBusDomainInjectNMI },
{ "ManagedSave", virtDBusDomainManagedSave },
{ "ManagedSaveRemove", virtDBusDomainManagedSaveRemove },
{ "MemoryStats", virtDBusDomainMemoryStats },
--
2.15.0