Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 7 +++++++ src/domain.c | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index c7fb637..05f4da9 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -106,6 +106,13 @@ <arg name="size" type="t" direction="in"/> <arg name="flags" type="u" direction="in"/> </method> + <method name="CoreDumpWithFormat"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCoreDumpWithFormat"/> + <arg name="to" type="s" direction="in"/> + <arg name="dumpformat" type="u" direction="in"/> + <arg name="flags" type="u" direction="in"/> + </method> <method name="Create"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateWithFlags"/> diff --git a/src/domain.c b/src/domain.c index 191d9e8..7c87133 100644 --- a/src/domain.c +++ b/src/domain.c @@ -574,6 +574,31 @@ virtDBusDomainBlockResize(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } +static void +virtDBusDomainCoreDumpWithFormat(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 *to; + guint dumpformat; + guint flags; + + g_variant_get(inArgs, "(&suu)", &to, &dumpformat, &flags); + + domain = virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainCoreDumpWithFormat(domain, to, dumpformat, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainCreate(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1438,6 +1463,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = { { "BlockPull", virtDBusDomainBlockPull }, { "BlockRebase", virtDBusDomainBlockRebase }, { "BlockResize", virtDBusDomainBlockResize }, + { "CoreDumpWithFormat", virtDBusDomainCoreDumpWithFormat }, { "Create", virtDBusDomainCreate }, { "Destroy", virtDBusDomainDestroy }, { "DetachDevice", virtDBusDomainDetachDevice }, -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list