From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523618141511109.46631931054571; Fri, 13 Apr 2018 04:15:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0AF4E312AC72; Fri, 13 Apr 2018 11:15:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF9845D6B4; Fri, 13 Apr 2018 11:15:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 784FF180BAD3; Fri, 13 Apr 2018 11:15:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFYxN025914 for ; Fri, 13 Apr 2018 07:15:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id E86F72166BAE; Fri, 13 Apr 2018 11:15:33 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F6FE2166BAD for ; Fri, 13 Apr 2018 11:15:33 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:12 +0200 Message-Id: <20180413111531.28327-2-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 01/20] Implement Setter for Autostart property for Domain interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 13 Apr 2018 11:15:40 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 5 +++-- src/domain.c | 22 +++++++++++++++++++++- test/test_domain.py | 7 +++++++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 78378bb..b8ee5b8 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -7,9 +7,10 @@ - + + value=3D"See https://libvirt.org/html/libvirt-libvirt-domain.html#= virDomainGetAutostart and + https://libvirt.org/html/libvirt-libvirt-domain.html#virDom= ainSetAutostart"/> Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15236181400781020.8949825354077; Fri, 13 Apr 2018 04:15:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 845353141B57; Fri, 13 Apr 2018 11:15:38 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4AA7F885CF; Fri, 13 Apr 2018 11:15:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F17B81808873; Fri, 13 Apr 2018 11:15:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFYUC025919 for ; Fri, 13 Apr 2018 07:15:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 871842166BAE; Fri, 13 Apr 2018 11:15:34 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E4BF2166BAD for ; Fri, 13 Apr 2018 11:15:34 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:13 +0200 Message-Id: <20180413111531.28327-3-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 02/20] Implement SchedulerType property for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 13 Apr 2018 11:15:39 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 4 ++++ src/domain.c | 23 +++++++++++++++++++++++ test/test_domain.py | 3 +++ 3 files changed, 30 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index b8ee5b8..df9fbf9 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -28,6 +28,10 @@ + + + diff --git a/src/domain.c b/src/domain.c index 82682ef..f775fd4 100644 --- a/src/domain.c +++ b/src/domain.c @@ -149,6 +149,28 @@ virtDBusDomainGetPersistent(const gchar *objectPath, *value =3D g_variant_new("b", !!persistent); } =20 +static void +virtDBusDomainGetSchedulerType(const gchar *objectPath, + gpointer userData, + GVariant **value, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + g_autofree gchar *schedtype =3D NULL; + gint nparams; + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + schedtype =3D virDomainGetSchedulerType(domain, &nparams); + if (!schedtype) + return virtDBusUtilSetLastVirtError(error); + + *value =3D g_variant_new("(si)", schedtype, nparams); +} + static void virtDBusDomainGetState(const gchar *objectPath, gpointer userData, @@ -517,6 +539,7 @@ static virtDBusGDBusPropertyTable virtDBusDomainPropert= yTable[] =3D { { "Name", virtDBusDomainGetName, NULL }, { "OSType", virtDBusDomainGetOsType, NULL }, { "Persistent", virtDBusDomainGetPersistent, NULL }, + { "SchedulerType", virtDBusDomainGetSchedulerType, NULL}, { "State", virtDBusDomainGetState, NULL }, { "UUID", virtDBusDomainGetUUID, NULL }, { 0 } diff --git a/test/test_domain.py b/test/test_domain.py index 7fa9aad..a7cf962 100755 --- a/test/test_domain.py +++ b/test/test_domain.py @@ -16,6 +16,9 @@ class TestDomain(libvirttest.BaseTestClass): assert isinstance(props['Name'], dbus.String) assert isinstance(props['OSType'], dbus.String) assert isinstance(props['Persistent'], dbus.Boolean) + assert any([isinstance(props['SchedulerType'], dbus.Struct), + isinstance(props['SchedulerType'][0], dbus.String), + isinstance(props['SchedulerType'][1], dbus.Int32)]) assert isinstance(props['State'], dbus.String) assert isinstance(props['UUID'], dbus.String) =20 --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523618144020790.7930744779552; Fri, 13 Apr 2018 04:15:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9ED5F13AAA; Fri, 13 Apr 2018 11:15:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 46F687CA52; Fri, 13 Apr 2018 11:15:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 082C31805971; Fri, 13 Apr 2018 11:15:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFZth025928 for ; Fri, 13 Apr 2018 07:15:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 263912166BAE; Fri, 13 Apr 2018 11:15:35 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0FA62166BAD for ; Fri, 13 Apr 2018 11:15:34 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:14 +0200 Message-Id: <20180413111531.28327-4-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 03/20] Implement MemoryStats for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 13 Apr 2018 11:15:43 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This method is not tested for now since the test driver doesn't support this API. Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 6 ++++ src/domain.c | 72 +++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 78 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index df9fbf9..7174769 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -69,6 +69,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index f775fd4..5f87572 100644 --- a/src/domain.c +++ b/src/domain.c @@ -3,6 +3,42 @@ =20 #include =20 +VIRT_DBUS_ENUM_DECL(virtDBusDomainMemoryStat) +VIRT_DBUS_ENUM_IMPL(virtDBusDomainMemoryStat, + VIR_DOMAIN_MEMORY_STAT_LAST, + "swap_in", + "swap_out", + "major_fault", + "minor_fault", + "unused", + "available", + "actual_baloon", + "rss", + "usable", + "last_update") + +static GVariant * +virtDBusDomainMemoryStatsToGVariant(virDomainMemoryStatPtr stats, + gint nr_stats, + GError **error) +{ + GVariantBuilder builder; + + g_variant_builder_init(&builder, G_VARIANT_TYPE("a{st}")); + + for (gint i =3D 0; i < nr_stats; i++) { + const gchar *memoryStat =3D virtDBusDomainMemoryStatTypeToString(s= tats[i].tag); + if (!memoryStat) { + g_set_error(error, VIRT_DBUS_ERROR, VIRT_DBUS_ERROR_LIBVIRT, + "Can't translate virDomainMemoryStatTags to string= ."); + return NULL; + } + g_variant_builder_add(&builder, "{st}", memoryStat, stats[i].val); + } + + return g_variant_builder_end(&builder); +} + static virDomainPtr virtDBusDomainGetVirDomain(virtDBusConnect *connect, const gchar *objectPath, @@ -398,6 +434,41 @@ virtDBusDomainGetXMLDesc(GVariant *inArgs, *outArgs =3D g_variant_new("(s)", xml); } =20 +static void +virtDBusDomainMemoryStats(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + virDomainMemoryStatStruct stats[VIR_DOMAIN_MEMORY_STAT_NR]; + gint nr_stats; + guint flags; + GVariant *gstats; + + g_variant_get(inArgs, "(u)", &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + nr_stats =3D virDomainMemoryStats(domain, stats, VIR_DOMAIN_MEMORY_STA= T_NR, flags); + if (nr_stats < 0) + return virtDBusUtilSetLastVirtError(error); + + gstats =3D virtDBusDomainMemoryStatsToGVariant(stats, nr_stats, error); + if (!gstats) { + virtDBusUtilSetLastVirtError(error); + return; + } + + *outArgs =3D g_variant_new_tuple(&gstats, 1); +} + static void virtDBusDomainReboot(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -551,6 +622,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTab= le[] =3D { { "GetStats", virtDBusDomainGetStats }, { "GetVcpus", virtDBusDomainGetVcpus }, { "GetXMLDesc", virtDBusDomainGetXMLDesc }, + { "MemoryStats", virtDBusDomainMemoryStats }, { "Reboot", virtDBusDomainReboot }, { "Reset", virtDBusDomainReset }, { "Resume", virtDBusDomainResume }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523618147539433.9439889087845; Fri, 13 Apr 2018 04:15:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC4A13133E62; Fri, 13 Apr 2018 11:15:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A58185D757; Fri, 13 Apr 2018 11:15:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 693BC4CAA1; Fri, 13 Apr 2018 11:15:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFZjQ025938 for ; Fri, 13 Apr 2018 07:15:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id B94D02166BAE; Fri, 13 Apr 2018 11:15:35 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 603D22166BAD for ; Fri, 13 Apr 2018 11:15:35 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:15 +0200 Message-Id: <20180413111531.28327-5-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 04/20] Implement AttachDevice method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 13 Apr 2018 11:15:46 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This method is not tested for now since the test driver doesn't suport this API. Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- 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 7174769..9360cbf 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -40,6 +40,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index 5f87572..dccba94 100644 --- a/src/domain.c +++ b/src/domain.c @@ -296,6 +296,30 @@ virtDBusDomainSetAutostart(GVariant *value, return virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusDomainAttachDevice(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 =3D userData; + g_autoptr(virDomain) domain =3D NULL; + const gchar *xml; + guint flags; + + g_variant_get(inArgs, "(&su)", &xml, &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainAttachDeviceFlags(domain, xml, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainCreate(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -617,6 +641,7 @@ static virtDBusGDBusPropertyTable virtDBusDomainPropert= yTable[] =3D { }; =20 static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] =3D { + { "AttachDevice", virtDBusDomainAttachDevice }, { "Create", virtDBusDomainCreate }, { "Destroy", virtDBusDomainDestroy }, { "GetStats", virtDBusDomainGetStats }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523782206673375.0714983772423; Sun, 15 Apr 2018 01:50:06 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58BCE313469F; Sun, 15 Apr 2018 08:50:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29ACA80F9C; Sun, 15 Apr 2018 08:50:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 59FD64CAA1; Sun, 15 Apr 2018 08:50:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFaU6025945 for ; Fri, 13 Apr 2018 07:15:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 57F822166BAE; Fri, 13 Apr 2018 11:15:36 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id F31962166BAD for ; Fri, 13 Apr 2018 11:15:35 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:16 +0200 Message-Id: <20180413111531.28327-6-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 05/20] Implement DetachDevice method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sun, 15 Apr 2018 08:50:05 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This method is not tested for now since the test driver doesn't suport this API. Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- 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 9360cbf..5c310ad 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -56,6 +56,12 @@ value=3D"See https://libvirt.org/html/libvirt-libvirt-domain.html#= virDomainDestroyFlags"/> + + + + + diff --git a/src/domain.c b/src/domain.c index dccba94..2c3174b 100644 --- a/src/domain.c +++ b/src/domain.c @@ -366,6 +366,30 @@ virtDBusDomainDestroy(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusDomainDetachDevice(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 =3D userData; + g_autoptr(virDomain) domain =3D NULL; + const gchar *xml; + guint flags; + + g_variant_get(inArgs, "(&su)", &xml, &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainDetachDeviceFlags(domain, xml, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainStatsRecordPtr, virDomainStatsRecor= dListFree); =20 static void @@ -644,6 +668,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTab= le[] =3D { { "AttachDevice", virtDBusDomainAttachDevice }, { "Create", virtDBusDomainCreate }, { "Destroy", virtDBusDomainDestroy }, + { "DetachDevice", virtDBusDomainDetachDevice }, { "GetStats", virtDBusDomainGetStats }, { "GetVcpus", virtDBusDomainGetVcpus }, { "GetXMLDesc", virtDBusDomainGetXMLDesc }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523618150691145.8190913275413; Fri, 13 Apr 2018 04:15:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6025C30B96D7; Fri, 13 Apr 2018 11:15:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E4DA8DD79; Fri, 13 Apr 2018 11:15:49 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DD7D3180BAD3; Fri, 13 Apr 2018 11:15:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFbXi025953 for ; Fri, 13 Apr 2018 07:15:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id EADBC2166BAE; Fri, 13 Apr 2018 11:15:36 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9279C2166BAD for ; Fri, 13 Apr 2018 11:15:36 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:17 +0200 Message-Id: <20180413111531.28327-7-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 06/20] Implement GetJobInfo method for Domain interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 13 Apr 2018 11:15:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 5 +++++ src/domain.c | 49 +++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 54 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 5c310ad..c672053 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -62,6 +62,11 @@ + + + + diff --git a/src/domain.c b/src/domain.c index 2c3174b..47bd585 100644 --- a/src/domain.c +++ b/src/domain.c @@ -3,6 +3,16 @@ =20 #include =20 +VIRT_DBUS_ENUM_DECL(virtDBusDomainJob) +VIRT_DBUS_ENUM_IMPL(virtDBusDomainJob, + VIR_DOMAIN_JOB_LAST, + "none", + "bounded", + "unbounded", + "completed", + "failed", + "canceled") + VIRT_DBUS_ENUM_DECL(virtDBusDomainMemoryStat) VIRT_DBUS_ENUM_IMPL(virtDBusDomainMemoryStat, VIR_DOMAIN_MEMORY_STAT_LAST, @@ -390,6 +400,44 @@ virtDBusDomainDetachDevice(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusDomainGetJobInfo(GVariant *inArgs G_GNUC_UNUSED, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + g_autofree virDomainJobInfoPtr jobInfo =3D NULL; + const gchar *jobTypeStr; + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + jobInfo =3D g_new0(virDomainJobInfo, 1); + if (virDomainGetJobInfo(domain, jobInfo) < 0) + return virtDBusUtilSetLastVirtError(error); + + jobTypeStr =3D virtDBusDomainJobTypeToString(jobInfo->type); + if (!jobTypeStr) { + g_set_error(error, VIRT_DBUS_ERROR, VIRT_DBUS_ERROR_LIBVIRT, + "Can't translate virDomainJobType to string."); + virtDBusUtilSetLastVirtError(error); + return; + } + *outArgs =3D g_variant_new("((sttttttttttt))", jobTypeStr, + jobInfo->timeElapsed, jobInfo->timeRemaining, + jobInfo->dataTotal, jobInfo->dataProcessed, + jobInfo->dataRemaining, jobInfo->memTotal, + jobInfo->memProcessed, jobInfo->memRemaining, + jobInfo->fileTotal, jobInfo->fileProcessed, + jobInfo->fileRemaining); +} + G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainStatsRecordPtr, virDomainStatsRecor= dListFree); =20 static void @@ -669,6 +717,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTab= le[] =3D { { "Create", virtDBusDomainCreate }, { "Destroy", virtDBusDomainDestroy }, { "DetachDevice", virtDBusDomainDetachDevice }, + { "GetJobInfo", virtDBusDomainGetJobInfo }, { "GetStats", virtDBusDomainGetStats }, { "GetVcpus", virtDBusDomainGetVcpus }, { "GetXMLDesc", virtDBusDomainGetXMLDesc }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523618154440118.31430838723145; Fri, 13 Apr 2018 04:15:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D468C300484E; Fri, 13 Apr 2018 11:15:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A85EC7A24B; Fri, 13 Apr 2018 11:15:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 61779180215E; Fri, 13 Apr 2018 11:15:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFbYM025961 for ; Fri, 13 Apr 2018 07:15:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 894982166BAE; Fri, 13 Apr 2018 11:15:37 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30BBB2166BAD for ; Fri, 13 Apr 2018 11:15:37 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:18 +0200 Message-Id: <20180413111531.28327-8-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 07/20] Implement AbortJob for Domain interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 13 Apr 2018 11:15:53 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 4 ++++ src/domain.c | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index c672053..074dd62 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -40,6 +40,10 @@ + + + diff --git a/src/domain.c b/src/domain.c index 47bd585..b55a615 100644 --- a/src/domain.c +++ b/src/domain.c @@ -306,6 +306,26 @@ virtDBusDomainSetAutostart(GVariant *value, return virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusDomainAbortJob(GVariant *inArgs G_GNUC_UNUSED, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath, + gpointer userData, + GVariant **outArgs G_GNUC_UNUSED, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainAbortJob(domain) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainAttachDevice(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -713,6 +733,7 @@ static virtDBusGDBusPropertyTable virtDBusDomainPropert= yTable[] =3D { }; =20 static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] =3D { + { "AbortJob", virtDBusDomainAbortJob }, { "AttachDevice", virtDBusDomainAttachDevice }, { "Create", virtDBusDomainCreate }, { "Destroy", virtDBusDomainDestroy }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15237822103078.083454011678555; Sun, 15 Apr 2018 01:50:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1FB43135517; Sun, 15 Apr 2018 08:50:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD23917B67; Sun, 15 Apr 2018 08:50:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BF92B4CAAD; Sun, 15 Apr 2018 08:50:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFcZl025969 for ; Fri, 13 Apr 2018 07:15:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2763E2166BAE; Fri, 13 Apr 2018 11:15:38 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id C30F62166BAD for ; Fri, 13 Apr 2018 11:15:37 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:19 +0200 Message-Id: <20180413111531.28327-9-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 08/20] Implement MigrateSetMaxDowntime method for Domain interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Sun, 15 Apr 2018 08:50:09 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- 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 074dd62..c3c64fa 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -96,6 +96,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index b55a615..88e6aaa 100644 --- a/src/domain.c +++ b/src/domain.c @@ -585,6 +585,30 @@ virtDBusDomainMemoryStats(GVariant *inArgs, *outArgs =3D g_variant_new_tuple(&gstats, 1); } =20 +static void +virtDBusDomainMigrateSetMaxDowntime(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 =3D userData; + g_autoptr(virDomain) domain =3D NULL; + gulong downtime; + guint flags; + + g_variant_get(inArgs, "(tu)", &downtime, &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainMigrateSetMaxDowntime(domain, downtime, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainReboot(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -743,6 +767,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTab= le[] =3D { { "GetVcpus", virtDBusDomainGetVcpus }, { "GetXMLDesc", virtDBusDomainGetXMLDesc }, { "MemoryStats", virtDBusDomainMemoryStats }, + { "MigrateSetMaxDowntime", virtDBusDomainMigrateSetMaxDowntime }, { "Reboot", virtDBusDomainReboot }, { "Reset", virtDBusDomainReset }, { "Resume", virtDBusDomainResume }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523618157629430.41756231315685; Fri, 13 Apr 2018 04:15:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B3D03130D85; Fri, 13 Apr 2018 11:15:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D205712A68; Fri, 13 Apr 2018 11:15:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9580D4CAA4; Fri, 13 Apr 2018 11:15:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFcvj025980 for ; Fri, 13 Apr 2018 07:15:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id BA3E12166BAE; Fri, 13 Apr 2018 11:15:38 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 617F82166BAD for ; Fri, 13 Apr 2018 11:15:38 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:20 +0200 Message-Id: <20180413111531.28327-10-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 09/20] Implement MigrateGetMaxDowntime method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 13 Apr 2018 11:15:56 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index c3c64fa..10c4da8 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -96,6 +96,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index 88e6aaa..522fedb 100644 --- a/src/domain.c +++ b/src/domain.c @@ -585,6 +585,36 @@ virtDBusDomainMemoryStats(GVariant *inArgs, *outArgs =3D g_variant_new_tuple(&gstats, 1); } =20 +static void +virtDBusDomainMigrateGetMaxDowntime(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + gulong downtime; + guint flags; + gint ret; + + g_variant_get(inArgs, "(u)", &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + ret =3D virDomainMigrateGetMaxDowntime(domain, + (unsigned long long *)&downtime, + flags); + if (ret < 0) + return virtDBusUtilSetLastVirtError(error); + + *outArgs =3D g_variant_new("(t)", downtime); +} + static void virtDBusDomainMigrateSetMaxDowntime(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -767,6 +797,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTab= le[] =3D { { "GetVcpus", virtDBusDomainGetVcpus }, { "GetXMLDesc", virtDBusDomainGetXMLDesc }, { "MemoryStats", virtDBusDomainMemoryStats }, + { "MigrateGetMaxDowntime", virtDBusDomainMigrateGetMaxDowntime }, { "MigrateSetMaxDowntime", virtDBusDomainMigrateSetMaxDowntime }, { "Reboot", virtDBusDomainReboot }, { "Reset", virtDBusDomainReset }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523618160931624.3996856274423; Fri, 13 Apr 2018 04:16:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 48B32C057F91; Fri, 13 Apr 2018 11:15:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 15AC55F7C7; Fri, 13 Apr 2018 11:15:59 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C600F180BAD7; Fri, 13 Apr 2018 11:15:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFd6s025990 for ; Fri, 13 Apr 2018 07:15:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 59D492166BAE; Fri, 13 Apr 2018 11:15:39 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 00B0D2166BAD for ; Fri, 13 Apr 2018 11:15:38 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:21 +0200 Message-Id: <20180413111531.28327-11-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 10/20] Implement ManagedSave method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 13 Apr 2018 11:16:00 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 5 +++++ src/domain.c | 24 ++++++++++++++++++++++++ test/test_domain.py | 15 +++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 10c4da8..91e2558 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -90,6 +90,11 @@ + + + + diff --git a/src/domain.c b/src/domain.c index 522fedb..4d42d28 100644 --- a/src/domain.c +++ b/src/domain.c @@ -550,6 +550,29 @@ virtDBusDomainGetXMLDesc(GVariant *inArgs, *outArgs =3D g_variant_new("(s)", xml); } =20 +static void +virtDBusDomainManagedSave(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 =3D userData; + g_autoptr(virDomain) domain =3D NULL; + guint flags; + + g_variant_get(inArgs, "(u)", &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainManagedSave(domain, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainMemoryStats(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -796,6 +819,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTab= le[] =3D { { "GetStats", virtDBusDomainGetStats }, { "GetVcpus", virtDBusDomainGetVcpus }, { "GetXMLDesc", virtDBusDomainGetXMLDesc }, + { "ManagedSave", virtDBusDomainManagedSave }, { "MemoryStats", virtDBusDomainMemoryStats }, { "MigrateGetMaxDowntime", virtDBusDomainMigrateGetMaxDowntime }, { "MigrateSetMaxDowntime", virtDBusDomainMigrateSetMaxDowntime }, diff --git a/test/test_domain.py b/test/test_domain.py index a7cf962..31348ce 100755 --- a/test/test_domain.py +++ b/test/test_domain.py @@ -47,6 +47,21 @@ class TestDomain(libvirttest.BaseTestClass): autostart_current =3D domain.Get('org.libvirt.Domain', 'Autostart'= , dbus_interface=3Ddbus.PROPERTIES_IFACE) assert autostart_current =3D=3D dbus.Boolean(autostart_expected) =20 + def test_domain_managed_save(self): + def domain_stopped(path, _event): + assert isinstance(path, dbus.ObjectPath) + self.loop.quit() + + self.connect.connect_to_signal('DomainEvent', domain_stopped, arg1= =3D'Stopped') + + obj, domain =3D self.domain() + domain.ManagedSave(0) + + state =3D obj.Get('org.libvirt.Domain', 'State', dbus_interface=3D= dbus.PROPERTIES_IFACE) + assert state =3D=3D 'shutoff' + + self.main_loop() + def test_resume(self): def domain_resumed(path, _event): assert isinstance(path, dbus.ObjectPath) --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152361816415140.176022224857206; Fri, 13 Apr 2018 04:16:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF8413134BCA; Fri, 13 Apr 2018 11:16:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5CF88A9FC; Fri, 13 Apr 2018 11:16:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6C07A180BADC; Fri, 13 Apr 2018 11:16:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFeAZ025995 for ; Fri, 13 Apr 2018 07:15:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id ED19A2166BAE; Fri, 13 Apr 2018 11:15:39 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93DB52166BAD for ; Fri, 13 Apr 2018 11:15:39 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:22 +0200 Message-Id: <20180413111531.28327-12-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 11/20] Implement HasManagedSaveImage method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 13 Apr 2018 11:16:03 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 29 +++++++++++++++++++++++++++++ test/test_domain.py | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 91e2558..e29cd4c 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -90,6 +90,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index 4d42d28..05904d7 100644 --- a/src/domain.c +++ b/src/domain.c @@ -550,6 +550,34 @@ virtDBusDomainGetXMLDesc(GVariant *inArgs, *outArgs =3D g_variant_new("(s)", xml); } =20 +static void +virtDBusDomainHasManagedSaveImage(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) + +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + gint managedSaveImage; + guint flags; + + g_variant_get(inArgs, "(u)", &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + managedSaveImage =3D virDomainHasManagedSaveImage(domain, flags); + if (managedSaveImage < 0) + return virtDBusUtilSetLastVirtError(error); + + *outArgs =3D g_variant_new("(b)", managedSaveImage); +} + static void virtDBusDomainManagedSave(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -819,6 +847,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTab= le[] =3D { { "GetStats", virtDBusDomainGetStats }, { "GetVcpus", virtDBusDomainGetVcpus }, { "GetXMLDesc", virtDBusDomainGetXMLDesc }, + { "HasManagedSaveImage", virtDBusDomainHasManagedSaveImage }, { "ManagedSave", virtDBusDomainManagedSave }, { "MemoryStats", virtDBusDomainMemoryStats }, { "MigrateGetMaxDowntime", virtDBusDomainMigrateGetMaxDowntime }, diff --git a/test/test_domain.py b/test/test_domain.py index 31348ce..13f27f7 100755 --- a/test/test_domain.py +++ b/test/test_domain.py @@ -56,7 +56,7 @@ class TestDomain(libvirttest.BaseTestClass): =20 obj, domain =3D self.domain() domain.ManagedSave(0) - + assert domain.HasManagedSaveImage(0) =3D=3D dbus.Boolean(True) state =3D obj.Get('org.libvirt.Domain', 'State', dbus_interface=3D= dbus.PROPERTIES_IFACE) assert state =3D=3D 'shutoff' =20 --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152361814510878.03462444787635; Fri, 13 Apr 2018 04:15:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93E983136308; Fri, 13 Apr 2018 11:15:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6380D7A256; Fri, 13 Apr 2018 11:15:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1C39E4CA9E; Fri, 13 Apr 2018 11:15:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFeK5026006 for ; Fri, 13 Apr 2018 07:15:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8B4B1215CDCB; Fri, 13 Apr 2018 11:15:40 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32B302166BAD for ; Fri, 13 Apr 2018 11:15:40 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:23 +0200 Message-Id: <20180413111531.28327-13-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 12/20] Implement ManagedSaveRemove method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 13 Apr 2018 11:15:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 5 +++++ src/domain.c | 24 ++++++++++++++++++++++++ test/test_domain.py | 2 ++ 3 files changed, 31 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index e29cd4c..f300b59 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -101,6 +101,11 @@ value=3D"See https://libvirt.org/html/libvirt-libvirt-domain.html#= virDomainManagedSave"/> + + + + diff --git a/src/domain.c b/src/domain.c index 05904d7..5f83b33 100644 --- a/src/domain.c +++ b/src/domain.c @@ -601,6 +601,29 @@ virtDBusDomainManagedSave(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusDomainManagedSaveRemove(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 =3D userData; + g_autoptr(virDomain) domain =3D NULL; + guint flags; + + g_variant_get(inArgs, "(u)", &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainManagedSaveRemove(domain, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainMemoryStats(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -849,6 +872,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTab= le[] =3D { { "GetXMLDesc", virtDBusDomainGetXMLDesc }, { "HasManagedSaveImage", virtDBusDomainHasManagedSaveImage }, { "ManagedSave", virtDBusDomainManagedSave }, + { "ManagedSaveRemove", virtDBusDomainManagedSaveRemove }, { "MemoryStats", virtDBusDomainMemoryStats }, { "MigrateGetMaxDowntime", virtDBusDomainMigrateGetMaxDowntime }, { "MigrateSetMaxDowntime", virtDBusDomainMigrateSetMaxDowntime }, diff --git a/test/test_domain.py b/test/test_domain.py index 13f27f7..45a99f9 100755 --- a/test/test_domain.py +++ b/test/test_domain.py @@ -59,6 +59,8 @@ class TestDomain(libvirttest.BaseTestClass): assert domain.HasManagedSaveImage(0) =3D=3D dbus.Boolean(True) state =3D obj.Get('org.libvirt.Domain', 'State', dbus_interface=3D= dbus.PROPERTIES_IFACE) assert state =3D=3D 'shutoff' + domain.ManagedSaveRemove(0) + assert domain.HasManagedSaveImage(0) =3D=3D dbus.Boolean(False) =20 self.main_loop() =20 --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523782214083884.0837302296669; Sun, 15 Apr 2018 01:50:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B60724A6E9; Sun, 15 Apr 2018 08:50:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 897EB17CE9; Sun, 15 Apr 2018 08:50:12 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4998A1805972; Sun, 15 Apr 2018 08:50:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFfpl026016 for ; Fri, 13 Apr 2018 07:15:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 29E80215CDCB; Fri, 13 Apr 2018 11:15:41 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id C55E2215CDC8 for ; Fri, 13 Apr 2018 11:15:40 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:24 +0200 Message-Id: <20180413111531.28327-14-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 13/20] Implement SetVcpus method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sun, 15 Apr 2018 08:50:13 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Move testing of [Get,Set]Vcpus to seperate test. Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 26 ++++++++++++++++++++++++++ test/test_domain.py | 9 +++++++-- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index f300b59..41814c7 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -138,6 +138,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index 5f83b33..9b8779b 100644 --- a/src/domain.c +++ b/src/domain.c @@ -781,6 +781,31 @@ virtDBusDomainResume(GVariant *inArgs G_GNUC_UNUSED, virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusDomainSetVcpus(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 =3D userData; + g_autoptr(virDomain) domain =3D NULL; + guint vcpus; + guint flags; + + g_variant_get(inArgs, "(uu)", &vcpus, &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainSetVcpusFlags(domain, vcpus, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainShutdown(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -879,6 +904,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTab= le[] =3D { { "Reboot", virtDBusDomainReboot }, { "Reset", virtDBusDomainReset }, { "Resume", virtDBusDomainResume }, + { "SetVcpus", virtDBusDomainSetVcpus }, { "Shutdown", virtDBusDomainShutdown }, { "Suspend", virtDBusDomainSuspend }, { "Undefine", virtDBusDomainUndefine }, diff --git a/test/test_domain.py b/test/test_domain.py index 45a99f9..31e09bf 100755 --- a/test/test_domain.py +++ b/test/test_domain.py @@ -27,8 +27,6 @@ class TestDomain(libvirttest.BaseTestClass): =20 xml =3D domain.GetXMLDesc(0) assert isinstance(xml, dbus.String) - vcpus =3D domain.GetVcpus(0) - assert isinstance(vcpus, dbus.UInt32) =20 domain.Reboot(0) domain.Shutdown(0) @@ -123,5 +121,12 @@ class TestDomain(libvirttest.BaseTestClass): =20 self.main_loop() =20 + def test_domain_vcpus(self): + obj, domain =3D self.domain() + vcpus_expected =3D 2 + domain.SetVcpus(vcpus_expected, 0) + assert domain.GetVcpus(0) =3D=3D dbus.Int32(vcpus_expected) + + if __name__ =3D=3D '__main__': libvirttest.run() --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523618168014858.4238372480033; Fri, 13 Apr 2018 04:16:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 51650318C763; Fri, 13 Apr 2018 11:16:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 221A022716; Fri, 13 Apr 2018 11:16:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D18DF4CAA9; Fri, 13 Apr 2018 11:16:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFfDt026022 for ; Fri, 13 Apr 2018 07:15:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id BC703215CDCB; Fri, 13 Apr 2018 11:15:41 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63F7E215CDC8 for ; Fri, 13 Apr 2018 11:15:41 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:25 +0200 Message-Id: <20180413111531.28327-15-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 14/20] Implement GetMemoryParameters method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 13 Apr 2018 11:16:06 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 41814c7..36167d8 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -71,6 +71,12 @@ value=3D"See https://libvirt.org/html/libvirt-libvirt-domain.html#= virDomainGetJobInfo"/> + + + + + diff --git a/src/domain.c b/src/domain.c index 9b8779b..7ab832b 100644 --- a/src/domain.c +++ b/src/domain.c @@ -458,6 +458,41 @@ virtDBusDomainGetJobInfo(GVariant *inArgs G_GNUC_UNUSE= D, jobInfo->fileRemaining); } =20 +static void +virtDBusDomainGetMemoryParameters(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + g_autofree virTypedParameterPtr params =3D NULL; + gint nparams =3D 0; + guint flags; + gint ret; + GVariant *grecords; + + g_variant_get(inArgs, "(u)", &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + ret =3D virDomainGetMemoryParameters(domain, NULL, &nparams, flags); + if (ret =3D=3D 0 && nparams !=3D 0) { + params =3D g_new0(virTypedParameter, nparams); + if (virDomainGetMemoryParameters(domain, params, &nparams, flags) = < 0) + return virtDBusUtilSetLastVirtError(error); + } + + grecords =3D virtDBusUtilTypedParamsToGVariant(params, nparams); + + *outArgs =3D g_variant_new_tuple(&grecords, 1); +} + G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainStatsRecordPtr, virDomainStatsRecor= dListFree); =20 static void @@ -892,6 +927,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTab= le[] =3D { { "Destroy", virtDBusDomainDestroy }, { "DetachDevice", virtDBusDomainDetachDevice }, { "GetJobInfo", virtDBusDomainGetJobInfo }, + { "GetMemoryParameters", virtDBusDomainGetMemoryParameters }, { "GetStats", virtDBusDomainGetStats }, { "GetVcpus", virtDBusDomainGetVcpus }, { "GetXMLDesc", virtDBusDomainGetXMLDesc }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152378221829827.742434353988415; Sun, 15 Apr 2018 01:50:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 02C9D83C; Sun, 15 Apr 2018 08:50:17 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD3D5171BC; Sun, 15 Apr 2018 08:50:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7AA8D4CAB7; Sun, 15 Apr 2018 08:50:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFgku026029 for ; Fri, 13 Apr 2018 07:15:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5B938215CDCB; Fri, 13 Apr 2018 11:15:42 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 02962215CDC8 for ; Fri, 13 Apr 2018 11:15:41 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:26 +0200 Message-Id: <20180413111531.28327-16-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 15/20] Implement GetBlkioParameters method for domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 15 Apr 2018 08:50:17 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 36167d8..243a978 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -66,6 +66,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index 7ab832b..9cf691a 100644 --- a/src/domain.c +++ b/src/domain.c @@ -420,6 +420,41 @@ virtDBusDomainDetachDevice(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusDomainGetBlkioParameters(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + g_autofree virTypedParameterPtr params =3D NULL; + gint nparams =3D 0; + guint flags; + gint ret; + GVariant *grecords; + + g_variant_get(inArgs, "(u)", &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + ret =3D virDomainGetBlkioParameters(domain, NULL, &nparams, flags); + if (ret =3D=3D 0 && nparams !=3D 0) { + params =3D g_new0(virTypedParameter, nparams); + if (virDomainGetBlkioParameters(domain, params, &nparams, flags) <= 0) + return virtDBusUtilSetLastVirtError(error); + } + + grecords =3D virtDBusUtilTypedParamsToGVariant(params, nparams); + + *outArgs =3D g_variant_new_tuple(&grecords, 1); +} + static void virtDBusDomainGetJobInfo(GVariant *inArgs G_GNUC_UNUSED, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -926,6 +961,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTab= le[] =3D { { "Create", virtDBusDomainCreate }, { "Destroy", virtDBusDomainDestroy }, { "DetachDevice", virtDBusDomainDetachDevice }, + { "GetBlkioParameters", virtDBusDomainGetBlkioParameters }, { "GetJobInfo", virtDBusDomainGetJobInfo }, { "GetMemoryParameters", virtDBusDomainGetMemoryParameters }, { "GetStats", virtDBusDomainGetStats }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523782221861419.0849282022185; Sun, 15 Apr 2018 01:50:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E9683133E9C; Sun, 15 Apr 2018 08:50:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F920176DC; Sun, 15 Apr 2018 08:50:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 03A58180BAD9; Sun, 15 Apr 2018 08:50:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFhfk026040 for ; Fri, 13 Apr 2018 07:15:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id ED74C215CDCB; Fri, 13 Apr 2018 11:15:42 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 951E0215CDC8 for ; Fri, 13 Apr 2018 11:15:42 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:27 +0200 Message-Id: <20180413111531.28327-17-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 16/20] Implement Updated property for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sun, 15 Apr 2018 08:50:21 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 4 ++++ src/domain.c | 22 ++++++++++++++++++++++ test/test_domain.py | 1 + 3 files changed, 27 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 243a978..21eb162 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -36,6 +36,10 @@ + + + diff --git a/src/domain.c b/src/domain.c index 9cf691a..5a2dbfb 100644 --- a/src/domain.c +++ b/src/domain.c @@ -266,6 +266,27 @@ virtDBusDomainGetState(const gchar *objectPath, *value =3D g_variant_new("s", string); } =20 +static void +virtDBusDomainGetUpdated(const gchar *objectPath, + gpointer userData, + GVariant **value, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + gint updated; + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + updated =3D virDomainIsUpdated(domain); + if (updated < 0) + return virtDBusUtilSetLastVirtError(error); + + *value =3D g_variant_new("b", !!updated); +} + static void virtDBusDomainGetUUID(const gchar *objectPath, gpointer userData, @@ -951,6 +972,7 @@ static virtDBusGDBusPropertyTable virtDBusDomainPropert= yTable[] =3D { { "Persistent", virtDBusDomainGetPersistent, NULL }, { "SchedulerType", virtDBusDomainGetSchedulerType, NULL}, { "State", virtDBusDomainGetState, NULL }, + { "Updated", virtDBusDomainGetUpdated, NULL }, { "UUID", virtDBusDomainGetUUID, NULL }, { 0 } }; diff --git a/test/test_domain.py b/test/test_domain.py index 31e09bf..f2ae215 100755 --- a/test/test_domain.py +++ b/test/test_domain.py @@ -20,6 +20,7 @@ class TestDomain(libvirttest.BaseTestClass): isinstance(props['SchedulerType'][0], dbus.String), isinstance(props['SchedulerType'][1], dbus.Int32)]) assert isinstance(props['State'], dbus.String) + assert isinstance(props['Updated'], dbus.Boolean) assert isinstance(props['UUID'], dbus.String) =20 # Call all methods except Reset and GetStats, because the test bac= kend --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523782225542464.9929682541632; Sun, 15 Apr 2018 01:50:25 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 434D6A916; Sun, 15 Apr 2018 08:50:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 19415620A8; Sun, 15 Apr 2018 08:50:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CF6A04CAB9; Sun, 15 Apr 2018 08:50:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFhhG026045 for ; Fri, 13 Apr 2018 07:15:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C97D2166BAE; Fri, 13 Apr 2018 11:15:43 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 339D52166BAD for ; Fri, 13 Apr 2018 11:15:43 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:28 +0200 Message-Id: <20180413111531.28327-18-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 17/20] Implement MigrateGetMaxSpeed method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 15 Apr 2018 08:50:24 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 21eb162..eec9dcb 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -134,6 +134,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index 5a2dbfb..46a8c03 100644 --- a/src/domain.c +++ b/src/domain.c @@ -780,6 +780,33 @@ virtDBusDomainMigrateGetMaxDowntime(GVariant *inArgs, *outArgs =3D g_variant_new("(t)", downtime); } =20 +static void +virtDBusDomainMigrateGetMaxSpeed(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) + +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + gulong bandwidth; + guint flags; + + g_variant_get(inArgs, "(u)", &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainMigrateGetMaxSpeed(domain, &bandwidth, flags) < 0) + return virtDBusUtilSetLastVirtError(error); + + *outArgs =3D g_variant_new("(t)", bandwidth); +} + static void virtDBusDomainMigrateSetMaxDowntime(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -994,6 +1021,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTa= ble[] =3D { { "ManagedSaveRemove", virtDBusDomainManagedSaveRemove }, { "MemoryStats", virtDBusDomainMemoryStats }, { "MigrateGetMaxDowntime", virtDBusDomainMigrateGetMaxDowntime }, + { "MigrateGetMaxSpeed", virtDBusDomainMigrateGetMaxSpeed }, { "MigrateSetMaxDowntime", virtDBusDomainMigrateSetMaxDowntime }, { "Reboot", virtDBusDomainReboot }, { "Reset", virtDBusDomainReset }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523618171602497.67384815674916; Fri, 13 Apr 2018 04:16:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A6EC80469; Fri, 13 Apr 2018 11:16:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C03FE5F7CE; Fri, 13 Apr 2018 11:16:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8088A4CAA4; Fri, 13 Apr 2018 11:16:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFiHm026055 for ; Fri, 13 Apr 2018 07:15:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 104CF2166BAE; Fri, 13 Apr 2018 11:15:44 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id C63252166BAD for ; Fri, 13 Apr 2018 11:15:43 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:29 +0200 Message-Id: <20180413111531.28327-19-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 18/20] Implement MigrateSetMaxSpeed method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 13 Apr 2018 11:16:10 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- 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 eec9dcb..838ebed 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -146,6 +146,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index 46a8c03..b7bc10c 100644 --- a/src/domain.c +++ b/src/domain.c @@ -831,6 +831,30 @@ virtDBusDomainMigrateSetMaxDowntime(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusDomainMigrateSetMaxSpeed(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 =3D userData; + g_autoptr(virDomain) domain =3D NULL; + gulong bandwidth; + guint flags; + + g_variant_get(inArgs, "(tu)", &bandwidth, &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainMigrateSetMaxSpeed(domain, bandwidth, flags) < 0) + return virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainReboot(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1023,6 +1047,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodT= able[] =3D { { "MigrateGetMaxDowntime", virtDBusDomainMigrateGetMaxDowntime }, { "MigrateGetMaxSpeed", virtDBusDomainMigrateGetMaxSpeed }, { "MigrateSetMaxDowntime", virtDBusDomainMigrateSetMaxDowntime }, + { "MigrateSetMaxSpeed", virtDBusDomainMigrateSetMaxSpeed }, { "Reboot", virtDBusDomainReboot }, { "Reset", virtDBusDomainReset }, { "Resume", virtDBusDomainResume }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523782229278414.82328415397126; Sun, 15 Apr 2018 01:50:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0FDF53133E78; Sun, 15 Apr 2018 08:50:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF2F717A97; Sun, 15 Apr 2018 08:50:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 83B724CABF; Sun, 15 Apr 2018 08:50:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFiDJ026066 for ; Fri, 13 Apr 2018 07:15:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id A2F002166BAE; Fri, 13 Apr 2018 11:15:44 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A4952166BAD for ; Fri, 13 Apr 2018 11:15:44 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:30 +0200 Message-Id: <20180413111531.28327-20-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 19/20] Implement SetMemory method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sun, 15 Apr 2018 08:50:28 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 838ebed..dc1df26 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -166,6 +166,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index b7bc10c..72d5775 100644 --- a/src/domain.c +++ b/src/domain.c @@ -923,6 +923,31 @@ virtDBusDomainResume(GVariant *inArgs G_GNUC_UNUSED, virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusDomainSetMemory(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 =3D userData; + g_autoptr(virDomain) domain =3D NULL; + gulong memory; + guint flags; + + g_variant_get(inArgs, "(tu)", &memory, &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainSetMemoryFlags(domain, memory, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainSetVcpus(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1052,6 +1077,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodT= able[] =3D { { "Reset", virtDBusDomainReset }, { "Resume", virtDBusDomainResume }, { "SetVcpus", virtDBusDomainSetVcpus }, + { "SetMemory", virtDBusDomainSetMemory }, { "Shutdown", virtDBusDomainShutdown }, { "Suspend", virtDBusDomainSuspend }, { "Undefine", virtDBusDomainUndefine }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 07:02:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523782233403546.7308965494788; Sun, 15 Apr 2018 01:50:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1F6E328206; Sun, 15 Apr 2018 08:50:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF98717CE5; Sun, 15 Apr 2018 08:50:31 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7B67E4EBDA; Sun, 15 Apr 2018 08:50:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3DBFjkV026074 for ; Fri, 13 Apr 2018 07:15:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 413152166BAE; Fri, 13 Apr 2018 11:15:45 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCCCF2166BAD for ; Fri, 13 Apr 2018 11:15:44 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Fri, 13 Apr 2018 13:15:31 +0200 Message-Id: <20180413111531.28327-21-kkoukiou@redhat.com> In-Reply-To: <20180413111531.28327-1-kkoukiou@redhat.com> References: <20180413111531.28327-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH v3 20/20] Implement GetSchedulerParameters method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sun, 15 Apr 2018 08:50:32 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou Reviewed-by: Pavel Hrdina --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index dc1df26..98e2873 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -87,6 +87,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index 72d5775..ce19e89 100644 --- a/src/domain.c +++ b/src/domain.c @@ -549,6 +549,41 @@ virtDBusDomainGetMemoryParameters(GVariant *inArgs, *outArgs =3D g_variant_new_tuple(&grecords, 1); } =20 +static void +virtDBusDomainGetSchedulerParameters(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + g_autofree virTypedParameterPtr params =3D NULL; + gint nparams; + guint flags; + GVariant *grecords; + g_autofree gchar *ret =3D NULL; + + g_variant_get(inArgs, "(u)", &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + ret =3D virDomainGetSchedulerType(domain, &nparams); + if (ret && nparams !=3D 0) { + params =3D g_new0(virTypedParameter, nparams); + if (virDomainGetSchedulerParametersFlags(domain, params, &nparams,= 0)) + return virtDBusUtilSetLastVirtError(error); + } + + grecords =3D virtDBusUtilTypedParamsToGVariant(params, nparams); + + *outArgs =3D g_variant_new_tuple(&grecords, 1); +} + G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainStatsRecordPtr, virDomainStatsRecor= dListFree); =20 static void @@ -1062,6 +1097,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodT= able[] =3D { { "GetBlkioParameters", virtDBusDomainGetBlkioParameters }, { "GetJobInfo", virtDBusDomainGetJobInfo }, { "GetMemoryParameters", virtDBusDomainGetMemoryParameters }, + { "GetSchedulerParameters", virtDBusDomainGetSchedulerParameters }, { "GetStats", virtDBusDomainGetStats }, { "GetVcpus", virtDBusDomainGetVcpus }, { "GetXMLDesc", virtDBusDomainGetXMLDesc }, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list