Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 7 +++++++ src/domain.c | 27 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index bc8a6eb..5c08756 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -316,6 +316,13 @@ <arg name="keycodes" type="au" direction="in"/> <arg name="flags" type="u" direction="in"/> </method> + <method name="SendProcessSignal"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendProcessSignal"/> + <arg name="pidValue" type="x" direction="in"/> + <arg name="sigNum" type="u" direction="in"/> + <arg name="flags" type="u" direction="in"/> + </method> <method name="SetMemory"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryFlags"/> diff --git a/src/domain.c b/src/domain.c index c30e9b5..1cca5df 100644 --- a/src/domain.c +++ b/src/domain.c @@ -1599,6 +1599,32 @@ virtDBusDomainSendKey(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } +static void +virtDBusDomainSendProcessSignal(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; + gint64 pidValue; + guint sigNum; + guint flags; + + g_variant_get(inArgs, "(xuu)", &pidValue, &sigNum, &flags); + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainSendProcessSignal(domain, pidValue, sigNum, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainSetMemory(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1774,6 +1800,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "Resume", virtDBusDomainResume }, { "Save", virtDBusDomainSave }, { "SendKey", virtDBusDomainSendKey }, + { "SendProcessSignal", virtDBusDomainSendProcessSignal }, { "SetVcpus", virtDBusDomainSetVcpus }, { "SetMemory", virtDBusDomainSetMemory }, { "Shutdown", virtDBusDomainShutdown }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list