From patchwork Thu Jan 2 15:12:36 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: 854662 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp7823631wrq; Thu, 2 Jan 2025 07:17:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWgQvAWSk7miiL+na85kiF662TKjS7j4OOOhQbaO4aJVCzCxAU09fhuvdMFhISPI3cw5UWBzQ==@linaro.org X-Google-Smtp-Source: AGHT+IFC8PkxdmZvHcTXPp6lQAoZ3dTjLlziqcLB7zK4GoeRr+9XH4lj+YJmEkrI7GmBxg4ZixJB X-Received: by 2002:a05:6902:849:b0:e39:8882:9ca with SMTP id 3f1490d57ef6-e538c239ademr37488327276.13.1735831050724; Thu, 02 Jan 2025 07:17:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735831050; cv=none; d=google.com; s=arc-20240605; b=K2y9lK+KSYKaveA1N0/3vH8DUpLpB5kOZc4C1HdxEzBGvi2/OC56ecOLyGnECKLYpk 4k3I++rZvS27nt92+/AhdIwoq8w5EigRHshlSTC0NLyduWXfPejYgRn+iNgjY5zyMz30 zAx66rmJOqcZBCcvqnx+75N3mfMjJ/w7VIx569CcMUXPOy5wuwcXdgYa6YGjmKNMzmBB hEfocml0VQzEihPum7WJsDh+iaXo8oUxrPvvxv4X2hUkHTS6Jy3lMibLIFtu/A/3xoJ5 X483Uu2Oyvh8TKbbMn6NxaactrxCYEHxDyB7tJoujUOuRtvDw+tXZq5SQcfJt+qnPWkk Z4Ow== 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=SedjiUgYQYU6AzbLGFtcjZEu6+G941iL/2CKfBNylU4=; fh=PTspa9wvhkaR6hEChXR5orGauuRbRK309fOYTYlWOh4=; b=KDdGRDOI2FY5slS2B7ea/bJsgHrKbrA+uh1ytmbLrsivY8ZjcqVhZTZ0x8K9TfapoH aUlGeKAODhoDaM5ZzFyYAvfAJF5x0bAGpmgX2MhxAua7RHFAk1rYtzrNE+WNb9YdkIO9 AFQ3GybJJwX8z+LJbF4MFyU3kDHx9uCSXa79zQ6zUxdA4WKo8h1i63Z1cRF780A0xMEf fR04OvlB92PomX1FIiJqdQGbwdE1732i5gwVUydaJ3qXWCWhhw7VnKDxyfkgRFz+vQ1h 2ZjSyjBK7wyTYkvbqhwNCEm+XTuL5IM9OJwrFrMDlI/viFAPnNNr+VG5E0NYMxPTxRzp aHSw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QYuWcKjU; 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 3f1490d57ef6-e537d1ae161si15817852276.599.2025.01.02.07.17.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jan 2025 07:17:30 -0800 (PST) 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=QYuWcKjU; 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 1tTMsx-0007YE-IL; Thu, 02 Jan 2025 10:13:19 -0500 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 1tTMsk-0007Us-6n for qemu-devel@nongnu.org; Thu, 02 Jan 2025 10:13:08 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTMsc-0006VG-0o for qemu-devel@nongnu.org; Thu, 02 Jan 2025 10:13:01 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4361fe642ddso121002215e9.2 for ; Thu, 02 Jan 2025 07:12:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735830776; x=1736435576; 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=SedjiUgYQYU6AzbLGFtcjZEu6+G941iL/2CKfBNylU4=; b=QYuWcKjUgvQsnL9CYxPmVP4sBXfViWf56rCj/EdVf1xtxV6eCW9AN1mcK8MCJQ+gAR 0xrIpvy74gJC6AdwVEO4ghxHXaHPU4UQgI2K1HItDx7YrWbGlJnFYAAC6pOvGfkav9qh Cl2fdeX8E3dpY39OXtYEtI39fm0yN3OUdkeTPaYoQxd9fT+niL97METHZHbBQFvrqpJs ShQTe9CCmOmMvIHJx1IJcHobYRBPcyVR5FarOO5v9R+8QwTTjFCh/LYRuCJPs+f8zMFA kQc7Sdv5zi9IilqIUn7d2o5EA2TTBdBpa2duM3c8rpicTVg64fyA5XhLDVZyOoY6HAKy rjjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735830776; x=1736435576; 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=SedjiUgYQYU6AzbLGFtcjZEu6+G941iL/2CKfBNylU4=; b=bxk5eOvPsbD1+FKaF3gtlJoJpMUOG1PFXJBbBkq8sNsqYPRdDbEZ+JXikhmW4LU0E6 91iViuHRIatonDpeeGaR3JoyjX8r3Z/pEiUCmzVNcT4mEQopTAbuqSXG6dZPZc8o+hOW Mrmk2iTpph4Gx6Dy+71DTE8g5xNNugKucaShSDvCrhNpkfdFM/H0zjY1RkVHe1j8yAPW JFbwkM9tH4784o7/IZ0V70mSJmYidJbSkQo34zLiKTxin/HNReDfsNa7kItffEfRqn6E O9wMVc/rntTeL6CUTEYsiKaf6j3Ug7B/cobclp9a179rKAG8kKKXA5b1QEuMWAm0NOt6 OeOQ== X-Gm-Message-State: AOJu0Yzl79cLWXRFeTSQSq/rhXgVqJnsM+6mQanzyDKGC1VnhwUTlVOs V+X6OdH60rdMulE4UyqCcfmG/egBUozThRP2fLSB9fEuuyAvxQFtKg+5f9I984WBopzokGoZsoT bSDg7ig== X-Gm-Gg: ASbGncurs+0rKslHeOiHCTo1r/79neJzqINxSOaXLwR9EvdY0MkC2f1piwHr2kZ03qm rPMfi98nHhNBdCoefegWOhcADlHE/gXOUQuu6iZ6QwTgRhvmJq5oLsZvdmOAsYSEDChcKKShu8K 3MpdIZIesRJ/6isvnYgCJWz+H9xlGog8DJGPFALMwbrUQoHx9rTKTPpQdaivXuEvyJhyZCC3H0R +P98DMLX8bjQ77FnZgHfvTQKavk4S7lF3WesScjkWIOeb39fAk+aP3TsSlMm4lnh9RqpEcWfBN2 hJB25Nfq21ROL25y9+w+Nu+BBTGC0QE= X-Received: by 2002:a05:600c:4748:b0:434:f804:a9b0 with SMTP id 5b1f17b1804b1-43668b78818mr372590985e9.29.1735830776258; Thu, 02 Jan 2025 07:12:56 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4366127c4d7sm454232475e9.34.2025.01.02.07.12.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Jan 2025 07:12:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-block@nongnu.org, Marcel Apfelbaum , David Hildenbrand , "Michael S. Tsirkin" , Zhenwei Pi , Fam Zheng , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Peter Xu , Richard Henderson , Paolo Bonzini , "Gonglei (Arei)" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v3 02/10] qdev: Implement qemu_create_machine() for user emulation Date: Thu, 2 Jan 2025 16:12:36 +0100 Message-ID: <20250102151244.59357-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250102151244.59357-1-philmd@linaro.org> References: <20250102151244.59357-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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=unavailable 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 To satisfy QOM containers design, implement qemu_create_machine() for user emulation, creating a 'fake' machine. Suggested-by: Peter Xu Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-user-stubs.c | 11 +++++++++++ hw/core/meson.build | 1 + 2 files changed, 12 insertions(+) create mode 100644 hw/core/qdev-user-stubs.c diff --git a/hw/core/qdev-user-stubs.c b/hw/core/qdev-user-stubs.c new file mode 100644 index 00000000000..9d481a61dbf --- /dev/null +++ b/hw/core/qdev-user-stubs.c @@ -0,0 +1,11 @@ +#include "qemu/osdep.h" +#include "hw/qdev-core.h" + +void qemu_create_machine(QDict *qdict) +{ + Object *fake_machine_obj; + + fake_machine_obj = object_property_add_new_container(object_get_root(), + "machine"); + object_property_add_new_container(fake_machine_obj, "unattached"); +} diff --git a/hw/core/meson.build b/hw/core/meson.build index ce9dfa3f4bf..0f020fed1df 100644 --- a/hw/core/meson.build +++ b/hw/core/meson.build @@ -46,3 +46,4 @@ system_ss.add(files( 'vm-change-state-handler.c', 'clock-vmstate.c', )) +user_ss.add(files('qdev-user-stubs.c'))