From nobody Mon Feb 9 08:58:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1486572388070731.042678762702; Wed, 8 Feb 2017 08:46:28 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v18GgJ7Z042103; Wed, 8 Feb 2017 11:42:19 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v18GgGBs019776 for ; Wed, 8 Feb 2017 11:42:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4AA126E90C; Wed, 8 Feb 2017 16:42:16 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44E966D15D for ; Wed, 8 Feb 2017 16:42:16 +0000 (UTC) Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A2C0FC7051 for ; Wed, 8 Feb 2017 16:42:15 +0000 (UTC) Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v18GgDMu003847 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Feb 2017 16:42:14 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v18GgDPt002148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Feb 2017 16:42:13 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v18GgCqg011722; Wed, 8 Feb 2017 16:42:13 GMT Received: from paddy.lan (/89.114.92.174) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 08 Feb 2017 08:42:12 -0800 From: Joao Martins To: Libvirt Development List Date: Wed, 8 Feb 2017 16:44:40 +0000 Message-Id: <1486572280-2212-5-git-send-email-joao.m.martins@oracle.com> In-Reply-To: <1486572280-2212-1-git-send-email-joao.m.martins@oracle.com> References: <1486572280-2212-1-git-send-email-joao.m.martins@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 08 Feb 2017 16:42:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 08 Feb 2017 16:42:15 +0000 (UTC) for IP:'156.151.31.81' DOMAIN:'userp1040.oracle.com' HELO:'userp1040.oracle.com' FROM:'joao.m.martins@oracle.com' RCPT:'' X-RedHat-Spam-Score: -103.788 (BAYES_50, DCC_REPUT_00_12, RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2, RP_MATCHES_RCVD, SPF_PASS, UNPARSEABLE_RELAY, USER_IN_WHITELIST) 156.151.31.81 userp1040.oracle.com 156.151.31.81 userp1040.oracle.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Cc: Joao Martins Subject: [libvirt] [PATCH RFC 4/4] libxl: domainInterfaceAddresses agent support 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Allow querying of guest interface address through agent through command `virsh domifaddr test --source agent` Signed-off-by: Joao Martins --- src/libxl/libxl_driver.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index cf5e702..8f8fbec 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -6261,6 +6261,8 @@ libxlDomainInterfaceAddresses(virDomainPtr dom, unsigned int source, unsigned int flags) { + libxlDriverPrivatePtr driver =3D dom->conn->privateData; + libxlDomainObjPrivatePtr priv; virDomainObjPtr vm =3D NULL; int ret =3D -1; =20 @@ -6282,6 +6284,22 @@ libxlDomainInterfaceAddresses(virDomainPtr dom, case VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE: ret =3D libxlGetDHCPInterfaces(dom, vm, ifaces); break; + case VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT: + priv =3D vm->privateData; + if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_QUERY) < 0) + goto cleanup; + + if (!libxlDomainAgentAvailable(vm, true)) + goto endjob; + + libxlDomainObjEnterAgent(vm); + ret =3D qemuAgentGetInterfaces(priv->agent, ifaces); + libxlDomainObjExitAgent(vm); + + endjob: + libxlDomainObjEndJob(driver, vm); + + break; =20 default: virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, --=20 2.1.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list