qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Eduardo Habkost" <eduardo@habkost.net>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	qemu-block@nongnu.org,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Zhenwei Pi" <pizhenwei@bytedance.com>,
	"Fam Zheng" <fam@euphon.net>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Gonglei (Arei)" <arei.gonglei@huawei.com>
Subject: Re: [PATCH v3 02/10] qdev: Implement qemu_create_machine() for user emulation
Date: Thu, 2 Jan 2025 16:17:44 +0100	[thread overview]
Message-ID: <53d28483-a790-4927-a3a1-386cbeb1745c@linaro.org> (raw)
In-Reply-To: <20250102151244.59357-3-philmd@linaro.org>

On 2/1/25 16:12, Philippe Mathieu-Daudé wrote:
> To satisfy QOM containers design, implement qemu_create_machine()
> for user emulation, creating a 'fake' machine.
> 
> Suggested-by: Peter Xu <peterx@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   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 @@

   /* SPDX-License-Identifier: GPL-2.0-or-later */

> +#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'))



  reply	other threads:[~2025-01-02 15:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-02 15:12 [PATCH v3 00/10] QOM: container_get() removal Philippe Mathieu-Daudé
2025-01-02 15:12 ` [PATCH v3 01/10] qdev: Expose qemu_create_machine() Philippe Mathieu-Daudé
2025-01-02 15:12 ` [PATCH v3 02/10] qdev: Implement qemu_create_machine() for user emulation Philippe Mathieu-Daudé
2025-01-02 15:17   ` Philippe Mathieu-Daudé [this message]
2025-01-02 15:12 ` [PATCH v3 03/10] qdev: Call qemu_create_machine() on " Philippe Mathieu-Daudé
2025-01-02 15:12 ` [PATCH v3 04/10] qdev: Make qdev_get_machine() not use container_get() Philippe Mathieu-Daudé
2025-01-02 15:12 ` [PATCH v3 05/10] qdev: Add machine_get_container() Philippe Mathieu-Daudé
2025-01-02 15:12 ` [PATCH v3 06/10] qdev: Use machine_get_container() Philippe Mathieu-Daudé
2025-01-02 15:12 ` [PATCH v3 07/10] qom: Add object_get_container() Philippe Mathieu-Daudé
2025-01-02 15:12 ` [PATCH v3 08/10] qom: Use object_get_container() Philippe Mathieu-Daudé
2025-01-02 15:12 ` [PATCH v3 09/10] qom: Remove container_get() Philippe Mathieu-Daudé
2025-01-02 15:12 ` [PATCH v3 10/10] qdev: Inline machine_containers[] in qemu_create_machine_containers() Philippe Mathieu-Daudé
2025-01-02 17:29 ` [PATCH v3 00/10] QOM: container_get() removal Peter Xu
2025-01-02 21:14   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53d28483-a790-4927-a3a1-386cbeb1745c@linaro.org \
    --to=philmd@linaro.org \
    --cc=arei.gonglei@huawei.com \
    --cc=berrange@redhat.com \
    --cc=david@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=fam@euphon.net \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=pizhenwei@bytedance.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).