From nobody Sat May 4 06:37:20 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1536825454072563.2567122283347; Thu, 13 Sep 2018 00:57:34 -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 B727D3001910; Thu, 13 Sep 2018 07:57:31 +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 7728D60BE0; Thu, 13 Sep 2018 07:57:31 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 27332181A139; Thu, 13 Sep 2018 07:57:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8D7uvj7028063 for ; Thu, 13 Sep 2018 03:56:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 114605D6B5; Thu, 13 Sep 2018 07:56:57 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 086295D6AA for ; Thu, 13 Sep 2018 07:56:53 +0000 (UTC) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B594307D973 for ; Thu, 13 Sep 2018 07:56:53 +0000 (UTC) Received: by mail-pg1-f174.google.com with SMTP id 2-v6so2371657pgo.4 for ; Thu, 13 Sep 2018 00:56:53 -0700 (PDT) Received: from localhost.localdomain ([45.122.156.254]) by smtp.gmail.com with ESMTPSA id q85-v6sm5113007pfa.151.2018.09.13.00.56.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Sep 2018 00:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=hlKjVcx0l611EVxJRB+udY3nQglMmknt6nsRWjztP5I=; b=uV3R+tbw5KgIAaSq4xtl6z7YIvI1gzaek/GXBUPJ7T+5s0OXJ7tbFpcT8hfUDtADCx /fGXoNdXPsWnOjIvZU1WEoSLBHZgzdtuGXCmUpDBFIMtJY1M0thMpXqlbwaBOyhkHZ3g PbF6xET7dtGXnE/1jNJ7Ug63OrkNJSxVyQnnoc1egBAwDo7ZpCU7ah/+B74XNSTjqHcX IcuPCEpNV3C8tze7s2VJ9qk2GtpKO2Crfmv2gcB8mMsHJO3hoWypIuE+tmk/dSFX3owc 8KxeWrSGyLIVNb4qL5jRLgIKhIJBz+C1R/wGyLndMF9zispUj9nedxXlsmDjt4Fr9kX3 KpAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=hlKjVcx0l611EVxJRB+udY3nQglMmknt6nsRWjztP5I=; b=RrJiS+El9X0wXgNQVp/DW+nJ4pburDhIcIqqBZ7xgFNOs0qBJJPZuV0IwPxd3DNNaU rKob0gL1WmZVNJmz5NC+gD72ec1XPZ5kVKt+LD+Ih9qI/MY8/yS83sDK3iDOF6/nXiea xTz3lzlYsmBffe6MzULccsN9dzNpl63QphahODIhw7d8QM/TRP/L+N4+XxBjQBPWzFid WQ0jOT0z8X6q307eQDjERlapHbLbp7cN/o6+P8r14gLxHs/gk37835YPtasOV/pVL4Ik rVWmn2/ISXg9LSP34TrjNlSlzDcfppPvq1neMcaeS0OvPCn1C4X4GEG4djZzAQaiGvuH 956A== X-Gm-Message-State: APzg51DC6j4qQ6mwbhZzbL4WTVaODl5zFfWRIPBAb9sWU4Aa1QAIWoeu KdKx4DhI/VUOEPuHrOgCaat2aJn8 X-Google-Smtp-Source: ANB0VdbnOOJoT6+c1l1+UJnpxP+lKafc7YwvCTTDLz397EM2SpvrlZYltzad8bZ9GBytfPVUHp+g9Q== X-Received: by 2002:a62:868b:: with SMTP id x133-v6mr6228316pfd.252.1536825412249; Thu, 13 Sep 2018 00:56:52 -0700 (PDT) From: Lin Ma To: libvir-list@redhat.com Date: Thu, 13 Sep 2018 15:54:23 +0800 Message-Id: <20180913075424.28333-2-lma@suse.com> In-Reply-To: <20180913075424.28333-1-lma@suse.com> References: <20180913075424.28333-1-lma@suse.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 13 Sep 2018 07:56:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 13 Sep 2018 07:56:53 +0000 (UTC) for IP:'209.85.215.174' DOMAIN:'mail-pg1-f174.google.com' HELO:'mail-pg1-f174.google.com' FROM:'morecache@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.24 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.215.174 mail-pg1-f174.google.com 209.85.215.174 mail-pg1-f174.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: skrtbhtngr@gmail.com, chenhanxiao@gmail.com, Lin Ma Subject: [libvirt] [PATCH v2 1/2] qemu: Remove network type limitation for qemuARPGetInterfaces X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 13 Sep 2018 07:57:32 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When we call qemuARPGetInterfaces to get IP from the host's arp table, We ignore VIR_DOMAIN_NET_TYPE_ETHERNET, VIR_DOMAIN_NET_TYPE_VHOSTUSER and VIR_DOMAIN_NET_TYPE_DIRECT due to the host's arp table won't include the ip <-> mac entries about these type of backends. Signed-off-by: Lin Ma --- src/qemu/qemu_driver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2f8d6915e1..f066e02f36 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20940,7 +20940,9 @@ qemuARPGetInterfaces(virDomainObjPtr vm, goto cleanup; =20 for (i =3D 0; i < vm->def->nnets; i++) { - if (vm->def->nets[i]->type !=3D VIR_DOMAIN_NET_TYPE_NETWORK) + if (vm->def->nets[i]->type =3D=3D VIR_DOMAIN_NET_TYPE_ETHERNET || + vm->def->nets[i]->type =3D=3D VIR_DOMAIN_NET_TYPE_VHOSTUSER || + vm->def->nets[i]->type =3D=3D VIR_DOMAIN_NET_TYPE_DIRECT) continue; =20 virMacAddrFormat(&(vm->def->nets[i]->mac), macaddr); --=20 2.15.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 06:37:20 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1536825425168988.2151457904973; Thu, 13 Sep 2018 00:57:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E70A3082140; Thu, 13 Sep 2018 07:57:03 +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 2F7469A32A; Thu, 13 Sep 2018 07:57:03 +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 C52DE18005D0; Thu, 13 Sep 2018 07:57:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8D7v23E028073 for ; Thu, 13 Sep 2018 03:57:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0C4BF2010CBA; Thu, 13 Sep 2018 07:57:02 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0415E2010D03 for ; Thu, 13 Sep 2018 07:56:59 +0000 (UTC) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A2DC317C3E4 for ; Thu, 13 Sep 2018 07:56:58 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id j26-v6so2288277pfi.10 for ; Thu, 13 Sep 2018 00:56:58 -0700 (PDT) Received: from localhost.localdomain ([45.122.156.254]) by smtp.gmail.com with ESMTPSA id q85-v6sm5113007pfa.151.2018.09.13.00.56.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Sep 2018 00:56:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=sS+oTxbeYECCWzYybZtH337n0/fMBCKxKX/U7vR9nmc=; b=uxhpnuGmSSpqtAjF3I01tVyeK2xTDR/PvvB0V6iHgUs9etAFhGv8y96qUbZDDX4BAc +A16MF+NVj/XM/A3jdtZGwDwnywv5S/n8p/4sN0k7S5XMbBrr1hquqJ4p16gOX7i4Jfd Kc6cDTXv6avUyFDMXcB0a87imlszlDa3INDgOGNuXJgZvvuqn8K2EOaxuLe+F4cXbQ0D lJN3lpFk4Kq6lVzJMIygs1kPcOZ6eysiycz9AEyQrprkQvBZHHZDgzvzagYuVr1+SR0W rzFskvOqmRpt61WRtxjqbZYanwC+QrBSQoBLcjlVBvL+hYCdQy3eg/9SLHn2wEDv1S3I VKTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=sS+oTxbeYECCWzYybZtH337n0/fMBCKxKX/U7vR9nmc=; b=uJK3fhNrMHqLvTtzrWSTPVrmVM4IgRNECzN55XD1nvl4f0BuUnAZSZ3Icxt+7WObFJ RVsSxxLVREHvD21+5t1unb/ggRHYYpd+pvlsxfSN1zH4FwBtzOVyICR+7bzY4OsYII/h LY4z5pHhaysnSVMDOqKbOB3oWbiEr5f6zASthxnBDlacQcaObwXu4+wUpxpHdC6VI8Jt VWszN4p0CIk/C4imzWUI9Em0qrSEK+zmMdIYrxZj4k76iSBcLG0DRaFJv91N+iYYbh3g 8lvw31ahoNy7PpUI0+djIqETPC+4NkdIHIptnM2Xlha/YWFiMEnAA81YoBuVhuopflzD oCXg== X-Gm-Message-State: APzg51AzCXoZL4wF5G3OdwXvdyCR/r5qjVQNdU3wNGXnQ6NfhbMNAdia I0Npt34PtxlU1e5/zDzzY2bDueHt X-Google-Smtp-Source: ANB0VdYuyHBrzaM3sVPmufFtDL64bi1ZDTWbXhjx3SdO3xPK2BFAvFV6sRZ3HtS5obZVdBIOoX5sFQ== X-Received: by 2002:a62:7590:: with SMTP id q138-v6mr6252696pfc.148.1536825417473; Thu, 13 Sep 2018 00:56:57 -0700 (PDT) From: Lin Ma To: libvir-list@redhat.com Date: Thu, 13 Sep 2018 15:54:24 +0800 Message-Id: <20180913075424.28333-3-lma@suse.com> In-Reply-To: <20180913075424.28333-1-lma@suse.com> References: <20180913075424.28333-1-lma@suse.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 13 Sep 2018 07:56:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 13 Sep 2018 07:56:58 +0000 (UTC) for IP:'209.85.210.195' DOMAIN:'mail-pf1-f195.google.com' HELO:'mail-pf1-f195.google.com' FROM:'morecache@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.242 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.210.195 mail-pf1-f195.google.com 209.85.210.195 mail-pf1-f195.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Cc: skrtbhtngr@gmail.com, chenhanxiao@gmail.com, Lin Ma Subject: [libvirt] [PATCH v2 2/2] virarptable: Return a virArpTablePtr when the nlmsghdr for loop is over 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.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 13 Sep 2018 07:57:04 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" commit b00c9c39 removed the label end_of_netlink_messages and 'return table' statement, It causes the function virArpTableGet doesn't return a proper virArpTable pointer. How to reproduce: # virsh domiflist sles12sp3 Interface Type Source Model MAC Reviewed-by: Chen Hanxiao Reviewed-by: John Ferlan ------------------------------------------------------- vnet0 network default virtio 52:54:00:cd:02:e6 # virsh domifaddr sles12sp3 --source arp error: Failed to query for interfaces addresses error: An error occurred, but the cause is unknown It seems that the "if (nh->nlmsg_type =3D=3D NLMSG_DONE)" statement won't be meted. So this patch adds 'return table' when the iterations of nlmsghdr for loop is over. Signed-off-by: Lin Ma Reviewed-by: Chen Hanxiao --- src/util/virarptable.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virarptable.c b/src/util/virarptable.c index 04a6f35571..217a960d5a 100644 --- a/src/util/virarptable.c +++ b/src/util/virarptable.c @@ -152,6 +152,8 @@ virArpTableGet(void) } } =20 + return table; + cleanup: virArpTableFree(table); return NULL; --=20 2.15.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list