From nobody Wed May 15 15:08:56 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 1530913064581751.0001535147561; Fri, 6 Jul 2018 14:37:44 -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 F06B8308FB8A; Fri, 6 Jul 2018 21:37:42 +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 B4F31600C8; Fri, 6 Jul 2018 21:37:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5152D4A46C; Fri, 6 Jul 2018 21:37:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbAsT003831 for ; Fri, 6 Jul 2018 17:37:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id D9F9F1001F3E; Fri, 6 Jul 2018 21:37:10 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62A531001938; Fri, 6 Jul 2018 21:37:10 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:41 -0400 Message-Id: <831f1916dcfcbc875ce0b7e049971f6579c0674c.1530912831.git.aharter@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 01/15] Introduce Interface Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 06 Jul 2018 21:37:43 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/Makefile.am | 1 + data/org.libvirt.Interface.xml | 7 +++ src/Makefile.am | 2 + src/connect.c | 6 +++ src/connect.h | 1 + src/interface.c | 86 ++++++++++++++++++++++++++++++++++ src/interface.h | 9 ++++ src/util.c | 35 ++++++++++++++ src/util.h | 15 ++++++ 9 files changed, 162 insertions(+) create mode 100644 data/org.libvirt.Interface.xml create mode 100644 src/interface.c create mode 100644 src/interface.h diff --git a/data/Makefile.am b/data/Makefile.am index 7b523da..35a0bbd 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -33,6 +33,7 @@ polkit_DATA =3D \ interfaces_files =3D \ org.libvirt.Connect.xml \ org.libvirt.Domain.xml \ + org.libvirt.Interface.xml \ org.libvirt.Network.xml \ org.libvirt.NodeDevice.xml \ org.libvirt.NWFilter.xml \ diff --git a/data/org.libvirt.Interface.xml b/data/org.libvirt.Interface.xml new file mode 100644 index 0000000..93fa32f --- /dev/null +++ b/data/org.libvirt.Interface.xml @@ -0,0 +1,7 @@ + + + + + + diff --git a/src/Makefile.am b/src/Makefile.am index b5bf129..d0e8f0d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -41,6 +41,8 @@ libvirt_dbus_SOURCES =3D \ events.h \ gdbus.c \ gdbus.h \ + interface.c \ + interface.h \ main.c \ network.c \ network.h \ diff --git a/src/connect.c b/src/connect.c index 9ebceaa..b10533a 100644 --- a/src/connect.c +++ b/src/connect.c @@ -1,6 +1,7 @@ #include "connect.h" #include "domain.h" #include "events.h" +#include "interface.h" #include "network.h" #include "nodedev.h" #include "nwfilter.h" @@ -1810,6 +1811,7 @@ virtDBusConnectFree(virtDBusConnect *connect) =20 g_free(connect->nodeDevPath); g_free(connect->domainPath); + g_free(connect->interfacePath); g_free(connect->networkPath); g_free(connect->nwfilterPath); g_free(connect->secretPath); @@ -1869,6 +1871,10 @@ virtDBusConnectNew(virtDBusConnect **connectp, if (error && *error) return; =20 + virtDBusInterfaceRegister(connect, error); + if (error && *error) + return; + virtDBusNetworkRegister(connect, error); if (error && *error) return; diff --git a/src/connect.h b/src/connect.h index b81b6a8..f755534 100644 --- a/src/connect.h +++ b/src/connect.h @@ -14,6 +14,7 @@ struct virtDBusConnect { const gchar *connectPath; gchar *nodeDevPath; gchar *domainPath; + gchar *interfacePath; gchar *networkPath; gchar *nwfilterPath; gchar *secretPath; diff --git a/src/interface.c b/src/interface.c new file mode 100644 index 0000000..6dbc702 --- /dev/null +++ b/src/interface.c @@ -0,0 +1,86 @@ +#include "interface.h" +#include "util.h" + +#include + +static virInterfacePtr +virtDBusInterfaceGetVirInterface(virtDBusConnect *connect, + const gchar *objectPath, + GError **error) +{ + virInterfacePtr interface; + + if (virtDBusConnectOpen(connect, error) < 0) + return NULL; + + interface =3D virtDBusUtilVirInterfaceFromBusPath(connect->connection, + objectPath, + connect->interfacePath= ); + if (!interface) { + virtDBusUtilSetLastVirtError(error); + return NULL; + } + + return interface; +} + +static virtDBusGDBusPropertyTable virtDBusInterfacePropertyTable[] =3D { + { 0 } +}; + +static virtDBusGDBusMethodTable virtDBusInterfaceMethodTable[] =3D { + { 0 } +}; + +static gchar ** +virtDBusInterfaceEnumerate(gpointer userData) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virInterfacePtr) interfaces =3D NULL; + gint num =3D 0; + gchar **ret =3D NULL; + + if (!virtDBusConnectOpen(connect, NULL)) + return NULL; + + num =3D virConnectListAllInterfaces(connect->connection, &interfaces, = 0); + if (num < 0) + return NULL; + + if (num =3D=3D 0) + return NULL; + + ret =3D g_new0(gchar *, num + 1); + + for (gint i =3D 0; i < num; i++) { + ret[i] =3D virtDBusUtilBusPathForVirInterface(interfaces[i], + connect->interfacePath= ); + } + + return ret; +} + +static GDBusInterfaceInfo *interfaceInfo; + +void +virtDBusInterfaceRegister(virtDBusConnect *connect, + GError **error) +{ + connect->interfacePath =3D g_strdup_printf("%s/interface", + connect->connectPath); + + if (!interfaceInfo) { + interfaceInfo =3D virtDBusGDBusLoadIntrospectData(VIRT_DBUS_INTERF= ACE_INTERFACE, + error); + if (!interfaceInfo) + return; + } + + virtDBusGDBusRegisterSubtree(connect->bus, + connect->interfacePath, + interfaceInfo, + virtDBusInterfaceEnumerate, + virtDBusInterfaceMethodTable, + virtDBusInterfacePropertyTable, + connect); +} diff --git a/src/interface.h b/src/interface.h new file mode 100644 index 0000000..8e5ee0a --- /dev/null +++ b/src/interface.h @@ -0,0 +1,9 @@ +#pragma once + +#include "connect.h" + +#define VIRT_DBUS_INTERFACE_INTERFACE "org.libvirt.Interface" + +void +virtDBusInterfaceRegister(virtDBusConnect *connect, + GError **error); diff --git a/src/util.c b/src/util.c index 8c822f2..9e11285 100644 --- a/src/util.c +++ b/src/util.c @@ -278,6 +278,41 @@ virtDBusUtilVirDomainListFree(virDomainPtr *domains) g_free(domains); } =20 +virInterfacePtr +virtDBusUtilVirInterfaceFromBusPath(virConnectPtr connection, + const gchar *path, + const gchar *interfacePath) +{ + g_autofree gchar *macstr =3D NULL; + gsize prefixLen =3D strlen(interfacePath) + 1; + + macstr =3D virtDBusUtilDecodeStr(path + prefixLen); + + return virInterfaceLookupByMACString(connection, macstr); +} + +gchar * +virtDBusUtilBusPathForVirInterface(virInterfacePtr interface, + const gchar *interfacePath) +{ + const gchar *macstr =3D NULL; + g_autofree const gchar *encodedMACStr =3D NULL; + + macstr =3D virInterfaceGetMACString(interface); + encodedMACStr =3D virtDBusUtilEncodeStr(macstr); + + return g_strdup_printf("%s/%s", interfacePath, encodedMACStr); +} + +void +virtDBusUtilVirInterfaceListFree(virInterfacePtr *interfaces) +{ + for (gint i =3D 0; interfaces[i] !=3D NULL; i++) + virInterfaceFree(interfaces[i]); + + g_free(interfaces); +} + virNetworkPtr virtDBusUtilVirNetworkFromBusPath(virConnectPtr connection, const gchar *path, diff --git a/src/util.h b/src/util.h index a688a3d..b05c2fc 100644 --- a/src/util.h +++ b/src/util.h @@ -65,6 +65,21 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainPtr, virtDBusUtil= VirDomainListFree); =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainStatsRecordPtr, virDomainStatsRecor= dListFree); =20 +virInterfacePtr +virtDBusUtilVirInterfaceFromBusPath(virConnectPtr connection, + const gchar *path, + const gchar *interfacePath); + +gchar * +virtDBusUtilBusPathForVirInterface(virInterfacePtr interface, + const gchar *interfacePath); + +void +virtDBusUtilVirInterfaceListFree(virInterfacePtr *interfaces); + +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virInterface, virInterfaceFree); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virInterfacePtr, virtDBusUtilVirInterfaceLis= tFree); + virNetworkPtr virtDBusUtilVirNetworkFromBusPath(virConnectPtr connection, const gchar *path, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 1530913069820297.89598483076554; Fri, 6 Jul 2018 14:37:49 -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 4FF7437E7B; Fri, 6 Jul 2018 21:37:48 +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 0A7B184FF; Fri, 6 Jul 2018 21:37:48 +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 B00EC18037F0; Fri, 6 Jul 2018 21:37:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbBpT003839 for ; Fri, 6 Jul 2018 17:37:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7A9D41001F5E; Fri, 6 Jul 2018 21:37:11 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14ED81001F3E; Fri, 6 Jul 2018 21:37:10 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:42 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 02/15] Implement Name property for Interface 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]); Fri, 06 Jul 2018 21:37:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Interface.xml | 5 +++++ src/interface.c | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/data/org.libvirt.Interface.xml b/data/org.libvirt.Interface.xml index 93fa32f..ad7c326 100644 --- a/data/org.libvirt.Interface.xml +++ b/data/org.libvirt.Interface.xml @@ -3,5 +3,10 @@ =20 + + + + diff --git a/src/interface.c b/src/interface.c index 6dbc702..733ce44 100644 --- a/src/interface.c +++ b/src/interface.c @@ -24,7 +24,29 @@ virtDBusInterfaceGetVirInterface(virtDBusConnect *connec= t, return interface; } =20 +static void +virtDBusInterfaceGetName(const gchar *objectPath, + gpointer userData, + GVariant **value, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virInterface) interface =3D NULL; + const gchar *name; + + interface =3D virtDBusInterfaceGetVirInterface(connect, objectPath, er= ror); + if (!interface) + return; + + name =3D virInterfaceGetName(interface); + if (!name) + return virtDBusUtilSetLastVirtError(error); + + *value =3D g_variant_new("s", name); +} + static virtDBusGDBusPropertyTable virtDBusInterfacePropertyTable[] =3D { + { "Name", virtDBusInterfaceGetName, NULL }, { 0 } }; =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 1530913075383967.8302678557601; Fri, 6 Jul 2018 14:37:55 -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 E1E6EC03D461; Fri, 6 Jul 2018 21:37:53 +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 995B253B2C; Fri, 6 Jul 2018 21:37:53 +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 4A1F03FB1D; Fri, 6 Jul 2018 21:37:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbC64003846 for ; Fri, 6 Jul 2018 17:37:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1587E1001F5E; Fri, 6 Jul 2018 21:37:12 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB9681001F5D; Fri, 6 Jul 2018 21:37:11 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:43 -0400 Message-Id: <128f8bb60a265686d71868256d8eef883f8285f5.1530912831.git.aharter@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 03/15] Implement MACString property for Interface 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.31]); Fri, 06 Jul 2018 21:37:54 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Interface.xml | 5 +++++ src/interface.c | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/data/org.libvirt.Interface.xml b/data/org.libvirt.Interface.xml index ad7c326..e6d9f2a 100644 --- a/data/org.libvirt.Interface.xml +++ b/data/org.libvirt.Interface.xml @@ -8,5 +8,10 @@ value=3D"See https://libvirt.org/html/libvirt-libvirt-interface.ht= ml#virInterfaceGetName"/> + + + + diff --git a/src/interface.c b/src/interface.c index 733ce44..2b62304 100644 --- a/src/interface.c +++ b/src/interface.c @@ -45,7 +45,29 @@ virtDBusInterfaceGetName(const gchar *objectPath, *value =3D g_variant_new("s", name); } =20 +static void +virtDBusInterfaceGetMACString(const gchar *objectPath, + gpointer userData, + GVariant **value, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virInterface) interface =3D NULL; + const gchar *mac; + + interface =3D virtDBusInterfaceGetVirInterface(connect, objectPath, er= ror); + if (!interface) + return; + + mac =3D virInterfaceGetMACString(interface); + if (!mac) + return virtDBusUtilSetLastVirtError(error); + + *value =3D g_variant_new("s", mac); +} + static virtDBusGDBusPropertyTable virtDBusInterfacePropertyTable[] =3D { + { "MACString", virtDBusInterfaceGetMACString, NULL }, { "Name", virtDBusInterfaceGetName, NULL }, { 0 } }; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 1530913039509674.4664042852636; Fri, 6 Jul 2018 14:37:19 -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 A4D9230832EE; Fri, 6 Jul 2018 21:37: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 B3DD1600C4; Fri, 6 Jul 2018 21:37: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 9F9C518037EC; Fri, 6 Jul 2018 21:37:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbCZL003852 for ; Fri, 6 Jul 2018 17:37:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id A9FE91001938; Fri, 6 Jul 2018 21:37:12 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45B3C10021B1; Fri, 6 Jul 2018 21:37:12 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:44 -0400 Message-Id: <15b4a1d5d8eb6179152da0b27b22e967718e1985.1530912831.git.aharter@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 04/15] Implement Active property for Interface 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]); Fri, 06 Jul 2018 21:37:18 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Interface.xml | 4 ++++ src/interface.c | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/data/org.libvirt.Interface.xml b/data/org.libvirt.Interface.xml index e6d9f2a..f50bc37 100644 --- a/data/org.libvirt.Interface.xml +++ b/data/org.libvirt.Interface.xml @@ -13,5 +13,9 @@ value=3D"See https://libvirt.org/html/libvirt-libvirt-interface.ht= ml#virInterfaceGetMACString"/> + + + diff --git a/src/interface.c b/src/interface.c index 2b62304..b73e116 100644 --- a/src/interface.c +++ b/src/interface.c @@ -66,7 +66,29 @@ virtDBusInterfaceGetMACString(const gchar *objectPath, *value =3D g_variant_new("s", mac); } =20 +static void +virtDBusInterfaceGetActive(const gchar *objectPath, + gpointer userData, + GVariant **value, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virInterface) interface =3D NULL; + gint active; + + interface =3D virtDBusInterfaceGetVirInterface(connect, objectPath, er= ror); + if (!interface) + return; + + active =3D virInterfaceIsActive(interface); + if (active < 0) + return virtDBusUtilSetLastVirtError(error); + + *value =3D g_variant_new("b", !!active); +} + static virtDBusGDBusPropertyTable virtDBusInterfacePropertyTable[] =3D { + { "Active", virtDBusInterfaceGetActive, NULL }, { "MACString", virtDBusInterfaceGetMACString, NULL }, { "Name", virtDBusInterfaceGetName, NULL }, { 0 } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 1530913065260797.0387697396308; Fri, 6 Jul 2018 14:37:45 -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 05260308A95D; Fri, 6 Jul 2018 21:37: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 B5DB784FF; Fri, 6 Jul 2018 21:37:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 585274A46D; Fri, 6 Jul 2018 21:37:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbDb5003857 for ; Fri, 6 Jul 2018 17:37:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 440341001940; Fri, 6 Jul 2018 21:37:13 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id D52371001F5D; Fri, 6 Jul 2018 21:37:12 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:45 -0400 Message-Id: <5796df450068ea08180607dd7d64bd3868269f6c.1530912831.git.aharter@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 05/15] Implement ListInterfaces method for Connect 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.41]); Fri, 06 Jul 2018 21:37:43 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Connect.xml | 6 ++++++ src/connect.c | 38 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml index 7014a09..0604841 100644 --- a/data/org.libvirt.Connect.xml +++ b/data/org.libvirt.Connect.xml @@ -154,6 +154,12 @@ + + + + + diff --git a/src/connect.c b/src/connect.c index b10533a..a3d002e 100644 --- a/src/connect.c +++ b/src/connect.c @@ -772,6 +772,43 @@ virtDBusConnectListDomains(GVariant *inArgs, *outArgs =3D g_variant_new_tuple(&gdomains, 1); } =20 +static void +virtDBusConnectListInterfaces(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath G_GNUC_UNUSED, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virInterfacePtr) interfaces =3D NULL; + guint flags; + GVariantBuilder builder; + GVariant *ginterfaces; + + g_variant_get(inArgs, "(u)", &flags); + + if (!virtDBusConnectOpen(connect, error)) + return; + + if (virConnectListAllInterfaces(connect->connection, &interfaces, flag= s) < 0) + return virtDBusUtilSetLastVirtError(error); + + g_variant_builder_init(&builder, G_VARIANT_TYPE("ao")); + + for (gint i =3D 0; interfaces[i]; i++) { + g_autofree gchar *path =3D NULL; + path =3D virtDBusUtilBusPathForVirInterface(interfaces[i], + connect->interfacePath); + + g_variant_builder_add(&builder, "o", path); + } + + ginterfaces =3D g_variant_builder_end(&builder); + *outArgs =3D g_variant_new_tuple(&ginterfaces, 1); +} + static void virtDBusConnectListNetworks(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1767,6 +1804,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethod= Table[] =3D { { "GetDomainCapabilities", virtDBusConnectGetDomainCapabilities }, { "GetSysinfo", virtDBusConnectGetSysinfo }, { "ListDomains", virtDBusConnectListDomains }, + { "ListInterfaces", virtDBusConnectListInterfaces }, { "ListNetworks", virtDBusConnectListNetworks }, { "ListNodeDevices", virtDBusConnectListNodeDevices }, { "ListNWFilters", virtDBusConnectListNWFilters }, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 1530913080417811.6660131083476; Fri, 6 Jul 2018 14:38:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14BF183F45; Fri, 6 Jul 2018 21:37:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD3E21001F5E; Fri, 6 Jul 2018 21:37:58 +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 5CA0818037F3; Fri, 6 Jul 2018 21:37:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbDTA003865 for ; Fri, 6 Jul 2018 17:37:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id D5C5D1001F5D; Fri, 6 Jul 2018 21:37:13 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 729621001938; Fri, 6 Jul 2018 21:37:13 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:46 -0400 Message-Id: <46429af1810839a075fbf4621c4bf0c996ae848c.1530912831.git.aharter@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 06/15] Implement InterfaceDefineXML method for Connect 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 06 Jul 2018 21:37:59 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Connect.xml | 7 +++++++ src/connect.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml index 0604841..791e1f5 100644 --- a/data/org.libvirt.Connect.xml +++ b/data/org.libvirt.Connect.xml @@ -148,6 +148,13 @@ + + + + + + diff --git a/src/connect.c b/src/connect.c index a3d002e..8c39d52 100644 --- a/src/connect.c +++ b/src/connect.c @@ -735,6 +735,35 @@ virtDBusConnectGetSysinfo(GVariant *inArgs, *outArgs =3D g_variant_new("(s)", sysinfo); } =20 +static void +virtDBusConnectInterfaceDefineXML(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath G_GNUC_UNUSED, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virInterface) interface =3D NULL; + g_autofree gchar *path =3D NULL; + const gchar *xml; + guint flags; + + g_variant_get(inArgs, "(&su)", &xml, &flags); + + if (!virtDBusConnectOpen(connect, error)) + return; + + interface =3D virInterfaceDefineXML(connect->connection, xml, flags); + if (!interface) + return virtDBusUtilSetLastVirtError(error); + + path =3D virtDBusUtilBusPathForVirInterface(interface, connect->interf= acePath); + + *outArgs =3D g_variant_new("(o)", path); +} + static void virtDBusConnectListDomains(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1803,6 +1832,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethod= Table[] =3D { { "GetCPUModelNames", virtDBusConnectGetCPUModelNames }, { "GetDomainCapabilities", virtDBusConnectGetDomainCapabilities }, { "GetSysinfo", virtDBusConnectGetSysinfo }, + { "InterfaceDefineXML", virtDBusConnectInterfaceDefineXML }, { "ListDomains", virtDBusConnectListDomains }, { "ListInterfaces", virtDBusConnectListInterfaces }, { "ListNetworks", virtDBusConnectListNetworks }, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 153091308590262.56456388457332; Fri, 6 Jul 2018 14:38:05 -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 A9D3EA8BB; Fri, 6 Jul 2018 21:38:04 +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 6D7912A313; Fri, 6 Jul 2018 21:38:04 +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 EEDB818037F8; Fri, 6 Jul 2018 21:38:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbEht003875 for ; Fri, 6 Jul 2018 17:37:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7626910021B1; Fri, 6 Jul 2018 21:37:14 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 101F41001F5D; Fri, 6 Jul 2018 21:37:13 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:47 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 07/15] Implement InterfaceChangeBegin method for Connect 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.29]); Fri, 06 Jul 2018 21:38:05 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Connect.xml | 5 +++++ src/connect.c | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml index 791e1f5..604afea 100644 --- a/data/org.libvirt.Connect.xml +++ b/data/org.libvirt.Connect.xml @@ -148,6 +148,11 @@ + + + + diff --git a/src/connect.c b/src/connect.c index 8c39d52..7cf2d66 100644 --- a/src/connect.c +++ b/src/connect.c @@ -735,6 +735,27 @@ virtDBusConnectGetSysinfo(GVariant *inArgs, *outArgs =3D g_variant_new("(s)", sysinfo); } =20 +static void +virtDBusConnectInterfaceChangeBegin(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath G_GNUC_UNUSED, + gpointer userData, + GVariant **outArgs G_GNUC_UNUSED, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + guint flags; + + g_variant_get(inArgs, "(u)", &flags); + + if (!virtDBusConnectOpen(connect, error)) + return; + + if (virInterfaceChangeBegin(connect->connection, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusConnectInterfaceDefineXML(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1832,6 +1853,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethod= Table[] =3D { { "GetCPUModelNames", virtDBusConnectGetCPUModelNames }, { "GetDomainCapabilities", virtDBusConnectGetDomainCapabilities }, { "GetSysinfo", virtDBusConnectGetSysinfo }, + { "InterfaceChangeBegin", virtDBusConnectInterfaceChangeBegin }, { "InterfaceDefineXML", virtDBusConnectInterfaceDefineXML }, { "ListDomains", virtDBusConnectListDomains }, { "ListInterfaces", virtDBusConnectListInterfaces }, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 1530913091896332.0089305819042; Fri, 6 Jul 2018 14:38:11 -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 B25DD308212A; Fri, 6 Jul 2018 21:38: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 6DB35BA4D; Fri, 6 Jul 2018 21:38:10 +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 13BF93F7FE; Fri, 6 Jul 2018 21:38:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbFxD003890 for ; Fri, 6 Jul 2018 17:37:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 173F51001940; Fri, 6 Jul 2018 21:37:15 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id A231910021B1; Fri, 6 Jul 2018 21:37:14 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:48 -0400 Message-Id: <596d47857246a019a49449c28d7e1ff9a0ca02e6.1530912831.git.aharter@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 08/15] Implement InterfaceChangeCommit method for Connect 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.42]); Fri, 06 Jul 2018 21:38:11 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Connect.xml | 5 +++++ src/connect.c | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml index 604afea..8c88cc8 100644 --- a/data/org.libvirt.Connect.xml +++ b/data/org.libvirt.Connect.xml @@ -153,6 +153,11 @@ value=3D"See https://libvirt.org/html/libvirt-libvirt-interface.ht= ml#virInterfaceChangeBegin"/> + + + + diff --git a/src/connect.c b/src/connect.c index 7cf2d66..dadfd96 100644 --- a/src/connect.c +++ b/src/connect.c @@ -756,6 +756,27 @@ virtDBusConnectInterfaceChangeBegin(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusConnectInterfaceChangeCommit(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath G_GNUC_UNUSED, + gpointer userData, + GVariant **outArgs G_GNUC_UNUSED, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + guint flags; + + g_variant_get(inArgs, "(u)", &flags); + + if (!virtDBusConnectOpen(connect, error)) + return; + + if (virInterfaceChangeCommit(connect->connection, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusConnectInterfaceDefineXML(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1854,6 +1875,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethod= Table[] =3D { { "GetDomainCapabilities", virtDBusConnectGetDomainCapabilities }, { "GetSysinfo", virtDBusConnectGetSysinfo }, { "InterfaceChangeBegin", virtDBusConnectInterfaceChangeBegin }, + { "InterfaceChangeCommit", virtDBusConnectInterfaceChangeCommit }, { "InterfaceDefineXML", virtDBusConnectInterfaceDefineXML }, { "ListDomains", virtDBusConnectListDomains }, { "ListInterfaces", virtDBusConnectListInterfaces }, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 1530913069962536.2738041480442; Fri, 6 Jul 2018 14:37:49 -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 76318285CE; Fri, 6 Jul 2018 21:37:48 +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 36D4C5D76F; Fri, 6 Jul 2018 21:37:48 +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 D69A018037F4; Fri, 6 Jul 2018 21:37:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbF95003897 for ; Fri, 6 Jul 2018 17:37:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id A6C371001F5D; Fri, 6 Jul 2018 21:37:15 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46B241001938; Fri, 6 Jul 2018 21:37:15 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:49 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 09/15] Implement InterfaceChangeRollback method for Connect 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.30]); Fri, 06 Jul 2018 21:37:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Connect.xml | 5 +++++ src/connect.c | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml index 8c88cc8..7c97117 100644 --- a/data/org.libvirt.Connect.xml +++ b/data/org.libvirt.Connect.xml @@ -158,6 +158,11 @@ value=3D"See https://libvirt.org/html/libvirt-libvirt-interface.ht= ml#virInterfaceChangeCommit"/> + + + + diff --git a/src/connect.c b/src/connect.c index dadfd96..563535c 100644 --- a/src/connect.c +++ b/src/connect.c @@ -777,6 +777,27 @@ virtDBusConnectInterfaceChangeCommit(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusConnectInterfaceChangeRollback(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath G_GNUC_UNUS= ED, + gpointer userData, + GVariant **outArgs G_GNUC_UNUSED, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + guint flags; + + g_variant_get(inArgs, "(u)", &flags); + + if (!virtDBusConnectOpen(connect, error)) + return; + + if (virInterfaceChangeRollback(connect->connection, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static void virtDBusConnectInterfaceDefineXML(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1876,6 +1897,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethod= Table[] =3D { { "GetSysinfo", virtDBusConnectGetSysinfo }, { "InterfaceChangeBegin", virtDBusConnectInterfaceChangeBegin }, { "InterfaceChangeCommit", virtDBusConnectInterfaceChangeCommit }, + { "InterfaceChangeRollback", virtDBusConnectInterfaceChangeRollback }, { "InterfaceDefineXML", virtDBusConnectInterfaceDefineXML }, { "ListDomains", virtDBusConnectListDomains }, { "ListInterfaces", virtDBusConnectListInterfaces }, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 1530913044210248.7066755422618; Fri, 6 Jul 2018 14:37:24 -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 7AD08C0587C5; Fri, 6 Jul 2018 21:37:22 +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 2F65A7B8C7; Fri, 6 Jul 2018 21:37: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 857604A460; Fri, 6 Jul 2018 21:37:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbGoN003902 for ; Fri, 6 Jul 2018 17:37:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 45F521001940; Fri, 6 Jul 2018 21:37:16 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id D78781001F5D; Fri, 6 Jul 2018 21:37:15 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:50 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 10/15] Implement InterfaceLookupByName method for Connect 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.32]); Fri, 06 Jul 2018 21:37:23 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Connect.xml | 6 ++++++ src/connect.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml index 7c97117..f99e205 100644 --- a/data/org.libvirt.Connect.xml +++ b/data/org.libvirt.Connect.xml @@ -170,6 +170,12 @@ + + + + + diff --git a/src/connect.c b/src/connect.c index 563535c..51a6ba0 100644 --- a/src/connect.c +++ b/src/connect.c @@ -827,6 +827,34 @@ virtDBusConnectInterfaceDefineXML(GVariant *inArgs, *outArgs =3D g_variant_new("(o)", path); } =20 +static void +virtDBusConnectInterfaceLookupByName(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath G_GNUC_UNUSED, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUSED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virInterface) interface =3D NULL; + g_autofree gchar *path =3D NULL; + const gchar *name; + + g_variant_get(inArgs, "(s)", &name); + + if (!virtDBusConnectOpen(connect, NULL)) + return; + + interface =3D virInterfaceLookupByName(connect->connection, name); + if (!interface) + return virtDBusUtilSetLastVirtError(error); + + path =3D virtDBusUtilBusPathForVirInterface(interface, connect->interf= acePath); + + *outArgs =3D g_variant_new("(o)", path); +} + static void virtDBusConnectListDomains(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1899,6 +1927,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethod= Table[] =3D { { "InterfaceChangeCommit", virtDBusConnectInterfaceChangeCommit }, { "InterfaceChangeRollback", virtDBusConnectInterfaceChangeRollback }, { "InterfaceDefineXML", virtDBusConnectInterfaceDefineXML }, + { "InterfaceLookupByName", virtDBusConnectInterfaceLookupByName }, { "ListDomains", virtDBusConnectListDomains }, { "ListInterfaces", virtDBusConnectListInterfaces }, { "ListNetworks", virtDBusConnectListNetworks }, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 1530913064625919.5958225546939; Fri, 6 Jul 2018 14:37:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0BA5B3084028; Fri, 6 Jul 2018 21:37:43 +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 BEC0B68897; Fri, 6 Jul 2018 21:37:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 546BF18037F4; Fri, 6 Jul 2018 21:37:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbG2Q003907 for ; Fri, 6 Jul 2018 17:37:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id E092E1001F5E; Fri, 6 Jul 2018 21:37:16 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75A2E1001940; Fri, 6 Jul 2018 21:37:16 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:51 -0400 Message-Id: <60fcf49142aa2b26f76555c399b306d8fe3771d7.1530912831.git.aharter@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 11/15] Implement InterfaceLookupByMACString method for Connect Interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 06 Jul 2018 21:37:43 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Connect.xml | 6 ++++++ src/connect.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml index f99e205..535d225 100644 --- a/data/org.libvirt.Connect.xml +++ b/data/org.libvirt.Connect.xml @@ -170,6 +170,12 @@ + + + + + diff --git a/src/connect.c b/src/connect.c index 51a6ba0..f611965 100644 --- a/src/connect.c +++ b/src/connect.c @@ -827,6 +827,34 @@ virtDBusConnectInterfaceDefineXML(GVariant *inArgs, *outArgs =3D g_variant_new("(o)", path); } =20 +static void +virtDBusConnectInterfaceLookupByMACString(GVariant *inArgs, + GUnixFDList *inFDs G_GNUC_UNUSED, + const gchar *objectPath G_GNUC_U= NUSED, + gpointer userData, + GVariant **outArgs, + GUnixFDList **outFDs G_GNUC_UNUS= ED, + GError **error) +{ + virtDBusConnect *connect =3D userData; + g_autoptr(virInterface) interface =3D NULL; + g_autofree gchar *path =3D NULL; + const gchar *macstr; + + g_variant_get(inArgs, "(s)", &macstr); + + if (!virtDBusConnectOpen(connect, NULL)) + return; + + interface =3D virInterfaceLookupByMACString(connect->connection, macst= r); + if (!interface) + return virtDBusUtilSetLastVirtError(error); + + path =3D virtDBusUtilBusPathForVirInterface(interface, connect->interf= acePath); + + *outArgs =3D g_variant_new("(o)", path); +} + static void virtDBusConnectInterfaceLookupByName(GVariant *inArgs, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -1927,6 +1955,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethod= Table[] =3D { { "InterfaceChangeCommit", virtDBusConnectInterfaceChangeCommit }, { "InterfaceChangeRollback", virtDBusConnectInterfaceChangeRollback }, { "InterfaceDefineXML", virtDBusConnectInterfaceDefineXML }, + { "InterfaceLookupByMACString", virtDBusConnectInterfaceLookupByMACStr= ing }, { "InterfaceLookupByName", virtDBusConnectInterfaceLookupByName }, { "ListDomains", virtDBusConnectListDomains }, { "ListInterfaces", virtDBusConnectListInterfaces }, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 1530913099285980.4301426070832; Fri, 6 Jul 2018 14:38:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1873AC03D478; Fri, 6 Jul 2018 21:38: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 D42E2308332C; Fri, 6 Jul 2018 21:38: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 74C6918037F3; Fri, 6 Jul 2018 21:38:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbHD3003915 for ; Fri, 6 Jul 2018 17:37:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7EC721001938; Fri, 6 Jul 2018 21:37:17 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B8D810021B1; Fri, 6 Jul 2018 21:37:16 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:52 -0400 Message-Id: <8c14e4914df4a2d3171bc1ad0dc79643de3a6b18.1530912831.git.aharter@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 12/15] Implement Create method for Interface 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 06 Jul 2018 21:38:17 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Interface.xml | 5 +++++ src/interface.c | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/data/org.libvirt.Interface.xml b/data/org.libvirt.Interface.xml index f50bc37..f62346a 100644 --- a/data/org.libvirt.Interface.xml +++ b/data/org.libvirt.Interface.xml @@ -17,5 +17,10 @@ + + + + diff --git a/src/interface.c b/src/interface.c index b73e116..dec980a 100644 --- a/src/interface.c +++ b/src/interface.c @@ -87,6 +87,29 @@ virtDBusInterfaceGetActive(const gchar *objectPath, *value =3D g_variant_new("b", !!active); } =20 +static void +virtDBusInterfaceCreate(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(virInterface) interface =3D NULL; + guint flags; + + g_variant_get(inArgs, "(u)", &flags); + + interface =3D virtDBusInterfaceGetVirInterface(connect, objectPath, er= ror); + if (!interface) + return; + + if (virInterfaceCreate(interface, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static virtDBusGDBusPropertyTable virtDBusInterfacePropertyTable[] =3D { { "Active", virtDBusInterfaceGetActive, NULL }, { "MACString", virtDBusInterfaceGetMACString, NULL }, @@ -95,6 +118,7 @@ static virtDBusGDBusPropertyTable virtDBusInterfacePrope= rtyTable[] =3D { }; =20 static virtDBusGDBusMethodTable virtDBusInterfaceMethodTable[] =3D { + { "Create", virtDBusInterfaceCreate }, { 0 } }; =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 1530913069882305.4395887826614; Fri, 6 Jul 2018 14:37:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A951012C1A; Fri, 6 Jul 2018 21:37:48 +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 7190626DC1; Fri, 6 Jul 2018 21:37:48 +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 1DCB83FCC0; Fri, 6 Jul 2018 21:37:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbIEw003928 for ; Fri, 6 Jul 2018 17:37:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 199CE1001F5D; Fri, 6 Jul 2018 21:37:18 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA9BD1001938; Fri, 6 Jul 2018 21:37:17 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:53 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 13/15] Implement Destroy method for Interface 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 06 Jul 2018 21:37:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Interface.xml | 5 +++++ src/interface.c | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/data/org.libvirt.Interface.xml b/data/org.libvirt.Interface.xml index f62346a..16caba1 100644 --- a/data/org.libvirt.Interface.xml +++ b/data/org.libvirt.Interface.xml @@ -22,5 +22,10 @@ value=3D"See https://libvirt.org/html/libvirt-libvirt-interface.ht= ml#virInterfaceCreate"/> + + + + diff --git a/src/interface.c b/src/interface.c index dec980a..54a4c6b 100644 --- a/src/interface.c +++ b/src/interface.c @@ -110,6 +110,29 @@ virtDBusInterfaceCreate(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusInterfaceDestroy(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(virInterface) interface =3D NULL; + guint flags; + + g_variant_get(inArgs, "(u)", &flags); + + interface =3D virtDBusInterfaceGetVirInterface(connect, objectPath, er= ror); + if (!interface) + return; + + if (virInterfaceDestroy(interface, flags) < 0) + virtDBusUtilSetLastVirtError(error); +} + static virtDBusGDBusPropertyTable virtDBusInterfacePropertyTable[] =3D { { "Active", virtDBusInterfaceGetActive, NULL }, { "MACString", virtDBusInterfaceGetMACString, NULL }, @@ -119,6 +142,7 @@ static virtDBusGDBusPropertyTable virtDBusInterfaceProp= ertyTable[] =3D { =20 static virtDBusGDBusMethodTable virtDBusInterfaceMethodTable[] =3D { { "Create", virtDBusInterfaceCreate }, + { "Destroy", virtDBusInterfaceDestroy }, { 0 } }; =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 15309131041841023.4874647099688; Fri, 6 Jul 2018 14:38:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D959112C10; Fri, 6 Jul 2018 21:38:22 +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 97A602010CF5; Fri, 6 Jul 2018 21:38: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 3419518037FC; Fri, 6 Jul 2018 21:38:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbIhs003940 for ; Fri, 6 Jul 2018 17:37:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id AEFA21001F5E; Fri, 6 Jul 2018 21:37:18 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A36D1001F5D; Fri, 6 Jul 2018 21:37:18 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:54 -0400 Message-Id: <61f6e062c9e5648273b37d59e6939184cffc4c9c.1530912831.git.aharter@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 14/15] Implement Undefine method for Interface 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 06 Jul 2018 21:38:23 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Interface.xml | 4 ++++ src/interface.c | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/data/org.libvirt.Interface.xml b/data/org.libvirt.Interface.xml index 16caba1..5ca366c 100644 --- a/data/org.libvirt.Interface.xml +++ b/data/org.libvirt.Interface.xml @@ -27,5 +27,9 @@ value=3D"See https://libvirt.org/html/libvirt-libvirt-interface.ht= ml#virInterfaceDestroy"/> + + + diff --git a/src/interface.c b/src/interface.c index 54a4c6b..07e1aba 100644 --- a/src/interface.c +++ b/src/interface.c @@ -133,6 +133,26 @@ virtDBusInterfaceDestroy(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusInterfaceUndefine(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(virInterface) interface =3D NULL; + + interface =3D virtDBusInterfaceGetVirInterface(connect, objectPath, er= ror); + if (!interface) + return; + + if (virInterfaceUndefine(interface) < 0) + virtDBusUtilSetLastVirtError(error); +} + static virtDBusGDBusPropertyTable virtDBusInterfacePropertyTable[] =3D { { "Active", virtDBusInterfaceGetActive, NULL }, { "MACString", virtDBusInterfaceGetMACString, NULL }, @@ -143,6 +163,7 @@ static virtDBusGDBusPropertyTable virtDBusInterfaceProp= ertyTable[] =3D { static virtDBusGDBusMethodTable virtDBusInterfaceMethodTable[] =3D { { "Create", virtDBusInterfaceCreate }, { "Destroy", virtDBusInterfaceDestroy }, + { "Undefine", virtDBusInterfaceUndefine }, { 0 } }; =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 15 15:08:56 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 1530913109819654.0198319202973; Fri, 6 Jul 2018 14:38:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 40D565F72E; Fri, 6 Jul 2018 21:38: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 0C2AE30012C9; Fri, 6 Jul 2018 21:38: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 B37DA3F64B; Fri, 6 Jul 2018 21:38:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w66LbJ8R003953 for ; Fri, 6 Jul 2018 17:37:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 506EB10021B1; Fri, 6 Jul 2018 21:37:19 +0000 (UTC) Received: from new-host.redhat.com (ovpn-116-165.phx2.redhat.com [10.3.116.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF6621001F5D; Fri, 6 Jul 2018 21:37:18 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Fri, 6 Jul 2018 17:36:55 -0400 Message-Id: <01316ec4a4a033049c26cd6568c56b250504ff0e.1530912831.git.aharter@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [dbus PATCH 15/15] Implement GetXMLDesc method for Interface 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.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 06 Jul 2018 21:38:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Anya Harter --- data/org.libvirt.Interface.xml | 6 ++++++ src/interface.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/data/org.libvirt.Interface.xml b/data/org.libvirt.Interface.xml index 5ca366c..efe59e3 100644 --- a/data/org.libvirt.Interface.xml +++ b/data/org.libvirt.Interface.xml @@ -27,6 +27,12 @@ value=3D"See https://libvirt.org/html/libvirt-libvirt-interface.ht= ml#virInterfaceDestroy"/> + + + + + diff --git a/src/interface.c b/src/interface.c index 07e1aba..83dbdbe 100644 --- a/src/interface.c +++ b/src/interface.c @@ -133,6 +133,33 @@ virtDBusInterfaceDestroy(GVariant *inArgs, virtDBusUtilSetLastVirtError(error); } =20 +static void +virtDBusInterfaceGetXMLDesc(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(virInterface) interface =3D NULL; + g_autofree gchar *xml =3D NULL; + guint flags; + + g_variant_get(inArgs, "(u)", &flags); + + interface =3D virtDBusInterfaceGetVirInterface(connect, objectPath, er= ror); + if (!interface) + return; + + xml =3D virInterfaceGetXMLDesc(interface, flags); + if (!xml) + return virtDBusUtilSetLastVirtError(error); + + *outArgs =3D g_variant_new("(s)", xml); +} + static void virtDBusInterfaceUndefine(GVariant *inArgs G_GNUC_UNUSED, GUnixFDList *inFDs G_GNUC_UNUSED, @@ -163,6 +190,7 @@ static virtDBusGDBusPropertyTable virtDBusInterfaceProp= ertyTable[] =3D { static virtDBusGDBusMethodTable virtDBusInterfaceMethodTable[] =3D { { "Create", virtDBusInterfaceCreate }, { "Destroy", virtDBusInterfaceDestroy }, + { "GetXMLDesc", virtDBusInterfaceGetXMLDesc }, { "Undefine", virtDBusInterfaceUndefine }, { 0 } }; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list