From nobody Thu May 2 17:47:11 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153628288397371.63537027953407; Thu, 6 Sep 2018 18:14:43 -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 2605E3083390; Fri, 7 Sep 2018 01:14:41 +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 176F32A2F2; Fri, 7 Sep 2018 01:14:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 74DE91800533; Fri, 7 Sep 2018 01:14:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w871EY8x002014 for ; Thu, 6 Sep 2018 21:14:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 712A12166BDB; Fri, 7 Sep 2018 01:14:34 +0000 (UTC) Received: from vhost2.laine.org (ovpn-117-58.phx2.redhat.com [10.3.117.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 086A12166BA3 for ; Fri, 7 Sep 2018 01:14:31 +0000 (UTC) From: Laine Stump To: libvir-list@redhat.com Date: Thu, 6 Sep 2018 21:14:26 -0400 Message-Id: <20180907011426.424588-1-laine@laine.org> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] conf: fix bogus error when is in an 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.44]); Fri, 07 Sep 2018 01:14:42 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" virDomainDefCollectBootOrder() is called for every item on the list for each type of device. Since an is on both the list of hostdev devices and the list of network devices, it will be counted twice, and the code that checks for multiple devices with the same boot order will give a false positive. To remedy this, we make sure to return early for hostdev devices that have a parent.type !=3D NONE. This was introduced in commit 5b75a4, which was first in libvirt-4.4.0. Resolves: https://bugzilla.redhat.com/1601318 Signed-off-by: Laine Stump Reviewed-by: J=EF=BF=BDn Tomko --- src/conf/domain_conf.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 77cc73744f..71a2fb0426 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5062,6 +5062,14 @@ virDomainDefCollectBootOrder(virDomainDefPtr def ATT= RIBUTE_UNUSED, if (info->bootIndex =3D=3D 0) return 0; =20 + if (dev->type =3D=3D VIR_DOMAIN_DEVICE_HOSTDEV && + dev->data.hostdev->parent.type !=3D VIR_DOMAIN_DEVICE_NONE) { + /* This hostdev is a child of a higher level device + * (e.g. interface), and thus already being counted on the + * list for the other device type. + */ + return 0; + } if (virAsprintf(&order, "%u", info->bootIndex) < 0) goto cleanup; =20 --=20 2.14.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list