From: Blue Swirl <blauwirbel@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH, RFC 0/5] Improve device info handling
Date: Wed, 2 Sep 2009 17:41:40 +0300 [thread overview]
Message-ID: <f43fc5580909020741y6453fd6bvfcccdcf509b52106@mail.gmail.com> (raw)
In-Reply-To: <4A9E1247.9040009@redhat.com>
On Wed, Sep 2, 2009 at 9:35 AM, Gerd Hoffmann<kraxel@redhat.com> wrote:
> Hi,
>
>>> drives are host side state, they don't go into qdev.
>>
>> My idea was that boards (like pc) should be in the long run
>> represented by a qdev.
>
> The qdev root is the main_system_bus right now, I don't see a need to change
> that. All core devices (cpus, memory, pic, ...) can be children of the main
> system bus.
That level is too low, because the metamachine level would not be
interested in the internals of the pc device (except generic
parameters like memory, number of CPUs etc), but how it connects to
the host devices.
>> But shouldn't the drives, network and char devices be qdevs too,
>> wouldn't it help the metamachine (or "pc" device)?
>
> We have to clearly separate between host state and guest state.
> qdev is about guest state.
Yes, it's about guest state _now_, but why limit it to that? But if
host devices as a class are really different from guest device, we
could have something similar to qdev but for host devices. I still
don't see a need for a special type.
> A disk has two sides: The host side (virtual drive foo is a lvm volume in
> raw format / a file in qcow2 format / a iso image / whatever else) and the
> guest side (this virtual drive is a master ide disk / scsi disk with id 3 /
> virtio disk / ...). Only the later is represented by qdev. The link
> between the two is a property.
There is no need for a link. Instead of the property stuff, the pc
qdev should make available mappable objects (drive placeholders), the
metamachine would plug in the host drives by mapping the drive to a
host drive. It's just like device vs. address: drive placeholder vs.
host drive.
In fact, maybe we should have more devices at metamachine level: "pc"
qdev and "host" qdev (hdev if you can convince me). Maybe other
virtual objects too, like vlans, monitor, gdbstub etc.
> Likewise for chardevs and network.
Consider vlan:
DeviceState *gdev, *hdev, *vlan;
VLAN *gvlan, *hvlan;
hdev = qdev_create(NULL, "host");
qdev_init(hdev);
gdev = qdev_create(NULL, "pc");
qdev_init(gdev);
vlan = qdev_create(NULL, "vlan");
qdev_init(gdev);
gvlan = qdev_get_vlan_in(gdev, 0); // Analogous to gpio
hvlan = qdev_get_vlan_in(hdev, 0);
vlan_map(vlan, gvlan);
vlan_map(vlan, hvlan);
Beautiful, isn't it? ;-)
next prev parent reply other threads:[~2009-09-02 14:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-29 14:06 [Qemu-devel] [PATCH, RFC 0/5] Improve device info handling Blue Swirl
2009-08-31 8:12 ` Gerd Hoffmann
2009-08-31 15:23 ` Blue Swirl
2009-09-01 7:54 ` Gerd Hoffmann
2009-09-01 16:21 ` Blue Swirl
2009-09-02 6:35 ` Gerd Hoffmann
2009-09-02 14:41 ` Blue Swirl [this message]
2009-09-02 16:42 ` Gerd Hoffmann
2009-09-02 17:53 ` Blue Swirl
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=f43fc5580909020741y6453fd6bvfcccdcf509b52106@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.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).