qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/5] cxl/type3: Expose ct3 functions so that inheriters can c


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 3/5] cxl/type3: Expose ct3 functions so that inheriters can call them
Date: Tue, 5 Sep 2023 10:59:15 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.0

Hi Gregory,

On 1/9/23 03:29, Gregory Price wrote:
For devices built on top of ct3, we need the init, realize, and
exit functions exposed to correctly start up and tear down.

You shouldn't need this. Your device class can inherit from
the CT3 base class by setting its .parent to TYPE_CXL_TYPE3:

static const TypeInfo my_cxl_types[] = {
    {
        .name           = TYPE_MY_CXL_DEVICE_X,
        .parent         = TYPE_CXL_TYPE3,
        .class_init     = dev_x_class_init,
    },
    {
        .name           = TYPE_MY_CXL_DEVICE_Y,
        .parent         = TYPE_CXL_TYPE3,
        .class_init     = dev_y_class_init,
    }
};

You can see some documentation about QOM here:
https://qemu-project.gitlab.io/qemu/devel/qom.html
But still you'll have to look at examples in the tree.

Signed-off-by: Gregory Price <gregory.price@memverge.com>
---
  hw/mem/cxl_type3.c          | 8 ++++----
  include/hw/cxl/cxl_device.h | 5 +++++
  2 files changed, 9 insertions(+), 4 deletions(-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]