From nobody Wed Feb 11 06:32:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1648225684; cv=none; d=zohomail.com; s=zohoarc; b=fJuleatLD946R1ENYXRMyk+4cv7dfvILZWlEtiP8IO/5KELEcawquo7Nuja2SxoGOC8DAxYtmSA1T/Ln0a59hKR2gtdUo6d0K3vuIrvknq74CYS3RECOAtKlb8zXsymtVaA1AX+ntyqTHFxycfph8Q1nl1vKi6Neo79x/4af5xA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648225684; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yrs5xg1EOeTznpljp+NQtx2/oXriKlRCQ8n+J5Vdc0g=; b=Ya9rPsNnmaEfA4JPOuVAst19h79u4y8RxDxH+9z8Qc9Uou6H1e5gHMKhSL9gV5vsO3RBHSshaQ3hlCS6YpiCJVrekyq9cUJmnmhUIkDcUZOzHRNaD6zhhvETcskIIfDeAG7B+en2cXFSrFlvOtNSVl5nki4pAKs57ELa9wHjwiU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1648225684090698.0546567133678; Fri, 25 Mar 2022 09:28:04 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-599-sDMEeczYMbSgL5a22h8P3A-1; Fri, 25 Mar 2022 12:27:09 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DD1D73802ADD; Fri, 25 Mar 2022 16:27:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C65AB403D17D; Fri, 25 Mar 2022 16:27:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AFEBE1940352; Fri, 25 Mar 2022 16:27:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6A664194036E for ; Fri, 25 Mar 2022 16:27:01 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5A9825E8A50; Fri, 25 Mar 2022 16:27:01 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.192.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD4165E8A46 for ; Fri, 25 Mar 2022 16:27:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648225683; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=yrs5xg1EOeTznpljp+NQtx2/oXriKlRCQ8n+J5Vdc0g=; b=bd03qClvCtOWwV4dpNVChZwJioRhPAgL4DBUB0u6x3d1t1VoA6Fm+jjbliFZC3omY7z5wY 41h6vvj+8M2VkGhEh22SdQOJOni3QkeDCVaKbPqgx/kS952A1s5holjRvc4nCEP1S1VeRl KjsJfDIqb6deAvhtG9bi24ke+QRXejI= X-MC-Unique: sDMEeczYMbSgL5a22h8P3A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [PATCH 9/9] network: Convert managed property of hostdev-pci ports correctly Date: Fri, 25 Mar 2022 17:26:52 +0100 Message-Id: <20220325162652.328686-10-abologna@redhat.com> In-Reply-To: <20220325162652.328686-1-abologna@redhat.com> References: <20220325162652.328686-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1648225685991100003 Content-Type: text/plain; charset="utf-8"; x-default="true" virNetworkForwardDef.managed is a bool but virNetworkPortDef.hostdevpci.managed is a virTristateBool, which means that the current code performs the following incorrect conversion: false -> BOOL_ABSENT true -> BOOL_YES Using the virTristateBoolFromBool() helper solves the issue. Fixes: 6cb0ec48bd95c95489a987e05a88e8bcf1f9109c Signed-off-by: Andrea Bolognani --- src/network/bridge_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 67c5a111b3..e7049ba384 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -3991,7 +3991,7 @@ networkAllocatePort(virNetworkObj *obj, } port->plug.hostdevpci.addr =3D dev->device.pci; port->plug.hostdevpci.driver =3D netdef->forward.driverName; - port->plug.hostdevpci.managed =3D netdef->forward.managed; + port->plug.hostdevpci.managed =3D virTristateBoolFromBool(netdef->= forward.managed); =20 if (port->virtPortProfile) { /* make sure type is supported for hostdev connections */ --=20 2.35.1