From nobody Mon Sep 8 17:12:43 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=1753972506; cv=none; d=zohomail.com; s=zohoarc; b=cmsSJwpgmrPx38FkjJscvNWL5l0IPp2pRvIBdxJdxdpmn4gFZ7J5E9suARWzFCavr+yEAD75mIVZ2rMlyT8HZhuIo7AqlWYcxpF1rEzIRfDypajRNjnwRfjq79cHl0fBGlgXGfL/pCBwDLF4VBh8PYXr3cEhOXMFkesJb46vsKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753972506; 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=ECEPRZsU3hn3Bv/GaaM9hFRMD2KfvA6x0CcCCxewG/o=; b=RRfN6jstBomyXU53Gh9h7nW/pNZzLPhePGVuiCsf20l912HYq9flmqtICS0/n1c69i5nNyC4ZJ6cB7QGF9yQB+BHjKuQ5559RHELbj63bcOI8ynDeaOuwN9x/Vqsl78AJX97nDIhPkthRlRZfYaqcmi/3lqQgPntHQiL4KQipEA= 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 1753972506705380.4839588888683; Thu, 31 Jul 2025 07:35:06 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A6141D90; Thu, 31 Jul 2025 10:35:05 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id AF47DCA1; Thu, 31 Jul 2025 10:34:26 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6B06DB46; Thu, 31 Jul 2025 10:34:23 -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 EA384B46 for ; Thu, 31 Jul 2025 10:34:22 -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-154-o6alrMcaOaSI-ymjkuPVMw-1; Thu, 31 Jul 2025 10:34:20 -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 C6D9D1956052 for ; Thu, 31 Jul 2025 14:34:19 +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 B8A183000199; Thu, 31 Jul 2025 14:34:18 +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=1753972462; 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=yjW89/UnMp33m+xyVVNvpQZ/RM51rUl5kn/ivpkqr1M=; b=S5azCNyCd0x1G2WUVkfAm4xC8UV1+zD0MBR+7VsboklluPickk8dP//hUUM3qk28JzSu1W QPOOW9IFiJ+GlfundmpFwhIaaQShwPmIAt5LtwKTaPSa7/k9vU1+Amt7bdnKpE4MNfsLYP 4lP6OIJQoJxtCG2H6PLxxNbTslO23Ns= X-MC-Unique: o6alrMcaOaSI-ymjkuPVMw-1 X-Mimecast-MFC-AGG-ID: o6alrMcaOaSI-ymjkuPVMw_1753972459 To: devel@lists.libvirt.org Subject: [PATCH 1/5] Unexport virCHProcessSetupVcpu Date: Thu, 31 Jul 2025 16:34:09 +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: oNCvhZibZhVYLVMrORJ7nw8Y6tzulZvfhWZrvLeF8YQ_1753972459 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 53OKOC3HFUXNYHMAK6UNKCINW36QOFA7 X-Message-ID-Hash: 53OKOC3HFUXNYHMAK6UNKCINW36QOFA7 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: 1753972510019116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa The function is not used outside of the module. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/ch/ch_process.c | 2 +- src/ch/ch_process.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c index cc84823fdc..cd2e88af1e 100644 --- a/src/ch/ch_process.c +++ b/src/ch/ch_process.c @@ -409,7 +409,7 @@ virCHProcessSetupEmulatorThreads(virDomainObj *vm) * * Returns 0 on success, -1 on error. */ -int +static int virCHProcessSetupVcpu(virDomainObj *vm, unsigned int vcpuid) { diff --git a/src/ch/ch_process.h b/src/ch/ch_process.h index 7a6995b7cf..70ae8f700d 100644 --- a/src/ch/ch_process.h +++ b/src/ch/ch_process.h @@ -30,9 +30,6 @@ int virCHProcessStop(virCHDriver *driver, virDomainObj *vm, virDomainShutoffReason reason); -int virCHProcessSetupVcpu(virDomainObj *vm, - unsigned int vcpuid); - int virCHProcessStartRestore(virCHDriver *driver, virDomainObj *vm, const char *from); --=20 2.50.1 From nobody Mon Sep 8 17:12:43 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 Reviewed-by: J=C3=A1n Tomko --- 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 From nobody Mon Sep 8 17:12:43 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=1753972550; cv=none; d=zohomail.com; s=zohoarc; b=mcIgmCCnK3J/aJc1MWSBAU514P+VeMGxjVfXUWWl78l+I4s9oEOz+OG9li2n/nrvNjTF8l5tqZV7nIlGPe63PzVB+IKE2Dxzk83EwUXNu0N/McAP3Y0V7mW51yy7o9ODXvKZOyCSRF0QbQGaUV8J4cv9hEBTqZnlsCeLuRy1Y9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753972550; 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=6x6wYJY6WBf/3rQJzCF8oskwbTz8zv+MqL+FeH1gSdg=; b=TLCIqkoyzr3uq5JSbHxtxwCVViEpSAe8ZaAv1fTyQSNicQrwmiG98v+lrEMi2cK5z0ZqkjOe1GP22YWbYOleDWB5TDH/r1Y5A+TDwA6CdtaAXAnr3el+fimrU4cNtdOmy/ooGrICr8ieY2dJ1a3zIDFAaGh/7Ncgmr7VmAy6qRM= 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 1753972550889595.2113041024165; Thu, 31 Jul 2025 07:35:50 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id E8A871244; Thu, 31 Jul 2025 10:35:49 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 55897CA0; Thu, 31 Jul 2025 10:34:32 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6DDF2BB1; Thu, 31 Jul 2025 10:34:27 -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 DF563BB1 for ; Thu, 31 Jul 2025 10:34:25 -0400 (EDT) Received: from mx-prod-mc-02.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-448-nkgfkbT2NQ-Z224Dq1x9JQ-1; Thu, 31 Jul 2025 10:34:23 -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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 00B1D1956094 for ; Thu, 31 Jul 2025 14:34:23 +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 EB98D3000218; Thu, 31 Jul 2025 14:34:21 +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=1753972465; 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=pw+c5EGJFa4f2JnlPX8ofy71yAuX5yWaY02s8VtTU/8=; b=MWPw1m6LEIRGayVtJ/srdr1PNLp/8PtA4EmtIiL4OXlQn4OjdT6pWUc0nSKx4qblwHZ7fR HvYz/yoHIkKK5H15bnUgCEoYQO9N7Vsjwe6fN8g6PMmN9KbCNsDyHvaAvCOjY7CabNlmFu WEwZzkq7kVBJNaW3v17hWA5ULFQkqkc= X-MC-Unique: nkgfkbT2NQ-Z224Dq1x9JQ-1 X-Mimecast-MFC-AGG-ID: nkgfkbT2NQ-Z224Dq1x9JQ_1753972463 To: devel@lists.libvirt.org Subject: [PATCH 3/5] qemu: domain: Remove unused qemuDomainGetVcpuHalted Date: Thu, 31 Jul 2025 16:34:11 +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: Y7K5-sWQkGuRsSRdEAVMkY2IE-2GSFhB13_XXQLFRz0_1753972463 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: XPF5U5NSOLJPL63P6VBM4CSEGZ3SRZPC X-Message-ID-Hash: XPF5U5NSOLJPL63P6VBM4CSEGZ3SRZPC 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: 1753972552591116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 15 --------------- src/qemu/qemu_domain.h | 1 - 2 files changed, 16 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a2c7c88a7e..e45757ccd5 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8603,21 +8603,6 @@ qemuDomainRefreshVcpuInfo(virDomainObj *vm, return ret; } -/** - * qemuDomainGetVcpuHalted: - * @vm: domain object - * @vcpu: cpu id - * - * Returns the vCPU halted state. - */ -bool -qemuDomainGetVcpuHalted(virDomainObj *vm, - unsigned int vcpuid) -{ - virDomainVcpuDef *vcpu =3D virDomainDefGetVcpu(vm->def, vcpuid); - return QEMU_DOMAIN_VCPU_PRIVATE(vcpu)->halted; -} - /** * qemuDomainRefreshVcpuHalted: * @driver: qemu driver data diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 1afd932764..ffe5bee1bf 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -870,7 +870,6 @@ int qemuDomainValidateVcpuInfo(virDomainObj *vm); int qemuDomainRefreshVcpuInfo(virDomainObj *vm, int asyncJob, bool state); -bool qemuDomainGetVcpuHalted(virDomainObj *vm, unsigned int vcpu); int qemuDomainRefreshVcpuHalted(virDomainObj *vm, int asyncJob); --=20 2.50.1 From nobody Mon Sep 8 17:12:43 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=1753972573; cv=none; d=zohomail.com; s=zohoarc; b=dmdrF/+qhtd+wpVIVWKYDGthbbZDCXbG7PoqepIJlybe4zpON6rBubMbMIK3GkDxQBrXR9weGqwMQ7bZxrUBve2IYowRuCEwbsLvRWJtoEKVRxtYGwY7C4w1oy0yAqpOAkQBiXfwi7riernQ91+rLgO/2kea3c4n3t6mg18XQtA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753972573; 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=lCp/Q45AzYEJkGJOZ2aPEfc4yu4cjkblJ7P7XD8oA5I=; b=VreK2Q0ehMsCSuY9HGYjKVCz/EWXBDbHlaf/LEiMFFLc6KBiV2KkcRQ1DiGaOJdj2kxbFu0SCeC2ZAXP3OncrIUWDs4p3YzdIUBHW5Uq3zzdGwaF0RsSdaaHntEQFLH0OvE/VyqL6Elc30zjmmJaZFD8+QtXSD0jTxMfRJ+I9Oc= 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 1753972573663343.50304457430263; Thu, 31 Jul 2025 07:36:13 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 70544B7B; Thu, 31 Jul 2025 10:36:11 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4207AC04; Thu, 31 Jul 2025 10:34:39 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1FA601174; Thu, 31 Jul 2025 10:34:34 -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 58B3ABC1 for ; Thu, 31 Jul 2025 10:34:27 -0400 (EDT) Received: from mx-prod-mc-06.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-470-ZMSUrDv9NyedEl94a1dVWQ-1; Thu, 31 Jul 2025 10:34:25 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7FC1B1800261 for ; Thu, 31 Jul 2025 14:34:24 +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 7432F3000199; Thu, 31 Jul 2025 14:34:23 +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_PASS 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=1753972467; 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=Lo45BCZXgE8Mp8JWVOGgHI0ew97HtJseTHA74cT3WMI=; b=FmuLTCqY5aL2B5Ewkt5/d2EL/63uf1w9uthGj34VIIERsC9fk7RtxJFgqS1AxqoBweQYpV +r8swIB3qP3jn+02uGuSbf4Pss09mKHP6fpboVrhJR1n7pk55uKfVB1BvF3fzzxHfcZX5j 3xfR1Ugr1Sx7yUGGilUnGIcbafBKTG0= X-MC-Unique: ZMSUrDv9NyedEl94a1dVWQ-1 X-Mimecast-MFC-AGG-ID: ZMSUrDv9NyedEl94a1dVWQ_1753972464 To: devel@lists.libvirt.org Subject: [PATCH 4/5] virCHDomainRefreshThreadInfo: Don't trust vcpu ID returned by hypervisor Date: Thu, 31 Jul 2025 16:34:12 +0200 Message-ID: <511d44d1d44c08814cfde5ec3d5519736aa18e37.1753972379.git.pkrempa@redhat.com> 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: N6atiDuqJS2neU_3NNCF1KIE55C64Ii3ghPdtf-u_nk_1753972464 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: XSPUYVSJPX4LJ3QJNV2YG6BG5Y2A335J X-Message-ID-Hash: XSPUYVSJPX4LJ3QJNV2YG6BG5Y2A335J 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: 1753972574942116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa The hypervisor may return an index out of range of current vCPUs defined in the domain which would cause a NULL dereference. Validate that the vCPU struct with ID fetched from hypervisor exists before dereferencing it. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/ch/ch_domain.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/ch/ch_domain.c b/src/ch/ch_domain.c index 7231fdc49f..85bd99e1e9 100644 --- a/src/ch/ch_domain.c +++ b/src/ch/ch_domain.c @@ -276,10 +276,15 @@ virCHDomainRefreshThreadInfo(virDomainObj *vm) /* TODO: hotplug support */ vcpuInfo =3D &info[i].vcpuInfo; - vcpu =3D virDomainDefGetVcpu(vm->def, vcpuInfo->cpuid); - vcpupriv =3D CH_DOMAIN_VCPU_PRIVATE(vcpu); - vcpupriv->tid =3D vcpuInfo->tid; - ncpus++; + + if ((vcpu =3D virDomainDefGetVcpu(vm->def, vcpuInfo->cpuid))) { + vcpupriv =3D CH_DOMAIN_VCPU_PRIVATE(vcpu); + vcpupriv->tid =3D vcpuInfo->tid; + ncpus++; + } else { + VIR_WARN("vcpu '%d' reported by hypervisor but not found in de= finition", + vcpuInfo->cpuid); + } } /* TODO: Remove the warning when hotplug is implemented.*/ --=20 2.50.1 From nobody Mon Sep 8 17:12:43 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=1753972593; cv=none; d=zohomail.com; s=zohoarc; b=A9MFKEf4niJHMRnH/oKpz3E1SABZyoHSBOUq82xunBvYFZfSQ0J8S0/kcBJ4RHvb9MDkEZGZHzd7rRWAubvxar28BbI6i3jGyjjQVUgGvv1lcZVxAh4aMlE0AUTFXI7pdLJbflX6pRyNzNDiPVRIooqQQrShwXQAvqQ6YF0n6Ls= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753972593; 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=7KLnPrUkSAYInHN/umq5KBJqeEmYXuAWSo8/X02D4Vw=; b=PX3j+KnbTg2pDS16rLNt/qfBnLRGVLDDzPHSobn6I3zMC4QzH2PosUlpgQEMI8uLIHYO6Fqd29zJIyAmDjoE9d5WcXhxHyaGXnx4ugENcGjnXgPb7moQQzIXTkekJCKOojj2rMTySkj+MKAKQgoXMhCF0kZXXdLlWol8k6FbCeE= 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 1753972592892814.1480298498352; Thu, 31 Jul 2025 07:36:32 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id F1583BDF; Thu, 31 Jul 2025 10:36:29 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 124C311B9; Thu, 31 Jul 2025 10:34:45 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A54DEC33; Thu, 31 Jul 2025 10:34:40 -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 F03C21252 for ; Thu, 31 Jul 2025 10:34:28 -0400 (EDT) Received: from mx-prod-mc-06.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-471-zU8eeLKrP5mnDwy_QCypBg-1; Thu, 31 Jul 2025 10:34:26 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 332CD18003FC for ; Thu, 31 Jul 2025 14:34:26 +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 00EFF3000199; Thu, 31 Jul 2025 14:34:24 +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_PASS 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=1753972468; 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=dZpvtEbWo383K5zYNH30oi+irmAQwpUWc9MSpkmB50I=; b=RBX824gZs4KQNMTmaVxfgChLj15qgvR+3n6wbt0IOY0P2uyg+oajjTG9Oy8lHSYUiTJ8AF tMHoaP5hEEEp0d7mxyb24DS39c1T/cFNueY38aq+C/8JS8WPJfaDFJI/u7TjKn2eC2/B1k k76bXWgQLjAeVlOu4v92niQNY5UKvVY= X-MC-Unique: zU8eeLKrP5mnDwy_QCypBg-1 X-Mimecast-MFC-AGG-ID: zU8eeLKrP5mnDwy_QCypBg_1753972466 To: devel@lists.libvirt.org Subject: [PATCH 5/5] virCHDomainRefreshThreadInfo: Remove illusion that caller cares about return value Date: Thu, 31 Jul 2025 16:34:13 +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: vkWtyOk2bl9dYgfiRtTvtLQHd_P0M1meYwcjUAxomj0_1753972466 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: MOG6RWPLY6W5WYXODGWD2NN6FYXW6GAB X-Message-ID-Hash: MOG6RWPLY6W5WYXODGWD2NN6FYXW6GAB 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: 1753972595253116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa The caller doesn't check the return value. Remove it to avoid confusing readers. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/ch/ch_domain.c | 4 +--- src/ch/ch_domain.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ch/ch_domain.c b/src/ch/ch_domain.c index 85bd99e1e9..6ace9eafbf 100644 --- a/src/ch/ch_domain.c +++ b/src/ch/ch_domain.c @@ -254,7 +254,7 @@ chValidateDomainDeviceDef(const virDomainDeviceDef *dev, return 0; } -int +void virCHDomainRefreshThreadInfo(virDomainObj *vm) { unsigned int maxvcpus =3D virDomainDefGetVcpusMax(vm->def); @@ -291,8 +291,6 @@ virCHDomainRefreshThreadInfo(virDomainObj *vm) if (ncpus !=3D maxvcpus) VIR_WARN("Mismatch in the number of cpus, expected: %u, actual: %z= u", maxvcpus, ncpus); - - return 0; } virDomainDefParserConfig virCHDriverDomainDefParserConfig =3D { diff --git a/src/ch/ch_domain.h b/src/ch/ch_domain.h index 69a657f6af..4532fe9ce0 100644 --- a/src/ch/ch_domain.h +++ b/src/ch/ch_domain.h @@ -62,7 +62,7 @@ void virCHDomainRemoveInactive(virCHDriver *driver, virDomainObj *vm); -int +void virCHDomainRefreshThreadInfo(virDomainObj *vm); pid_t --=20 2.50.1