From: "Andreas Färber" <afaerber@suse.de>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Juan Quintela <quintela@redhat.com>,
qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH RFC qom-next 4/4] pcie_port: Turn PCIEPort and PCIESlot into abstract QOM types
Date: Sun, 28 Jul 2013 14:36:33 +0200 [thread overview]
Message-ID: <51F51051.7050801@suse.de> (raw)
In-Reply-To: <87y58y49tx.fsf@codemonkey.ws>
Hi Anthony,
Am 22.07.2013 22:29, schrieb Anthony Liguori:
> for consistency, I think having everything be relatively to
> *one* type for a Property list is pretty helpful.
>
> Expecting someone to know the type hierarchy by heart such that this
> doesn't look like a bug is too much IMHO.
I have changed v2 not to mix different-but-compatible struct types in
one VMStateDescription.
Could you clarify if that was what you meant with the above?
Or would you also be opposed to - post-1.6 - changing
VMSTATE_PCIE_DEVICE(parent_obj[.parent_obj], MyStruct)
to
VMSTATE_PCIE_DEVICE()
as suggested elsewhere in this thread?
I'm thinking that writing VMSTATE_PCIE_DEVICE() already clearly
indicates the developer knows the device inherits from TYPE_PCI_DEVICE.
All PCIe devices using VMSTATE_PCIE_DEVICE() today use it at an offset
of 0 and so do all PCI devices using VMSTATE_PCI_DEVICE() apparently.
VMSTATE_PCI_DEVICE_POINTER() would be unaffected, but is unused anyway.
My survey also concluded that luckily all VMSTATE_PCIE_DEVICE() and
VMSTATE_PCI_DEVICE() are placed as first VMStateField, so moving parent
state to its class might be possible, similar to qdev props todays with
class_base_init clearing it for derived types.
However this would require to either refactor core VMState code to
operate on a list, aggregated from one or more zero-terminated arrays,
which I would consider invasive and error-prone, or simply have Device
code allocate a new VMStateDescription before registering it in QOM
realize (so it can be free'd on unrealize). Thoughts?
Either way, it would work for CPU but not for PCI, since there are two
different macros, VMSTATE_PCI_DEVICE() and VMSTATE_PCIE_DEVICE() both
for PCIDeviceClass. Not sure how to solve that without multi-inheritence.
SHPC_VMSTATE() seems to be another macro beyond VMSTATE_MSIX() operating
on PCIDevice but placed in an individual device (pci-bridge-dev). Can it
be turned into a subsection, Michael?
Regards,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-07-28 12:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-21 14:09 [Qemu-devel] [PATCH RFC qom-next 0/4] QOM'ification of pci-bridge types Andreas Färber
2013-07-21 14:09 ` [Qemu-devel] [PATCH RFC qom-next 1/4] pci-bridge: Turn into abstract QOM type Andreas Färber
2013-07-21 14:09 ` [Qemu-devel] [PATCH RFC qom-next 2/4] pci-bridge-dev: QOM parent field cleanup Andreas Färber
2013-07-21 14:09 ` [Qemu-devel] [PATCH RFC qom-next 3/4] pci-bridge/i82801b11: Rename parent field Andreas Färber
2013-07-21 14:09 ` [Qemu-devel] [PATCH RFC qom-next 4/4] pcie_port: Turn PCIEPort and PCIESlot into abstract QOM types Andreas Färber
2013-07-21 20:26 ` Michael S. Tsirkin
2013-07-22 17:42 ` Andreas Färber
2013-07-22 19:34 ` Michael S. Tsirkin
2013-07-22 20:29 ` Anthony Liguori
2013-07-22 21:04 ` Andreas Färber
2013-07-23 7:07 ` Michael S. Tsirkin
2013-07-23 9:10 ` Andreas Färber
2013-07-23 9:59 ` Michael S. Tsirkin
2013-07-23 10:21 ` Andreas Färber
2013-07-23 11:21 ` Gerd Hoffmann
2013-07-23 12:35 ` Michael S. Tsirkin
2013-07-23 7:04 ` Michael S. Tsirkin
2013-07-28 12:36 ` Andreas Färber [this message]
2013-07-28 12:58 ` Michael S. Tsirkin
2013-07-21 20:26 ` [Qemu-devel] [PATCH RFC qom-next 0/4] QOM'ification of pci-bridge types Michael S. Tsirkin
2013-07-22 17:22 ` Andreas Färber
2013-07-22 22:05 ` Andreas Färber
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=51F51051.7050801@suse.de \
--to=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.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).