From nobody Sun Apr 28 14:51:52 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 1523781385171493.94171553127467; Sun, 15 Apr 2018 01:36:25 -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 C0E121B285A; Sun, 15 Apr 2018 08:36: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 87F6880F88; Sun, 15 Apr 2018 08:36: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 3DD3B5BBF3; Sun, 15 Apr 2018 08:36:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3C9j7ZN003026 for ; Thu, 12 Apr 2018 05:45:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 984BF2026985; Thu, 12 Apr 2018 09:45:07 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FA432024CA4 for ; Thu, 12 Apr 2018 09:45:07 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 11:45:00 +0200 Message-Id: <20180412094505.25643-2-kkoukiou@redhat.com> In-Reply-To: <20180412094505.25643-1-kkoukiou@redhat.com> References: <20180412094505.25643-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 1/6] 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 15 Apr 2018 08:36: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 | 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 15235263119961001.8288147773628; Thu, 12 Apr 2018 02:45: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 33AF785542; Thu, 12 Apr 2018 09:45:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E54CD67E40; Thu, 12 Apr 2018 09:45: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 A49AD4CA9F; Thu, 12 Apr 2018 09:45:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3C9j8WL003038 for ; Thu, 12 Apr 2018 05:45:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 374E22024CA7; Thu, 12 Apr 2018 09:45:08 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id D2B412024CA4 for ; Thu, 12 Apr 2018 09:45:07 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 11:45:01 +0200 Message-Id: <20180412094505.25643-3-kkoukiou@redhat.com> In-Reply-To: <20180412094505.25643-1-kkoukiou@redhat.com> References: <20180412094505.25643-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 2/6] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 12 Apr 2018 09:45:10 +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 Sun Apr 28 14:51:52 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 1523526315302635.3475795565399; Thu, 12 Apr 2018 02:45:15 -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 A16DF18EC5A; Thu, 12 Apr 2018 09:45: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 6144C78DCF; Thu, 12 Apr 2018 09:45:13 +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 21FEA4CAA2; Thu, 12 Apr 2018 09:45:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3C9j85p003051 for ; Thu, 12 Apr 2018 05:45:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id CA38E2017E8A; Thu, 12 Apr 2018 09:45:08 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 717E12026985 for ; Thu, 12 Apr 2018 09:45:08 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 11:45:02 +0200 Message-Id: <20180412094505.25643-4-kkoukiou@redhat.com> In-Reply-To: <20180412094505.25643-1-kkoukiou@redhat.com> References: <20180412094505.25643-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 3/6] 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.38]); Thu, 12 Apr 2018 09:45:14 +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 Sun Apr 28 14:51:52 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 1523526315719572.7248791316251; Thu, 12 Apr 2018 02:45:15 -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 D3C453130669; Thu, 12 Apr 2018 09:45:13 +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 9C7B278DC5; Thu, 12 Apr 2018 09:45:13 +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 4DCC6180215F; Thu, 12 Apr 2018 09:45:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3C9j9fB003061 for ; Thu, 12 Apr 2018 05:45:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6A0EC2024CA4; Thu, 12 Apr 2018 09:45:09 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0FD6E202660C for ; Thu, 12 Apr 2018 09:45:08 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 11:45:03 +0200 Message-Id: <20180412094505.25643-5-kkoukiou@redhat.com> In-Reply-To: <20180412094505.25643-1-kkoukiou@redhat.com> References: <20180412094505.25643-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 4/6] Implement MemoryStats for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 12 Apr 2018 09:45:14 +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 | 57 +++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 64 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..0893f96 100644 --- a/src/domain.c +++ b/src/domain.c @@ -17,6 +17,29 @@ VIRT_DBUS_ENUM_IMPL(virtDBusDomainMemoryStat, "usable", "last_update") =20 +static const gchar * +virtDBusDomainMemoryStatToString(gint tag) +{ + const gchar *str =3D virtDBusDomainMemoryStatTypeToString(tag); + return str ? str : "unknown"; +} + +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++) + g_variant_builder_add(&builder, "{st}", + virtDBusDomainMemoryStatToString(stats[i].ta= g), + stats[i].val); + + return g_variant_builder_end(&builder); +} + static virDomainPtr virtDBusDomainGetVirDomain(virtDBusConnect *connect, const gchar *objectPath, @@ -412,6 +435,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 +621,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 Sun Apr 28 14:51:52 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 1523526319428752.971425813787; Thu, 12 Apr 2018 02:45:19 -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 1CDC281DF1; Thu, 12 Apr 2018 09:45: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 DDFAA78DC7; Thu, 12 Apr 2018 09:45:17 +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 84D24180BAD3; Thu, 12 Apr 2018 09:45:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3C9jAO1003066 for ; Thu, 12 Apr 2018 05:45:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 084312026985; Thu, 12 Apr 2018 09:45:10 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id A32AB2024CA7 for ; Thu, 12 Apr 2018 09:45:09 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 11:45:04 +0200 Message-Id: <20180412094505.25643-6-kkoukiou@redhat.com> In-Reply-To: <20180412094505.25643-1-kkoukiou@redhat.com> References: <20180412094505.25643-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 5/6] 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 12 Apr 2018 09:45:18 +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 0893f96..d246d45 100644 --- a/src/domain.c +++ b/src/domain.c @@ -297,6 +297,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, @@ -616,6 +640,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 Sun Apr 28 14:51:52 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 1523526319335768.2833727071403; Thu, 12 Apr 2018 02:45:19 -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 CA65813AA1; Thu, 12 Apr 2018 09:45:17 +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 8297F877A7; Thu, 12 Apr 2018 09:45:17 +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 243C2180596F; Thu, 12 Apr 2018 09:45:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3C9jAVM003078 for ; Thu, 12 Apr 2018 05:45:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9AB072024CA4; Thu, 12 Apr 2018 09:45:10 +0000 (UTC) Received: from katerina.brq.redhat.com (unknown [10.43.2.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41924202660C for ; Thu, 12 Apr 2018 09:45:10 +0000 (UTC) From: Katerina Koukiou To: libvir-list@redhat.com Date: Thu, 12 Apr 2018 11:45:05 +0200 Message-Id: <20180412094505.25643-7-kkoukiou@redhat.com> In-Reply-To: <20180412094505.25643-1-kkoukiou@redhat.com> References: <20180412094505.25643-1-kkoukiou@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [dbus PATCH 6/6] Implement DetachDevice method for Domain Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 12 Apr 2018 09:45:18 +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 d246d45..ed50c68 100644 --- a/src/domain.c +++ b/src/domain.c @@ -367,6 +367,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 @@ -643,6 +667,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