From patchwork Thu Apr 24 22:20:55 2025 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: 883998 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp3673577wrs; Thu, 24 Apr 2025 15:26:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVgmPGJgVlhy+ndOggHWto2NxEV1gs44NCRuwjtHa8DI5+0jN7HILYHqabdPinmCglnw8DQRw==@linaro.org X-Google-Smtp-Source: AGHT+IGPdHzpTyTL0KSVJ4G3ZqaIXyB+dvbxW1EpxKp6PdDLKDHPP1+adg66m15SBrWzE0feyXqO X-Received: by 2002:a05:620a:2b88:b0:7c9:4df8:6b88 with SMTP id af79cd13be357-7c9606a5416mr56579885a.7.1745533579838; Thu, 24 Apr 2025 15:26:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745533579; cv=none; d=google.com; s=arc-20240605; b=ZXkj4qYpIewD7AOUtMqasksmKRVCnBBnek1AB2Txdu3P7b89JLKAQSoWk7VFFUEKl1 MulC6qpO5VCLqu6IW68r1kq5JC36Dr2ZC/ntlj4dMA0SEFcpcGMsPWnvYhaq6nn2/xF8 qKzesEkSqQ+9UrXba5Bu0i41FSTdPU+xFL6eQwn1VqERPLGJ+nXV8F6GWNpO9E1AI/E1 /ZIYANZQsSCI79YNKhyw9waTOEhU8zI+9Vw2shaac36E1ppHsKLhPU/9qzuG/QKA4Mej kBu4oyRXn8mfoFwF2Zc0rq1cm7Acgfm18JTjHpmnX4FuAcwt3ToYbtaNDindAiEOHp3d GYIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=3/h/8JlKQTj5C7D4ksIw0VPKDSTa8HWXtIX5aCCEMPI=; fh=0htP/E62RePjDPlH7cln4AEjpwt/VA0EePtBoJU71HU=; b=BLffRqhGfqafhKjQuoMiYH+PGoSwBD4b1FyRgWuVyp+GyKSvBJn9NlgjWFky+lbdBr 2AKh3wYpXylXjU3yKdwvqHVo+vA3cpedMeWQGZ408nsX/nKyxLc4EOWhuLtpcczD+srk oUvQWJvN7TlHWnVyRYmyac59G5mjPCa6iJtKIrSJT8rVj13aRKxyC74/CJsXe24cKCgn mEVotV169JOEPnbr395AWj9CWS851u36fPN+xrwRLpGCuUfqMiPC95PVAudXqbx3TCSH g918eKbRqVUCxCTb8M67BIPxIWC4fSLUI/QuPS6Yw5r9xbM/HG4QqESk0piDrLS7DxV3 3UhQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WU5ToOAZ; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c958eb894bsi236051485a.498.2025.04.24.15.26.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Apr 2025 15:26:19 -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=WU5ToOAZ; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u84wu-0004VD-IB; Thu, 24 Apr 2025 18:21:40 -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 1u84ws-0004V3-9n for qemu-devel@nongnu.org; Thu, 24 Apr 2025 18:21:38 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u84wq-0000xN-OM for qemu-devel@nongnu.org; Thu, 24 Apr 2025 18:21:38 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-39ee57c0b8cso1667413f8f.0 for ; Thu, 24 Apr 2025 15:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745533295; x=1746138095; 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=3/h/8JlKQTj5C7D4ksIw0VPKDSTa8HWXtIX5aCCEMPI=; b=WU5ToOAZ5pr7+slmxMEMr7csmSVFSCXjkhas5U4pPpZpGaBTMsn7l39GODDxUFzI7f W2Pf9ym8vg+xxa0YEeEycEapv8pJYR3M71XlNr8r2NtaitHLvNWtEUcww9uS1lIW8ymd i7WlSfx7LzZLiFCEcPQbleH19qreWChbVYhnx7opqRVUe4o9lfcxDtP9ruG6zlv4NzC/ jhtWHd/HJF4byUuS8iaGGV/XX9keEkdMu6fVZ0dtqyL2SwPmMrZ2ZPypIAJEGVmnUruk JezLr1/Fy5gr2WtKEsxh/EI9B1ZbiEg4N1GVAo04dCal8pkn+b9NZMpRdAiArJRBbL1D SdiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745533295; x=1746138095; 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=3/h/8JlKQTj5C7D4ksIw0VPKDSTa8HWXtIX5aCCEMPI=; b=icbtvmZ8WV2xze87KHVaUSMGdUQRq6n68+mp+1WFghzH7j1huQyvfVnHZxvg/Webug 9taglft7VuRRGZdJkBJrNpR4jqmfzRE+LoGMv3/X5tz5qh56fcjSQu1z04CD8sbp8X3X 7LM0sinki8pf5dFkCEsuWQWR2s/+d2avbuBe5doUppo4MlvHPA8qwC+It/Ik77isZvuD VJaTTl8H9aaSNLF9SMI7BjiFdD4/pvdiEzBkDrxOF48pb9swmA47AZrLYvvFNbnAQEbe 704cJi673TERjYXDwSG5lDMjkrXhXskhDf6+VKWM6xHBMM9Jt5KZRt7uqsxpsEU/lM4M zk3g== X-Forwarded-Encrypted: i=1; AJvYcCX7TbNHSWDbxh9UMz9iehYygUW/siiC3b6Aln1lORXnVZKyF3xEYhb+VBK/Y3S1Bfuz1P2I673cIM4T@nongnu.org X-Gm-Message-State: AOJu0YyS03zFULR1OKk4sGHjqgu4vaU3NL+lXPTaCIJ0xG19a6etTb0f RxcZRmNAxqZPeR97/C942cgZ/EAKXQEI0H3LukaVl6zsQMMLFYSGQQfGV9JUwgg= X-Gm-Gg: ASbGncsJmos9Y3WjxS8BM3rdKWnIkWyGXQq8bmmyIk2olMKwbbHgUZrnK7gYsWNiB5i HZ3vQCey7jmHFxYyf2FHF9N6E/8J4lhecBSA3RtdYgu8CCzC8dkTzK36nOLoYP7Yhaal6NHemN+ CZpelmcGvjLvoCRs9tvHXRZwwBNzP4KN3DknjBpHkrnBrU5XNcSdqRVTAfKJzmnIV/rRylFHLzK yKIPQJ6+5sKioYWAhynuf2gS2PVEFCyIJoy9IKGsAn3fr/oHnNftzIZPPlV6mpJ/cp72iXkhdai iRNjxW8IjFAUiQlqkwqH/whckL0Y2V5hZxfCF9BgFzvhJq2TrQyI6UIejHsK7I3/d6FFvF6tQMh FPXpid+AT40E/JAQ= X-Received: by 2002:a5d:59a9:0:b0:39c:e28:5f0d with SMTP id ffacd0b85a97d-3a072ac8c28mr806800f8f.25.1745533295016; Thu, 24 Apr 2025 15:21:35 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-440a53044besm3258715e9.14.2025.04.24.15.21.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Apr 2025 15:21:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Pierrick Bouvier , Richard Henderson , qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH v5 04/21] hw/core/null-machine: Define machine as generic QOM type Date: Fri, 25 Apr 2025 00:20:55 +0200 Message-ID: <20250424222112.36194-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250424222112.36194-1-philmd@linaro.org> References: <20250424222112.36194-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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 While DEFINE_MACHINE() is a succinct macro, it doesn't allow registering QOM interfaces to the defined machine. Convert to the generic DEFINE_TYPES() in preparation to register interfaces. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- hw/core/null-machine.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c index a6e477a2d88..3e03771d570 100644 --- a/hw/core/null-machine.c +++ b/hw/core/null-machine.c @@ -42,8 +42,10 @@ static void machine_none_init(MachineState *mch) } } -static void machine_none_machine_init(MachineClass *mc) +static void null_machine_class_init(ObjectClass *oc, const void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "empty machine"; mc->init = machine_none_init; mc->max_cpus = 1; @@ -55,4 +57,12 @@ static void machine_none_machine_init(MachineClass *mc) mc->no_cdrom = 1; } -DEFINE_MACHINE("none", machine_none_machine_init) +static const TypeInfo null_machine_types[] = { + { + .name = MACHINE_TYPE_NAME("none"), + .parent = TYPE_MACHINE, + .class_init = null_machine_class_init, + }, +}; + +DEFINE_TYPES(null_machine_types)