From nobody Tue Sep 9 19:11:26 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=1753972532; cv=none; d=zohomail.com; s=zohoarc; b=CoMLWB/G0F7O1O4WNc2nZjLimdulRS8GAlAMYBwKhWGs5XtaCuyhRIlBv9jKgcpYdpuPqBfc2Oe9r8oCAiKq7dISGEIh2Tgej/Rajd4fEofYeaq/G++eBudhulWaZ4O66aZGCp/1XVxkaEorwL6T8uviUaGDCdbbyz50a97L0ak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753972532; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=h9LnQiQYfgPDMVcPjGO7RtEpC1PHK+3I8usqCn8lNYg=; b=U+q+tjQoVxBh1nJfgNxp0BY8Tn+HtAKGb2WLC4nrmiYEmIKQYCadseKQci4DECRtYq0GcWsk3OWncpAC2T6Zs5K+Slmec+R76EnB52jcBzfZmZ8kY9uEsl9YCO3B/NhrCAr0Xc0pckg8jEJ0QmxY7inqfXwV6/8d+MyGnkl29jU= 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 1753972531302868.2472993511803; Thu, 31 Jul 2025 07:35:31 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 5AC7412BF; Thu, 31 Jul 2025 10:35:30 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 637D6BFA; Thu, 31 Jul 2025 10:34:30 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 847C8B7B; Thu, 31 Jul 2025 10:34:24 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 13117B47 for ; Thu, 31 Jul 2025 10:34:24 -0400 (EDT) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-650-Xx7YvQRDP0eTOK9mvkYBHg-1; Thu, 31 Jul 2025 10:34:22 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 727D319773E8 for ; Thu, 31 Jul 2025 14:34:21 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.29]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5C3A83000199; Thu, 31 Jul 2025 14:34:20 +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=2.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_SBL_CSS,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1753972463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IQU+NAe50DurWnZi+fvwn2LXxZHvDcx838cya3vdKog=; b=CxSQlCtuLJUTBCpwVK2arJrg9nzEC+v1j4cNXFAsYobxY9VnXGuaVH8CeVIGKWoQWY50mS NDPYeYGyAHY/kp3Y9GbN1og7VJDDBHAsx8hhscfpNgp9p8q2MHEqsLKS6DJGRUcA1mMvsY m0mGzs8kFljZ9Jle+5QTSCFdDYwFnF0= X-MC-Unique: Xx7YvQRDP0eTOK9mvkYBHg-1 X-Mimecast-MFC-AGG-ID: Xx7YvQRDP0eTOK9mvkYBHg_1753972461 To: devel@lists.libvirt.org Subject: [PATCH 2/5] virDomainVcpuDefPostParse: Remove impossible check Date: Thu, 31 Jul 2025 16:34:10 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: KNotgnjid7vLrk9g0H-fQ1t0MMC8S-jvbnzrPcfjoBQ_1753972461 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 3T3GT5NWHQGBT5JJR52RLPFLZFRHJQOF X-Message-ID-Hash: 3T3GT5NWHQGBT5JJR52RLPFLZFRHJQOF 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 CC: Peter Krempa 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: 1753972534416116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Many callers of 'virDomainDefGetVcpu' don't validate return value when iterating CPUs up to def->maxvcpus/virDomainDefGetVcpusMax. Remove this one. Signed-off-by: Peter Krempa --- src/conf/domain_postparse.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/conf/domain_postparse.c b/src/conf/domain_postparse.c index a07ec8d94e..38e731348d 100644 --- a/src/conf/domain_postparse.c +++ b/src/conf/domain_postparse.c @@ -1013,10 +1013,6 @@ virDomainVcpuDefPostParse(virDomainDef *def) for (i =3D 0; i < maxvcpus; i++) { vcpu =3D virDomainDefGetVcpu(def, i); - /* impossible but some compilers don't like it */ - if (!vcpu) - continue; - switch (vcpu->hotpluggable) { case VIR_TRISTATE_BOOL_ABSENT: if (vcpu->online) --=20 2.50.1