From nobody Tue Sep 9 09:55:24 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1747056648; cv=none; d=zohomail.com; s=zohoarc; b=HOARpEMagi7fnb3xhT+ZPWfqhFkN72i3pDYOoM3Xi1yaI+CE5J1Or5WP4cwo1p3zqCM6WUbc3jLlAeBw/pM8dQGK8LJ2ZgsBCoTmOQwSZL9FvA0mE/hCVCAPFdgnlQ/Q934Hjliq+S37+1Q414nJ/XIbf3oLuoyhfsQkKlm5w44= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747056648; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=X6WqH5zhkikmr4Cisv8V7FZmN+w9vmtvT7J6kW+zss8=; b=n50/1jQUrg6weNOM468MDBa5x+UM0uxU4j9pSxOErKcD2TVdp5P0AeUh4lYkpgIz8tRo+158GUFZMP4vz7z3MLWlPVAXXQ3w8eD+Z6cqiuzcfOe8YycsTVtG9hdQFzOe13xEZ08MUCm444WjR5yfQobJyPfKW5/oGEDOwGdnSm0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1747056648313887.8088989652457; Mon, 12 May 2025 06:30:48 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 69FB915EF; Mon, 12 May 2025 09:30:47 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id BADF112BD; Mon, 12 May 2025 09:30:15 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 80A5E128C; Mon, 12 May 2025 09:30:09 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id DFA29128A for ; Mon, 12 May 2025 09:30:08 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-365-D2sD_nHNPwe4HUuKjFrxcA-1; Mon, 12 May 2025 09:30:07 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 717BC18004A7 for ; Mon, 12 May 2025 13:30:06 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A686C1801482 for ; Mon, 12 May 2025 13:30:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747056608; h=from:from: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; bh=cjtFaVCYrgnOjl2Oh205cO0vmOyMv1j/CDjxbYddY6k=; b=LqFFmkcGIk8eenaZGp2lwUHYwe+k7hISVbF9yLmuqbB8vc4Eu1r7ybD0Mu13SbLevATai4 DdCmR99RQ0x8W6l4haW0C3MQavPAcBT+7+lv4TDqwxcvncMD+u5Hdtcz70gpOpHTitrx+G Ig2eu+jEd4X3RfbGjjHHaeQRHoL9zvQ= X-MC-Unique: D2sD_nHNPwe4HUuKjFrxcA-1 X-Mimecast-MFC-AGG-ID: D2sD_nHNPwe4HUuKjFrxcA_1747056606 To: devel@lists.libvirt.org Subject: [PATCH 1/2] qemuDomainPrepareHostdevPCI: Fix return values after conversion from bool to int Date: Mon, 12 May 2025 15:30:01 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 47MZ4zBfhQwDqtvRVB7p7QvJarF0VjcvCemGCNlQ5nA_1747056606 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: LB52MPXJDUQHZ46IBPAWRJZJD2RY4RTW X-Message-ID-Hash: LB52MPXJDUQHZ46IBPAWRJZJD2RY4RTW X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1747056658196116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Historically when the code was in 'qemuHostdevPreparePCIDevicesCheckSupport' the function returned bools. Later it was refactored and moved to 'qemuDomainPrepareHostdevPCI' the return values were not changed. Thus the function now returned '-1', 'false', and 'true'. Callers checked for '-1' only so the few cases forbidding legacy device passthrough were no longer causing fatal errors. Fixes: 3b87709c768480e085556e06bd8d08f62270d42d Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 52da234343..73869fcfac 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9945,28 +9945,28 @@ qemuDomainPrepareHostdevPCI(virDomainHostdevDef *ho= stdev, if (!supportsPassthroughVFIO) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("host doesn't support VFIO PCI passthrough")); - return false; + return -1; } break; case VIR_DEVICE_HOSTDEV_PCI_DRIVER_NAME_KVM: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("host doesn't support legacy PCI passthrough")); - return false; + return -1; case VIR_DEVICE_HOSTDEV_PCI_DRIVER_NAME_XEN: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("QEMU does not support device assignment mode '%1= $s'"), virDeviceHostdevPCIDriverNameTypeToString(*driverNa= me)); - return false; + return -1; default: case VIR_DEVICE_HOSTDEV_PCI_DRIVER_NAME_LAST: virReportEnumRangeError(virDeviceHostdevPCIDriverName, *driverName= ); - break; + return -1; } - return true; + return 0; } --=20 2.49.0