From: Philippe Mathieu-Daudé Date: Wed, 25 Mar 2026 14:44:40 +0000 (+0100) Subject: qom: Declare GlobalProperty structure in 'qom/compat-properties.h' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da36151de17e25cd68192bd00ae10de03bf48437;p=thirdparty%2Fqemu.git 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é Reviewed-by: Michael Tokarev Message-Id: <20260325151728.45378-4-philmd@linaro.org> --- diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index 89388530fdb..ca63304c952 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -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" diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-properties.h index d8745d4c65f..17543957a6c 100644 --- a/include/hw/core/qdev-properties.h +++ b/include/hw/core/qdev-properties.h @@ -1,6 +1,7 @@ #ifndef QEMU_QDEV_PROPERTIES_H #define QEMU_QDEV_PROPERTIES_H +#include "qom/compat-properties.h" #include "hw/core/qdev.h" /** diff --git a/include/hw/core/qdev.h b/include/hw/core/qdev.h index 778617787c7..337d69ea2c3 100644 --- a/include/hw/core/qdev.h +++ b/include/hw/core/qdev.h @@ -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. ***/ /** diff --git a/include/qom/compat-properties.h b/include/qom/compat-properties.h new file mode 100644 index 00000000000..6e44aabc26b --- /dev/null +++ b/include/qom/compat-properties.h @@ -0,0 +1,32 @@ +/* + * QEMU Object Model + * + * Copyright IBM, Corp. 2011 + * + * Authors: + * Anthony Liguori + * + * 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 diff --git a/qom/object.c b/qom/object.c index e5c0c2f53ed..d6500bcbbf4 100644 --- a/qom/object.c +++ b/qom/object.c @@ -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"