From: Eduardo Habkost <ehabkost@redhat.com>
To: Juergen Gross <jgross@suse.com>
Cc: qemu-devel@nongnu.org, xen-devel@lists.xensource.com,
anthony.perard@citrix.com, sstabellini@kernel.org,
kraxel@redhat.com, armbru@redhat.com,
Marcel Apfelbaum <marcel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 3/4] xen: create qdev for each backend device
Date: Thu, 23 Mar 2017 17:57:08 -0300 [thread overview]
Message-ID: <20170323205708.GA32071@thinpad.lan.raisama.net> (raw)
In-Reply-To: <20161122061059.26058-4-jgross@suse.com>
Hi,
I am reviewing the existing code that sets has_dynamic_sysbus,
and this patch confused me. I have a question below:
On Tue, Nov 22, 2016 at 07:10:58AM +0100, Juergen Gross wrote:
> Create a qdev plugged to the xen-sysbus for each new backend device.
> This device can be used as a parent for all needed devices of that
> backend. The id of the new device will be "xen-<type>-<dev>" with
> <type> being the xen backend type (e.g. "qdisk") and <dev> the xen
> backend number of the type under which it is to be found in xenstore.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> ---
> hw/xen/xen_backend.c | 47 ++++++++++++++++++++++++++++++++++++++++++++
> hw/xen/xen_pvdev.c | 4 +++-
> include/hw/xen/xen_backend.h | 4 ++++
> include/hw/xen/xen_pvdev.h | 1 +
> 4 files changed, 55 insertions(+), 1 deletion(-)
>
[...]
> +static void xen_set_dynamic_sysbus(void)
> +{
> + Object *machine = qdev_get_machine();
> + ObjectClass *oc = object_get_class(machine);
> + MachineClass *mc = MACHINE_CLASS(oc);
> +
> + mc->has_dynamic_sysbus = true;
> +}
> +
Why exactly is this code necessary? I assume there's no current
use case for "-device xen-sysdev" and "-device xen-backend",
correct? The devices created by C code like xen_be_get_xendev()
aren't supposed to be returned by
foreach_dynamic_sysbus_device().
> int xen_be_register(const char *type, struct XenDevOps *ops)
> {
> char path[50];
> @@ -562,6 +579,8 @@ int xen_be_register(const char *type, struct XenDevOps *ops)
>
> void xen_be_register_common(void)
> {
> + xen_set_dynamic_sysbus();
> +
> xen_be_register("console", &xen_console_ops);
> xen_be_register("vkbd", &xen_kbdmouse_ops);
> xen_be_register("qdisk", &xen_blkdev_ops);
[...]
--
Eduardo
next prev parent reply other threads:[~2017-03-23 20:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-22 6:10 [Qemu-devel] [PATCH v3 0/4] xen: add qdevs for each backend, correct pvUSB Juergen Gross
2016-11-22 6:10 ` [Qemu-devel] [PATCH v3 1/4] xen: add an own bus for xen backend devices Juergen Gross
2016-11-22 6:10 ` [Qemu-devel] [PATCH v3 2/4] qdev: add function qdev_set_id() Juergen Gross
2017-03-23 21:11 ` Eduardo Habkost
2016-11-22 6:10 ` [Qemu-devel] [PATCH v3 3/4] xen: create qdev for each backend device Juergen Gross
2017-03-23 20:57 ` Eduardo Habkost [this message]
2016-11-22 6:10 ` [Qemu-devel] [PATCH v3 4/4] xen: attach pvusb usb bus to backend qdev Juergen Gross
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=20170323205708.GA32071@thinpad.lan.raisama.net \
--to=ehabkost@redhat.com \
--cc=anthony.perard@citrix.com \
--cc=armbru@redhat.com \
--cc=jgross@suse.com \
--cc=kraxel@redhat.com \
--cc=marcel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xensource.com \
/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).