Thanks a lot.

On Thu, Aug 31, 2023 at 2:11 PM Philippe Mathieu-Daudé <phi...@linaro.org>
wrote:

> Hi,
>
> On 31/8/23 05:15, Liu Jaloo wrote:
> > Where actually defined the "PC_MACHINE_CLASS", I can't find it in source
> > code, please help to point out the file.
>
> It is defined in include/hw/i386/pc.h:
>
> OBJECT_DECLARE_TYPE(PCMachineState, PCMachineClass, PC_MACHINE)
>
> The macro itself is defined in include/qom/object.h:
>
> /**
>   * OBJECT_DECLARE_TYPE:
>   * @InstanceType: instance struct name
>   * @ClassType: class struct name
>   * @MODULE_OBJ_NAME: the object name in uppercase with underscore
> separators
>   *
>   * This macro is typically used in a header file, and will:
>   *
>   *   - create the typedefs for the object and class structs
>   *   - register the type for use with g_autoptr
>   *   - provide three standard type cast functions
>   *
>   * The object struct and class struct need to be declared manually.
>   */
>
> See the QOM documentation:
>
> https://qemu-project.gitlab.io/qemu/devel/qom.html
>
> Regards,
>
> Phil.
>

Reply via email to