From patchwork Tue Jul 2 05:01:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 809034 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp44050wru; Mon, 1 Jul 2024 22:03:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWds179ET+UKUdqJoTZ4miF9dVOQNPnbPkpSJgzyBTb42b1+Q3hLnYVWOfh69h0wc3DdLW2+1AzzPmOH+WNuPP1 X-Google-Smtp-Source: AGHT+IGTHInWO8B+RNJSz16nXxtXtM7Tpao7v3MJRZXR++PvSeI9Tlh0M+mTTiwYFscxE7gSnnQi X-Received: by 2002:a05:622a:1186:b0:446:5568:a6de with SMTP id d75a77b69052e-44662e59a71mr92325561cf.48.1719896608482; Mon, 01 Jul 2024 22:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719896608; cv=none; d=google.com; s=arc-20160816; b=J2xU+fBQHjMzevk1OTQF9kI9BGIGbe52ZENZ9hO5LqGiFGxnRycsXMMACPIzRTuyz7 hYStSiDjvp6FEabaJbyyQ5o9UsiFYqmuhdvBLpxGsm6wmNkB6SmiNF6pjrdbcQDUXmUU Ea1B6UJOXT9ErArW9r5UY/xT4ASgz1FtdU8hvlmSeRAIz5Ke//rc6/kBoQBUkHKP9Ork FD0+Ep/sGRdRvLAqg9XVH7CX+GQmlqpHch48ABGeTh5pS/vuWqboz+kEY1i5RrsvaCA7 fIQJVBB4B8J1BKKoCvVcdzfkdGtCWEDn7Vn3d9teXl3/6TB28eIFsj5AK0a4H0lHKUmD W2xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JbdsfJ44aAB8rxW6wAXXI/854m0o2ZFI+jAaNwL715g=; fh=B/0b1FThncQQQALBQMKdmnM3E+nS03h1GE8Rgi7aa2k=; b=kxVAp9XH3bTi/6Lvg6Ros89C4gYJhuu7pgPBP/HZmEPybDTshVqH9G21dEPhpjU2E4 HiXDvn2qjWQ6u0530g5oUweErUXLh2aNXJXKBL/EqnlOyHBQZgTKnUGKtdNsf4MXqy8n oF888lY2JvcwKuaU5JDQ1zmLijEJkuzLnscoCnvRlNtRzTYfEdP365WWJyn3bVR7PN3w f3fbv4KuKdfJNFewoXp4rIUIKT9HDvECBzohGlYFyBgufQbfjqZpyBacjQ96ByA+m2wd U82tOuede5OAWBDS6zJBogxaD+mtKdgJPmVODF6VHbUga1a4sbUwQiO3hFqj1dnERh0J uXmQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FBFI41WO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-446513c1bbcsi92959001cf.70.2024.07.01.22.03.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 22:03:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FBFI41WO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOVf4-0000T5-CT; Tue, 02 Jul 2024 01:02:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOVf1-0008Tq-K3 for qemu-devel@nongnu.org; Tue, 02 Jul 2024 01:02:35 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOVex-0007Ea-9r for qemu-devel@nongnu.org; Tue, 02 Jul 2024 01:02:34 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-52e829086f3so3575683e87.3 for ; Mon, 01 Jul 2024 22:02:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719896549; x=1720501349; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JbdsfJ44aAB8rxW6wAXXI/854m0o2ZFI+jAaNwL715g=; b=FBFI41WO3Y5PjrYn8KHPhZQXGFbPrmytEnrd7/qJQbiHEj6bVjgmJXb/IzvNIvJvUH rCAp5tvTeuonI9zWClXeEf7jpOID4LtMGeUcf/nL0kcW3sQrHtqPyxQwJaLgAW+zA5ff FP5pJwUWFFYm23fRUZWC3lKGpBnJZFnxxVHFk5nEbZ32IjysywBCZKCtB+TTBHOqaIA+ a5PYGGmTxIPvdZf2d3xFku5n1YaHlb/SahjFMuBWMW5LWQN42kE9auQ+XmNZ4z6wCBWT N4s1nEuhDZpFu3H1SBYsjEwk5LKw8o24jNuVz+PV5o2KdsNYYWrq8jJZ1Mdh1mQJ93wJ M32Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719896549; x=1720501349; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JbdsfJ44aAB8rxW6wAXXI/854m0o2ZFI+jAaNwL715g=; b=uHI05vyDXxW0iDvaawxSqCBaq1ZqNSTBuxxhh3A5tpdID1IbwWfBFGuNaZ0B8+PrCt tccruV3z3fn21TG1BThR3SYx1fxcSL/VwhIZ+SZzNwZnyypcBiM+bvpTau/2DYfI94zM DZueJDAeItLLuT9HfYwngsu/KDL/yT/So8+NTQcdd1RonZj7/fVtWHoaOTJILZd8gFww TjsL7+iLqwO7DBF0EnGWs8GzjznF2arOs5+AAxMtdZq3M/jJFyj9ltpl0CHhaNV0wMvb 0ou0SxCQloL1j8JgwEqxpcPdi0NsjyUmj0dAaJHyv2vvRPm6H4Zz5LNUhJ31YaHaUjot r/OA== X-Gm-Message-State: AOJu0YzVKUviFamP2E5n1XlbUNLk/SAQ+ZAaqyz3Kf4OwtMvvp4LgVC6 9qmpChyCQ6aov0SmX/ys5bhItzV/TOKdYSmfX9vfNmVOg5Yvt2VAawCxF8NlVKGEaV22BwURhzd T X-Received: by 2002:ac2:4c41:0:b0:52b:bee3:dcc6 with SMTP id 2adb3069b0e04-52e826fa995mr5628932e87.51.1719896549046; Mon, 01 Jul 2024 22:02:29 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.58]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a1108b0sm11916332f8f.114.2024.07.01.22.02.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 01 Jul 2024 22:02:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 12/22] hw: skip registration of outdated versioned machine types Date: Tue, 2 Jul 2024 07:01:02 +0200 Message-ID: <20240702050112.35907-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240702050112.35907-1-philmd@linaro.org> References: <20240702050112.35907-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=philmd@linaro.org; helo=mail-lf1-x12b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Daniel P. Berrangé This calls the MACHINE_VER_DELETION() macro in the machine type registration method, so that when a versioned machine type reaches the end of its life, it is no longer registered with QOM and thus cannot be used. The actual definition of the machine type should be deleted at this point, but experience shows that can easily be forgotten. By skipping registration the manual code deletion task can be done at any later date. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240620165742.1711389-12-berrange@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 1 + hw/arm/virt.c | 1 + hw/m68k/virt.c | 1 + hw/ppc/spapr.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + 5 files changed, 5 insertions(+) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 83d2e66498..4e55d7ef6e 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -340,6 +340,7 @@ extern const size_t pc_compat_2_3_len; }; \ static void MACHINE_VER_SYM(register, namesym, __VA_ARGS__)(void) \ { \ + MACHINE_VER_DELETION(__VA_ARGS__); \ type_register(&MACHINE_VER_SYM(info, namesym, __VA_ARGS__)); \ } \ type_init(MACHINE_VER_SYM(register, namesym, __VA_ARGS__)); diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 02e13b4a3d..b0c68d66a3 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -123,6 +123,7 @@ static void arm_virt_compat_set(MachineClass *mc) }; \ static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ { \ + MACHINE_VER_DELETION(__VA_ARGS__); \ type_register_static(&MACHINE_VER_SYM(info, virt, __VA_ARGS__)); \ } \ type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index 37bb36b385..cda199af8f 100644 --- a/hw/m68k/virt.c +++ b/hw/m68k/virt.c @@ -356,6 +356,7 @@ type_init(virt_machine_register_types) }; \ static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ { \ + MACHINE_VER_DELETION(__VA_ARGS__); \ type_register_static(&MACHINE_VER_SYM(info, virt, __VA_ARGS__)); \ } \ type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 55268489d3..044e6a8d9d 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4824,6 +4824,7 @@ static void spapr_machine_latest_class_options(MachineClass *mc) }; \ static void MACHINE_VER_SYM(register, spapr, __VA_ARGS__)(void) \ { \ + MACHINE_VER_DELETION(__VA_ARGS__); \ type_register(&MACHINE_VER_SYM(info, spapr, __VA_ARGS__)); \ } \ type_init(MACHINE_VER_SYM(register, spapr, __VA_ARGS__)) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index c25dc3e13f..336cb8c6d4 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -847,6 +847,7 @@ static const TypeInfo ccw_machine_info = { }; \ static void MACHINE_VER_SYM(register, ccw, __VA_ARGS__)(void) \ { \ + MACHINE_VER_DELETION(__VA_ARGS__); \ type_register_static(&MACHINE_VER_SYM(info, ccw, __VA_ARGS__)); \ } \ type_init(MACHINE_VER_SYM(register, ccw, __VA_ARGS__))