qom: Declare GlobalProperty structure in 'qom/compat-properties.h'

While GlobalProperty is expected to only be used by QDev board
layer, it is used by the lower QOM API, so define it in the
qom/ namespace. This helps to build binary which use QOM but
don't need the QDev layer.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Message-Id: <20260325151728.45378-4-philmd@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé
2026-03-25 15:44:40 +01:00
parent c459df2fc2
commit da36151de1
5 changed files with 35 additions and 18 deletions

View File

@@ -8,6 +8,7 @@
#include "system/blockdev.h"
#include "qapi/qapi-types-machine.h"
#include "qemu/module.h"
#include "qom/compat-properties.h"
#include "qom/object.h"
#include "hw/core/cpu.h"
#include "hw/core/resettable.h"

View File

@@ -1,6 +1,7 @@
#ifndef QEMU_QDEV_PROPERTIES_H
#define QEMU_QDEV_PROPERTIES_H
#include "qom/compat-properties.h"
#include "hw/core/qdev.h"
/**

View File

@@ -404,23 +404,6 @@ struct BusState {
ResettableState reset;
};
/**
* typedef GlobalProperty - a global property type
*
* @used: Set to true if property was used when initializing a device.
* @optional: If set to true, GlobalProperty will be skipped without errors
* if the property doesn't exist.
*
* An error is fatal for non-hotplugged devices, when the global is applied.
*/
typedef struct GlobalProperty {
const char *driver;
const char *property;
const char *value;
bool used;
bool optional;
} GlobalProperty;
/*** Board API. This should go away once we have a machine config file. ***/
/**

View File

@@ -0,0 +1,32 @@
/*
* QEMU Object Model
*
* Copyright IBM, Corp. 2011
*
* Authors:
* Anthony Liguori <aliguori@us.ibm.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef QEMU_COMPAT_PROPERTIES_H
#define QEMU_COMPAT_PROPERTIES_H
/**
* typedef GlobalProperty - a global property type
*
* @used: Set to true if property was used when initializing a device.
* @optional: If set to true, GlobalProperty will be skipped without errors
* if the property doesn't exist.
*
* An error is fatal for non-hotplugged devices, when the global is applied.
*/
typedef struct GlobalProperty {
const char *driver;
const char *property;
const char *value;
bool used;
bool optional;
} GlobalProperty;
#endif

View File

@@ -11,8 +11,8 @@
*/
#include "qemu/osdep.h"
#include "hw/core/qdev.h"
#include "qapi/error.h"
#include "qom/compat-properties.h"
#include "qom/object.h"
#include "qom/object_interfaces.h"
#include "qemu/cutils.h"