From nobody Wed May 8 13:39:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598998785; cv=none; d=zohomail.com; s=zohoarc; b=G973BedskB9VBs1+d2HtS8DAJvTJHKPGNNHygM+QK0SmTNklxOQL6am6Atpxo0lTlOmBDDjo9Wtwy0DlFS6drFyFv8r07mnfBU0yNn1CjcX6Uj+doYcrfijcL0hSqTkEf1x+GBAk/nAGfQYh53pWsmyVz99gT+quDUEkatEBk9Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598998785; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=r78CXU1cseQRiKkXkMx12je+N2rw8Gxk80Kd72nNSJo=; b=kyNe7M/uLTS+R8NNOtUvl/xObmHCBVb8nnESb+pjxqcq9NrUtSE3V4BqQ3Gbm8E9zB/uayp/vivaWH+Pa8DHYS3ReuEETgWAkQ5m9CZu9EwP+oiVRdFmlz4ZH9bdyLkORR82WBYHMuO8DkcXy8OaVOsNInQGoF8aLs2KmX3fbL4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1598998785427687.194344462581; Tue, 1 Sep 2020 15:19:45 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139--AGNaT20PxW8nleY8L5obw-1; Tue, 01 Sep 2020 18:19:41 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 75ADC1084C8B; Tue, 1 Sep 2020 22:19:34 +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 4C9BE5C1BB; Tue, 1 Sep 2020 22:19:33 +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 39BB679A3E; Tue, 1 Sep 2020 22:19:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 081MJRaN007327 for ; Tue, 1 Sep 2020 18:19:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7C5572028DC0; Tue, 1 Sep 2020 22:19:27 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 76AFE200AD55 for ; Tue, 1 Sep 2020 22:19:25 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1B82F811E78 for ; Tue, 1 Sep 2020 22:19:25 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [62.140.7.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-501-GTD94b4gONG1QrEh1ygABQ-1; Tue, 01 Sep 2020 18:19:22 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2058.outbound.protection.outlook.com [104.47.5.58]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-24-ZK6kw-yNN6W3HC7Hhxy8nA-1; Wed, 02 Sep 2020 00:19:19 +0200 Received: from VI1PR0401MB2429.eurprd04.prod.outlook.com (2603:10a6:800:2c::13) by VI1PR04MB4493.eurprd04.prod.outlook.com (2603:10a6:803:76::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.23; Tue, 1 Sep 2020 22:19:17 +0000 Received: from VI1PR0401MB2429.eurprd04.prod.outlook.com ([fe80::a0ba:4965:e484:d014]) by VI1PR0401MB2429.eurprd04.prod.outlook.com ([fe80::a0ba:4965:e484:d014%9]) with mapi id 15.20.3326.025; Tue, 1 Sep 2020 22:19:17 +0000 Received: from linux-tbji.devlab.prv.suse.com (192.150.153.236) by AM3PR05CA0109.eurprd05.prod.outlook.com (2603:10a6:207:2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.20 via Frontend Transport; Tue, 1 Sep 2020 22:19:16 +0000 X-MC-Unique: -AGNaT20PxW8nleY8L5obw-1 X-MC-Unique: GTD94b4gONG1QrEh1ygABQ-1 X-MC-Unique: ZK6kw-yNN6W3HC7Hhxy8nA-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH] conf: Don't check virTristateBool < 0 Date: Tue, 1 Sep 2020 16:18:52 -0600 Message-ID: <20200901221852.27122-1-jfehlig@suse.com> X-ClientProxiedBy: AM3PR05CA0109.eurprd05.prod.outlook.com (2603:10a6:207:2::11) To VI1PR0401MB2429.eurprd04.prod.outlook.com (2603:10a6:800:2c::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Originating-IP: [192.150.153.236] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dbaa149a-d194-4f4a-cf8a-08d84ec510e4 X-MS-TrafficTypeDiagnostic: VI1PR04MB4493: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6Bc3uy+S5tF44YavXdev0qGLAFFqRZGOIm3/nN35vFIDUd6xOf4YDtxAoixD7qSyrUVGddbj8EO5sri0v47SJW7+/PYHIAlE5FIu7VY5CnmDnkc6jcb6A+qVZQ9LIZFhoTDXxhUxtszjcF2dWzYIS0Xt0UlaJyjjK0x/fOw1hWhl6g4vf16v02Lc9Zuo8U1EFDtYDrlLps5tUbmwAfqdzQLnGZwGKj69kqHrNHE8vzRA21tYoq2x7jGH2qkaC23Ls78paNzzJiyq974xMEiaAFxtNQnf6t1o/edBmoc+P7hTd5ArNP5uASb8RsXzt8NTrS9+4dBWKpyhEHS03Jf9jg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0401MB2429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(39860400002)(346002)(376002)(366004)(136003)(316002)(66556008)(956004)(1076003)(66946007)(2616005)(83380400001)(7696005)(478600001)(66476007)(6666004)(8676002)(52116002)(6486002)(6916009)(5660300002)(186003)(16526019)(107886003)(4326008)(8936002)(2906002)(26005)(86362001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 7isoaninNO0i9bGb1dyWlgJUpax6Mqe6sYgrSzGgbPWON9oEHbKJM4hEIGI72rDuDIH37mIf4ACG1nDwTqOOHYaChlh8XW36IKY4Z7xvZwmKADb0nJdxRCsRuU1No8oH467pyM6cVF0BPMSpSDVfQl0sbt5JnFWD77nX9mi137nAQpfteodDcCWtvtBP74XPvbCX2MoRJ19agOoFt3U7uM12kwbEBdm0wlI1ne51xD0hITrt6Eu8376cbL8xkSMpWVtPluXOSgBPJCRwxSvMw7iiKW58wl2pRbSzpo+w5e/xrgpmsV1+eggfQdSofmPI3UWLoXHPOHkW4tq9s6G7B0HkBuWw5IC1JlvHkk5qFOvMx/zOuGrCC+5zizjgtYiy7lrK2vwslm+l7mxeLiP6cwgoSxgNR2X5x0UfTeUSxsIvw8v+b/udAXx98IxdyTxyC3hmg9kgJWuwWar8zMph1zyzUt1jWLvKFh3JP132/NUnkvk9VWNVERln07AoTGrf4LxHQGj9oACpDLnP7ktIB5Sr3Ki132P2dfutqkNkffjIq7w05ymgKykNrwXxPrFBsa21pY+D30/dtU8HJKtpRqlIOuU6Ejzwp8hllnxaVrR2nmWAsEwzqtLuhzh/0/SnSvEiHWm6DrA/jQ+XP+tUNw== X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbaa149a-d194-4f4a-cf8a-08d84ec510e4 X-MS-Exchange-CrossTenant-AuthSource: VI1PR0401MB2429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2020 22:19:17.6108 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kuZANoSF/g7jAMPVL7SESRWThj0F/C1DbpGU5YFgQ5J2LSoT66d3OZIaS0dBcb9tPmznxuha1Rle5XT1a04zPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4493 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 081MJRaN007327 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Commit 9d15647dcb introduced a check of virtTristateBool < 0, which causes a build failure in some environments ../dist-unpack/libvirt-6.8.0/src/conf/domain_conf.c:8144:78: error: result of comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-unsigned-enum-zero-compare] if ((def->writeFiltering =3D virTristateBoolTypeFromString(filtering)) < 0)= { Fix it by assigning the return value of virTristateBoolTypeFromString to a temp int variable, which allows checking for unknown values before assigning to the virtTristateBool variable. Signed-off-by: Jim Fehlig --- Perhaps considered trivial and could be pushed under the build-breaker rule, but I'd prefer a review since I've botched trivial patches in the past :-). src/conf/domain_conf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7d177a5562..5b224ccd78 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8141,12 +8141,15 @@ virDomainHostdevSubsysPCIDefParseXML(xmlNodePtr nod= e, xmlNodePtr cur; =20 if ((filtering =3D virXMLPropString(node, "writeFiltering"))) { - if ((def->writeFiltering =3D virTristateBoolTypeFromString(filteri= ng)) < 0) { + int filterval; + + if ((filterval =3D virTristateBoolTypeFromString(filtering)) < 0) { virReportError(VIR_ERR_XML_ERROR, _("unknown pci writeFiltering setting '%s'"), filtering); return -1; } + def->writeFiltering =3D filterval; } =20 cur =3D node->children; --=20 2.28.0