From nobody Thu May 2 06:33:54 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 1523543589737930.866448871485; Thu, 12 Apr 2018 07:33:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B6BD313064A; Thu, 12 Apr 2018 14:33: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 04320832DA; Thu, 12 Apr 2018 14:33: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 76A954CA9C; Thu, 12 Apr 2018 14:33: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 w3CEX4n1008521 for ; Thu, 12 Apr 2018 10:33:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 39161215CDCB; Thu, 12 Apr 2018 14:33:04 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4D49215CDC6 for ; Thu, 12 Apr 2018 14:33:03 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:40 +0200 Message-Id: <20180412143301.6850-2-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 01/22] 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 12 Apr 2018 14:33:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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 1523543593256307.3704798332101; Thu, 12 Apr 2018 07:33:13 -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 0317580F93; Thu, 12 Apr 2018 14:33:12 +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 BB2685D755; Thu, 12 Apr 2018 14:33:11 +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 7E9694CAA0; Thu, 12 Apr 2018 14:33:11 +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 w3CEX4Ml008531 for ; Thu, 12 Apr 2018 10:33:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id CB2A3215CDCB; Thu, 12 Apr 2018 14:33:04 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 72B16215CDC6 for ; Thu, 12 Apr 2018 14:33:04 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:41 +0200 Message-Id: <20180412143301.6850-3-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 02/22] 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 12 Apr 2018 14:33:12 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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..dbeafce 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 Thu May 2 06:33:54 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 1523543596585381.45639340946764; Thu, 12 Apr 2018 07:33:16 -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 26DF15D678; Thu, 12 Apr 2018 14:33:15 +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 EBD787E04A; Thu, 12 Apr 2018 14:33:14 +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 B12F34CAA4; Thu, 12 Apr 2018 14:33:14 +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 w3CEX5LX008539 for ; Thu, 12 Apr 2018 10:33:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6960A215CDCB; Thu, 12 Apr 2018 14:33:05 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10926215CDC6 for ; Thu, 12 Apr 2018 14:33:04 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:42 +0200 Message-Id: <20180412143301.6850-4-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 03/22] Introduce virtDBusDomainMemoryStatTypeToString helper function 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.39]); Thu, 12 Apr 2018 14:33:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- src/domain.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/domain.c b/src/domain.c index f775fd4..9b3de57 100644 --- a/src/domain.c +++ b/src/domain.c @@ -3,6 +3,20 @@ =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 virDomainPtr virtDBusDomainGetVirDomain(virtDBusConnect *connect, const gchar *objectPath, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 06:33:54 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 1523543600060815.3988651212289; Thu, 12 Apr 2018 07:33:20 -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 7401D3134C40; Thu, 12 Apr 2018 14:33:18 +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 3384B67E57; Thu, 12 Apr 2018 14:33:18 +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 D770D1805972; Thu, 12 Apr 2018 14:33:17 +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 w3CEX6vB008557 for ; Thu, 12 Apr 2018 10:33:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 07695215CDCB; Thu, 12 Apr 2018 14:33:06 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id A31C6215CDC6 for ; Thu, 12 Apr 2018 14:33:05 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:43 +0200 Message-Id: <20180412143301.6850-5-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 04/22] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 12 Apr 2018 14:33:19 +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 --- data/org.libvirt.Domain.xml | 7 ++++++ src/domain.c | 52 +++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 59 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index dbeafce..6795d30 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -69,6 +69,13 @@ + + + + + + diff --git a/src/domain.c b/src/domain.c index 9b3de57..59118b9 100644 --- a/src/domain.c +++ b/src/domain.c @@ -17,6 +17,24 @@ VIRT_DBUS_ENUM_IMPL(virtDBusDomainMemoryStat, "usable", "last_update") =20 +static GVariant * +virtDBusDomainMemoryStatsToGVariant(virDomainMemoryStatPtr stats, + gint nr_stats) +{ + 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) + return 0; + g_variant_builder_add(&builder, "{st}", memoryStat, stats[i].val); + } + + return g_variant_builder_end(&builder); +} + static virDomainPtr virtDBusDomainGetVirDomain(virtDBusConnect *connect, const gchar *objectPath, @@ -412,6 +430,39 @@ 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; + g_autofree virDomainMemoryStatPtr stats =3D NULL; + guint max_stats; + gint nr_stats; + guint flags; + GVariant *gstats; + + g_variant_get(inArgs, "(uu)", &max_stats, &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + stats =3D g_new0(virDomainMemoryStatStruct, max_stats); + nr_stats =3D virDomainMemoryStats(domain, stats, max_stats, flags); + if (nr_stats =3D=3D -1) + return virtDBusUtilSetLastVirtError(error); + + gstats =3D virtDBusDomainMemoryStatsToGVariant(stats, nr_stats); + + *outArgs =3D g_variant_new_tuple(&gstats, 1); +} + static void virtDBusDomainReboot(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -565,6 +616,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 Thu May 2 06:33:54 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 1523781491576108.59846618918345; Sun, 15 Apr 2018 01:38: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 22D15883C3; Sun, 15 Apr 2018 08:38:10 +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 DCBE1611AF; Sun, 15 Apr 2018 08:38: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 8D894181D0A7; Sun, 15 Apr 2018 08:38: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 w3CEX6aN008563 for ; Thu, 12 Apr 2018 10:33:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 99BC2215CDCB; Thu, 12 Apr 2018 14:33:06 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4135F215CDC6 for ; Thu, 12 Apr 2018 14:33:06 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:44 +0200 Message-Id: <20180412143301.6850-6-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 05/22] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sun, 15 Apr 2018 08:38:10 +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 --- 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 6795d30..b620939 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 59118b9..cfdd820 100644 --- a/src/domain.c +++ b/src/domain.c @@ -292,6 +292,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) =3D=3D -1) + return virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainCreate(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -611,6 +635,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 Thu May 2 06:33:54 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 152354360448085.78278512296447; Thu, 12 Apr 2018 07:33:24 -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 2AA38318C765; Thu, 12 Apr 2018 14:33:23 +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 F27696E71E; Thu, 12 Apr 2018 14:33:22 +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 AD26F4CAA8; Thu, 12 Apr 2018 14:33:22 +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 w3CEX7kc008569 for ; Thu, 12 Apr 2018 10:33:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3916B215CDCB; Thu, 12 Apr 2018 14:33:07 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4589215CDC6 for ; Thu, 12 Apr 2018 14:33:06 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:45 +0200 Message-Id: <20180412143301.6850-7-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 06/22] 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 12 Apr 2018 14:33:23 +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 --- 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 b620939..83e37bc 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 cfdd820..cd44d6b 100644 --- a/src/domain.c +++ b/src/domain.c @@ -362,6 +362,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) =3D=3D -1) + return virtDBusUtilSetLastVirtError(error); +} + G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainStatsRecordPtr, virDomainStatsRecor= dListFree); =20 static void @@ -638,6 +662,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 Thu May 2 06:33:54 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 1523543608564859.964896695652; Thu, 12 Apr 2018 07:33:28 -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 C2F1C3130D9B; Thu, 12 Apr 2018 14:33:26 +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 47D4085B02; Thu, 12 Apr 2018 14:33:26 +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 E8BFC180BAD4; Thu, 12 Apr 2018 14:33:25 +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 w3CEX7Dc008579 for ; Thu, 12 Apr 2018 10:33:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id CB944215CDCB; Thu, 12 Apr 2018 14:33:07 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 731D6215CDC6 for ; Thu, 12 Apr 2018 14:33:07 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:46 +0200 Message-Id: <20180412143301.6850-8-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 07/22] Introduce virtDBusDomainJobTypeToString function 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]); Thu, 12 Apr 2018 14:33:27 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- src/domain.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/domain.c b/src/domain.c index cd44d6b..bf352a7 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, --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 06:33:54 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 1523781499817673.111775212928; Sun, 15 Apr 2018 01:38:19 -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 9273F307D88B; Sun, 15 Apr 2018 08:38:15 +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 603CB17AC0; Sun, 15 Apr 2018 08:38:15 +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 18771ADABB; Sun, 15 Apr 2018 08:38:15 +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 w3CEX8ju008586 for ; Thu, 12 Apr 2018 10:33:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6A0EE215CDCB; Thu, 12 Apr 2018 14:33:08 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11142215CDC6 for ; Thu, 12 Apr 2018 14:33:07 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:47 +0200 Message-Id: <20180412143301.6850-9-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 08/22] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sun, 15 Apr 2018 08:38:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- data/org.libvirt.Domain.xml | 5 +++++ src/domain.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 83e37bc..2e0339b 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 bf352a7..e80749b 100644 --- a/src/domain.c +++ b/src/domain.c @@ -396,6 +396,40 @@ virtDBusDomainDetachDevice(GVariant *inArgs, return 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) =3D=3D -1) + return virtDBusUtilSetLastVirtError(error); + + jobTypeStr =3D virtDBusDomainJobTypeToString(jobInfo->type); + if (!jobTypeStr) + 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 @@ -673,6 +707,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 Thu May 2 06:33:54 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 1523543594809492.361591998044; Thu, 12 Apr 2018 07:33: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 136795F7B8; Thu, 12 Apr 2018 14:33:13 +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 D7AA367E40; Thu, 12 Apr 2018 14:33: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 968924CAA1; Thu, 12 Apr 2018 14:33: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 w3CEX9QC008599 for ; Thu, 12 Apr 2018 10:33:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 07DAA215CDCB; Thu, 12 Apr 2018 14:33:09 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id A3C4F215CDC6 for ; Thu, 12 Apr 2018 14:33:08 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:48 +0200 Message-Id: <20180412143301.6850-10-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 09/22] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 12 Apr 2018 14:33:13 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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 2e0339b..152ed4b 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 e80749b..d1be665 100644 --- a/src/domain.c +++ b/src/domain.c @@ -302,6 +302,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, @@ -703,6 +723,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 Thu May 2 06:33:54 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 1523543597428181.32423750498413; Thu, 12 Apr 2018 07:33:17 -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 3F7FE3136322; Thu, 12 Apr 2018 14:33:16 +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 166FD8A9D4; Thu, 12 Apr 2018 14:33: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 C6184180596E; Thu, 12 Apr 2018 14:33:15 +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 w3CEX9Di008609 for ; Thu, 12 Apr 2018 10:33:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9B792215CDCB; Thu, 12 Apr 2018 14:33:09 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41B66215CDC6 for ; Thu, 12 Apr 2018 14:33:09 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:49 +0200 Message-Id: <20180412143301.6850-11-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 10/22] 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 12 Apr 2018 14:33:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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 152ed4b..c509b4e 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -97,6 +97,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index d1be665..c42e1c6 100644 --- a/src/domain.c +++ b/src/domain.c @@ -575,6 +575,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; + guint64 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) + return virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainReboot(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -733,6 +757,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 Thu May 2 06:33:54 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 1523543602342803.8530287833044; Thu, 12 Apr 2018 07:33:22 -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 141873130672; Thu, 12 Apr 2018 14:33:21 +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 7C00D67E73; Thu, 12 Apr 2018 14:33: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 0BCB51808800; Thu, 12 Apr 2018 14:33: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 w3CEXA2W008619 for ; Thu, 12 Apr 2018 10:33:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3A0C4215CDCB; Thu, 12 Apr 2018 14:33:10 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5664215CDCC for ; Thu, 12 Apr 2018 14:33:09 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:50 +0200 Message-Id: <20180412143301.6850-12-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 11/22] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 12 Apr 2018 14:33:21 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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 c509b4e..3903689 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -97,6 +97,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index c42e1c6..e1b2d72 100644 --- a/src/domain.c +++ b/src/domain.c @@ -575,6 +575,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 G_GNUC_UNUSED, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virDomain) domain =3D NULL; + guint64 downtime; + guint flags; + gint ret; + + g_variant_get(inArgs, "(u)", &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + ret =3D virDomainMigrateGetMaxDowntime(domain, + (long long unsigned int *)&downti= me, + flags); + if (ret < 0) + return virtDBusUtilSetLastVirtError(error); + + *outArgs =3D g_variant_new("(t)", downtime); +} + static void virtDBusDomainMigrateSetMaxDowntime(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -757,6 +787,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 Thu May 2 06:33:54 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 1523543612674872.3721982268503; Thu, 12 Apr 2018 07:33:32 -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 B1AE2313633E; Thu, 12 Apr 2018 14:33:30 +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 7909B85B12; Thu, 12 Apr 2018 14:33:30 +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 085D4180BAD9; Thu, 12 Apr 2018 14:33:30 +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 w3CEXAHP008627 for ; Thu, 12 Apr 2018 10:33:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id CCE00215CDCB; Thu, 12 Apr 2018 14:33:10 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7451C215CDCC for ; Thu, 12 Apr 2018 14:33:10 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:51 +0200 Message-Id: <20180412143301.6850-13-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 12/22] 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 12 Apr 2018 14:33:31 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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 3903689..382b062 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 e1b2d72..53f8798 100644 --- a/src/domain.c +++ b/src/domain.c @@ -542,6 +542,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, @@ -786,6 +809,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 Thu May 2 06:33:54 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 1523543619196107.77812940098136; Thu, 12 Apr 2018 07:33:39 -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 E7A0419CBBE; Thu, 12 Apr 2018 14:33:37 +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 B8B0D8A9CA; Thu, 12 Apr 2018 14:33:37 +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 9DD2D4CAB4; Thu, 12 Apr 2018 14:33:34 +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 w3CEXBA6008635 for ; Thu, 12 Apr 2018 10:33:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6B4C1215CDCB; Thu, 12 Apr 2018 14:33:11 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12E63215CDCC for ; Thu, 12 Apr 2018 14:33:10 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:52 +0200 Message-Id: <20180412143301.6850-14-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 13/22] 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.29]); Thu, 12 Apr 2018 14:33:38 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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 382b062..57e5ea4 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 53f8798..26f6bbf 100644 --- a/src/domain.c +++ b/src/domain.c @@ -542,6 +542,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("(u)", managedSaveImage); +} + static void virtDBusDomainManagedSave(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -809,6 +837,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 Thu May 2 06:33:54 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 1523543620259320.1461840794226; Thu, 12 Apr 2018 07:33:40 -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 E4B0461B8C; Thu, 12 Apr 2018 14:33: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 B95D48779F; Thu, 12 Apr 2018 14:33: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 77ED1180BAE5; Thu, 12 Apr 2018 14:33:38 +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 w3CEXCx1008642 for ; Thu, 12 Apr 2018 10:33:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0A96B215CDCB; Thu, 12 Apr 2018 14:33:12 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id A50472166BAD for ; Thu, 12 Apr 2018 14:33:11 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:53 +0200 Message-Id: <20180412143301.6850-15-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 14/22] 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 12 Apr 2018 14:33:39 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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 57e5ea4..087b64e 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 26f6bbf..336128e 100644 --- a/src/domain.c +++ b/src/domain.c @@ -593,6 +593,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, @@ -839,6 +862,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 Thu May 2 06:33:54 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 1523781501265206.1590775771332; Sun, 15 Apr 2018 01:38:21 -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 007353135534; Sun, 15 Apr 2018 08:38:20 +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 C63FA80F8B; Sun, 15 Apr 2018 08:38:19 +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 858DAADABB; Sun, 15 Apr 2018 08:38:19 +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 w3CEXCDE008651 for ; Thu, 12 Apr 2018 10:33:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9B962215CDCE; Thu, 12 Apr 2018 14:33:12 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43B24215CDCC for ; Thu, 12 Apr 2018 14:33:12 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:54 +0200 Message-Id: <20180412143301.6850-16-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 15/22] 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.12 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:38:20 +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 --- 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 087b64e..7f58cbd 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -139,6 +139,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index 336128e..1896590 100644 --- a/src/domain.c +++ b/src/domain.c @@ -771,6 +771,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) + return virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainShutdown(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -869,6 +894,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 Thu May 2 06:33:54 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 152354360726438.68448661070556; Thu, 12 Apr 2018 07:33:27 -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 D89AE18E687; Thu, 12 Apr 2018 14:33: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 B1CA5857AA; Thu, 12 Apr 2018 14:33: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 7A1DD4CAAB; Thu, 12 Apr 2018 14:33:24 +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 w3CEXDjW008659 for ; Thu, 12 Apr 2018 10:33:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 39CEA215CDCB; Thu, 12 Apr 2018 14:33:13 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id D551D215CDC6 for ; Thu, 12 Apr 2018 14:33:12 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:55 +0200 Message-Id: <20180412143301.6850-17-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 16/22] 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 12 Apr 2018 14:33:26 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 7f58cbd..db9a93e 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 1896590..1f907e0 100644 --- a/src/domain.c +++ b/src/domain.c @@ -450,6 +450,42 @@ 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; + GVariant *grecords; + + g_variant_get(inArgs, "(u)", &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainGetMemoryParameters(domain, NULL, &nparams, flags) =3D=3D= 0 && + nparams !=3D 0) { + if ((params =3D g_new0(virTypedParameter, nparams)) =3D=3D NULL) + return; + if (virDomainGetMemoryParameters(domain, params, &nparams, flags)) + 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 @@ -882,6 +918,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 Thu May 2 06:33:54 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 1523543624862767.289109192286; Thu, 12 Apr 2018 07:33:44 -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 8D524C058ECA; Thu, 12 Apr 2018 14:33: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 5C78067E63; Thu, 12 Apr 2018 14:33: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 17E414CAB8; Thu, 12 Apr 2018 14:33: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 w3CEXDdO008666 for ; Thu, 12 Apr 2018 10:33:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id CD0A6215CDCB; Thu, 12 Apr 2018 14:33:13 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 73348215CDC6 for ; Thu, 12 Apr 2018 14:33:13 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:56 +0200 Message-Id: <20180412143301.6850-18-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 17/22] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 12 Apr 2018 14:33:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index db9a93e..576f415 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 1f907e0..0ae093a 100644 --- a/src/domain.c +++ b/src/domain.c @@ -416,6 +416,42 @@ virtDBusDomainDetachDevice(GVariant *inArgs, return 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; + GVariant *grecords; + + g_variant_get(inArgs, "(u)", &flags); + + domain =3D virtDBusDomainGetVirDomain(connect, objectPath, error); + if (!domain) + return; + + if (virDomainGetBlkioParameters(domain, NULL, &nparams, flags) =3D=3D = 0 && + nparams !=3D 0) { + if ((params =3D g_new0(virTypedParameter, nparams)) =3D=3D NULL) + return; + if (virDomainGetBlkioParameters(domain, params, &nparams, flags)) + 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, @@ -917,6 +953,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 Thu May 2 06:33:54 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 1523543610113505.32128912063024; Thu, 12 Apr 2018 07:33:30 -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 93F454A6F3; Thu, 12 Apr 2018 14:33: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 0D2757E042; Thu, 12 Apr 2018 14:33:28 +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 B59FD4CAAF; Thu, 12 Apr 2018 14:33: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 w3CEXEnR008676 for ; Thu, 12 Apr 2018 10:33:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6D0C5215CDCB; Thu, 12 Apr 2018 14:33:14 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12A3F215CDC6 for ; Thu, 12 Apr 2018 14:33:13 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:57 +0200 Message-Id: <20180412143301.6850-19-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 18/22] 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 12 Apr 2018 14:33:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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 576f415..4b0d02f 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 0ae093a..4e93c2e 100644 --- a/src/domain.c +++ b/src/domain.c @@ -262,6 +262,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, @@ -943,6 +964,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 Thu May 2 06:33:54 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 1523543614662838.0523955220044; Thu, 12 Apr 2018 07:33:34 -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 2420C5D676; Thu, 12 Apr 2018 14:33: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 E443B7E054; Thu, 12 Apr 2018 14:33: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 AD97B4CAB2; Thu, 12 Apr 2018 14:33: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 w3CEXFr5008687 for ; Thu, 12 Apr 2018 10:33:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0B27A215CDCB; Thu, 12 Apr 2018 14:33:15 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6F53215CDC6 for ; Thu, 12 Apr 2018 14:33:14 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:58 +0200 Message-Id: <20180412143301.6850-20-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 19/22] 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 12 Apr 2018 14:33:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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 4b0d02f..1ce1918 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -135,6 +135,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index 4e93c2e..2383870 100644 --- a/src/domain.c +++ b/src/domain.c @@ -772,6 +772,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; + guint64 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, @@ -986,6 +1013,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 Thu May 2 06:33:54 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 1523543617628687.0659454465355; Thu, 12 Apr 2018 07:33:37 -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 5AFAF18EC7D; Thu, 12 Apr 2018 14:33:36 +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 2CD047AD6F; Thu, 12 Apr 2018 14:33:36 +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 831EB180BADC; Thu, 12 Apr 2018 14:33:35 +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 w3CEXFcP008695 for ; Thu, 12 Apr 2018 10:33:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9D20F215CDCB; Thu, 12 Apr 2018 14:33:15 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44D26215CDC6 for ; Thu, 12 Apr 2018 14:33:15 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:32:59 +0200 Message-Id: <20180412143301.6850-21-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 20/22] 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 12 Apr 2018 14:33:36 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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 1ce1918..5d4323b 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -147,6 +147,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index 2383870..85395aa 100644 --- a/src/domain.c +++ b/src/domain.c @@ -823,6 +823,30 @@ virtDBusDomainMigrateSetMaxDowntime(GVariant *inArgs, return 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; + guint64 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, @@ -1015,6 +1039,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 Thu May 2 06:33:54 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 1523543622414784.1865295236396; Thu, 12 Apr 2018 07:33:42 -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 0DDD4C058EA8; Thu, 12 Apr 2018 14:33:41 +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 B1ECE8A9EA; Thu, 12 Apr 2018 14:33:40 +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 683DB4CAB7; Thu, 12 Apr 2018 14:33:40 +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 w3CEXGrX008705 for ; Thu, 12 Apr 2018 10:33:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3BBFF215CDCB; Thu, 12 Apr 2018 14:33:16 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7172215CDC6 for ; Thu, 12 Apr 2018 14:33:15 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:33:00 +0200 Message-Id: <20180412143301.6850-22-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 21/22] 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 12 Apr 2018 14:33:41 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- 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 5d4323b..0937cbb 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -167,6 +167,12 @@ + + + + + diff --git a/src/domain.c b/src/domain.c index 85395aa..a8d3e6c 100644 --- a/src/domain.c +++ b/src/domain.c @@ -915,6 +915,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) + return virtDBusUtilSetLastVirtError(error); +} + static void virtDBusDomainSetVcpus(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1044,6 +1069,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 Thu May 2 06:33:54 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 1523781505093260.83373295342017; Sun, 15 Apr 2018 01:38: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 C17B63135B3B; Sun, 15 Apr 2018 08:38:23 +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 8FBAC63F8E; Sun, 15 Apr 2018 08:38:23 +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 45493B3487; Sun, 15 Apr 2018 08:38: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 w3CEXGMs008716 for ; Thu, 12 Apr 2018 10:33:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id D2C1F215CDCB; Thu, 12 Apr 2018 14:33:16 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74B96215CDC6 for ; Thu, 12 Apr 2018 14:33:16 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 16:33:01 +0200 Message-Id: <20180412143301.6850-23-kkoukiou@redhat.com> In-Reply-To: <20180412143301.6850-1-kkoukiou@redhat.com> References: <20180412143301.6850-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 v2 22/22] 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.11 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:38:24 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Katerina Koukiou --- data/org.libvirt.Domain.xml | 6 ++++++ src/domain.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 0937cbb..5763a8a 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 a8d3e6c..0eda7cf 100644 --- a/src/domain.c +++ b/src/domain.c @@ -543,6 +543,43 @@ 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) { + if ((params =3D g_new0(virTypedParameter, nparams)) =3D=3D NULL) + return; + 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 @@ -1054,6 +1091,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