Merge tag 'pull-qapi-2026-11-02-v2' of https://repo.or.cz/qemu/armbru into staging
QAPI patches for 2026-11-02 # -----BEGIN PGP SIGNATURE----- # # iQJGBAABCgAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmro2HsSHGFybWJydUBy # ZWRoYXQuY29tAAoJEDhwtADrkYZTUgYQALkOmmEhdlD5iatEU3Jcl7yy0Pto53tp # 7sOP2AjxW0Hy4LJFFGGS6C8t5i+AZVuKHoydmUVY7RZBEoVhVnqD6Ia58dF1uzDJ # RvPbkKrYXlkfKaAsL9XkTf3+/RxCRUBriHbua90YuIIbvj3f4uzM0bQLpu8M5M4l # 8BT4NsbgqLp5XwndH9oxlxUH69nTuIwdYZSdnYTXJpnx6ySR89nDhXFzVBVre4Oy # nD/wtGvLfN8ULDic6eOLIr9ks8YGcAP7jIgqmnIvvooewMXJm1utmzd1MUQNgSC8 # /r++STOkGYe4dAyOjgAC4ZOHj2U3IMOltiXIKaN8+Hz/j2rM71xnyeqX9o92SFwh # dKBJbHOj6yf/FrsD4pbakpd9R/gNe+tUqEXnSopo8msZL1qE7SNRF69Ri+aFfgdt # VUQB2fZgj+dvTOY7GIa7Yr1Mj8U9Y3rmDsJ20nEqgNPaj3jserDueJ8xfgrifYdh # zFCEjr7RIW9F8wO6uQN62Et4/tA7VWVF8tt70BKdq96OJ+RhHVWVECgcnTlS/gTn # 4psihUoBa+whwYJk8Q6uMUhpT9rHXQrwxqZFtMlItWg9wKkAjqsc2PzUJT1tZfee # GrPuMBDQfW9zvIlB6DZcZuPIh5Y3fBj4aiHPsIcNxj8GeqwVu+n8m/xLJ/BqVEGr # FNb1esRYontl # =fjYB # -----END PGP SIGNATURE----- # gpg: Signature made Mon 02 Nov 2026 10:37:47 AM PST # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [unknown] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [unknown] # gpg: WARNING: The key's User ID is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * tag 'pull-qapi-2026-11-02-v2' of https://repo.or.cz/qemu/armbru: (74 commits) tests/qmp-cmd-test: assert qapi-type resolves in query-qmp-schema qom: use QAPITypeInfo in object_property_get_enum qom: Drop object_property_add_enum() parameter @lookup hw/i386: convert PCSouthBridgeOption to QAPI enum qdev: PropertyInfo.enum_table is no longer used, drop qdev: convert PropertyInfo definitions to use qapi_type target/riscv: convert PropertyInfo definitions to use qapi_type hw: convert device-local PropertyInfo definitions to use qapi_type hw/ufs: Convert PropertyInfo to QAPITypeInfo qdev: convert system PropertyInfo definitions to use qapi_type qdev: convert core PropertyInfo definitions to use qapi_type qdev: add qapi_type field to PropertyInfo with fallback registration hw/s390x: convert BootCertificatesList to QAPI-aware registration hw/ppc/spapr_drc: convert fdt property to QAPI-aware registration hw/s390-virtio-ccw: convert loadparm property to QAPI-aware registration hw/nvdimm: convert UUID property to QAPI-aware registration qom: replace object_property_add_tm with StructTm QAPI type virtio-balloon: convert guest-stats property to QAPI type i386/x86: convert SgxEPCList property to QAPI-aware registration accel/hvf: convert OnOffSplit property to QAPI-aware registration ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
commit
c5fee4d93f
163 files changed
+1778
-1235
No files matched your search
+8
-16
@@ -11,6 +11,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "accel/accel-ops.h"
|
||||
#include "exec/cpu-common.h"
|
||||
@@ -230,18 +231,12 @@ static int hvf_accel_init(AccelState *as, MachineState *ms)
|
||||
return hvf_arch_init();
|
||||
}
|
||||
|
||||
static void hvf_set_kernel_irqchip(Object *obj, Visitor *v,
|
||||
const char *name, void *opaque,
|
||||
static void hvf_set_kernel_irqchip(Object *obj, int value,
|
||||
Error **errp)
|
||||
{
|
||||
OnOffSplit mode;
|
||||
|
||||
hvf_kernel_irqchip_override = true;
|
||||
if (!visit_type_OnOffSplit(v, name, &mode, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
switch (value) {
|
||||
case ON_OFF_SPLIT_ON:
|
||||
#ifdef HOST_X86_64
|
||||
/* macOS 12 onwards exposes an HVF virtual APIC. */
|
||||
@@ -261,11 +256,7 @@ static void hvf_set_kernel_irqchip(Object *obj, Visitor *v,
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* The value was checked in visit_type_OnOffSplit() above. If
|
||||
* we get here, then something is wrong in QEMU.
|
||||
*/
|
||||
abort();
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,9 +268,10 @@ static void hvf_accel_class_init(ObjectClass *oc, const void *data)
|
||||
ac->allowed = &hvf_allowed;
|
||||
hvf_kernel_irqchip_override = false;
|
||||
hvf_kernel_irqchip = false;
|
||||
object_class_property_add(oc, "kernel-irqchip", "on|off|split",
|
||||
NULL, hvf_set_kernel_irqchip,
|
||||
NULL, NULL);
|
||||
|
||||
object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split",
|
||||
&OnOffSplit_type_info, NULL,
|
||||
hvf_set_kernel_irqchip);
|
||||
object_class_property_set_description(oc, "kernel-irqchip",
|
||||
"Configure HVF irqchip");
|
||||
}
|
||||
|
||||
+14
-19
@@ -24,6 +24,7 @@
|
||||
#include "qemu/config-file.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "hw/pci/msi.h"
|
||||
#include "hw/pci/msix.h"
|
||||
#include "hw/s390x/adapter.h"
|
||||
@@ -46,6 +47,7 @@
|
||||
#include "qapi/visitor.h"
|
||||
#include "qapi/qapi-types-common.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "system/reset.h"
|
||||
#include "qemu/guest-random.h"
|
||||
#include "system/hw_accel.h"
|
||||
@@ -4150,22 +4152,17 @@ static void kvm_set_kvm_shadow_mem(Object *obj, Visitor *v,
|
||||
s->kvm_shadow_mem = value;
|
||||
}
|
||||
|
||||
static void kvm_set_kernel_irqchip(Object *obj, Visitor *v,
|
||||
const char *name, void *opaque,
|
||||
static void kvm_set_kernel_irqchip(Object *obj, int value,
|
||||
Error **errp)
|
||||
{
|
||||
KVMState *s = KVM_STATE(obj);
|
||||
OnOffSplit mode;
|
||||
|
||||
if (s->fd != -1) {
|
||||
error_setg(errp, "Cannot set properties after the accelerator has been initialized");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!visit_type_OnOffSplit(v, name, &mode, errp)) {
|
||||
return;
|
||||
}
|
||||
switch (mode) {
|
||||
switch (value) {
|
||||
case ON_OFF_SPLIT_ON:
|
||||
s->kernel_irqchip_allowed = true;
|
||||
s->kernel_irqchip_required = true;
|
||||
@@ -4182,10 +4179,7 @@ static void kvm_set_kernel_irqchip(Object *obj, Visitor *v,
|
||||
s->kernel_irqchip_split = ON_OFF_AUTO_ON;
|
||||
break;
|
||||
default:
|
||||
/* The value was checked in visit_type_OnOffSplit() above. If
|
||||
* we get here, then something is wrong in QEMU.
|
||||
*/
|
||||
abort();
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4302,21 +4296,22 @@ static void kvm_accel_class_init(ObjectClass *oc, const void *data)
|
||||
ac->has_memory = kvm_accel_has_memory;
|
||||
ac->allowed = &kvm_allowed;
|
||||
|
||||
object_class_property_add(oc, "kernel-irqchip", "on|off|split",
|
||||
NULL, kvm_set_kernel_irqchip,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split",
|
||||
&OnOffSplit_type_info, NULL,
|
||||
kvm_set_kernel_irqchip);
|
||||
object_class_property_set_description(oc, "kernel-irqchip",
|
||||
"Configure KVM in-kernel irqchip");
|
||||
|
||||
object_class_property_add(oc, "kvm-shadow-mem", "int",
|
||||
kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "kvm-shadow-mem", "int", &int_type_info,
|
||||
kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "kvm-shadow-mem",
|
||||
"KVM shadow MMU size");
|
||||
|
||||
object_class_property_add(oc, "dirty-ring-size", "uint32",
|
||||
kvm_get_dirty_ring_size, kvm_set_dirty_ring_size,
|
||||
NULL, NULL);
|
||||
&uint32_type_info,
|
||||
kvm_get_dirty_ring_size, kvm_set_dirty_ring_size,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "dirty-ring-size",
|
||||
"Size of KVM dirty page ring buffer (default: 0, i.e. use bitmap)");
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/rcu.h"
|
||||
@@ -239,6 +240,7 @@ static void nitro_accel_class_init(ObjectClass *oc, const void *data)
|
||||
"Start enclave in debug mode (enables console output)");
|
||||
|
||||
object_class_property_add(oc, "enclave-cid", "uint64",
|
||||
&uint64_type_info,
|
||||
nitro_get_enclave_cid,
|
||||
nitro_set_enclave_cid,
|
||||
NULL, NULL);
|
||||
|
||||
+4
-3
@@ -29,6 +29,7 @@
|
||||
#include "exec/icount.h"
|
||||
#include "tcg/startup.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/accel.h"
|
||||
#include "qemu/atomic.h"
|
||||
@@ -270,9 +271,9 @@ static void tcg_accel_class_init(ObjectClass *oc, const void *data)
|
||||
tcg_get_thread,
|
||||
tcg_set_thread);
|
||||
|
||||
object_class_property_add(oc, "tb-size", "uint32",
|
||||
tcg_get_tb_size, tcg_set_tb_size,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "tb-size", "uint32", &uint32_type_info,
|
||||
tcg_get_tb_size, tcg_set_tb_size,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "tb-size",
|
||||
"TCG translation block cache size");
|
||||
|
||||
|
||||
+14
-34
@@ -22,6 +22,7 @@
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-types-common.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "migration/blocker.h"
|
||||
#include "accel/accel-cpu-target.h"
|
||||
@@ -433,18 +434,12 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
static void whpx_set_kernel_irqchip(Object *obj, Visitor *v,
|
||||
const char *name, void *opaque,
|
||||
Error **errp)
|
||||
static void whpx_set_kernel_irqchip(Object *obj, int value,
|
||||
Error **errp)
|
||||
{
|
||||
struct whpx_state *whpx = &whpx_global;
|
||||
OnOffSplit mode;
|
||||
|
||||
if (!visit_type_OnOffSplit(v, name, &mode, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
switch (value) {
|
||||
case ON_OFF_SPLIT_ON:
|
||||
whpx->kernel_irqchip_allowed = true;
|
||||
whpx->kernel_irqchip_required = true;
|
||||
@@ -462,26 +457,15 @@ static void whpx_set_kernel_irqchip(Object *obj, Visitor *v,
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* The value was checked in visit_type_OnOffSplit() above. If
|
||||
* we get here, then something is wrong in QEMU.
|
||||
*/
|
||||
abort();
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
static void whpx_set_hyperv(Object *obj, Visitor *v,
|
||||
const char *name, void *opaque,
|
||||
Error **errp)
|
||||
static void whpx_set_hyperv(Object *obj, int value, Error **errp)
|
||||
{
|
||||
struct whpx_state *whpx = &whpx_global;
|
||||
OnOffAuto mode;
|
||||
|
||||
if (!visit_type_OnOffAuto(v, name, &mode, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
switch (value) {
|
||||
case ON_OFF_AUTO_ON:
|
||||
whpx->hyperv_enlightenments_allowed = true;
|
||||
whpx->hyperv_enlightenments_required = true;
|
||||
@@ -497,11 +481,7 @@ static void whpx_set_hyperv(Object *obj, Visitor *v,
|
||||
whpx->hyperv_enlightenments_required = false;
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
* The value was checked in visit_type_OnOffAuto() above. If
|
||||
* we get here, then something is wrong in QEMU.
|
||||
*/
|
||||
abort();
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -528,14 +508,14 @@ static void whpx_accel_class_init(ObjectClass *oc, const void *data)
|
||||
ac->pre_resume_vm = whpx_pre_resume_vm;
|
||||
ac->allowed = &whpx_allowed;
|
||||
|
||||
object_class_property_add(oc, "kernel-irqchip", "on|off|split",
|
||||
NULL, whpx_set_kernel_irqchip,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, "kernel-irqchip", "on|off|split",
|
||||
&OnOffSplit_type_info, NULL,
|
||||
whpx_set_kernel_irqchip);
|
||||
object_class_property_set_description(oc, "kernel-irqchip",
|
||||
"Configure WHPX in-kernel irqchip");
|
||||
object_class_property_add(oc, "hyperv", "OnOffAuto",
|
||||
NULL, whpx_set_hyperv,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, "hyperv", "OnOffAuto",
|
||||
&OnOffAuto_type_info, NULL,
|
||||
whpx_set_hyperv);
|
||||
object_class_property_set_description(oc, "hyperv",
|
||||
"Configure Hyper-V enlightenments");
|
||||
|
||||
|
||||
+4
-3
@@ -22,6 +22,7 @@
|
||||
#include "authz/list.h"
|
||||
#include "trace.h"
|
||||
#include "qom/object_interfaces.h"
|
||||
#include "qapi/qapi-type-infos-authz.h"
|
||||
#include "qapi/qapi-visit-authz.h"
|
||||
#include "qemu/module.h"
|
||||
|
||||
@@ -120,13 +121,13 @@ qauthz_list_class_init(ObjectClass *oc, const void *data)
|
||||
{
|
||||
QAuthZClass *authz = QAUTHZ_CLASS(oc);
|
||||
|
||||
object_class_property_add_enum(oc, "policy",
|
||||
"QAuthZListPolicy",
|
||||
&QAuthZListPolicy_lookup,
|
||||
object_class_property_add_enum(oc, "policy", "QAuthZListPolicy",
|
||||
&QAuthZListPolicy_type_info,
|
||||
qauthz_list_prop_get_policy,
|
||||
qauthz_list_prop_set_policy);
|
||||
|
||||
object_class_property_add(oc, "rules", "QAuthZListRule",
|
||||
&QAuthZListRuleList_type_info,
|
||||
qauthz_list_prop_get_rules,
|
||||
qauthz_list_prop_set_rules,
|
||||
NULL, NULL);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "system/cryptodev.h"
|
||||
#include "system/stats.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/qapi-commands-cryptodev.h"
|
||||
#include "qapi/qapi-types-stats.h"
|
||||
#include "qapi/visitor.h"
|
||||
@@ -622,15 +623,15 @@ cryptodev_backend_class_init(ObjectClass *oc, const void *data)
|
||||
ucc->prepare_delete = cryptodev_backend_prepare_delete;
|
||||
|
||||
QTAILQ_INIT(&crypto_clients);
|
||||
object_class_property_add(oc, "queues", "uint32",
|
||||
object_class_property_add(oc, "queues", "uint32", &uint32_type_info,
|
||||
cryptodev_backend_get_queues,
|
||||
cryptodev_backend_set_queues,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "throttle-bps", "uint64",
|
||||
object_class_property_add(oc, "throttle-bps", "uint64", &uint64_type_info,
|
||||
cryptodev_backend_get_bps,
|
||||
cryptodev_backend_set_bps,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "throttle-ops", "uint64",
|
||||
object_class_property_add(oc, "throttle-ops", "uint64", &uint64_type_info,
|
||||
cryptodev_backend_get_ops,
|
||||
cryptodev_backend_set_ops,
|
||||
NULL, NULL);
|
||||
|
||||
+18
-22
@@ -19,7 +19,7 @@
|
||||
#include "qom/object_interfaces.h"
|
||||
#include "qom/object.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(HostMemoryBackendFile, MEMORY_BACKEND_FILE)
|
||||
|
||||
@@ -230,30 +230,24 @@ static void file_memory_backend_set_readonly(Object *obj, bool value,
|
||||
fb->readonly = value;
|
||||
}
|
||||
|
||||
static void file_memory_backend_get_rom(Object *obj, Visitor *v,
|
||||
const char *name, void *opaque,
|
||||
Error **errp)
|
||||
static int file_memory_backend_get_rom(Object *obj, Error **errp)
|
||||
{
|
||||
HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(obj);
|
||||
OnOffAuto rom = fb->rom;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &rom, errp);
|
||||
return fb->rom;
|
||||
}
|
||||
|
||||
static void file_memory_backend_set_rom(Object *obj, Visitor *v,
|
||||
const char *name, void *opaque,
|
||||
Error **errp)
|
||||
static void file_memory_backend_set_rom(Object *obj, int value, Error **errp)
|
||||
{
|
||||
HostMemoryBackend *backend = MEMORY_BACKEND(obj);
|
||||
HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(obj);
|
||||
|
||||
if (host_memory_backend_mr_inited(backend)) {
|
||||
error_setg(errp, "cannot change property '%s' of %s.", name,
|
||||
error_setg(errp, "cannot change property 'rom' of %s.",
|
||||
object_get_typename(obj));
|
||||
return;
|
||||
}
|
||||
|
||||
visit_type_OnOffAuto(v, name, &fb->rom, errp);
|
||||
fb->rom = value;
|
||||
}
|
||||
|
||||
static void file_backend_unparent(Object *obj)
|
||||
@@ -281,14 +275,14 @@ file_backend_class_init(ObjectClass *oc, const void *data)
|
||||
file_memory_backend_get_discard_data, file_memory_backend_set_discard_data);
|
||||
object_class_property_add_str(oc, "mem-path",
|
||||
get_mem_path, set_mem_path);
|
||||
object_class_property_add(oc, "align", "uint64",
|
||||
file_memory_backend_get_align,
|
||||
file_memory_backend_set_align,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "offset", "int",
|
||||
file_memory_backend_get_offset,
|
||||
file_memory_backend_set_offset,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "align", "uint64", &uint64_type_info,
|
||||
file_memory_backend_get_align,
|
||||
file_memory_backend_set_align,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "offset", "int", &int_type_info,
|
||||
file_memory_backend_get_offset,
|
||||
file_memory_backend_set_offset,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "offset",
|
||||
"Offset into the target file (ex: 1G)");
|
||||
#ifdef CONFIG_LIBPMEM
|
||||
@@ -298,8 +292,10 @@ file_backend_class_init(ObjectClass *oc, const void *data)
|
||||
object_class_property_add_bool(oc, "readonly",
|
||||
file_memory_backend_get_readonly,
|
||||
file_memory_backend_set_readonly);
|
||||
object_class_property_add(oc, "rom", "OnOffAuto",
|
||||
file_memory_backend_get_rom, file_memory_backend_set_rom, NULL, NULL);
|
||||
object_class_property_add_enum(oc, "rom", "OnOffAuto",
|
||||
&OnOffAuto_type_info,
|
||||
file_memory_backend_get_rom,
|
||||
file_memory_backend_set_rom);
|
||||
object_class_property_set_description(oc, "rom",
|
||||
"Whether to create Read Only Memory (ROM)");
|
||||
}
|
||||
|
||||
+12
-13
@@ -16,11 +16,12 @@
|
||||
#include "qemu/memfd.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qom/object.h"
|
||||
#include "migration/cpr.h"
|
||||
#include "system/kvm.h"
|
||||
#include <linux/kvm.h>
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(HostMemoryBackendMemfd, MEMORY_BACKEND_MEMFD)
|
||||
|
||||
@@ -98,24 +99,20 @@ have_fd:
|
||||
backend->size, ram_flags, fd, 0, errp);
|
||||
}
|
||||
|
||||
static void
|
||||
memfd_backend_get_guest_memfd(Object *o, Visitor *v,
|
||||
const char *value, void *opaque,
|
||||
Error **errp)
|
||||
static int
|
||||
memfd_backend_get_guest_memfd(Object *o, Error **errp)
|
||||
{
|
||||
HostMemoryBackendMemfd *m = MEMORY_BACKEND_MEMFD(o);
|
||||
|
||||
visit_type_OnOffAuto(v, value, &m->guest_memfd, errp);
|
||||
return m->guest_memfd;
|
||||
}
|
||||
|
||||
static void
|
||||
memfd_backend_set_guest_memfd(Object *o, Visitor *v,
|
||||
const char *value, void *opaque,
|
||||
Error **errp)
|
||||
memfd_backend_set_guest_memfd(Object *o, int value, Error **errp)
|
||||
{
|
||||
HostMemoryBackendMemfd *m = MEMORY_BACKEND_MEMFD(o);
|
||||
|
||||
visit_type_OnOffAuto(v, value, &m->guest_memfd, errp);
|
||||
m->guest_memfd = value;
|
||||
}
|
||||
|
||||
static bool
|
||||
@@ -199,6 +196,7 @@ memfd_backend_class_init(ObjectClass *oc, const void *data)
|
||||
object_class_property_set_description(oc, "hugetlb",
|
||||
"Use huge pages");
|
||||
object_class_property_add(oc, "hugetlbsize", "uint64",
|
||||
&uint64_type_info,
|
||||
memfd_backend_get_hugetlbsize,
|
||||
memfd_backend_set_hugetlbsize,
|
||||
NULL, NULL);
|
||||
@@ -206,9 +204,10 @@ memfd_backend_class_init(ObjectClass *oc, const void *data)
|
||||
"Huge pages size (ex: 2M, 1G)");
|
||||
}
|
||||
|
||||
object_class_property_add(oc, "guest-memfd", "OnOffAuto",
|
||||
memfd_backend_get_guest_memfd,
|
||||
memfd_backend_set_guest_memfd, NULL, NULL);
|
||||
object_class_property_add_enum(oc, "guest-memfd", "OnOffAuto",
|
||||
&OnOffAuto_type_info,
|
||||
memfd_backend_get_guest_memfd,
|
||||
memfd_backend_set_guest_memfd);
|
||||
object_class_property_set_description(oc, "guest-memfd",
|
||||
"Use guest memfd");
|
||||
|
||||
|
||||
+16
-14
@@ -16,6 +16,7 @@
|
||||
#include "hw/core/boards.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-visit.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/config-file.h"
|
||||
#include "qom/compat-properties.h"
|
||||
@@ -528,10 +529,10 @@ host_memory_backend_class_init(ObjectClass *oc, const void *data)
|
||||
host_memory_backend_set_prealloc);
|
||||
object_class_property_set_description(oc, "prealloc",
|
||||
"Preallocate memory");
|
||||
object_class_property_add(oc, "prealloc-threads", "int",
|
||||
host_memory_backend_get_prealloc_threads,
|
||||
host_memory_backend_set_prealloc_threads,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "prealloc-threads", "int", &int_type_info,
|
||||
host_memory_backend_get_prealloc_threads,
|
||||
host_memory_backend_set_prealloc_threads,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "prealloc-threads",
|
||||
"Number of CPU threads to use for prealloc");
|
||||
object_class_property_add_link(oc, "prealloc-context",
|
||||
@@ -539,22 +540,23 @@ host_memory_backend_class_init(ObjectClass *oc, const void *data)
|
||||
object_property_allow_set_link, OBJ_PROP_LINK_STRONG);
|
||||
object_class_property_set_description(oc, "prealloc-context",
|
||||
"Context to use for creating CPU threads for preallocation");
|
||||
object_class_property_add(oc, "size", "size",
|
||||
host_memory_backend_get_size,
|
||||
host_memory_backend_set_size,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "size", "size", &size_type_info,
|
||||
host_memory_backend_get_size,
|
||||
host_memory_backend_set_size,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "size",
|
||||
"Size of the memory region (ex: 500M)");
|
||||
object_class_property_add(oc, "host-nodes", "[uint16]",
|
||||
host_memory_backend_get_host_nodes,
|
||||
host_memory_backend_set_host_nodes,
|
||||
NULL, NULL);
|
||||
&uint16List_type_info,
|
||||
host_memory_backend_get_host_nodes,
|
||||
host_memory_backend_set_host_nodes,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "host-nodes",
|
||||
"Binds memory to the list of NUMA host nodes");
|
||||
object_class_property_add_enum(oc, "policy", "HostMemPolicy",
|
||||
&HostMemPolicy_lookup,
|
||||
host_memory_backend_get_policy,
|
||||
host_memory_backend_set_policy);
|
||||
&HostMemPolicy_type_info,
|
||||
host_memory_backend_get_policy,
|
||||
host_memory_backend_set_policy);
|
||||
object_class_property_set_description(oc, "policy",
|
||||
"Set the NUMA policy");
|
||||
object_class_property_add_bool(oc, "share",
|
||||
|
||||
@@ -41,13 +41,6 @@ void rng_backend_request_entropy(RngBackend *s, size_t size,
|
||||
}
|
||||
}
|
||||
|
||||
static bool rng_backend_prop_get_opened(Object *obj, Error **errp)
|
||||
{
|
||||
RngBackend *s = RNG_BACKEND(obj);
|
||||
|
||||
return s->opened;
|
||||
}
|
||||
|
||||
static void rng_backend_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
RngBackend *s = RNG_BACKEND(uc);
|
||||
@@ -123,10 +116,6 @@ static void rng_backend_class_init(ObjectClass *oc, const void *data)
|
||||
UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
|
||||
|
||||
ucc->complete = rng_backend_complete;
|
||||
|
||||
object_class_property_add_bool(oc, "opened",
|
||||
rng_backend_prop_get_opened,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static const TypeInfo rng_backend_info = {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "hw/core/qdev-properties.h"
|
||||
#include "hw/core/qdev-properties-system.h"
|
||||
#include "hw/core/qdev-prop-internal.h"
|
||||
#include "qapi/qapi-type-infos-sockets.h"
|
||||
|
||||
static bool read_bytes(const int socket, uint8_t *buffer,
|
||||
size_t number_of_bytes)
|
||||
@@ -254,8 +255,8 @@ void spdm_socket_close(const int socket, SpdmTransportType transport_type)
|
||||
|
||||
const PropertyInfo qdev_prop_spdm_trans = {
|
||||
.type = "SpdmTransportType",
|
||||
.qapi_type = &SpdmTransportType_type_info,
|
||||
.description = "Spdm Transport, doe/nvme/mctp/scsi/unspecified",
|
||||
.enum_table = &SpdmTransportType_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "system/tpm_backend.h"
|
||||
#include "system/tpm_util.h"
|
||||
#include "trace.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
|
||||
/* tpm backend property */
|
||||
|
||||
@@ -78,6 +79,7 @@ static void release_tpm(Object *obj, const char *name, void *opaque)
|
||||
|
||||
const PropertyInfo qdev_prop_tpm = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "ID of a tpm to use as a backend",
|
||||
.get = get_tpm,
|
||||
.set = set_tpm,
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include "qemu/thread.h"
|
||||
#include "system/qtest.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/qapi-type-infos-block-core.h"
|
||||
#include "qapi/qapi-visit-block-core.h"
|
||||
#include "qom/object.h"
|
||||
#include "qom/object_interfaces.h"
|
||||
@@ -984,17 +986,16 @@ static void throttle_group_obj_class_init(ObjectClass *klass,
|
||||
|
||||
/* individual properties */
|
||||
for (i = 0; i < sizeof(properties) / sizeof(ThrottleParamInfo); i++) {
|
||||
object_class_property_add(klass,
|
||||
properties[i].name,
|
||||
"int64",
|
||||
object_class_property_add(klass, properties[i].name, "int64",
|
||||
&int64_type_info,
|
||||
throttle_group_get,
|
||||
throttle_group_set,
|
||||
NULL, &properties[i]);
|
||||
}
|
||||
|
||||
/* ThrottleLimits */
|
||||
object_class_property_add(klass,
|
||||
"limits", "ThrottleLimits",
|
||||
object_class_property_add(klass, "limits", "ThrottleLimits",
|
||||
&ThrottleLimits_type_info,
|
||||
throttle_group_get_limits,
|
||||
throttle_group_set_limits,
|
||||
NULL, NULL);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "qemu/option.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/clone-visitor.h"
|
||||
#include "qapi/qapi-type-infos-sockets.h"
|
||||
#include "qapi/qapi-visit-sockets.h"
|
||||
#include "qemu/yank.h"
|
||||
#include "trace.h"
|
||||
@@ -1569,6 +1570,7 @@ static void char_socket_class_init(ObjectClass *oc, const void *data)
|
||||
cc->chr_get_filename = tcp_chr_get_filename;
|
||||
|
||||
object_class_property_add(oc, "addr", "SocketAddress",
|
||||
&SocketAddress_type_info,
|
||||
char_socket_get_addr, NULL,
|
||||
NULL, NULL);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "crypto/secret_common.h"
|
||||
#include "crypto/cipher.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-type-infos-crypto.h"
|
||||
#include "qom/object_interfaces.h"
|
||||
#include "qemu/base64.h"
|
||||
#include "qemu/module.h"
|
||||
@@ -269,9 +270,8 @@ qcrypto_secret_class_init(ObjectClass *oc, const void *data)
|
||||
|
||||
ucc->complete = qcrypto_secret_complete;
|
||||
|
||||
object_class_property_add_enum(oc, "format",
|
||||
"QCryptoSecretFormat",
|
||||
&QCryptoSecretFormat_lookup,
|
||||
object_class_property_add_enum(oc, "format", "QCryptoSecretFormat",
|
||||
&QCryptoSecretFormat_type_info,
|
||||
qcrypto_secret_prop_get_format,
|
||||
qcrypto_secret_prop_set_format);
|
||||
object_class_property_add_str(oc, "keyid",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include <asm/unistd.h>
|
||||
#include <linux/keyctl.h>
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qom/object_interfaces.h"
|
||||
#include "trace.h"
|
||||
@@ -107,10 +108,10 @@ qcrypto_secret_keyring_class_init(ObjectClass *oc, const void *data)
|
||||
QCryptoSecretCommonClass *sic = QCRYPTO_SECRET_COMMON_CLASS(oc);
|
||||
sic->load_data = qcrypto_secret_keyring_load_data;
|
||||
|
||||
object_class_property_add(oc, "serial", "int32_t",
|
||||
qcrypto_secret_prop_get_key,
|
||||
qcrypto_secret_prop_set_key,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "serial", "int32_t", &int32_type_info,
|
||||
qcrypto_secret_prop_get_key,
|
||||
qcrypto_secret_prop_set_key,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-type-infos-crypto.h"
|
||||
#include "qapi-types-crypto.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/error-report.h"
|
||||
@@ -221,9 +222,8 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, const void *data)
|
||||
object_class_property_add_str(oc, "dir",
|
||||
qcrypto_tls_creds_prop_get_dir,
|
||||
qcrypto_tls_creds_prop_set_dir);
|
||||
object_class_property_add_enum(oc, "endpoint",
|
||||
"QCryptoTLSCredsEndpoint",
|
||||
&QCryptoTLSCredsEndpoint_lookup,
|
||||
object_class_property_add_enum(oc, "endpoint", "QCryptoTLSCredsEndpoint",
|
||||
&QCryptoTLSCredsEndpoint_type_info,
|
||||
qcrypto_tls_creds_prop_get_endpoint,
|
||||
qcrypto_tls_creds_prop_set_endpoint);
|
||||
object_class_property_add_str(oc, "priority",
|
||||
|
||||
+117
-44
@@ -1250,7 +1250,8 @@ JSON array of strings.
|
||||
To examine a type, start with a command or event using it, then follow
|
||||
references by name.
|
||||
|
||||
QAPI schema definitions not reachable that way are omitted.
|
||||
.. TODO document QOM introspection (qom-list, qom-list-properties,
|
||||
qom-get) and how it relates to QAPI type information.
|
||||
|
||||
The SchemaInfo for a command has meta-type "command", and variant
|
||||
members "arg-type", "ret-type" and "allow-oob". On the wire, the
|
||||
@@ -2012,33 +2013,20 @@ Example::
|
||||
|
||||
const QLitObject example_qmp_schema_qlit = QLIT_QLIST(((QLitObject[]) {
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
{ "arg-type", QLIT_QSTR("0"), },
|
||||
{ "meta-type", QLIT_QSTR("command"), },
|
||||
{ "name", QLIT_QSTR("my-command"), },
|
||||
{ "ret-type", QLIT_QSTR("1"), },
|
||||
{ "json-type", QLIT_QSTR("string"), },
|
||||
{ "meta-type", QLIT_QSTR("builtin"), },
|
||||
{ "name", QLIT_QSTR("str"), },
|
||||
{}
|
||||
})),
|
||||
/* "[str]" = strList */
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
{ "arg-type", QLIT_QSTR("2"), },
|
||||
{ "meta-type", QLIT_QSTR("event"), },
|
||||
{ "name", QLIT_QSTR("MY_EVENT"), },
|
||||
{ "element-type", QLIT_QSTR("str"), },
|
||||
{ "meta-type", QLIT_QSTR("array"), },
|
||||
{ "name", QLIT_QSTR("[str]"), },
|
||||
{}
|
||||
})),
|
||||
/* "0" = q_obj_my-command-arg */
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
{ "members", QLIT_QLIST(((QLitObject[]) {
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
{ "name", QLIT_QSTR("arg1"), },
|
||||
{ "type", QLIT_QSTR("[1]"), },
|
||||
{}
|
||||
})),
|
||||
{}
|
||||
})), },
|
||||
{ "meta-type", QLIT_QSTR("object"), },
|
||||
{ "name", QLIT_QSTR("0"), },
|
||||
{}
|
||||
})),
|
||||
/* "1" = UserDefOne */
|
||||
[Remainder of built-in types omitted...]
|
||||
/* "32" = UserDefOne */
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
{ "members", QLIT_QLIST(((QLitObject[]) {
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
@@ -2061,43 +2049,128 @@ Example::
|
||||
{}
|
||||
})), },
|
||||
{ "meta-type", QLIT_QSTR("object"), },
|
||||
{ "name", QLIT_QSTR("1"), },
|
||||
{ "name", QLIT_QSTR("32"), },
|
||||
{}
|
||||
})),
|
||||
/* "2" = q_empty */
|
||||
/* "[32]" = UserDefOneList */
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
{ "element-type", QLIT_QSTR("32"), },
|
||||
{ "meta-type", QLIT_QSTR("array"), },
|
||||
{ "name", QLIT_QSTR("[32]"), },
|
||||
{}
|
||||
})),
|
||||
/* "34" = q_obj_my-command-arg */
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
{ "members", QLIT_QLIST(((QLitObject[]) {
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
{ "name", QLIT_QSTR("arg1"), },
|
||||
{ "type", QLIT_QSTR("[32]"), },
|
||||
{}
|
||||
})),
|
||||
{}
|
||||
})), },
|
||||
{ "meta-type", QLIT_QSTR("object"), },
|
||||
{ "name", QLIT_QSTR("2"), },
|
||||
{ "name", QLIT_QSTR("34"), },
|
||||
{}
|
||||
})),
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
{ "element-type", QLIT_QSTR("1"), },
|
||||
{ "meta-type", QLIT_QSTR("array"), },
|
||||
{ "name", QLIT_QSTR("[1]"), },
|
||||
{ "arg-type", QLIT_QSTR("34"), },
|
||||
{ "meta-type", QLIT_QSTR("command"), },
|
||||
{ "name", QLIT_QSTR("my-command"), },
|
||||
{ "ret-type", QLIT_QSTR("32"), },
|
||||
{}
|
||||
})),
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
{ "json-type", QLIT_QSTR("int"), },
|
||||
{ "meta-type", QLIT_QSTR("builtin"), },
|
||||
{ "name", QLIT_QSTR("int"), },
|
||||
{}
|
||||
})),
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
{ "json-type", QLIT_QSTR("string"), },
|
||||
{ "meta-type", QLIT_QSTR("builtin"), },
|
||||
{ "name", QLIT_QSTR("str"), },
|
||||
{}
|
||||
})),
|
||||
QLIT_QDICT(((QLitDictEntry[]) {
|
||||
{ "json-type", QLIT_QSTR("boolean"), },
|
||||
{ "meta-type", QLIT_QSTR("builtin"), },
|
||||
{ "name", QLIT_QSTR("bool"), },
|
||||
{ "arg-type", QLIT_QSTR("30"), },
|
||||
{ "meta-type", QLIT_QSTR("event"), },
|
||||
{ "name", QLIT_QSTR("MY_EVENT"), },
|
||||
{}
|
||||
})),
|
||||
{}
|
||||
}));
|
||||
|
||||
[Uninteresting stuff omitted...]
|
||||
|
||||
|
||||
Code generated for type information
|
||||
-----------------------------------
|
||||
|
||||
Type information is generated for user-defined types and their array
|
||||
types. With option --builtins, it is also generated for the built-in
|
||||
types.
|
||||
|
||||
The following files are created:
|
||||
|
||||
``$(prefix)qapi-type-infos.c``
|
||||
A ``QAPITypeInfo`` instance for each type listed above, providing
|
||||
a mapping between the QAPI type name and the masked name used by
|
||||
introspection, along with optional enum lookup table and array
|
||||
type pointers.
|
||||
|
||||
``$(prefix)qapi-type-infos.h``
|
||||
Declarations for the above type info instances
|
||||
|
||||
Each ``QAPITypeInfo`` struct has the following fields:
|
||||
|
||||
``name``
|
||||
The QAPI type name (e.g. ``"UserDefOne"``).
|
||||
|
||||
``masked_name``
|
||||
The masked name used in ``query-qmp-schema`` output.
|
||||
|
||||
``lookup``
|
||||
For enum types, a pointer to the corresponding ``QEnumLookup``
|
||||
table. ``NULL`` for non-enum types.
|
||||
|
||||
These type info instances are used by QOM property registration
|
||||
functions (``object_property_add()``,
|
||||
``object_class_property_add_enum()``, etc.) to associate each property
|
||||
with its QAPI type. The ``qom-list`` and ``device-list-properties``
|
||||
QMP commands then expose the ``qapi-type`` field, giving management
|
||||
tools a formal type reference they can look up in the introspection
|
||||
schema.
|
||||
|
||||
Example::
|
||||
|
||||
$ cat qapi-generated/example-qapi-type-infos.h
|
||||
[Uninteresting stuff omitted...]
|
||||
|
||||
#ifndef EXAMPLE_QAPI_TYPE_INFOS_H
|
||||
#define EXAMPLE_QAPI_TYPE_INFOS_H
|
||||
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
|
||||
extern const QAPITypeInfo UserDefOne_type_info;
|
||||
|
||||
extern const QAPITypeInfo UserDefOneList_type_info;
|
||||
|
||||
#endif /* EXAMPLE_QAPI_TYPE_INFOS_H */
|
||||
$ cat qapi-generated/example-qapi-type-infos.c
|
||||
[Uninteresting stuff omitted...]
|
||||
|
||||
const QAPITypeInfo UserDefOne_type_info = {
|
||||
.name = "UserDefOne",
|
||||
.masked_name = "32",
|
||||
};
|
||||
|
||||
const QAPITypeInfo UserDefOneList_type_info = {
|
||||
.name = "UserDefOneList",
|
||||
.masked_name = "[32]",
|
||||
};
|
||||
|
||||
[Uninteresting stuff omitted...]
|
||||
|
||||
For a modular QAPI schema (see section `Include directives`_), code for
|
||||
each sub-module SUBDIR/SUBMODULE.json is actually generated into ::
|
||||
|
||||
SUBDIR/$(prefix)qapi-type-infos-SUBMODULE.h
|
||||
SUBDIR/$(prefix)qapi-type-infos-SUBMODULE.c
|
||||
|
||||
If qapi-gen.py is run with option --builtins, additional files are
|
||||
created:
|
||||
|
||||
``qapi-builtin-type-infos.h``
|
||||
Type info instances for built-in types
|
||||
|
||||
``qapi-builtin-type-infos.c``
|
||||
Definitions for the above type info instances
|
||||
@@ -119,6 +119,8 @@ Where:
|
||||
|
||||
The actual commands are documented in the :doc:`qemu-qmp-ref`.
|
||||
|
||||
.. _out-of-band execution:
|
||||
|
||||
Out-of-band execution
|
||||
---------------------
|
||||
|
||||
|
||||
@@ -22,27 +22,7 @@ polling the guest's balloon driver for new stats in the specified time
|
||||
interval.
|
||||
|
||||
To retrieve those stats, clients have to query the guest-stats property,
|
||||
which will return a dictionary containing:
|
||||
|
||||
* A key named 'stats', containing all available stats. If the guest
|
||||
doesn't support a particular stat, or if it couldn't be retrieved,
|
||||
its value will be -1. Currently, the following stats are supported:
|
||||
|
||||
- stat-swap-in
|
||||
- stat-swap-out
|
||||
- stat-major-faults
|
||||
- stat-minor-faults
|
||||
- stat-free-memory
|
||||
- stat-total-memory
|
||||
- stat-available-memory
|
||||
- stat-disk-caches
|
||||
- stat-htlb-pgalloc
|
||||
- stat-htlb-pgfail
|
||||
|
||||
* A key named last-update, which contains the last stats update
|
||||
timestamp in seconds. Since this timestamp is generated by the host,
|
||||
a buggy guest can't influence its value. The value is 0 if the guest
|
||||
has not updated the stats (yet).
|
||||
which will return a VirtioBalloonGuestStats (see QAPI documentation).
|
||||
|
||||
It's also important to note the following:
|
||||
|
||||
|
||||
@@ -512,7 +512,7 @@ class QAPIDocDirective(NestedDirective):
|
||||
modules.add(module_source)
|
||||
|
||||
if doc.symbol:
|
||||
ent = schema.lookup_entity(doc.symbol)
|
||||
ent = schema.lookup_defn(doc.symbol)
|
||||
assert isinstance(ent, QAPISchemaDefinition)
|
||||
vis.visit_entity(ent)
|
||||
else:
|
||||
|
||||
@@ -168,7 +168,7 @@ eligible for CVE assignment. Annotations will be extended to other backend
|
||||
and object types over time, to make their security status explicit.
|
||||
|
||||
It is possible to control or identify the usage of types that do not offer
|
||||
an explicit security boundary using the ``insecure-types`` parameter to the
|
||||
an explicit security boundary using the ``insecure-input`` parameter to the
|
||||
``-compat`` argument, which accepts three values:
|
||||
|
||||
* accept: usage of any type will be permitted. This is the current
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qom/object_interfaces.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "block/thread-pool.h"
|
||||
#include "system/event-loop-base.h"
|
||||
|
||||
@@ -105,14 +106,17 @@ static void event_loop_base_class_init(ObjectClass *klass,
|
||||
ucc->prepare_delete = event_loop_base_prepare_delete;
|
||||
|
||||
object_class_property_add(klass, "aio-max-batch", "int64",
|
||||
&int64_type_info,
|
||||
event_loop_base_get_param,
|
||||
event_loop_base_set_param,
|
||||
NULL, &aio_max_batch_info);
|
||||
object_class_property_add(klass, "thread-pool-min", "int64",
|
||||
&int64_type_info,
|
||||
event_loop_base_get_param,
|
||||
event_loop_base_set_param,
|
||||
NULL, &thread_pool_min_info);
|
||||
object_class_property_add(klass, "thread-pool-max", "int64",
|
||||
&int64_type_info,
|
||||
event_loop_base_get_param,
|
||||
event_loop_base_set_param,
|
||||
NULL, &thread_pool_max_info);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/pci/pci.h"
|
||||
#include "migration/vmstate.h"
|
||||
@@ -380,6 +381,7 @@ void ich9_pm_add_class_properties(ObjectClass *oc, ptrdiff_t pm_offset)
|
||||
object_property_allow_set_link,
|
||||
OBJ_PROP_LINK_STRONG);
|
||||
object_class_property_add(oc, ACPI_PM_PROP_GPE0_BLK, "uint32",
|
||||
&uint32_type_info,
|
||||
ich9_pm_get_gpe0_blk,
|
||||
NULL, NULL, NULL);
|
||||
object_class_property_add_uint8_ptr(oc, ACPI_PM_PROP_S3_DISABLED,
|
||||
|
||||
+5
-4
@@ -27,6 +27,7 @@
|
||||
#include "qemu/error-report.h"
|
||||
#include "qom/object_interfaces.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "hw/core/boards.h"
|
||||
#include "hw/acpi/aml-build.h"
|
||||
#include "hw/acpi/pci.h"
|
||||
@@ -139,8 +140,8 @@ static void acpi_generic_initiator_class_init(ObjectClass *oc, const void *data)
|
||||
acpi_generic_initiator_set_pci_device);
|
||||
object_class_property_set_description(oc, "pci-dev",
|
||||
"PCI device to associate with the node");
|
||||
object_class_property_add(oc, "node", "uint32", NULL,
|
||||
acpi_generic_initiator_set_node, NULL, NULL);
|
||||
object_class_property_add(oc, "node", "uint32", &uint32_type_info, NULL,
|
||||
acpi_generic_initiator_set_node, NULL, NULL);
|
||||
object_class_property_set_description(oc, "node",
|
||||
"NUMA node associated with the PCI device");
|
||||
}
|
||||
@@ -253,8 +254,8 @@ static void acpi_generic_port_class_init(ObjectClass *oc, const void *data)
|
||||
acpi_generic_port_set_pci_bus);
|
||||
object_class_property_set_description(oc, "pci-bus",
|
||||
"PCI Bus of the host bridge associated with this GP affinity structure");
|
||||
object_class_property_add(oc, "node", "uint32", NULL,
|
||||
acpi_generic_port_set_node, NULL, NULL);
|
||||
object_class_property_add(oc, "node", "uint32", &uint32_type_info, NULL,
|
||||
acpi_generic_port_set_node, NULL, NULL);
|
||||
object_class_property_set_description(oc, "node",
|
||||
"The NUMA node like ID to index HMAT/SLIT NUMA properties involving GP");
|
||||
}
|
||||
|
||||
+16
-19
@@ -72,7 +72,7 @@
|
||||
#include "whpx_arm.h"
|
||||
#include "hw/firmware/smbios.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "qobject/qlist.h"
|
||||
#include "standard-headers/linux/input.h"
|
||||
#include "hw/arm/smmuv3.h"
|
||||
@@ -3580,21 +3580,16 @@ bool virt_is_acpi_enabled(const VirtMachineState *vms)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void virt_get_acpi(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int virt_get_acpi(Object *obj, Error **errp)
|
||||
{
|
||||
VirtMachineState *vms = VIRT_MACHINE(obj);
|
||||
OnOffAuto acpi = vms->acpi;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &acpi, errp);
|
||||
return vms->acpi;
|
||||
}
|
||||
|
||||
static void virt_set_acpi(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void virt_set_acpi(Object *obj, int value, Error **errp)
|
||||
{
|
||||
VirtMachineState *vms = VIRT_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &vms->acpi, errp);
|
||||
vms->acpi = value;
|
||||
}
|
||||
|
||||
static bool virt_get_ras(Object *obj, Error **errp)
|
||||
@@ -4222,9 +4217,9 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data)
|
||||
mc->default_ram_id = "mach-virt.ram";
|
||||
mc->default_nic = "virtio-net-pci";
|
||||
|
||||
object_class_property_add(oc, "acpi", "OnOffAuto",
|
||||
virt_get_acpi, virt_set_acpi,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, "acpi", "OnOffAuto",
|
||||
&OnOffAuto_type_info, virt_get_acpi,
|
||||
virt_set_acpi);
|
||||
object_class_property_set_description(oc, "acpi",
|
||||
"Enable ACPI");
|
||||
object_class_property_add_bool(oc, "secure", virt_get_secure,
|
||||
@@ -4276,17 +4271,19 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data)
|
||||
"memory region for PCI MMIO");
|
||||
|
||||
object_class_property_add(oc, "highmem-mmio-size", "size",
|
||||
virt_get_highmem_mmio_size,
|
||||
virt_set_highmem_mmio_size,
|
||||
NULL, NULL);
|
||||
&size_type_info,
|
||||
virt_get_highmem_mmio_size,
|
||||
virt_set_highmem_mmio_size,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "highmem-mmio-size",
|
||||
"Set the high memory region size "
|
||||
"for PCI MMIO");
|
||||
|
||||
object_class_property_add(oc, "virtio-mmio-transports", "uint8",
|
||||
virt_get_virtio_transports,
|
||||
virt_set_virtio_transports,
|
||||
NULL, NULL);
|
||||
&uint8_type_info,
|
||||
virt_get_virtio_transports,
|
||||
virt_set_virtio_transports,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "virtio-mmio-transports",
|
||||
"Set the number of virtio-mmio transports to instantiate");
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "dataplane/xen-block.h"
|
||||
#include "hw/xen/interface/io/xs_wire.h"
|
||||
#include "trace.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
|
||||
#define XVDA_MAJOR 202
|
||||
#define XVDQ_MAJOR (1 << 20)
|
||||
@@ -664,6 +665,7 @@ invalid:
|
||||
*/
|
||||
static const PropertyInfo xen_block_prop_vdev = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "Virtual Disk specifier (d*p*/xvd*/hd*/sd*)",
|
||||
.get = xen_block_get_vdev,
|
||||
.set = xen_block_set_vdev,
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "system/qtest.h"
|
||||
#include "hw/core/clock.h"
|
||||
@@ -186,6 +187,7 @@ static void clock_initfn(Object *obj)
|
||||
|
||||
if (qtest_enabled()) {
|
||||
object_property_add(obj, "qtest-clock-period", "uint64",
|
||||
&uint64_type_info,
|
||||
clock_period_prop_get, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "qapi/qapi-commands-accelerator.h"
|
||||
#include "qapi/qapi-commands-machine.h"
|
||||
#include "qobject/qobject.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "qapi/qobject-input-visitor.h"
|
||||
#include "qapi/type-helpers.h"
|
||||
#include "qemu/uuid.h"
|
||||
@@ -278,7 +279,8 @@ static int query_memdev(Object *obj, void *opaque)
|
||||
} else {
|
||||
m->has_reserve = true;
|
||||
}
|
||||
m->policy = object_property_get_enum(obj, "policy", "HostMemPolicy",
|
||||
m->policy = object_property_get_enum(obj, "policy",
|
||||
&HostMemPolicy_type_info,
|
||||
&error_abort);
|
||||
host_nodes = object_property_get_qobject(obj,
|
||||
"host-nodes",
|
||||
|
||||
+17
-10
@@ -18,6 +18,7 @@
|
||||
#include "hw/core/loader.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-type-infos-machine.h"
|
||||
#include "qapi/qapi-visit-machine.h"
|
||||
#include "qapi/qapi-commands-machine.h"
|
||||
#include "qemu/madvise.h"
|
||||
@@ -1121,25 +1122,30 @@ static void machine_class_init(ObjectClass *oc, const void *data)
|
||||
"Dump current dtb to a file and quit");
|
||||
|
||||
object_class_property_add(oc, "boot", "BootConfiguration",
|
||||
machine_get_boot, machine_set_boot,
|
||||
NULL, NULL);
|
||||
&BootConfiguration_type_info,
|
||||
machine_get_boot, machine_set_boot,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "boot",
|
||||
"Boot configuration");
|
||||
|
||||
object_class_property_add(oc, "smp", "SMPConfiguration",
|
||||
machine_get_smp, machine_set_smp,
|
||||
NULL, NULL);
|
||||
&SMPConfiguration_type_info,
|
||||
machine_get_smp, machine_set_smp,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "smp",
|
||||
"CPU topology");
|
||||
|
||||
object_class_property_add(oc, "smp-cache", "SmpCachePropertiesWrapper",
|
||||
machine_get_smp_cache, machine_set_smp_cache, NULL, NULL);
|
||||
&SmpCachePropertiesWrapper_type_info,
|
||||
machine_get_smp_cache, machine_set_smp_cache,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "smp-cache",
|
||||
"Cache properties list for SMP machine");
|
||||
|
||||
object_class_property_add(oc, "phandle-start", "int",
|
||||
machine_get_phandle_start, machine_set_phandle_start,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "phandle-start", "int", &int_type_info,
|
||||
machine_get_phandle_start,
|
||||
machine_set_phandle_start,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "phandle-start",
|
||||
"The first phandle ID we may generate dynamically");
|
||||
|
||||
@@ -1215,8 +1221,9 @@ static void machine_class_init(ObjectClass *oc, const void *data)
|
||||
"Valid value is ID of hostmem based backend");
|
||||
|
||||
object_class_property_add(oc, "memory", "MemorySizeConfiguration",
|
||||
machine_get_mem, machine_set_mem,
|
||||
NULL, NULL);
|
||||
&MemorySizeConfiguration_type_info,
|
||||
machine_get_mem, machine_set_mem,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "memory",
|
||||
"Memory size configuration");
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "qemu/uuid.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qdev-prop-internal.h"
|
||||
#include "qapi/qapi-type-infos.h"
|
||||
|
||||
#include "qemu/audio.h"
|
||||
#include "chardev/char-fe.h"
|
||||
@@ -239,6 +240,7 @@ static void release_drive(Object *obj, const char *name, void *opaque)
|
||||
|
||||
const PropertyInfo qdev_prop_drive = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "Node name or ID of a block device to use as a backend",
|
||||
.realized_set_allowed = true,
|
||||
.get = get_drive,
|
||||
@@ -248,6 +250,7 @@ const PropertyInfo qdev_prop_drive = {
|
||||
|
||||
const PropertyInfo qdev_prop_drive_iothread = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "Node name or ID of a block device to use as a backend",
|
||||
.realized_set_allowed = true,
|
||||
.get = get_drive,
|
||||
@@ -316,6 +319,7 @@ static void release_chr(Object *obj, const char *name, void *opaque)
|
||||
|
||||
const PropertyInfo qdev_prop_chr = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "ID of a chardev to use as a backend",
|
||||
.get = get_chr,
|
||||
.set = set_chr,
|
||||
@@ -390,6 +394,7 @@ inval:
|
||||
|
||||
const PropertyInfo qdev_prop_macaddr = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "Ethernet 6-byte MAC Address, example: 52:54:00:12:34:56",
|
||||
.get = get_mac,
|
||||
.set = set_mac,
|
||||
@@ -478,6 +483,7 @@ out:
|
||||
|
||||
const PropertyInfo qdev_prop_netdev = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "ID of a netdev to use as a backend",
|
||||
.get = get_netdev,
|
||||
.set = set_netdev,
|
||||
@@ -515,6 +521,7 @@ static void set_audiodev(Object *obj, Visitor *v, const char* name,
|
||||
|
||||
const PropertyInfo qdev_prop_audiodev = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "ID of an audiodev to use as a backend",
|
||||
/* release done on shutdown */
|
||||
.get = get_audiodev,
|
||||
@@ -584,7 +591,8 @@ static void qdev_propinfo_set_losttickpolicy(Object *obj, Visitor *v,
|
||||
int *ptr = object_field_prop_ptr(obj, prop);
|
||||
int value;
|
||||
|
||||
if (!visit_type_enum(v, name, &value, prop->info->enum_table, errp)) {
|
||||
if (!visit_type_enum(v, name, &value,
|
||||
prop->info->qapi_type->lookup, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -605,8 +613,8 @@ QEMU_BUILD_BUG_ON(sizeof(LostTickPolicy) != sizeof(int));
|
||||
|
||||
const PropertyInfo qdev_prop_losttickpolicy = {
|
||||
.type = "LostTickPolicy",
|
||||
.qapi_type = &LostTickPolicy_type_info,
|
||||
.description = "Policy for handling lost ticks (discard/delay/slew)",
|
||||
.enum_table = &LostTickPolicy_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_losttickpolicy,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -632,6 +640,7 @@ static void set_blocksize(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
const PropertyInfo qdev_prop_blocksize = {
|
||||
.type = "size",
|
||||
.qapi_type = &size_type_info,
|
||||
.description = "A power of two between " MIN_BLOCK_SIZE_STR
|
||||
" and " MAX_BLOCK_SIZE_STR,
|
||||
.get = qdev_propinfo_get_size32,
|
||||
@@ -645,8 +654,8 @@ QEMU_BUILD_BUG_ON(sizeof(BlockdevOnError) != sizeof(int));
|
||||
|
||||
const PropertyInfo qdev_prop_blockdev_on_error = {
|
||||
.type = "BlockdevOnError",
|
||||
.qapi_type = &BlockdevOnError_type_info,
|
||||
.description = "Error handling policy (report/ignore/enospc/stop/auto)",
|
||||
.enum_table = &BlockdevOnError_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -658,9 +667,9 @@ QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) != sizeof(int));
|
||||
|
||||
const PropertyInfo qdev_prop_bios_chs_trans = {
|
||||
.type = "BiosAtaTranslation",
|
||||
.qapi_type = &BiosAtaTranslation_type_info,
|
||||
.description = "Logical CHS translation algorithm "
|
||||
" (auto/none/lba/large/rechs)",
|
||||
.enum_table = &BiosAtaTranslation_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -670,8 +679,8 @@ const PropertyInfo qdev_prop_bios_chs_trans = {
|
||||
|
||||
const PropertyInfo qdev_prop_fdc_drive_type = {
|
||||
.type = "FloppyDriveType",
|
||||
.qapi_type = &FloppyDriveType_type_info,
|
||||
.description = "Floppy drive type (144/288/120/none/auto)",
|
||||
.enum_table = &FloppyDriveType_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -681,9 +690,9 @@ const PropertyInfo qdev_prop_fdc_drive_type = {
|
||||
|
||||
const PropertyInfo qdev_prop_multifd_compression = {
|
||||
.type = "MultiFDCompression",
|
||||
.qapi_type = &MultiFDCompression_type_info,
|
||||
.description = "multifd compression method"
|
||||
" (none/zlib/zstd/qpl/uadk/qatzip)",
|
||||
.enum_table = &MultiFDCompression_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -695,8 +704,8 @@ QEMU_BUILD_BUG_ON(sizeof(MigMode) != sizeof(int));
|
||||
|
||||
const PropertyInfo qdev_prop_mig_mode = {
|
||||
.type = "MigMode",
|
||||
.qapi_type = &MigMode_type_info,
|
||||
.description = "Migration mode (normal/cpr-reboot)",
|
||||
.enum_table = &MigMode_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -708,8 +717,8 @@ QEMU_BUILD_BUG_ON(sizeof(GranuleMode) != sizeof(int));
|
||||
|
||||
const PropertyInfo qdev_prop_granule_mode = {
|
||||
.type = "GranuleMode",
|
||||
.qapi_type = &GranuleMode_type_info,
|
||||
.description = "Granule page size (4k/8k/16k/64k/host)",
|
||||
.enum_table = &GranuleMode_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -717,8 +726,8 @@ const PropertyInfo qdev_prop_granule_mode = {
|
||||
|
||||
const PropertyInfo qdev_prop_zero_page_detection = {
|
||||
.type = "ZeroPageDetection",
|
||||
.qapi_type = &ZeroPageDetection_type_info,
|
||||
.description = "Zero page detection (none/legacy/multifd)",
|
||||
.enum_table = &ZeroPageDetection_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -730,8 +739,8 @@ QEMU_BUILD_BUG_ON(sizeof(SsidSizeMode) != sizeof(int));
|
||||
|
||||
const PropertyInfo qdev_prop_ssidsize_mode = {
|
||||
.type = "SsidSizeMode",
|
||||
.qapi_type = &SsidSizeMode_type_info,
|
||||
.description = "ssidsize mode: auto, 0-20",
|
||||
.enum_table = &SsidSizeMode_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -743,8 +752,8 @@ QEMU_BUILD_BUG_ON(sizeof(OasMode) != sizeof(int));
|
||||
|
||||
const PropertyInfo qdev_prop_oas_mode = {
|
||||
.type = "OasMode",
|
||||
.qapi_type = &OasMode_type_info,
|
||||
.description = "oas mode: auto, 32, 36, 40, 42, 44, 48, 52, 56",
|
||||
.enum_table = &OasMode_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -825,6 +834,7 @@ out:
|
||||
|
||||
const PropertyInfo qdev_prop_reserved_region = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "Reserved Region, example: 0xFEE00000:0xFEEFFFFF:0",
|
||||
.get = get_reserved_region,
|
||||
.set = set_reserved_region,
|
||||
@@ -904,7 +914,16 @@ static char *print_pci_devfn(Object *obj, const Property *prop)
|
||||
}
|
||||
|
||||
const PropertyInfo qdev_prop_pci_devfn = {
|
||||
/*
|
||||
* Both .type and .qapi_type are inaccurate. We actually accept
|
||||
* string or integer. The natural QAPI type would be an
|
||||
* alternate, but QAPI refuses this combination, because it
|
||||
* wouldn't work with the QObject input keyval visitor.
|
||||
* set_pci_devfn() bypasses this restriction by doing it manually.
|
||||
* It can pick integer only with JSON input (QMP).
|
||||
*/
|
||||
.type = "str",
|
||||
.qapi_type = &int32_type_info,
|
||||
.description = "Slot and optional function number, example: 06.0 or 06",
|
||||
.print = print_pci_devfn,
|
||||
.get = qdev_propinfo_get_int32,
|
||||
@@ -1011,6 +1030,7 @@ inval:
|
||||
|
||||
const PropertyInfo qdev_prop_pci_host_devaddr = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "Address (bus:device.function) of "
|
||||
"the host device, example: 04:10.0",
|
||||
.get = get_pci_host_devaddr,
|
||||
@@ -1021,8 +1041,8 @@ const PropertyInfo qdev_prop_pci_host_devaddr = {
|
||||
|
||||
const PropertyInfo qdev_prop_off_auto_pcibar = {
|
||||
.type = "OffAutoPCIBAR",
|
||||
.qapi_type = &OffAutoPCIBAR_type_info,
|
||||
.description = "off/auto/bar0/bar1/bar2/bar3/bar4/bar5",
|
||||
.enum_table = &OffAutoPCIBAR_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -1061,7 +1081,7 @@ static void get_prop_pcielinkspeed(Object *obj, Visitor *v, const char *name,
|
||||
abort();
|
||||
}
|
||||
|
||||
visit_type_enum(v, name, &speed, prop->info->enum_table, errp);
|
||||
visit_type_enum(v, name, &speed, prop->info->qapi_type->lookup, errp);
|
||||
}
|
||||
|
||||
static void set_prop_pcielinkspeed(Object *obj, Visitor *v, const char *name,
|
||||
@@ -1071,8 +1091,8 @@ static void set_prop_pcielinkspeed(Object *obj, Visitor *v, const char *name,
|
||||
PCIExpLinkSpeed *p = object_field_prop_ptr(obj, prop);
|
||||
int speed;
|
||||
|
||||
if (!visit_type_enum(v, name, &speed, prop->info->enum_table,
|
||||
errp)) {
|
||||
if (!visit_type_enum(v, name, &speed,
|
||||
prop->info->qapi_type->lookup, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1103,8 +1123,8 @@ static void set_prop_pcielinkspeed(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
const PropertyInfo qdev_prop_pcie_link_speed = {
|
||||
.type = "PCIELinkSpeed",
|
||||
.qapi_type = &PCIELinkSpeed_type_info,
|
||||
.description = "2_5/5/8/16/32/64",
|
||||
.enum_table = &PCIELinkSpeed_lookup,
|
||||
.get = get_prop_pcielinkspeed,
|
||||
.set = set_prop_pcielinkspeed,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -1146,7 +1166,7 @@ static void get_prop_pcielinkwidth(Object *obj, Visitor *v, const char *name,
|
||||
abort();
|
||||
}
|
||||
|
||||
visit_type_enum(v, name, &width, prop->info->enum_table, errp);
|
||||
visit_type_enum(v, name, &width, prop->info->qapi_type->lookup, errp);
|
||||
}
|
||||
|
||||
static void set_prop_pcielinkwidth(Object *obj, Visitor *v, const char *name,
|
||||
@@ -1156,8 +1176,8 @@ static void set_prop_pcielinkwidth(Object *obj, Visitor *v, const char *name,
|
||||
PCIExpLinkWidth *p = object_field_prop_ptr(obj, prop);
|
||||
int width;
|
||||
|
||||
if (!visit_type_enum(v, name, &width, prop->info->enum_table,
|
||||
errp)) {
|
||||
if (!visit_type_enum(v, name, &width,
|
||||
prop->info->qapi_type->lookup, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1191,8 +1211,8 @@ static void set_prop_pcielinkwidth(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
const PropertyInfo qdev_prop_pcie_link_width = {
|
||||
.type = "PCIELinkWidth",
|
||||
.qapi_type = &PCIELinkWidth_type_info,
|
||||
.description = "1/2/4/8/12/16/32",
|
||||
.enum_table = &PCIELinkWidth_lookup,
|
||||
.get = get_prop_pcielinkwidth,
|
||||
.set = set_prop_pcielinkwidth,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -1241,6 +1261,7 @@ static void set_default_uuid_auto(ObjectProperty *op, const Property *prop)
|
||||
|
||||
const PropertyInfo qdev_prop_uuid = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "UUID (aka GUID) or \"" UUID_VALUE_AUTO
|
||||
"\" for random value (default)",
|
||||
.get = get_uuid,
|
||||
@@ -1254,8 +1275,8 @@ QEMU_BUILD_BUG_ON(sizeof(S390CpuEntitlement) != sizeof(int));
|
||||
|
||||
const PropertyInfo qdev_prop_cpus390entitlement = {
|
||||
.type = "S390CpuEntitlement",
|
||||
.qapi_type = &S390CpuEntitlement_type_info,
|
||||
.description = "auto/low/medium/high (default medium)",
|
||||
.enum_table = &S390CpuEntitlement_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -1299,6 +1320,7 @@ static void release_iothread_vq_mapping_list(Object *obj,
|
||||
|
||||
const PropertyInfo qdev_prop_iothread_vq_mapping_list = {
|
||||
.type = "IOThreadVirtQueueMappingList",
|
||||
.qapi_type = &IOThreadVirtQueueMappingList_type_info,
|
||||
.description = "IOThread virtqueue mapping list [{\"iothread\":\"<id>\", "
|
||||
"\"vqs\":[1,2,3,...]},...]",
|
||||
.get = get_iothread_vq_mapping_list,
|
||||
@@ -1310,8 +1332,8 @@ const PropertyInfo qdev_prop_iothread_vq_mapping_list = {
|
||||
|
||||
const PropertyInfo qdev_prop_endian_mode = {
|
||||
.type = "EndianMode",
|
||||
.qapi_type = &EndianMode_type_info,
|
||||
.description = "Endian mode, big/little/unspecified",
|
||||
.enum_table = &EndianMode_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -1319,8 +1341,8 @@ const PropertyInfo qdev_prop_endian_mode = {
|
||||
|
||||
const PropertyInfo qdev_prop_vmapple_virtio_blk_variant = {
|
||||
.type = "VMAppleVirtioBlkVariant",
|
||||
.qapi_type = &VMAppleVirtioBlkVariant_type_info,
|
||||
.description = "unspecified/root/aux",
|
||||
.enum_table = &VMAppleVirtioBlkVariant_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -1364,6 +1386,7 @@ static void release_virtio_gpu_output_list(Object *obj,
|
||||
|
||||
const PropertyInfo qdev_prop_virtio_gpu_output_list = {
|
||||
.type = "VirtIOGPUOutputList",
|
||||
.qapi_type = &VirtIOGPUOutputList_type_info,
|
||||
.description = "VirtIO GPU output list [{\"name\":\"<name>\"},...]",
|
||||
.get = get_virtio_gpu_output_list,
|
||||
.set = set_virtio_gpu_output_list,
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "qdev-prop-internal.h"
|
||||
#include "qom/compat-properties.h"
|
||||
#include "qom/qom-qobject.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
|
||||
void qdev_prop_set_after_realize(DeviceState *dev, const char *name,
|
||||
Error **errp)
|
||||
@@ -105,7 +107,7 @@ void qdev_propinfo_get_enum(Object *obj, Visitor *v, const char *name,
|
||||
const Property *prop = opaque;
|
||||
int *ptr = object_field_prop_ptr(obj, prop);
|
||||
|
||||
visit_type_enum(v, name, ptr, prop->info->enum_table, errp);
|
||||
visit_type_enum(v, name, ptr, prop->info->qapi_type->lookup, errp);
|
||||
}
|
||||
|
||||
void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name,
|
||||
@@ -114,14 +116,15 @@ void qdev_propinfo_set_enum(Object *obj, Visitor *v, const char *name,
|
||||
const Property *prop = opaque;
|
||||
int *ptr = object_field_prop_ptr(obj, prop);
|
||||
|
||||
visit_type_enum(v, name, ptr, prop->info->enum_table, errp);
|
||||
visit_type_enum(v, name, ptr, prop->info->qapi_type->lookup, errp);
|
||||
}
|
||||
|
||||
void qdev_propinfo_set_default_value_enum(ObjectProperty *op,
|
||||
const Property *prop)
|
||||
{
|
||||
object_property_set_default_str(op,
|
||||
qapi_enum_lookup(prop->info->enum_table, prop->defval.i));
|
||||
qapi_enum_lookup(prop->info->qapi_type->lookup,
|
||||
prop->defval.i));
|
||||
}
|
||||
|
||||
/* Bit */
|
||||
@@ -172,6 +175,7 @@ static void set_default_value_bool(ObjectProperty *op, const Property *prop)
|
||||
|
||||
const PropertyInfo qdev_prop_bit = {
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.description = "on/off",
|
||||
.get = prop_get_bit,
|
||||
.set = prop_set_bit,
|
||||
@@ -222,6 +226,7 @@ static void prop_set_bit64(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
const PropertyInfo qdev_prop_bit64 = {
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.description = "on/off",
|
||||
.get = prop_get_bit64,
|
||||
.set = prop_set_bit64,
|
||||
@@ -284,8 +289,8 @@ static void prop_set_on_off_auto_bit64(Object *obj, Visitor *v,
|
||||
|
||||
const PropertyInfo qdev_prop_on_off_auto_bit64 = {
|
||||
.type = "OnOffAuto",
|
||||
.qapi_type = &OnOffAuto_type_info,
|
||||
.description = "on/off/auto",
|
||||
.enum_table = &OnOffAuto_lookup,
|
||||
.get = prop_get_on_off_auto_bit64,
|
||||
.set = prop_set_on_off_auto_bit64,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -313,6 +318,7 @@ static void set_bool(Object *obj, Visitor *v, const char *name, void *opaque,
|
||||
|
||||
const PropertyInfo qdev_prop_bool = {
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.description = "on/off",
|
||||
.get = get_bool,
|
||||
.set = set_bool,
|
||||
@@ -353,6 +359,7 @@ void qdev_propinfo_set_default_value_uint(ObjectProperty *op,
|
||||
|
||||
const PropertyInfo qdev_prop_uint8 = {
|
||||
.type = "uint8",
|
||||
.qapi_type = &uint8_type_info,
|
||||
.get = get_uint8,
|
||||
.set = set_uint8,
|
||||
.set_default_value = qdev_propinfo_set_default_value_uint,
|
||||
@@ -380,6 +387,7 @@ static void set_uint16(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
const PropertyInfo qdev_prop_uint16 = {
|
||||
.type = "uint16",
|
||||
.qapi_type = &uint16_type_info,
|
||||
.get = get_uint16,
|
||||
.set = set_uint16,
|
||||
.set_default_value = qdev_propinfo_set_default_value_uint,
|
||||
@@ -425,6 +433,7 @@ static void set_int32(Object *obj, Visitor *v, const char *name, void *opaque,
|
||||
|
||||
const PropertyInfo qdev_prop_uint32 = {
|
||||
.type = "uint32",
|
||||
.qapi_type = &uint32_type_info,
|
||||
.get = get_uint32,
|
||||
.set = set_uint32,
|
||||
.set_default_value = qdev_propinfo_set_default_value_uint,
|
||||
@@ -432,6 +441,7 @@ const PropertyInfo qdev_prop_uint32 = {
|
||||
|
||||
const PropertyInfo qdev_prop_int32 = {
|
||||
.type = "int32",
|
||||
.qapi_type = &int32_type_info,
|
||||
.get = qdev_propinfo_get_int32,
|
||||
.set = set_int32,
|
||||
.set_default_value = qdev_propinfo_set_default_value_int,
|
||||
@@ -477,6 +487,7 @@ static void set_int64(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
const PropertyInfo qdev_prop_uint64 = {
|
||||
.type = "uint64",
|
||||
.qapi_type = &uint64_type_info,
|
||||
.get = get_uint64,
|
||||
.set = set_uint64,
|
||||
.set_default_value = qdev_propinfo_set_default_value_uint,
|
||||
@@ -484,6 +495,7 @@ const PropertyInfo qdev_prop_uint64 = {
|
||||
|
||||
const PropertyInfo qdev_prop_int64 = {
|
||||
.type = "int64",
|
||||
.qapi_type = &int64_type_info,
|
||||
.get = get_int64,
|
||||
.set = set_int64,
|
||||
.set_default_value = qdev_propinfo_set_default_value_int,
|
||||
@@ -506,6 +518,7 @@ static void set_uint64_checkmask(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
const PropertyInfo qdev_prop_uint64_checkmask = {
|
||||
.type = "uint64",
|
||||
.qapi_type = &uint64_type_info,
|
||||
.get = get_uint64,
|
||||
.set = set_uint64_checkmask,
|
||||
};
|
||||
@@ -542,6 +555,11 @@ static void set_usize(Object *obj, Visitor *v, const char *name, void *opaque,
|
||||
|
||||
const PropertyInfo qdev_prop_usize = {
|
||||
.type = "usize",
|
||||
#if HOST_LONG_BITS == 32
|
||||
.qapi_type = &uint32_type_info,
|
||||
#else
|
||||
.qapi_type = &uint64_type_info,
|
||||
#endif
|
||||
.get = get_usize,
|
||||
.set = set_usize,
|
||||
.set_default_value = qdev_propinfo_set_default_value_uint,
|
||||
@@ -586,6 +604,7 @@ static void set_string(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
const PropertyInfo qdev_prop_string = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.release = release_string,
|
||||
.get = get_string,
|
||||
.set = set_string,
|
||||
@@ -595,8 +614,8 @@ const PropertyInfo qdev_prop_string = {
|
||||
|
||||
const PropertyInfo qdev_prop_on_off_auto = {
|
||||
.type = "OnOffAuto",
|
||||
.qapi_type = &OnOffAuto_type_info,
|
||||
.description = "on/off/auto",
|
||||
.enum_table = &OnOffAuto_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
@@ -638,6 +657,7 @@ static void set_size32(Object *obj, Visitor *v, const char *name, void *opaque,
|
||||
|
||||
const PropertyInfo qdev_prop_size32 = {
|
||||
.type = "size",
|
||||
.qapi_type = &size_type_info,
|
||||
.get = qdev_propinfo_get_size32,
|
||||
.set = set_size32,
|
||||
.set_default_value = qdev_propinfo_set_default_value_uint,
|
||||
@@ -941,8 +961,8 @@ void qdev_prop_set_enum(DeviceState *dev, const char *name, int value)
|
||||
|
||||
prop = qdev_prop_find(dev, name);
|
||||
object_property_set_str(OBJECT(dev), name,
|
||||
qapi_enum_lookup(prop->info->enum_table, value),
|
||||
&error_abort);
|
||||
qapi_enum_lookup(prop->info->qapi_type->lookup, value),
|
||||
&error_abort);
|
||||
}
|
||||
|
||||
void qdev_prop_set_array(DeviceState *dev, const char *name, QList *values)
|
||||
@@ -1051,6 +1071,7 @@ static void set_size(Object *obj, Visitor *v, const char *name, void *opaque,
|
||||
|
||||
const PropertyInfo qdev_prop_size = {
|
||||
.type = "size",
|
||||
.qapi_type = &size_type_info,
|
||||
.get = get_size,
|
||||
.set = set_size,
|
||||
.set_default_value = qdev_propinfo_set_default_value_uint,
|
||||
@@ -1133,6 +1154,7 @@ static void set_link(Object *obj, Visitor *v, const char *name, void *opaque,
|
||||
|
||||
const PropertyInfo qdev_prop_link = {
|
||||
.type = "link",
|
||||
.qapi_type = &str_type_info,
|
||||
.create = create_link_property,
|
||||
/*
|
||||
* Since we have a create method, the get and set are used
|
||||
@@ -1151,6 +1173,7 @@ void qdev_property_add_static(DeviceState *dev, const Property *prop)
|
||||
assert(!prop->info->create);
|
||||
|
||||
op = object_property_add(obj, prop->name, prop->info->type,
|
||||
prop->info->qapi_type,
|
||||
field_prop_getter(prop->info),
|
||||
field_prop_setter(prop->info),
|
||||
prop->info->release,
|
||||
@@ -1176,8 +1199,8 @@ static void qdev_class_add_property(DeviceClass *klass, const char *name,
|
||||
if (prop->info->create) {
|
||||
op = prop->info->create(oc, name, prop);
|
||||
} else {
|
||||
op = object_class_property_add(oc,
|
||||
name, prop->info->type,
|
||||
op = object_class_property_add(oc, name, prop->info->type,
|
||||
prop->info->qapi_type,
|
||||
field_prop_getter(prop->info),
|
||||
field_prop_setter(prop->info),
|
||||
prop->info->release,
|
||||
|
||||
+5
-2
@@ -12,6 +12,7 @@
|
||||
#include "hw/core/boards.h"
|
||||
#include "hw/cpu/core.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
|
||||
static void core_prop_get_core_id(Object *obj, Visitor *v, const char *name,
|
||||
@@ -82,9 +83,11 @@ static void cpu_core_class_init(ObjectClass *oc, const void *data)
|
||||
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||
|
||||
set_bit(DEVICE_CATEGORY_CPU, dc->categories);
|
||||
object_class_property_add(oc, "core-id", "int", core_prop_get_core_id,
|
||||
object_class_property_add(oc, "core-id", "int", &int_type_info,
|
||||
core_prop_get_core_id,
|
||||
core_prop_set_core_id, NULL, NULL);
|
||||
object_class_property_add(oc, "nr-threads", "int", core_prop_get_nr_threads,
|
||||
object_class_property_add(oc, "nr-threads", "int", &int_type_info,
|
||||
core_prop_get_nr_threads,
|
||||
core_prop_set_nr_threads, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -13,6 +13,7 @@
|
||||
#include "system/qtest.h"
|
||||
#include "hw/core/boards.h"
|
||||
|
||||
#include "qapi/qapi-type-infos-machine.h"
|
||||
#include "qapi/qapi-visit-machine.h"
|
||||
#include "hw/cxl/cxl.h"
|
||||
#include "hw/cxl/cxl_host.h"
|
||||
@@ -610,13 +611,14 @@ static void machine_set_cfmw(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
void cxl_machine_init(Object *obj, CXLState *state)
|
||||
{
|
||||
object_property_add(obj, "cxl", "bool", machine_get_cxl,
|
||||
object_property_add(obj, "cxl", "bool", &bool_type_info, machine_get_cxl,
|
||||
machine_set_cxl, NULL, state);
|
||||
object_property_set_description(obj, "cxl",
|
||||
"Set on/off to enable/disable "
|
||||
"CXL instantiation");
|
||||
|
||||
object_property_add(obj, "cxl-fmw", "CXLFixedMemoryWindow",
|
||||
&CXLFixedMemoryWindowOptionsList_type_info,
|
||||
machine_get_cfmw, machine_set_cfmw,
|
||||
NULL, state);
|
||||
object_property_set_description(obj, "cxl-fmw",
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "qemu/lockable.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/aio-wait.h"
|
||||
@@ -872,6 +873,7 @@ separator_error:
|
||||
|
||||
const PropertyInfo qdev_prop_apple_gfx_display_mode = {
|
||||
.type = "display_mode",
|
||||
.qapi_type = &str_type_info,
|
||||
.description =
|
||||
"Display mode in pixels and Hertz, as <width>x<height>@<refresh-rate> "
|
||||
"Example: 3840x2160@60",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "hw/gpio/aspeed_gpio.h"
|
||||
#include "hw/misc/aspeed_scu.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/core/irq.h"
|
||||
#include "migration/vmstate.h"
|
||||
@@ -1481,7 +1482,8 @@ static void aspeed_gpio_init(Object *obj)
|
||||
int pin_idx = j % GPIOS_PER_GROUP;
|
||||
const char *group = &props->group_label[group_idx][0];
|
||||
char *name = g_strdup_printf("gpio%s%d", group, pin_idx);
|
||||
object_property_add(obj, name, "bool", aspeed_gpio_get_pin,
|
||||
object_property_add(obj, name, "bool", &bool_type_info,
|
||||
aspeed_gpio_get_pin,
|
||||
aspeed_gpio_set_pin, NULL, NULL);
|
||||
g_free(name);
|
||||
}
|
||||
@@ -1489,8 +1491,9 @@ static void aspeed_gpio_init(Object *obj)
|
||||
|
||||
for (int i = 0; i < agc->nr_gpio_sets; i++) {
|
||||
g_autofree char *name = g_strdup_printf("gpio-set[%d]", i);
|
||||
object_property_add(obj, name, "uint32", aspeed_gpio_get_set,
|
||||
aspeed_gpio_set_set, NULL, NULL);
|
||||
object_property_add(obj, name, "uint32", &uint32_type_info,
|
||||
aspeed_gpio_get_set,
|
||||
aspeed_gpio_set_set, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "qemu/log.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/core/irq.h"
|
||||
#include "hw/core/qdev-properties.h"
|
||||
@@ -300,7 +301,8 @@ static void aspeed_sgpio_init(Object *obj)
|
||||
{
|
||||
for (int i = 0; i < ASPEED_SGPIO_MAX_PIN_PAIR * 2; i++) {
|
||||
g_autofree char *name = g_strdup_printf("sgpio%03d", i);
|
||||
object_property_add(obj, name, "bool", aspeed_sgpio_get_pin,
|
||||
object_property_add(obj, name, "bool", &bool_type_info,
|
||||
aspeed_sgpio_get_pin,
|
||||
aspeed_sgpio_set_pin, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -567,12 +567,12 @@ static void pca955x_initfn(Object *obj)
|
||||
if (k->has_led_support) {
|
||||
/* LED variant: expose the LED selector state as led%d. */
|
||||
name = g_strdup_printf("led%d", ix);
|
||||
object_property_add(obj, name, "bool",
|
||||
object_property_add(obj, name, "bool", NULL,
|
||||
pca955x_get_led, pca955x_set_led, NULL, NULL);
|
||||
} else {
|
||||
/* GPIO variant: expose the pin logic level as pin%d. */
|
||||
name = g_strdup_printf("pin%d", ix);
|
||||
object_property_add(obj, name, "str",
|
||||
object_property_add(obj, name, "str", NULL,
|
||||
pca955x_get_pin, pca955x_set_pin, NULL, NULL);
|
||||
}
|
||||
g_free(name);
|
||||
|
||||
+2
-1
@@ -280,7 +280,8 @@ static void pca9554_initfn(Object *obj)
|
||||
char *name;
|
||||
|
||||
name = g_strdup_printf("pin%d", pin);
|
||||
object_property_add(obj, name, "str", pca9554_get_pin, pca9554_set_pin,
|
||||
object_property_add(obj, name, "str", NULL, pca9554_get_pin,
|
||||
pca9554_set_pin,
|
||||
NULL, NULL);
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "hw/core/qdev-properties.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "trace.h"
|
||||
|
||||
@@ -409,10 +410,10 @@ static void stm32l4x5_gpio_init(Object *obj)
|
||||
|
||||
s->clk = qdev_init_clock_in(DEVICE(s), "clk", NULL, s, 0);
|
||||
|
||||
object_property_add(obj, "disconnected-pins", "uint16",
|
||||
object_property_add(obj, "disconnected-pins", "uint16", &uint16_type_info,
|
||||
disconnected_pins_get, disconnected_pins_set,
|
||||
NULL, &s->disconnected_pins);
|
||||
object_property_add(obj, "clock-freq-hz", "uint32",
|
||||
object_property_add(obj, "clock-freq-hz", "uint32", &uint32_type_info,
|
||||
clock_freq_get, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "hw/hexagon/hex-subsys.h"
|
||||
#include "hw/core/loader.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/log.h"
|
||||
@@ -154,6 +155,7 @@ static void hexagon_sim_set_subsystem_base(Object *obj, Visitor *v,
|
||||
static void add_dsp_properties(ObjectClass *oc)
|
||||
{
|
||||
object_class_property_add(oc, "subsystem-base", "uint32",
|
||||
&uint32_type_info,
|
||||
hexagon_sim_get_subsystem_base,
|
||||
hexagon_sim_set_subsystem_base, NULL, NULL);
|
||||
object_class_property_set_description(oc, "subsystem-base",
|
||||
|
||||
+25
-40
@@ -21,7 +21,7 @@
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "system/system.h"
|
||||
#include "system/cpus.h"
|
||||
#include "system/numa.h"
|
||||
@@ -519,55 +519,40 @@ static void microvm_machine_reset(MachineState *machine, ResetType type)
|
||||
}
|
||||
}
|
||||
|
||||
static void microvm_machine_get_rtc(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int microvm_machine_get_rtc(Object *obj, Error **errp)
|
||||
{
|
||||
MicrovmMachineState *mms = MICROVM_MACHINE(obj);
|
||||
OnOffAuto rtc = mms->rtc;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &rtc, errp);
|
||||
return mms->rtc;
|
||||
}
|
||||
|
||||
static void microvm_machine_set_rtc(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void microvm_machine_set_rtc(Object *obj, int value, Error **errp)
|
||||
{
|
||||
MicrovmMachineState *mms = MICROVM_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &mms->rtc, errp);
|
||||
mms->rtc = value;
|
||||
}
|
||||
|
||||
static void microvm_machine_get_pcie(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int microvm_machine_get_pcie(Object *obj, Error **errp)
|
||||
{
|
||||
MicrovmMachineState *mms = MICROVM_MACHINE(obj);
|
||||
OnOffAuto pcie = mms->pcie;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &pcie, errp);
|
||||
return mms->pcie;
|
||||
}
|
||||
|
||||
static void microvm_machine_set_pcie(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void microvm_machine_set_pcie(Object *obj, int value, Error **errp)
|
||||
{
|
||||
MicrovmMachineState *mms = MICROVM_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &mms->pcie, errp);
|
||||
mms->pcie = value;
|
||||
}
|
||||
|
||||
static void microvm_machine_get_ioapic2(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int microvm_machine_get_ioapic2(Object *obj, Error **errp)
|
||||
{
|
||||
MicrovmMachineState *mms = MICROVM_MACHINE(obj);
|
||||
OnOffAuto ioapic2 = mms->ioapic2;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &ioapic2, errp);
|
||||
return mms->ioapic2;
|
||||
}
|
||||
|
||||
static void microvm_machine_set_ioapic2(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void microvm_machine_set_ioapic2(Object *obj, int value, Error **errp)
|
||||
{
|
||||
MicrovmMachineState *mms = MICROVM_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &mms->ioapic2, errp);
|
||||
mms->ioapic2 = value;
|
||||
}
|
||||
|
||||
static bool microvm_machine_get_isa_serial(Object *obj, Error **errp)
|
||||
@@ -673,24 +658,24 @@ static void microvm_class_init(ObjectClass *oc, const void *data)
|
||||
hc->unplug_request = microvm_device_unplug_request_cb;
|
||||
hc->unplug = microvm_device_unplug_cb;
|
||||
|
||||
object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto",
|
||||
microvm_machine_get_rtc,
|
||||
microvm_machine_set_rtc,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, MICROVM_MACHINE_RTC, "OnOffAuto",
|
||||
&OnOffAuto_type_info,
|
||||
microvm_machine_get_rtc,
|
||||
microvm_machine_set_rtc);
|
||||
object_class_property_set_description(oc, MICROVM_MACHINE_RTC,
|
||||
"Enable MC146818 RTC");
|
||||
|
||||
object_class_property_add(oc, MICROVM_MACHINE_PCIE, "OnOffAuto",
|
||||
microvm_machine_get_pcie,
|
||||
microvm_machine_set_pcie,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, MICROVM_MACHINE_PCIE, "OnOffAuto",
|
||||
&OnOffAuto_type_info,
|
||||
microvm_machine_get_pcie,
|
||||
microvm_machine_set_pcie);
|
||||
object_class_property_set_description(oc, MICROVM_MACHINE_PCIE,
|
||||
"Enable PCIe");
|
||||
|
||||
object_class_property_add(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto",
|
||||
microvm_machine_get_ioapic2,
|
||||
microvm_machine_set_ioapic2,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, MICROVM_MACHINE_IOAPIC2, "OnOffAuto",
|
||||
&OnOffAuto_type_info,
|
||||
microvm_machine_get_ioapic2,
|
||||
microvm_machine_set_ioapic2);
|
||||
object_class_property_set_description(oc, MICROVM_MACHINE_IOAPIC2,
|
||||
"Enable second IO-APIC");
|
||||
|
||||
|
||||
+21
-18
@@ -46,6 +46,7 @@
|
||||
#include "kvm/kvm_i386.h"
|
||||
#include "kvm/tdx.h"
|
||||
#include "hw/xen/xen.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "qobject/qlist.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "hw/acpi/acpi.h"
|
||||
@@ -1417,21 +1418,16 @@ static const HotplugHandler *pc_get_hotplug_handler(MachineState *machine,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void pc_machine_get_vmport(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int pc_machine_get_vmport(Object *obj, Error **errp)
|
||||
{
|
||||
PCMachineState *pcms = PC_MACHINE(obj);
|
||||
OnOffAuto vmport = pcms->vmport;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &vmport, errp);
|
||||
return pcms->vmport;
|
||||
}
|
||||
|
||||
static void pc_machine_set_vmport(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void pc_machine_set_vmport(Object *obj, int value, Error **errp)
|
||||
{
|
||||
PCMachineState *pcms = PC_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &pcms->vmport, errp);
|
||||
pcms->vmport = value;
|
||||
}
|
||||
|
||||
static bool pc_machine_get_fd_bootchk(Object *obj, Error **errp)
|
||||
@@ -1723,14 +1719,17 @@ static void pc_machine_class_init(ObjectClass *oc, const void *data)
|
||||
pcmc->default_smbios_ep_type = SMBIOS_ENTRY_POINT_TYPE_AUTO;
|
||||
|
||||
object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size",
|
||||
pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g,
|
||||
NULL, NULL);
|
||||
&size_type_info,
|
||||
pc_machine_get_max_ram_below_4g,
|
||||
pc_machine_set_max_ram_below_4g,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, PC_MACHINE_MAX_RAM_BELOW_4G,
|
||||
"Maximum ram below the 4G boundary (32bit boundary)");
|
||||
|
||||
object_class_property_add(oc, PC_MACHINE_VMPORT, "OnOffAuto",
|
||||
pc_machine_get_vmport, pc_machine_set_vmport,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, PC_MACHINE_VMPORT, "OnOffAuto",
|
||||
&OnOffAuto_type_info,
|
||||
pc_machine_get_vmport,
|
||||
pc_machine_set_vmport);
|
||||
object_class_property_set_description(oc, PC_MACHINE_VMPORT,
|
||||
"Enable vmport (pc & q35)");
|
||||
|
||||
@@ -1759,14 +1758,18 @@ static void pc_machine_class_init(ObjectClass *oc, const void *data)
|
||||
pc_machine_set_default_bus_bypass_iommu);
|
||||
|
||||
object_class_property_add(oc, PC_MACHINE_MAX_FW_SIZE, "size",
|
||||
pc_machine_get_max_fw_size, pc_machine_set_max_fw_size,
|
||||
NULL, NULL);
|
||||
&size_type_info,
|
||||
pc_machine_get_max_fw_size,
|
||||
pc_machine_set_max_fw_size,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, PC_MACHINE_MAX_FW_SIZE,
|
||||
"Maximum combined firmware size");
|
||||
|
||||
object_class_property_add(oc, PC_MACHINE_SMBIOS_EP, "str",
|
||||
pc_machine_get_smbios_ep, pc_machine_set_smbios_ep,
|
||||
NULL, NULL);
|
||||
&str_type_info,
|
||||
pc_machine_get_smbios_ep,
|
||||
pc_machine_set_smbios_ep,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, PC_MACHINE_SMBIOS_EP,
|
||||
"SMBIOS Entry Point type [32, 64]");
|
||||
|
||||
|
||||
+15
-41
@@ -47,6 +47,7 @@
|
||||
#include "hw/acpi/acpi.h"
|
||||
#include "hw/vfio/types.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-type-infos-machine.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "system/xen.h"
|
||||
#ifdef CONFIG_XEN
|
||||
@@ -75,6 +76,11 @@ static GlobalProperty pc_piix_compat_defaults[] = {
|
||||
static const size_t pc_piix_compat_defaults_len =
|
||||
G_N_ELEMENTS(pc_piix_compat_defaults);
|
||||
|
||||
static const char *pc_south_bridge_type[] = {
|
||||
[PC_SOUTH_BRIDGE_OPTION_PIIX3] = TYPE_PIIX3_DEVICE,
|
||||
[PC_SOUTH_BRIDGE_OPTION_PIIX4] = TYPE_PIIX4_PCI_DEVICE,
|
||||
};
|
||||
|
||||
/*
|
||||
* Return the global irq number corresponding to a given device irq
|
||||
* pin. We could also use the bus number to have a more precise mapping.
|
||||
@@ -236,7 +242,8 @@ static void pc_init1(MachineState *machine, const char *pci_type)
|
||||
|
||||
gsi_state = pc_gsi_create(&x86ms->gsi, true);
|
||||
|
||||
pci_dev = pci_new_multifunction(-1, pcms->south_bridge);
|
||||
pci_dev = pci_new_multifunction(-1,
|
||||
pc_south_bridge_type[pcms->south_bridge]);
|
||||
object_property_set_bool(OBJECT(pci_dev), "has-usb",
|
||||
machine_usb(machine), &error_abort);
|
||||
object_property_set_bool(OBJECT(pci_dev), "has-acpi",
|
||||
@@ -317,51 +324,18 @@ static void pc_init1(MachineState *machine, const char *pci_type)
|
||||
}
|
||||
}
|
||||
|
||||
typedef enum PCSouthBridgeOption {
|
||||
PC_SOUTH_BRIDGE_OPTION_PIIX3,
|
||||
PC_SOUTH_BRIDGE_OPTION_PIIX4,
|
||||
PC_SOUTH_BRIDGE_OPTION_MAX,
|
||||
} PCSouthBridgeOption;
|
||||
|
||||
static const QEnumLookup PCSouthBridgeOption_lookup = {
|
||||
.array = (const char *const[]) {
|
||||
[PC_SOUTH_BRIDGE_OPTION_PIIX3] = TYPE_PIIX3_DEVICE,
|
||||
[PC_SOUTH_BRIDGE_OPTION_PIIX4] = TYPE_PIIX4_PCI_DEVICE,
|
||||
},
|
||||
.size = PC_SOUTH_BRIDGE_OPTION_MAX
|
||||
};
|
||||
|
||||
static int pc_get_south_bridge(Object *obj, Error **errp)
|
||||
{
|
||||
PCMachineState *pcms = PC_MACHINE(obj);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < PCSouthBridgeOption_lookup.size; i++) {
|
||||
if (g_strcmp0(PCSouthBridgeOption_lookup.array[i],
|
||||
pcms->south_bridge) == 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
error_setg(errp, "Invalid south bridge value set");
|
||||
return 0;
|
||||
return pcms->south_bridge;
|
||||
}
|
||||
|
||||
static void pc_set_south_bridge(Object *obj, int value, Error **errp)
|
||||
{
|
||||
PCMachineState *pcms = PC_MACHINE(obj);
|
||||
|
||||
if (value < 0) {
|
||||
error_setg(errp, "Value can't be negative");
|
||||
return;
|
||||
}
|
||||
|
||||
if (value >= PCSouthBridgeOption_lookup.size) {
|
||||
error_setg(errp, "Value too big");
|
||||
return;
|
||||
}
|
||||
|
||||
pcms->south_bridge = PCSouthBridgeOption_lookup.array[value];
|
||||
pcms->south_bridge = value;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_XEN
|
||||
@@ -398,7 +372,7 @@ static void pc_i440fx_machine_options(MachineClass *m)
|
||||
{
|
||||
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
|
||||
ObjectClass *oc = OBJECT_CLASS(m);
|
||||
pcmc->default_south_bridge = TYPE_PIIX3_DEVICE;
|
||||
pcmc->default_south_bridge = PC_SOUTH_BRIDGE_OPTION_PIIX3;
|
||||
pcmc->pci_root_uid = 0;
|
||||
pcmc->default_cpu_version = 1;
|
||||
|
||||
@@ -413,10 +387,10 @@ static void pc_i440fx_machine_options(MachineClass *m)
|
||||
machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE);
|
||||
machine_class_allow_dynamic_sysbus_dev(m, TYPE_UEFI_VARS_X64);
|
||||
|
||||
object_class_property_add_enum(oc, "x-south-bridge", "PCSouthBridgeOption",
|
||||
&PCSouthBridgeOption_lookup,
|
||||
pc_get_south_bridge,
|
||||
pc_set_south_bridge);
|
||||
object_class_property_add_enum(oc, "x-south-bridge",
|
||||
"PCSouthBridgeOption",
|
||||
&PCSouthBridgeOption_type_info,
|
||||
pc_get_south_bridge, pc_set_south_bridge);
|
||||
object_class_property_set_description(oc, "x-south-bridge",
|
||||
"Use a different south bridge than PIIX3");
|
||||
compat_props_add(m->compat_props,
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "hw/mem/memory-device.h"
|
||||
#include "hw/core/qdev-properties.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "target/i386/cpu.h"
|
||||
#include "system/address-spaces.h"
|
||||
@@ -160,6 +161,7 @@ static void sgx_epc_class_init(ObjectClass *oc, const void *data)
|
||||
mdc->fill_device_info = sgx_epc_md_fill_device_info;
|
||||
|
||||
object_class_property_add(oc, SGX_EPC_SIZE_PROP, "uint64",
|
||||
&uint64_type_info,
|
||||
sgx_epc_get_size,
|
||||
NULL,
|
||||
NULL, NULL);
|
||||
|
||||
+36
-56
@@ -24,7 +24,8 @@
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "qapi/qapi-type-infos-machine.h"
|
||||
#include "qapi/qapi-visit-machine.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "system/qtest.h"
|
||||
@@ -188,21 +189,16 @@ bool x86_machine_is_smm_enabled(const X86MachineState *x86ms)
|
||||
return false;
|
||||
}
|
||||
|
||||
static void x86_machine_get_smm(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int x86_machine_get_smm(Object *obj, Error **errp)
|
||||
{
|
||||
X86MachineState *x86ms = X86_MACHINE(obj);
|
||||
OnOffAuto smm = x86ms->smm;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &smm, errp);
|
||||
return x86ms->smm;
|
||||
}
|
||||
|
||||
static void x86_machine_set_smm(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void x86_machine_set_smm(Object *obj, int value, Error **errp)
|
||||
{
|
||||
X86MachineState *x86ms = X86_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &x86ms->smm, errp);
|
||||
x86ms->smm = value;
|
||||
}
|
||||
|
||||
bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms)
|
||||
@@ -213,55 +209,40 @@ bool x86_machine_is_acpi_enabled(const X86MachineState *x86ms)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void x86_machine_get_acpi(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int x86_machine_get_acpi(Object *obj, Error **errp)
|
||||
{
|
||||
X86MachineState *x86ms = X86_MACHINE(obj);
|
||||
OnOffAuto acpi = x86ms->acpi;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &acpi, errp);
|
||||
return x86ms->acpi;
|
||||
}
|
||||
|
||||
static void x86_machine_set_acpi(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void x86_machine_set_acpi(Object *obj, int value, Error **errp)
|
||||
{
|
||||
X86MachineState *x86ms = X86_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &x86ms->acpi, errp);
|
||||
x86ms->acpi = value;
|
||||
}
|
||||
|
||||
static void x86_machine_get_pit(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int x86_machine_get_pit(Object *obj, Error **errp)
|
||||
{
|
||||
X86MachineState *x86ms = X86_MACHINE(obj);
|
||||
OnOffAuto pit = x86ms->pit;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &pit, errp);
|
||||
return x86ms->pit;
|
||||
}
|
||||
|
||||
static void x86_machine_set_pit(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void x86_machine_set_pit(Object *obj, int value, Error **errp)
|
||||
{
|
||||
X86MachineState *x86ms = X86_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &x86ms->pit, errp);
|
||||
x86ms->pit = value;
|
||||
}
|
||||
|
||||
static void x86_machine_get_pic(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int x86_machine_get_pic(Object *obj, Error **errp)
|
||||
{
|
||||
X86MachineState *x86ms = X86_MACHINE(obj);
|
||||
OnOffAuto pic = x86ms->pic;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &pic, errp);
|
||||
return x86ms->pic;
|
||||
}
|
||||
|
||||
static void x86_machine_set_pic(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void x86_machine_set_pic(Object *obj, int value, Error **errp)
|
||||
{
|
||||
X86MachineState *x86ms = X86_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &x86ms->pic, errp);
|
||||
x86ms->pic = value;
|
||||
}
|
||||
|
||||
static char *x86_machine_get_oem_id(Object *obj, Error **errp)
|
||||
@@ -391,29 +372,27 @@ static void x86_machine_class_init(ObjectClass *oc, const void *data)
|
||||
mc->kvm_type = x86_kvm_type;
|
||||
nc->raise_nmi = x86_nmi;
|
||||
|
||||
object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto",
|
||||
x86_machine_get_smm, x86_machine_set_smm,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, X86_MACHINE_SMM, "OnOffAuto",
|
||||
&OnOffAuto_type_info, x86_machine_get_smm,
|
||||
x86_machine_set_smm);
|
||||
object_class_property_set_description(oc, X86_MACHINE_SMM,
|
||||
"Enable SMM");
|
||||
|
||||
object_class_property_add(oc, X86_MACHINE_ACPI, "OnOffAuto",
|
||||
x86_machine_get_acpi, x86_machine_set_acpi,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, X86_MACHINE_ACPI, "OnOffAuto",
|
||||
&OnOffAuto_type_info, x86_machine_get_acpi,
|
||||
x86_machine_set_acpi);
|
||||
object_class_property_set_description(oc, X86_MACHINE_ACPI,
|
||||
"Enable ACPI");
|
||||
|
||||
object_class_property_add(oc, X86_MACHINE_PIT, "OnOffAuto",
|
||||
x86_machine_get_pit,
|
||||
x86_machine_set_pit,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, X86_MACHINE_PIT, "OnOffAuto",
|
||||
&OnOffAuto_type_info, x86_machine_get_pit,
|
||||
x86_machine_set_pit);
|
||||
object_class_property_set_description(oc, X86_MACHINE_PIT,
|
||||
"Enable i8254 PIT");
|
||||
|
||||
object_class_property_add(oc, X86_MACHINE_PIC, "OnOffAuto",
|
||||
x86_machine_get_pic,
|
||||
x86_machine_set_pic,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, X86_MACHINE_PIC, "OnOffAuto",
|
||||
&OnOffAuto_type_info, x86_machine_get_pic,
|
||||
x86_machine_set_pic);
|
||||
object_class_property_set_description(oc, X86_MACHINE_PIC,
|
||||
"Enable i8259 PIC");
|
||||
|
||||
@@ -435,14 +414,15 @@ static void x86_machine_class_init(ObjectClass *oc, const void *data)
|
||||
"The string may be up to 8 bytes in size");
|
||||
|
||||
object_class_property_add(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, "uint64_t",
|
||||
x86_machine_get_bus_lock_ratelimit,
|
||||
x86_machine_set_bus_lock_ratelimit, NULL, NULL);
|
||||
&uint64_type_info,
|
||||
x86_machine_get_bus_lock_ratelimit,
|
||||
x86_machine_set_bus_lock_ratelimit, NULL, NULL);
|
||||
object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIMIT,
|
||||
"Set the ratelimit for the bus locks acquired in VMs");
|
||||
|
||||
object_class_property_add(oc, "sgx-epc", "SgxEPC",
|
||||
machine_get_sgx_epc, machine_set_sgx_epc,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "sgx-epc", "SgxEPC", &SgxEPCList_type_info,
|
||||
machine_get_sgx_epc, machine_set_sgx_epc,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "sgx-epc",
|
||||
"SGX EPC device");
|
||||
}
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/qapi-types-block.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/module.h"
|
||||
@@ -174,7 +175,7 @@ out:
|
||||
|
||||
static void ide_dev_instance_init(Object *obj)
|
||||
{
|
||||
object_property_add(obj, "bootindex", "int32",
|
||||
object_property_add(obj, "bootindex", "int32", &int32_type_info,
|
||||
ide_dev_get_bootindex,
|
||||
ide_dev_set_bootindex, NULL, NULL);
|
||||
object_property_set_int(obj, "bootindex", -1, NULL);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/i386/apic.h"
|
||||
#include "hw/i386/apic_internal.h"
|
||||
@@ -442,7 +443,7 @@ static void apic_common_initfn(Object *obj)
|
||||
APICCommonState *s = APIC_COMMON(obj);
|
||||
|
||||
s->id = s->initial_apic_id = -1;
|
||||
object_property_add(obj, "id", "uint32",
|
||||
object_property_add(obj, "id", "uint32", &uint32_type_info,
|
||||
apic_common_get_id,
|
||||
apic_common_set_id, NULL, NULL);
|
||||
}
|
||||
|
||||
+30
-43
@@ -36,7 +36,8 @@
|
||||
#include "target/loongarch/cpu.h"
|
||||
#include "target/loongarch/cpu-mmu.h"
|
||||
#include "hw/firmware/smbios.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/acpi/generic_event_device.h"
|
||||
#include "hw/mem/nvdimm.h"
|
||||
#include "hw/core/platform-bus.h"
|
||||
@@ -51,26 +52,21 @@
|
||||
#include "qemu/log.h"
|
||||
#include "kvm/kvm_loongarch.h"
|
||||
|
||||
static void virt_get_dmsi(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int virt_get_dmsi(Object *obj, Error **errp)
|
||||
{
|
||||
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(obj);
|
||||
OnOffAuto dmsi = lvms->dmsi;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &dmsi, errp);
|
||||
|
||||
return lvms->dmsi;
|
||||
}
|
||||
static void virt_set_dmsi(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
|
||||
static void virt_set_dmsi(Object *obj, int value, Error **errp)
|
||||
{
|
||||
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(obj);
|
||||
lvms->dmsi = value;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &lvms->dmsi, errp);
|
||||
|
||||
if (lvms->dmsi == ON_OFF_AUTO_OFF) {
|
||||
if (value == ON_OFF_AUTO_OFF) {
|
||||
lvms->misc_feature &= ~BIT(IOCSRF_DMSI);
|
||||
lvms->misc_status &= ~BIT_ULL(IOCSRM_DMSI_EN);
|
||||
} else if (lvms->dmsi == ON_OFF_AUTO_ON) {
|
||||
} else if (value == ON_OFF_AUTO_ON) {
|
||||
lvms->misc_feature = BIT(IOCSRF_DMSI);
|
||||
}
|
||||
}
|
||||
@@ -78,21 +74,16 @@ static void virt_set_dmsi(Object *obj, Visitor *v, const char *name,
|
||||
#define DEFAULT_HIGH_PCIE_MMIO_SIZE_GB 64
|
||||
#define DEFAULT_HIGH_PCIE_MMIO_SIZE (DEFAULT_HIGH_PCIE_MMIO_SIZE_GB * GiB)
|
||||
|
||||
static void virt_get_veiointc(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int virt_get_veiointc(Object *obj, Error **errp)
|
||||
{
|
||||
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(obj);
|
||||
OnOffAuto veiointc = lvms->veiointc;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &veiointc, errp);
|
||||
return lvms->veiointc;
|
||||
}
|
||||
|
||||
static void virt_set_veiointc(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void virt_set_veiointc(Object *obj, int value, Error **errp)
|
||||
{
|
||||
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &lvms->veiointc, errp);
|
||||
lvms->veiointc = value;
|
||||
}
|
||||
|
||||
static bool virt_get_highmem_mmio(Object *obj, Error **errp)
|
||||
@@ -1025,21 +1016,16 @@ static void virt_init(MachineState *machine)
|
||||
loongarch_load_kernel(machine, &lvms->bootinfo, phys_addr_mask);
|
||||
}
|
||||
|
||||
static void virt_get_acpi(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int virt_get_acpi(Object *obj, Error **errp)
|
||||
{
|
||||
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(obj);
|
||||
OnOffAuto acpi = lvms->acpi;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &acpi, errp);
|
||||
return lvms->acpi;
|
||||
}
|
||||
|
||||
static void virt_set_acpi(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void virt_set_acpi(Object *obj, int value, Error **errp)
|
||||
{
|
||||
LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &lvms->acpi, errp);
|
||||
lvms->acpi = value;
|
||||
}
|
||||
|
||||
static char *virt_get_oem_id(Object *obj, Error **errp)
|
||||
@@ -1483,18 +1469,19 @@ static void virt_class_init(ObjectClass *oc, const void *data)
|
||||
hc->unplug_request = virt_device_unplug_request;
|
||||
hc->unplug = virt_device_unplug;
|
||||
|
||||
object_class_property_add(oc, "acpi", "OnOffAuto",
|
||||
virt_get_acpi, virt_set_acpi,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, "acpi", "OnOffAuto",
|
||||
&OnOffAuto_type_info, virt_get_acpi,
|
||||
virt_set_acpi);
|
||||
object_class_property_set_description(oc, "acpi",
|
||||
"Enable ACPI");
|
||||
object_class_property_add(oc, "v-eiointc", "OnOffAuto",
|
||||
virt_get_veiointc, virt_set_veiointc,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, "v-eiointc", "OnOffAuto",
|
||||
&OnOffAuto_type_info, virt_get_veiointc,
|
||||
virt_set_veiointc);
|
||||
object_class_property_set_description(oc, "v-eiointc",
|
||||
"Enable Virt Extend I/O Interrupt Controller.");
|
||||
object_class_property_add(oc, "dmsi", "OnOffAuto",
|
||||
virt_get_dmsi, virt_set_dmsi, NULL, NULL);
|
||||
object_class_property_add_enum(oc, "dmsi", "OnOffAuto",
|
||||
&OnOffAuto_type_info, virt_get_dmsi,
|
||||
virt_set_dmsi);
|
||||
object_class_property_set_description(oc, "dmsi",
|
||||
"Enable direct Message-interrupts Controller.");
|
||||
machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE);
|
||||
@@ -1525,10 +1512,10 @@ static void virt_class_init(ObjectClass *oc, const void *data)
|
||||
object_class_property_set_description(oc, "highmem-mmio",
|
||||
"Set on/off to enable/disable high "
|
||||
"memory region for PCI MMIO");
|
||||
object_class_property_add(oc, "highmem-mmio-size", "size",
|
||||
virt_get_highmem_mmio_size,
|
||||
virt_set_highmem_mmio_size,
|
||||
NULL, NULL);
|
||||
object_class_property_add(oc, "highmem-mmio-size", "size", &size_type_info,
|
||||
virt_get_highmem_mmio_size,
|
||||
virt_set_highmem_mmio_size,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "highmem-mmio-size",
|
||||
"Set the high memory region size "
|
||||
"for PCI MMIO");
|
||||
|
||||
+4
-2
@@ -26,6 +26,7 @@
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/pmem.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/mem/nvdimm.h"
|
||||
#include "hw/core/qdev-properties.h"
|
||||
@@ -99,11 +100,12 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
static void nvdimm_init(Object *obj)
|
||||
{
|
||||
object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size",
|
||||
object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "size", &size_type_info,
|
||||
nvdimm_get_label_size, nvdimm_set_label_size, NULL,
|
||||
NULL);
|
||||
|
||||
object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", nvdimm_get_uuid,
|
||||
object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", &str_type_info,
|
||||
nvdimm_get_uuid,
|
||||
nvdimm_set_uuid, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -26,6 +26,7 @@
|
||||
#include "hw/mem/nvdimm.h"
|
||||
#include "hw/mem/memory-device.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/module.h"
|
||||
#include "system/hostmem.h"
|
||||
@@ -176,7 +177,8 @@ static void pc_dimm_get_size(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
static void pc_dimm_init(Object *obj)
|
||||
{
|
||||
object_property_add(obj, PC_DIMM_SIZE_PROP, "uint64", pc_dimm_get_size,
|
||||
object_property_add(obj, PC_DIMM_SIZE_PROP, "uint64", &uint64_type_info,
|
||||
pc_dimm_get_size,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "qemu/target-info.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "target/microblaze/cpu.h"
|
||||
#include "hw/core/sysbus.h"
|
||||
#include "net/net.h"
|
||||
@@ -175,7 +176,7 @@ static void petalogix_s3adsp1800_machine_class_init(ObjectClass *oc,
|
||||
mc->is_default = true;
|
||||
|
||||
prop = object_class_property_add_enum(oc, "endianness", "EndianMode",
|
||||
&EndianMode_lookup,
|
||||
&EndianMode_type_info,
|
||||
machine_get_endianness,
|
||||
machine_set_endianness);
|
||||
object_property_set_default_str(prop, target_big_endian() ? "big"
|
||||
|
||||
+25
-12
@@ -12,6 +12,7 @@
|
||||
#include "qemu/error-report.h"
|
||||
#include "hw/misc/aspeed_lpc.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/core/irq.h"
|
||||
#include "hw/core/qdev-properties.h"
|
||||
@@ -417,29 +418,41 @@ static void aspeed_lpc_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
static void aspeed_lpc_init(Object *obj)
|
||||
{
|
||||
object_property_add(obj, "idr1", "uint32", aspeed_kcs_get_register_property,
|
||||
object_property_add(obj, "idr1", "uint32", &uint32_type_info,
|
||||
aspeed_kcs_get_register_property,
|
||||
aspeed_kcs_set_register_property, NULL, NULL);
|
||||
object_property_add(obj, "odr1", "uint32", aspeed_kcs_get_register_property,
|
||||
object_property_add(obj, "odr1", "uint32", &uint32_type_info,
|
||||
aspeed_kcs_get_register_property,
|
||||
aspeed_kcs_set_register_property, NULL, NULL);
|
||||
object_property_add(obj, "str1", "uint32", aspeed_kcs_get_register_property,
|
||||
object_property_add(obj, "str1", "uint32", &uint32_type_info,
|
||||
aspeed_kcs_get_register_property,
|
||||
aspeed_kcs_set_register_property, NULL, NULL);
|
||||
object_property_add(obj, "idr2", "uint32", aspeed_kcs_get_register_property,
|
||||
object_property_add(obj, "idr2", "uint32", &uint32_type_info,
|
||||
aspeed_kcs_get_register_property,
|
||||
aspeed_kcs_set_register_property, NULL, NULL);
|
||||
object_property_add(obj, "odr2", "uint32", aspeed_kcs_get_register_property,
|
||||
object_property_add(obj, "odr2", "uint32", &uint32_type_info,
|
||||
aspeed_kcs_get_register_property,
|
||||
aspeed_kcs_set_register_property, NULL, NULL);
|
||||
object_property_add(obj, "str2", "uint32", aspeed_kcs_get_register_property,
|
||||
object_property_add(obj, "str2", "uint32", &uint32_type_info,
|
||||
aspeed_kcs_get_register_property,
|
||||
aspeed_kcs_set_register_property, NULL, NULL);
|
||||
object_property_add(obj, "idr3", "uint32", aspeed_kcs_get_register_property,
|
||||
object_property_add(obj, "idr3", "uint32", &uint32_type_info,
|
||||
aspeed_kcs_get_register_property,
|
||||
aspeed_kcs_set_register_property, NULL, NULL);
|
||||
object_property_add(obj, "odr3", "uint32", aspeed_kcs_get_register_property,
|
||||
object_property_add(obj, "odr3", "uint32", &uint32_type_info,
|
||||
aspeed_kcs_get_register_property,
|
||||
aspeed_kcs_set_register_property, NULL, NULL);
|
||||
object_property_add(obj, "str3", "uint32", aspeed_kcs_get_register_property,
|
||||
object_property_add(obj, "str3", "uint32", &uint32_type_info,
|
||||
aspeed_kcs_get_register_property,
|
||||
aspeed_kcs_set_register_property, NULL, NULL);
|
||||
object_property_add(obj, "idr4", "uint32", aspeed_kcs_get_register_property,
|
||||
object_property_add(obj, "idr4", "uint32", &uint32_type_info,
|
||||
aspeed_kcs_get_register_property,
|
||||
aspeed_kcs_set_register_property, NULL, NULL);
|
||||
object_property_add(obj, "odr4", "uint32", aspeed_kcs_get_register_property,
|
||||
object_property_add(obj, "odr4", "uint32", &uint32_type_info,
|
||||
aspeed_kcs_get_register_property,
|
||||
aspeed_kcs_set_register_property, NULL, NULL);
|
||||
object_property_add(obj, "str4", "uint32", aspeed_kcs_get_register_property,
|
||||
object_property_add(obj, "str4", "uint32", &uint32_type_info,
|
||||
aspeed_kcs_get_register_property,
|
||||
aspeed_kcs_set_register_property, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "hw/core/qdev-properties.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "trace.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qemu/cutils.h"
|
||||
@@ -259,7 +260,7 @@ static void aspeed_sdmc_set_ram_size(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
static void aspeed_sdmc_initfn(Object *obj)
|
||||
{
|
||||
object_property_add(obj, "ram-size", "int",
|
||||
object_property_add(obj, "ram-size", "int", &int_type_info,
|
||||
aspeed_sdmc_get_ram_size, aspeed_sdmc_set_ram_size,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "hw/core/registerfields.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/bitops.h"
|
||||
#include "qemu/error-report.h"
|
||||
@@ -491,7 +492,7 @@ static void npcm7xx_mft_init(Object *obj)
|
||||
s->clock_2 = qdev_init_clock_out(dev, "clock2");
|
||||
|
||||
for (int i = 0; i < NPCM7XX_PWM_PER_MODULE; ++i) {
|
||||
object_property_add(obj, "max_rpm[*]", "uint32",
|
||||
object_property_add(obj, "max_rpm[*]", "uint32", &uint32_type_info,
|
||||
npcm7xx_mft_get_max_rpm,
|
||||
npcm7xx_mft_set_max_rpm,
|
||||
NULL, &s->max_rpm[i]);
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "qapi/visitor.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "hw/core/qdev-properties.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
|
||||
#ifndef XLNX_VERSAL_TRNG_ERR_DEBUG
|
||||
#define XLNX_VERSAL_TRNG_ERR_DEBUG 0
|
||||
@@ -650,10 +651,23 @@ static void trng_prop_fault_event_set(Object *obj, Visitor *v,
|
||||
trng_fault_event_set(XLNX_VERSAL_TRNG(obj), *events);
|
||||
}
|
||||
|
||||
static void trng_prop_fault_event_get(Object *obj, Visitor *v,
|
||||
const char *name,
|
||||
void *opaque,
|
||||
Error **errp)
|
||||
{
|
||||
const Property *prop = opaque;
|
||||
uint32_t *events = object_field_prop_ptr(obj, prop);
|
||||
|
||||
visit_type_uint32(v, name, events, errp);
|
||||
}
|
||||
|
||||
static const PropertyInfo trng_prop_fault_events = {
|
||||
.type = "uint32",
|
||||
.qapi_type = &uint32_type_info,
|
||||
.description = "Set to trigger TRNG fault events",
|
||||
.set = trng_prop_fault_event_set,
|
||||
.get = trng_prop_fault_event_get,
|
||||
.realized_set_allowed = true,
|
||||
};
|
||||
|
||||
|
||||
+2
-1
@@ -29,6 +29,7 @@
|
||||
#include "ne2000.h"
|
||||
#include "system/system.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qom/object.h"
|
||||
@@ -131,7 +132,7 @@ out:
|
||||
|
||||
static void isa_ne2000_instance_init(Object *obj)
|
||||
{
|
||||
object_property_add(obj, "bootindex", "int32",
|
||||
object_property_add(obj, "bootindex", "int32", &int32_type_info,
|
||||
isa_ne2000_get_bootindex,
|
||||
isa_ne2000_set_bootindex, NULL, NULL);
|
||||
object_property_set_int(obj, "bootindex", -1, NULL);
|
||||
|
||||
@@ -203,6 +203,7 @@
|
||||
#include "qemu/units.h"
|
||||
#include "qemu/range.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "system/system.h"
|
||||
#include "system/block-backend.h"
|
||||
@@ -10613,6 +10614,7 @@ static void nvme_instance_init(Object *obj)
|
||||
DEVICE(obj));
|
||||
|
||||
object_property_add(obj, "smart_critical_warning", "uint8",
|
||||
&uint8_type_info,
|
||||
nvme_get_smart_warning,
|
||||
nvme_set_smart_warning, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/ctype.h"
|
||||
#include "nvme.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
|
||||
#define NGUID_SEPARATOR '-'
|
||||
|
||||
@@ -180,6 +181,7 @@ static void set_nguid(Object *obj, Visitor *v, const char *name, void *opaque,
|
||||
|
||||
const PropertyInfo qdev_prop_nguid = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description =
|
||||
"NGUID or \"" NGUID_VALUE_AUTO "\" for random value",
|
||||
.get = get_nguid,
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "hw/core/qdev-properties.h"
|
||||
#include "hw/core/qdev-properties-system.h"
|
||||
#include "hw/nvram/xlnx-efuse.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
|
||||
#ifndef XLNX_BBRAM_ERR_DEBUG
|
||||
#define XLNX_BBRAM_ERR_DEBUG 0
|
||||
@@ -487,6 +488,7 @@ static void bbram_prop_release_drive(Object *obj, const char *name,
|
||||
|
||||
static const PropertyInfo bbram_prop_drive = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "Node name or ID of a block device to use as BBRAM backend",
|
||||
.realized_set_allowed = true,
|
||||
.get = bbram_prop_get_drive,
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "system/blockdev.h"
|
||||
#include "hw/core/qdev-properties.h"
|
||||
#include "hw/core/qdev-properties-system.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
|
||||
#define TBIT0_OFFSET 28
|
||||
#define TBIT1_OFFSET 29
|
||||
@@ -252,6 +253,7 @@ static void efuse_prop_release_drive(Object *obj, const char *name,
|
||||
|
||||
static const PropertyInfo efuse_prop_drive = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "Node name or ID of a block device to use as eFUSE backend",
|
||||
.realized_set_allowed = true,
|
||||
.get = efuse_prop_get_drive,
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "hw/pci/pci.h"
|
||||
#include "hw/pci/pci_bus.h"
|
||||
#include "hw/pci/pci_host.h"
|
||||
@@ -75,7 +76,7 @@ void pxb_bus_class_init(ObjectClass *class, const void *data)
|
||||
pbc->bus_num = pxb_bus_num;
|
||||
pbc->numa_node = pxb_bus_numa_node;
|
||||
|
||||
object_class_property_add(class, "acpi_uid", "uint32",
|
||||
object_class_property_add(class, "acpi_uid", "uint32", &uint32_type_info,
|
||||
prop_pxb_uid_get, NULL, NULL, NULL);
|
||||
object_class_property_set_description(class, "acpi_uid",
|
||||
"ACPI Unique ID used to distinguish this PCI Host Bridge / ACPI00016");
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "hw/core/qdev-properties.h"
|
||||
#include "hw/core/sysbus.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/error-report.h"
|
||||
@@ -388,18 +389,22 @@ static void i440fx_pcihost_class_init(ObjectClass *klass, const void *data)
|
||||
dc->user_creatable = false;
|
||||
|
||||
object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_START, "uint32",
|
||||
&uint32_type_info,
|
||||
i440fx_pcihost_get_pci_hole_start,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE_END, "uint32",
|
||||
&uint32_type_info,
|
||||
i440fx_pcihost_get_pci_hole_end,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_START, "uint64",
|
||||
&uint64_type_info,
|
||||
i440fx_pcihost_get_pci_hole64_start,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
object_class_property_add(klass, PCI_HOST_PROP_PCI_HOLE64_END, "uint64",
|
||||
&uint64_type_info,
|
||||
i440fx_pcihost_get_pci_hole64_end,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "qemu/bswap.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "hw/pci-host/pnv_phb3_regs.h"
|
||||
#include "hw/pci-host/pnv_phb.h"
|
||||
#include "hw/pci-host/pnv_phb3.h"
|
||||
@@ -1164,12 +1165,12 @@ static void pnv_phb3_root_bus_class_init(ObjectClass *klass, const void *data)
|
||||
{
|
||||
BusClass *k = BUS_CLASS(klass);
|
||||
|
||||
object_class_property_add(klass, "phb-id", "uint32",
|
||||
object_class_property_add(klass, "phb-id", "uint32", &uint32_type_info,
|
||||
pnv_phb3_root_bus_get_prop,
|
||||
pnv_phb3_root_bus_set_prop,
|
||||
NULL, NULL);
|
||||
|
||||
object_class_property_add(klass, "chip-id", "uint32",
|
||||
object_class_property_add(klass, "chip-id", "uint32", &uint32_type_info,
|
||||
pnv_phb3_root_bus_get_prop,
|
||||
pnv_phb3_root_bus_set_prop,
|
||||
NULL, NULL);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "qemu/bswap.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "target/ppc/cpu.h"
|
||||
#include "hw/pci-host/pnv_phb4_regs.h"
|
||||
#include "hw/pci-host/pnv_phb4.h"
|
||||
@@ -2215,12 +2216,12 @@ static void pnv_phb4_root_bus_class_init(ObjectClass *klass, const void *data)
|
||||
{
|
||||
BusClass *k = BUS_CLASS(klass);
|
||||
|
||||
object_class_property_add(klass, "phb-id", "uint32",
|
||||
object_class_property_add(klass, "phb-id", "uint32", &uint32_type_info,
|
||||
pnv_phb4_root_bus_get_prop,
|
||||
pnv_phb4_root_bus_set_prop,
|
||||
NULL, NULL);
|
||||
|
||||
object_class_property_add(klass, "chip-id", "uint32",
|
||||
object_class_property_add(klass, "chip-id", "uint32", &uint32_type_info,
|
||||
pnv_phb4_root_bus_get_prop,
|
||||
pnv_phb4_root_bus_set_prop,
|
||||
NULL, NULL);
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "hw/core/qdev-properties.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/module.h"
|
||||
|
||||
@@ -227,18 +228,22 @@ static void q35_host_initfn(Object *obj)
|
||||
Q35_PCI_HOST_HOLE64_SIZE_DEFAULT);
|
||||
|
||||
object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32",
|
||||
&uint32_type_info,
|
||||
q35_host_get_pci_hole_start,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32",
|
||||
&uint32_type_info,
|
||||
q35_host_get_pci_hole_end,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64",
|
||||
&uint64_type_info,
|
||||
q35_host_get_pci_hole64_start,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64",
|
||||
&uint64_type_info,
|
||||
q35_host_get_pci_hole64_end,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "pci-internal.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
|
||||
#include "hw/xen/xen.h"
|
||||
#include "hw/i386/kvm/xen_evtchn.h"
|
||||
@@ -81,6 +82,7 @@ static void prop_pci_busnr_get(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
static const PropertyInfo prop_pci_busnr = {
|
||||
.type = "busnr",
|
||||
.qapi_type = &uint8_type_info,
|
||||
.get = prop_pci_busnr_get,
|
||||
};
|
||||
|
||||
|
||||
+18
-1
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "system/hw_accel.h"
|
||||
@@ -60,6 +61,7 @@ typedef struct SpaprCapabilityInfo {
|
||||
ObjectPropertyAccessor *get;
|
||||
ObjectPropertyAccessor *set;
|
||||
const char *type;
|
||||
const QAPITypeInfo *qapi_type;
|
||||
/* Possible values if this is a custom string type */
|
||||
SpaprCapPossible *possible;
|
||||
/* Make sure the virtual hardware can support this capability */
|
||||
@@ -726,6 +728,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_bool,
|
||||
.set = spapr_cap_set_bool,
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.apply = cap_htm_apply,
|
||||
},
|
||||
[SPAPR_CAP_VSX] = {
|
||||
@@ -735,6 +738,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_bool,
|
||||
.set = spapr_cap_set_bool,
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.apply = cap_vsx_apply,
|
||||
},
|
||||
[SPAPR_CAP_DFP] = {
|
||||
@@ -744,6 +748,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_bool,
|
||||
.set = spapr_cap_set_bool,
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.apply = cap_dfp_apply,
|
||||
},
|
||||
[SPAPR_CAP_CFPC] = {
|
||||
@@ -753,6 +758,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_string,
|
||||
.set = spapr_cap_set_string,
|
||||
.type = "string",
|
||||
.qapi_type = &str_type_info,
|
||||
.possible = &cap_cfpc_possible,
|
||||
.apply = cap_safe_cache_apply,
|
||||
},
|
||||
@@ -763,6 +769,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_string,
|
||||
.set = spapr_cap_set_string,
|
||||
.type = "string",
|
||||
.qapi_type = &str_type_info,
|
||||
.possible = &cap_sbbc_possible,
|
||||
.apply = cap_safe_bounds_check_apply,
|
||||
},
|
||||
@@ -775,6 +782,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_string,
|
||||
.set = spapr_cap_set_string,
|
||||
.type = "string",
|
||||
.qapi_type = &str_type_info,
|
||||
.possible = &cap_ibs_possible,
|
||||
.apply = cap_safe_indirect_branch_apply,
|
||||
},
|
||||
@@ -785,6 +793,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_pagesize,
|
||||
.set = spapr_cap_set_pagesize,
|
||||
.type = "int",
|
||||
.qapi_type = &size_type_info,
|
||||
.apply = cap_hpt_maxpagesize_apply,
|
||||
.cpu_apply = cap_hpt_maxpagesize_cpu_apply,
|
||||
},
|
||||
@@ -795,6 +804,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_bool,
|
||||
.set = spapr_cap_set_bool,
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.apply = cap_nested_kvm_hv_apply,
|
||||
},
|
||||
[SPAPR_CAP_NESTED_PAPR] = {
|
||||
@@ -804,6 +814,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_bool,
|
||||
.set = spapr_cap_set_bool,
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.apply = cap_nested_papr_apply,
|
||||
},
|
||||
[SPAPR_CAP_LARGE_DECREMENTER] = {
|
||||
@@ -813,6 +824,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_bool,
|
||||
.set = spapr_cap_set_bool,
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.apply = cap_large_decr_apply,
|
||||
.cpu_apply = cap_large_decr_cpu_apply,
|
||||
},
|
||||
@@ -823,6 +835,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_bool,
|
||||
.set = spapr_cap_set_bool,
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.apply = cap_ccf_assist_apply,
|
||||
},
|
||||
[SPAPR_CAP_FWNMI] = {
|
||||
@@ -832,6 +845,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_bool,
|
||||
.set = spapr_cap_set_bool,
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.apply = cap_fwnmi_apply,
|
||||
},
|
||||
[SPAPR_CAP_RPT_INVALIDATE] = {
|
||||
@@ -841,6 +855,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_bool,
|
||||
.set = spapr_cap_set_bool,
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.apply = cap_rpt_invalidate_apply,
|
||||
},
|
||||
[SPAPR_CAP_AIL_MODE_3] = {
|
||||
@@ -850,6 +865,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_bool,
|
||||
.set = spapr_cap_set_bool,
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.apply = cap_ail_mode_3_apply,
|
||||
},
|
||||
[SPAPR_CAP_DAWR1] = {
|
||||
@@ -859,6 +875,7 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
|
||||
.get = spapr_cap_get_bool,
|
||||
.set = spapr_cap_set_bool,
|
||||
.type = "bool",
|
||||
.qapi_type = &bool_type_info,
|
||||
.apply = cap_dawr1_apply,
|
||||
},
|
||||
};
|
||||
@@ -1069,7 +1086,7 @@ void spapr_caps_add_properties(SpaprMachineClass *smc)
|
||||
g_autofree char *name = g_strdup_printf("cap-%s", cap->name);
|
||||
g_autofree char *desc = g_strdup(cap->description);
|
||||
|
||||
object_class_property_add(klass, name, cap->type,
|
||||
object_class_property_add(klass, name, cap->type, cap->qapi_type,
|
||||
cap->get, cap->set,
|
||||
NULL, cap);
|
||||
|
||||
|
||||
+4
-3
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qobject/qnull.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "hw/ppc/spapr_drc.h"
|
||||
@@ -584,9 +585,9 @@ static void spapr_dr_connector_instance_init(Object *obj)
|
||||
SpaprDrcClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
|
||||
|
||||
object_property_add_uint32_ptr(obj, "id", &drc->id, OBJ_PROP_FLAG_READ);
|
||||
object_property_add(obj, "index", "uint32", prop_get_index,
|
||||
NULL, NULL, NULL);
|
||||
object_property_add(obj, "fdt", "struct", prop_get_fdt,
|
||||
object_property_add(obj, "index", "uint32", &uint32_type_info,
|
||||
prop_get_index, NULL, NULL, NULL);
|
||||
object_property_add(obj, "fdt", "struct", &any_type_info, prop_get_fdt,
|
||||
NULL, NULL, NULL);
|
||||
drc->state = drck->empty_state;
|
||||
}
|
||||
|
||||
+22
-3
@@ -33,6 +33,9 @@
|
||||
#include "migration/vmstate.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-events-misc.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qemu/module.h"
|
||||
|
||||
@@ -131,9 +134,23 @@ static void rtas_set_time_of_day(PowerPCCPU *cpu, SpaprMachineState *spapr,
|
||||
rtas_st(rets, 0, RTAS_OUT_SUCCESS);
|
||||
}
|
||||
|
||||
static void spapr_rtc_qom_date(Object *obj, struct tm *current_tm, Error **errp)
|
||||
static void spapr_rtc_qom_date(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
spapr_rtc_read(SPAPR_RTC(obj), current_tm, NULL);
|
||||
struct tm value;
|
||||
StructTm tm, *tmp = &tm;
|
||||
|
||||
spapr_rtc_read(SPAPR_RTC(obj), &value, NULL);
|
||||
|
||||
tm = (StructTm) {
|
||||
.tm_year = value.tm_year,
|
||||
.tm_mon = value.tm_mon,
|
||||
.tm_mday = value.tm_mday,
|
||||
.tm_hour = value.tm_hour,
|
||||
.tm_min = value.tm_min,
|
||||
.tm_sec = value.tm_sec,
|
||||
};
|
||||
visit_type_StructTm(v, name, &tmp, errp);
|
||||
}
|
||||
|
||||
static void spapr_rtc_realize(DeviceState *dev, Error **errp)
|
||||
@@ -150,7 +167,9 @@ static void spapr_rtc_realize(DeviceState *dev, Error **errp)
|
||||
rtc_ns = qemu_clock_get_ns(rtc_clock);
|
||||
rtc->ns_offset = host_s * NANOSECONDS_PER_SECOND - rtc_ns;
|
||||
|
||||
object_property_add_tm(OBJECT(rtc), "date", spapr_rtc_qom_date);
|
||||
object_property_add(OBJECT(rtc), "date", "struct tm",
|
||||
&StructTm_type_info,
|
||||
spapr_rtc_qom_date, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_spapr_rtc = {
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "hw/core/boards.h"
|
||||
#include "hw/remote/machine.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-type-infos-sockets.h"
|
||||
#include "qapi/qapi-visit-sockets.h"
|
||||
#include "qapi/qapi-events-misc.h"
|
||||
#include "qemu/notify.h"
|
||||
@@ -931,7 +932,8 @@ static void vfu_object_class_init(ObjectClass *klass, const void *data)
|
||||
|
||||
k->nr_devs = 0;
|
||||
|
||||
object_class_property_add(klass, "socket", "SocketAddress", NULL,
|
||||
object_class_property_add(klass, "socket", "SocketAddress",
|
||||
&SocketAddress_type_info, NULL,
|
||||
vfu_object_set_socket, NULL, NULL);
|
||||
object_class_property_set_description(klass, "socket",
|
||||
"SocketAddress "
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "qemu/units.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/core/boards.h"
|
||||
#include "hw/core/loader.h"
|
||||
@@ -744,6 +745,7 @@ static void microchip_icicle_kit_machine_class_init(ObjectClass *oc,
|
||||
mc->default_ram_size = 1537 * MiB;
|
||||
|
||||
object_class_property_add(oc, "clint-timebase-frequency", "uint32_t",
|
||||
&uint32_type_info,
|
||||
microchip_icicle_kit_get_clint_timebase_freq,
|
||||
microchip_icicle_kit_set_clint_timebase_freq,
|
||||
NULL, NULL);
|
||||
|
||||
+15
-25
@@ -58,7 +58,7 @@
|
||||
#include "hw/pci-host/gpex.h"
|
||||
#include "hw/display/ramfb.h"
|
||||
#include "hw/acpi/aml-build.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "hw/virtio/virtio-iommu.h"
|
||||
#include "hw/uefi/var-service-api.h"
|
||||
|
||||
@@ -1055,38 +1055,28 @@ bool virt_is_iommu_sys_enabled(RISCVVirtState *s)
|
||||
return s->iommu_sys == ON_OFF_AUTO_ON;
|
||||
}
|
||||
|
||||
static void virt_get_iommu_sys(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int virt_get_iommu_sys(Object *obj, Error **errp)
|
||||
{
|
||||
RISCVVirtState *s = RISCV_VIRT_MACHINE(obj);
|
||||
OnOffAuto iommu_sys = s->iommu_sys;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &iommu_sys, errp);
|
||||
return s->iommu_sys;
|
||||
}
|
||||
|
||||
static void virt_set_iommu_sys(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void virt_set_iommu_sys(Object *obj, int value, Error **errp)
|
||||
{
|
||||
RISCVVirtState *s = RISCV_VIRT_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &s->iommu_sys, errp);
|
||||
s->iommu_sys = value;
|
||||
}
|
||||
|
||||
static void virt_get_acpi(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static int virt_get_acpi(Object *obj, Error **errp)
|
||||
{
|
||||
RISCVVirtState *s = RISCV_VIRT_MACHINE(obj);
|
||||
OnOffAuto acpi = s->acpi;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &acpi, errp);
|
||||
return s->acpi;
|
||||
}
|
||||
|
||||
static void virt_set_acpi(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
static void virt_set_acpi(Object *obj, int value, Error **errp)
|
||||
{
|
||||
RISCVVirtState *s = RISCV_VIRT_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &s->acpi, errp);
|
||||
s->acpi = value;
|
||||
}
|
||||
|
||||
static const HotplugHandler *
|
||||
@@ -1184,15 +1174,15 @@ static void virt_machine_class_init(ObjectClass *oc, const void *data)
|
||||
object_class_property_set_description(oc, "aia-guests", str);
|
||||
}
|
||||
|
||||
object_class_property_add(oc, "acpi", "OnOffAuto",
|
||||
virt_get_acpi, virt_set_acpi,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, "acpi", "OnOffAuto",
|
||||
&OnOffAuto_type_info, virt_get_acpi,
|
||||
virt_set_acpi);
|
||||
object_class_property_set_description(oc, "acpi",
|
||||
"Enable ACPI");
|
||||
|
||||
object_class_property_add(oc, "iommu-sys", "OnOffAuto",
|
||||
virt_get_iommu_sys, virt_set_iommu_sys,
|
||||
NULL, NULL);
|
||||
object_class_property_add_enum(oc, "iommu-sys", "OnOffAuto",
|
||||
&OnOffAuto_type_info, virt_get_iommu_sys,
|
||||
virt_set_iommu_sys);
|
||||
object_class_property_set_description(oc, "iommu-sys",
|
||||
"Enable IOMMU platform device");
|
||||
}
|
||||
|
||||
+20
-3
@@ -42,6 +42,8 @@
|
||||
#include "migration/vmstate.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-events-misc.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "qapi/qapi-visit-common.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "trace.h"
|
||||
|
||||
@@ -854,12 +856,25 @@ static const MemoryRegionOps cmos_ops = {
|
||||
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||
};
|
||||
|
||||
static void rtc_get_date(Object *obj, struct tm *current_tm, Error **errp)
|
||||
static void rtc_get_date(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
MC146818RtcState *s = MC146818_RTC(obj);
|
||||
struct tm value;
|
||||
StructTm tm, *tmp = &tm;
|
||||
|
||||
rtc_update_time(s);
|
||||
rtc_get_time(s, current_tm);
|
||||
rtc_get_time(s, &value);
|
||||
|
||||
tm = (StructTm) {
|
||||
.tm_year = value.tm_year,
|
||||
.tm_mon = value.tm_mon,
|
||||
.tm_mday = value.tm_mday,
|
||||
.tm_hour = value.tm_hour,
|
||||
.tm_min = value.tm_min,
|
||||
.tm_sec = value.tm_sec,
|
||||
};
|
||||
visit_type_StructTm(v, name, &tmp, errp);
|
||||
}
|
||||
|
||||
static void rtc_realizefn(DeviceState *dev, Error **errp)
|
||||
@@ -1019,7 +1034,9 @@ static void rtc_class_initfn(ObjectClass *klass, const void *data)
|
||||
device_class_set_props(dc, mc146818rtc_properties);
|
||||
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
|
||||
|
||||
object_class_property_add_tm(klass, "date", rtc_get_date);
|
||||
object_class_property_add(klass, "date", "struct tm",
|
||||
&StructTm_type_info,
|
||||
rtc_get_date, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static const TypeInfo mc146818rtc_info = {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/ctype.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
|
||||
static void ccw_device_refill_ids(CcwDevice *dev)
|
||||
{
|
||||
@@ -75,6 +76,7 @@ static void ccw_device_set_loadparm(Object *obj, Visitor *v,
|
||||
|
||||
const PropertyInfo ccw_loadparm = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "Up to 8 chars in set of [A-Za-z0-9. ] to select"
|
||||
" a guest kernel",
|
||||
.get = ccw_device_get_loadparm,
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "hw/s390x/s390-virtio-ccw.h"
|
||||
#include "hw/s390x/s390-ccw.h"
|
||||
#include "exec/cpu-common.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
|
||||
typedef struct CrwContainer {
|
||||
CRW crw;
|
||||
@@ -2531,6 +2532,7 @@ out:
|
||||
|
||||
const PropertyInfo css_devid_propinfo = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "Identifier of an I/O device in the channel "
|
||||
"subsystem, example: fe.1.23ab",
|
||||
.get = get_css_devid,
|
||||
@@ -2539,6 +2541,7 @@ const PropertyInfo css_devid_propinfo = {
|
||||
|
||||
const PropertyInfo css_devid_ro_propinfo = {
|
||||
.type = "str",
|
||||
.qapi_type = &str_type_info,
|
||||
.description = "Read-only identifier of an I/O device in the channel "
|
||||
"subsystem, example: fe.1.23ab",
|
||||
.get = get_css_devid,
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "system/runstate.h"
|
||||
|
||||
#include "trace.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
|
||||
S390pciState *s390_get_phb(void)
|
||||
{
|
||||
@@ -1853,6 +1854,7 @@ static void s390_pci_set_fid(Object *obj, Visitor *v, const char *name,
|
||||
|
||||
static const PropertyInfo s390_pci_fid_propinfo = {
|
||||
.type = "uint32",
|
||||
.qapi_type = &uint32_type_info,
|
||||
.description = "zpci_fid",
|
||||
.get = s390_pci_get_fid,
|
||||
.set = s390_pci_set_fid,
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
#include "system/hostmem.h"
|
||||
#include "target/s390x/kvm/pv.h"
|
||||
#include "migration/blocker.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/qapi-type-infos-machine-s390x.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qapi/qapi-visit-machine-s390x.h"
|
||||
#include "hw/s390x/cpu-topology.h"
|
||||
@@ -908,7 +910,7 @@ static void ccw_machine_class_init(ObjectClass *oc, const void *data)
|
||||
object_class_property_set_description(oc, "dea-key-wrap",
|
||||
"enable/disable DEA key wrapping using the CPACF wrapping key");
|
||||
|
||||
object_class_property_add(oc, "loadparm", "loadparm",
|
||||
object_class_property_add(oc, "loadparm", "loadparm", &str_type_info,
|
||||
machine_get_loadparm, machine_set_loadparm,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, "loadparm",
|
||||
@@ -917,6 +919,7 @@ static void ccw_machine_class_init(ObjectClass *oc, const void *data)
|
||||
" and guest kernel");
|
||||
|
||||
object_class_property_add(oc, "boot-certs", "BootCertificatesList",
|
||||
&BootCertificatesList_type_info,
|
||||
machine_get_boot_certs, machine_set_boot_certs, NULL, NULL);
|
||||
object_class_property_set_description(oc, "boot-certs",
|
||||
"provide paths to a directory and/or a certificate file for secure boot");
|
||||
|
||||
+6
-2
@@ -53,6 +53,7 @@
|
||||
#include "qemu/timer.h"
|
||||
#include "hw/s390x/event-facility.h"
|
||||
#include "hw/s390x/ebcdic.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/qapi-visit-machine.h"
|
||||
#include "qapi/qapi-events-machine-s390x.h"
|
||||
#include "migration/vmstate.h"
|
||||
@@ -195,12 +196,15 @@ static void cpi_class_init(ObjectClass *klass, const void *data)
|
||||
"name of the cluster which the VM belongs to, if any"
|
||||
" e.g. \"PLEX \"");
|
||||
|
||||
object_class_property_add(klass, "system_level", "uint64", get_system_level,
|
||||
object_class_property_add(klass, "system_level", "uint64",
|
||||
&uint64_type_info,
|
||||
get_system_level,
|
||||
NULL, NULL, NULL);
|
||||
object_class_property_set_description(klass, "system_level",
|
||||
"distribution and kernel version in Linux e.g. 74872343805430528");
|
||||
|
||||
object_class_property_add(klass, "timestamp", "uint64", get_timestamp,
|
||||
object_class_property_add(klass, "timestamp", "uint64", &uint64_type_info,
|
||||
get_timestamp,
|
||||
NULL, NULL, NULL);
|
||||
object_class_property_set_description(klass, "timestamp",
|
||||
"latest update of CPI data in nanoseconds since the UNIX EPOCH");
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "hw/core/qdev-properties.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qemu/module.h"
|
||||
#include "virtio-ccw-mem.h"
|
||||
#include "hw/mem/memory-device.h"
|
||||
@@ -206,6 +207,7 @@ static void virtio_ccw_mem_instance_init(Object *obj)
|
||||
object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, OBJECT(&dev->vdev),
|
||||
VIRTIO_MEM_SIZE_PROP);
|
||||
object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size",
|
||||
&size_type_info,
|
||||
virtio_ccw_mem_get_requested_size,
|
||||
virtio_ccw_mem_set_requested_size, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qom/object.h"
|
||||
@@ -642,14 +643,17 @@ static void adc128d818_initfn(Object *obj)
|
||||
for (unsigned ch = 0u; ch < ADC128D818_NUM_CHANNELS; ch++) {
|
||||
char *name = g_strdup_printf("ain%u", ch);
|
||||
|
||||
object_property_add(obj, name, "int", adc128d818_get_ain,
|
||||
object_property_add(obj, name, "int", &int_type_info,
|
||||
adc128d818_get_ain,
|
||||
adc128d818_set_ain, NULL, NULL);
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
object_property_add(obj, "temperature", "int", adc128d818_get_temperature,
|
||||
object_property_add(obj, "temperature", "int", &int_type_info,
|
||||
adc128d818_get_temperature,
|
||||
adc128d818_set_temperature, NULL, NULL);
|
||||
object_property_add(obj, "ext-vref-mv", "int", adc128d818_get_ext_vref,
|
||||
object_property_add(obj, "ext-vref-mv", "int", &int_type_info,
|
||||
adc128d818_get_ext_vref,
|
||||
adc128d818_set_ext_vref, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -14,6 +14,7 @@
|
||||
#include "hw/core/irq.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qemu/module.h"
|
||||
@@ -217,7 +218,7 @@ static void adm1266_init(Object *obj)
|
||||
for (int i = 0; i < ADM1266_NUM_PAGES; i++) {
|
||||
pmbus_page_config(pmdev, i, flags);
|
||||
|
||||
object_property_add(obj, "vout[*]", "uint16",
|
||||
object_property_add(obj, "vout[*]", "uint16", &uint16_type_info,
|
||||
adm1266_get,
|
||||
adm1266_set, NULL, &pmdev->pages[i].read_vout);
|
||||
}
|
||||
|
||||
+5
-4
@@ -12,6 +12,7 @@
|
||||
#include "hw/core/irq.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qemu/module.h"
|
||||
@@ -493,19 +494,19 @@ static void adm1272_init(Object *obj)
|
||||
|
||||
pmbus_page_config(pmdev, 0, flags);
|
||||
|
||||
object_property_add(obj, "vin", "uint16",
|
||||
object_property_add(obj, "vin", "uint16", &uint16_type_info,
|
||||
adm1272_get,
|
||||
adm1272_set, NULL, &pmdev->pages[0].read_vin);
|
||||
|
||||
object_property_add(obj, "vout", "uint16",
|
||||
object_property_add(obj, "vout", "uint16", &uint16_type_info,
|
||||
adm1272_get,
|
||||
adm1272_set, NULL, &pmdev->pages[0].read_vout);
|
||||
|
||||
object_property_add(obj, "iout", "uint16",
|
||||
object_property_add(obj, "iout", "uint16", &uint16_type_info,
|
||||
adm1272_get,
|
||||
adm1272_set, NULL, &pmdev->pages[0].read_iout);
|
||||
|
||||
object_property_add(obj, "pin", "uint16",
|
||||
object_property_add(obj, "pin", "uint16", &uint16_type_info,
|
||||
adm1272_get,
|
||||
adm1272_set, NULL, &pmdev->pages[0].read_pin);
|
||||
|
||||
|
||||
+5
-4
@@ -22,6 +22,7 @@
|
||||
#include "hw/i2c/i2c.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qom/object.h"
|
||||
@@ -251,16 +252,16 @@ static void emc141x_reset(DeviceState *dev)
|
||||
|
||||
static void emc141x_initfn(Object *obj)
|
||||
{
|
||||
object_property_add(obj, "temperature0", "int",
|
||||
object_property_add(obj, "temperature0", "int", &int_type_info,
|
||||
emc141x_get_temperature,
|
||||
emc141x_set_temperature, NULL, NULL);
|
||||
object_property_add(obj, "temperature1", "int",
|
||||
object_property_add(obj, "temperature1", "int", &int_type_info,
|
||||
emc141x_get_temperature,
|
||||
emc141x_set_temperature, NULL, NULL);
|
||||
object_property_add(obj, "temperature2", "int",
|
||||
object_property_add(obj, "temperature2", "int", &int_type_info,
|
||||
emc141x_get_temperature,
|
||||
emc141x_set_temperature, NULL, NULL);
|
||||
object_property_add(obj, "temperature3", "int",
|
||||
object_property_add(obj, "temperature3", "int", &int_type_info,
|
||||
emc141x_get_temperature,
|
||||
emc141x_set_temperature, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "hw/sensor/isl_pmbus_vr.h"
|
||||
#include "hw/core/qdev-properties.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qemu/module.h"
|
||||
@@ -136,63 +137,63 @@ static void isl_pmbus_vr_add_props(Object *obj, uint64_t *flags, uint8_t pages)
|
||||
PMBusDevice *pmdev = PMBUS_DEVICE(obj);
|
||||
for (int i = 0; i < pages; i++) {
|
||||
if (flags[i] & PB_HAS_VIN) {
|
||||
object_property_add(obj, "vin[*]", "uint16",
|
||||
object_property_add(obj, "vin[*]", "uint16", &uint16_type_info,
|
||||
isl_pmbus_vr_get,
|
||||
isl_pmbus_vr_set,
|
||||
NULL, &pmdev->pages[i].read_vin);
|
||||
}
|
||||
|
||||
if (flags[i] & PB_HAS_VOUT) {
|
||||
object_property_add(obj, "vout[*]", "uint16",
|
||||
object_property_add(obj, "vout[*]", "uint16", &uint16_type_info,
|
||||
isl_pmbus_vr_get,
|
||||
isl_pmbus_vr_set,
|
||||
NULL, &pmdev->pages[i].read_vout);
|
||||
}
|
||||
|
||||
if (flags[i] & PB_HAS_IIN) {
|
||||
object_property_add(obj, "iin[*]", "uint16",
|
||||
object_property_add(obj, "iin[*]", "uint16", &uint16_type_info,
|
||||
isl_pmbus_vr_get,
|
||||
isl_pmbus_vr_set,
|
||||
NULL, &pmdev->pages[i].read_iin);
|
||||
}
|
||||
|
||||
if (flags[i] & PB_HAS_IOUT) {
|
||||
object_property_add(obj, "iout[*]", "uint16",
|
||||
object_property_add(obj, "iout[*]", "uint16", &uint16_type_info,
|
||||
isl_pmbus_vr_get,
|
||||
isl_pmbus_vr_set,
|
||||
NULL, &pmdev->pages[i].read_iout);
|
||||
}
|
||||
|
||||
if (flags[i] & PB_HAS_PIN) {
|
||||
object_property_add(obj, "pin[*]", "uint16",
|
||||
object_property_add(obj, "pin[*]", "uint16", &uint16_type_info,
|
||||
isl_pmbus_vr_get,
|
||||
isl_pmbus_vr_set,
|
||||
NULL, &pmdev->pages[i].read_pin);
|
||||
}
|
||||
|
||||
if (flags[i] & PB_HAS_POUT) {
|
||||
object_property_add(obj, "pout[*]", "uint16",
|
||||
object_property_add(obj, "pout[*]", "uint16", &uint16_type_info,
|
||||
isl_pmbus_vr_get,
|
||||
isl_pmbus_vr_set,
|
||||
NULL, &pmdev->pages[i].read_pout);
|
||||
}
|
||||
|
||||
if (flags[i] & PB_HAS_TEMPERATURE) {
|
||||
object_property_add(obj, "temp1[*]", "uint16",
|
||||
object_property_add(obj, "temp1[*]", "uint16", &uint16_type_info,
|
||||
isl_pmbus_vr_get,
|
||||
isl_pmbus_vr_set,
|
||||
NULL, &pmdev->pages[i].read_temperature_1);
|
||||
}
|
||||
|
||||
if (flags[i] & PB_HAS_TEMP2) {
|
||||
object_property_add(obj, "temp2[*]", "uint16",
|
||||
object_property_add(obj, "temp2[*]", "uint16", &uint16_type_info,
|
||||
isl_pmbus_vr_get,
|
||||
isl_pmbus_vr_set,
|
||||
NULL, &pmdev->pages[i].read_temperature_2);
|
||||
}
|
||||
|
||||
if (flags[i] & PB_HAS_TEMP3) {
|
||||
object_property_add(obj, "temp3[*]", "uint16",
|
||||
object_property_add(obj, "temp3[*]", "uint16", &uint16_type_info,
|
||||
isl_pmbus_vr_get,
|
||||
isl_pmbus_vr_set,
|
||||
NULL, &pmdev->pages[i].read_temperature_3);
|
||||
|
||||
+13
-12
@@ -25,6 +25,7 @@
|
||||
#include "hw/i2c/i2c.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/log.h"
|
||||
@@ -509,21 +510,21 @@ static void lsm303dlhc_mag_reset(DeviceState *dev)
|
||||
*/
|
||||
static void lsm303dlhc_mag_initfn(Object *obj)
|
||||
{
|
||||
object_property_add(obj, "mag-x", "int",
|
||||
lsm303dlhc_mag_get_x,
|
||||
lsm303dlhc_mag_set_x, NULL, NULL);
|
||||
object_property_add(obj, "mag-x", "int", &int_type_info,
|
||||
lsm303dlhc_mag_get_x,
|
||||
lsm303dlhc_mag_set_x, NULL, NULL);
|
||||
|
||||
object_property_add(obj, "mag-y", "int",
|
||||
lsm303dlhc_mag_get_y,
|
||||
lsm303dlhc_mag_set_y, NULL, NULL);
|
||||
object_property_add(obj, "mag-y", "int", &int_type_info,
|
||||
lsm303dlhc_mag_get_y,
|
||||
lsm303dlhc_mag_set_y, NULL, NULL);
|
||||
|
||||
object_property_add(obj, "mag-z", "int",
|
||||
lsm303dlhc_mag_get_z,
|
||||
lsm303dlhc_mag_set_z, NULL, NULL);
|
||||
object_property_add(obj, "mag-z", "int", &int_type_info,
|
||||
lsm303dlhc_mag_get_z,
|
||||
lsm303dlhc_mag_set_z, NULL, NULL);
|
||||
|
||||
object_property_add(obj, "temperature", "int",
|
||||
lsm303dlhc_mag_get_temperature,
|
||||
lsm303dlhc_mag_set_temperature, NULL, NULL);
|
||||
object_property_add(obj, "temperature", "int", &int_type_info,
|
||||
lsm303dlhc_mag_get_temperature,
|
||||
lsm303dlhc_mag_set_temperature, NULL, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "hw/core/irq.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/log.h"
|
||||
#include "qemu/module.h"
|
||||
@@ -727,7 +728,7 @@ static void max34451_init(Object *obj)
|
||||
|
||||
/* get and set the voltage in millivolts, max is 32767 mV */
|
||||
for (int i = 0; i < MAX34451_NUM_PWR_DEVICES; i++) {
|
||||
object_property_add(obj, "vout[*]", "uint16",
|
||||
object_property_add(obj, "vout[*]", "uint16", &uint16_type_info,
|
||||
max34451_get,
|
||||
max34451_set, NULL, &pmdev->pages[i].read_vout);
|
||||
}
|
||||
@@ -737,7 +738,7 @@ static void max34451_init(Object *obj)
|
||||
* centidegrees Celsius i.e.: 2500 -> 25.00 C, max is 327.67 C
|
||||
*/
|
||||
for (int i = 0; i < MAX34451_NUM_TEMP_DEVICES; i++) {
|
||||
object_property_add(obj, "temperature[*]", "uint16",
|
||||
object_property_add(obj, "temperature[*]", "uint16", &uint16_type_info,
|
||||
max34451_get,
|
||||
max34451_set,
|
||||
NULL,
|
||||
|
||||
+2
-1
@@ -28,6 +28,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qom/object.h"
|
||||
#include "hw/sensor/tmp105.h"
|
||||
@@ -408,7 +409,7 @@ static void tmp105_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
static void tmp105_initfn(Object *obj)
|
||||
{
|
||||
object_property_add(obj, "temperature", "int",
|
||||
object_property_add(obj, "temperature", "int", &int_type_info,
|
||||
tmp105_get_temperature,
|
||||
tmp105_set_temperature, NULL, NULL);
|
||||
object_property_set_description(obj, "temperature",
|
||||
|
||||
+5
-4
@@ -28,6 +28,7 @@
|
||||
#include "hw/i2c/i2c.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "qemu/module.h"
|
||||
#include "qom/object.h"
|
||||
@@ -350,16 +351,16 @@ static void tmp421_class_init(ObjectClass *klass, const void *data)
|
||||
dc->vmsd = &vmstate_tmp421;
|
||||
sc->dev = (DeviceInfo *) data;
|
||||
|
||||
object_class_property_add(klass, "temperature0", "int",
|
||||
object_class_property_add(klass, "temperature0", "int", &int_type_info,
|
||||
tmp421_get_temperature,
|
||||
tmp421_set_temperature, NULL, NULL);
|
||||
object_class_property_add(klass, "temperature1", "int",
|
||||
object_class_property_add(klass, "temperature1", "int", &int_type_info,
|
||||
tmp421_get_temperature,
|
||||
tmp421_set_temperature, NULL, NULL);
|
||||
object_class_property_add(klass, "temperature2", "int",
|
||||
object_class_property_add(klass, "temperature2", "int", &int_type_info,
|
||||
tmp421_get_temperature,
|
||||
tmp421_set_temperature, NULL, NULL);
|
||||
object_class_property_add(klass, "temperature3", "int",
|
||||
object_class_property_add(klass, "temperature3", "int", &int_type_info,
|
||||
tmp421_get_temperature,
|
||||
tmp421_set_temperature, NULL, NULL);
|
||||
}
|
||||
|
||||
+3
-12
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-type-infos-common.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "scsi/constants.h"
|
||||
#include "hw/core/irq.h"
|
||||
@@ -3234,17 +3235,6 @@ static void ufs_init_hc(UfsHc *u)
|
||||
ufs_fault_inject_init(u);
|
||||
}
|
||||
|
||||
const QEnumLookup UfsFaultInjectMode_lookup = {
|
||||
.array = (const char *const[]) {
|
||||
[UFS_FAULT_INJECT_ABORT_SUCCESS] = "abort-success",
|
||||
[UFS_FAULT_INJECT_ABORT_FAILED] = "abort-failed",
|
||||
[UFS_FAULT_INJECT_IN_TRANSITION] = "in-transition",
|
||||
[UFS_FAULT_INJECT_TIMEOUT] = "timeout",
|
||||
[UFS_FAULT_INJECT_SSU_TIMEOUT] = "ssu-timeout",
|
||||
},
|
||||
.size = UFS_FAULT_INJECT_MODE_MAX,
|
||||
};
|
||||
|
||||
static void ufs_prop_get_fault_inject_tag(Object *obj, Visitor *v,
|
||||
const char *name, void *opaque,
|
||||
Error **errp)
|
||||
@@ -3300,6 +3290,7 @@ static void ufs_prop_set_default_fault_inject_tag(ObjectProperty *op,
|
||||
|
||||
const PropertyInfo ufs_prop_fault_inject_tag = {
|
||||
.type = "uint32",
|
||||
.qapi_type = &uint32_type_info,
|
||||
.description = "Task tag to hold for fault injection",
|
||||
.get = ufs_prop_get_fault_inject_tag,
|
||||
.set = ufs_prop_set_fault_inject_tag,
|
||||
@@ -3309,9 +3300,9 @@ const PropertyInfo ufs_prop_fault_inject_tag = {
|
||||
|
||||
const PropertyInfo ufs_prop_fault_inject_mode = {
|
||||
.type = "UfsFaultInjectMode",
|
||||
.qapi_type = &UfsFaultInjectMode_type_info,
|
||||
.description = "Fault injection mode: abort-success, abort-failed, "
|
||||
"in-transition, timeout, ssu-timeout",
|
||||
.enum_table = &UfsFaultInjectMode_lookup,
|
||||
.get = qdev_propinfo_get_enum,
|
||||
.set = qdev_propinfo_set_enum,
|
||||
.set_default_value = qdev_propinfo_set_default_value_enum,
|
||||
|
||||
@@ -90,39 +90,6 @@ typedef struct UfsLu {
|
||||
UfsScsiOp scsi_op;
|
||||
} UfsLu;
|
||||
|
||||
/*
|
||||
* Fault injection modes for x-fault-inject-mode property.
|
||||
* Controls how the held transfer request and subsequent Task Management
|
||||
* Request (TMR) are resolved by the controller:
|
||||
*
|
||||
* UFS_FAULT_INJECT_ABORT_SUCCESS: TMR ABORT_TASK aborts the held request,
|
||||
* clears its state, and returns SUCCESS
|
||||
* (COMPL).
|
||||
* UFS_FAULT_INJECT_ABORT_FAILED: TMR ABORT_TASK returns
|
||||
* TASK_MANAGEMENT_FUNC_FAILED, forcing host
|
||||
* driver to escalate to Host Reset.
|
||||
* UFS_FAULT_INJECT_IN_TRANSITION: TMR QUERY_TASK releases the held request to
|
||||
* execute normally through the SCSI layer and
|
||||
* returns the real task status (SUCCEEDED while
|
||||
* the command is still in flight);
|
||||
* ABORT_TASK cancels the held request and
|
||||
* returns FUNCTION_COMPLETE.
|
||||
* UFS_FAULT_INJECT_TIMEOUT: TMR ABORT_TASK does not complete or clear
|
||||
* doorbell, triggering hardware-level TMR
|
||||
* timeout.
|
||||
* UFS_FAULT_INJECT_SSU_TIMEOUT: Intercepts SCSI START_STOP (0x1B) commands
|
||||
* targeting the UFS Device WLUN when
|
||||
* x-fault-inject-tag is armed.
|
||||
*/
|
||||
typedef enum UfsFaultInjectMode {
|
||||
UFS_FAULT_INJECT_ABORT_SUCCESS = 0,
|
||||
UFS_FAULT_INJECT_ABORT_FAILED,
|
||||
UFS_FAULT_INJECT_IN_TRANSITION,
|
||||
UFS_FAULT_INJECT_TIMEOUT,
|
||||
UFS_FAULT_INJECT_SSU_TIMEOUT,
|
||||
UFS_FAULT_INJECT_MODE_MAX,
|
||||
} UfsFaultInjectMode;
|
||||
|
||||
/*
|
||||
* Sentinel values for x-fault-inject-tag property.
|
||||
* Task Tags in UFS are 8-bit (0..255). Values >= 256 are reserved as
|
||||
@@ -375,6 +342,5 @@ void ufs_unrealize(UfsHc *u);
|
||||
|
||||
extern const PropertyInfo ufs_prop_fault_inject_tag;
|
||||
extern const PropertyInfo ufs_prop_fault_inject_mode;
|
||||
extern const QEnumLookup UfsFaultInjectMode_lookup;
|
||||
|
||||
#endif /* HW_UFS_UFS_H */
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/usb/usb.h"
|
||||
#include "hw/usb/desc.h"
|
||||
@@ -122,7 +123,7 @@ out:
|
||||
|
||||
static void usb_msd_instance_init(Object *obj)
|
||||
{
|
||||
object_property_add(obj, "bootindex", "int32",
|
||||
object_property_add(obj, "bootindex", "int32", &int32_type_info,
|
||||
usb_msd_get_bootindex,
|
||||
usb_msd_set_bootindex, NULL, NULL);
|
||||
object_property_set_int(obj, "bootindex", -1, NULL);
|
||||
|
||||
+3
-1
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include <sys/ioctl.h>
|
||||
#include "qapi/qapi-type-infos-sockets.h"
|
||||
#include "qapi-visit-sockets.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
||||
@@ -471,7 +472,8 @@ static void vfio_user_pci_class_init(ObjectClass *klass, const void *data)
|
||||
device_class_set_legacy_reset(dc, vfio_user_pci_reset);
|
||||
device_class_set_props(dc, vfio_user_pci_properties);
|
||||
|
||||
object_class_property_add(klass, "socket", "SocketAddress", NULL,
|
||||
object_class_property_add(klass, "socket", "SocketAddress",
|
||||
&SocketAddress_type_info, NULL,
|
||||
vfio_user_pci_set_socket, NULL, NULL);
|
||||
object_class_property_set_description(klass, "socket",
|
||||
"SocketAddress (UNIX sockets only)");
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "pci.h"
|
||||
#include "pci-quirks.h"
|
||||
#include "trace.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
|
||||
/*
|
||||
* List of device ids/vendor ids for which to disable
|
||||
@@ -1437,6 +1438,7 @@ static void set_nv_gpudirect_clique_id(Object *obj, Visitor *v,
|
||||
|
||||
const PropertyInfo qdev_prop_nv_gpudirect_clique = {
|
||||
.type = "uint8",
|
||||
.qapi_type = &uint8_type_info,
|
||||
.description = "NVIDIA GPUDirect Clique ID (0 - 15)",
|
||||
.get = get_nv_gpudirect_clique_id,
|
||||
.set = set_nv_gpudirect_clique_id,
|
||||
|
||||
+31
-54
@@ -27,7 +27,10 @@
|
||||
#include "hw/virtio/virtio-balloon.h"
|
||||
#include "system/address-spaces.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/qapi-events-machine.h"
|
||||
#include "qapi/qapi-type-infos-machine.h"
|
||||
#include "qapi/qapi-visit-machine.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "trace.h"
|
||||
#include "qemu/error-report.h"
|
||||
@@ -169,34 +172,6 @@ static void balloon_deflate_page(VirtIOBalloon *balloon,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* All stats upto VIRTIO_BALLOON_S_NR /must/ have a
|
||||
* non-NULL name declared here, since these are used
|
||||
* as keys for populating the QDict with stats
|
||||
*/
|
||||
static const char *balloon_stat_names[] = {
|
||||
[VIRTIO_BALLOON_S_SWAP_IN] = "stat-swap-in",
|
||||
[VIRTIO_BALLOON_S_SWAP_OUT] = "stat-swap-out",
|
||||
[VIRTIO_BALLOON_S_MAJFLT] = "stat-major-faults",
|
||||
[VIRTIO_BALLOON_S_MINFLT] = "stat-minor-faults",
|
||||
[VIRTIO_BALLOON_S_MEMFREE] = "stat-free-memory",
|
||||
|
||||
[VIRTIO_BALLOON_S_MEMTOT] = "stat-total-memory",
|
||||
[VIRTIO_BALLOON_S_AVAIL] = "stat-available-memory",
|
||||
[VIRTIO_BALLOON_S_CACHES] = "stat-disk-caches",
|
||||
[VIRTIO_BALLOON_S_HTLB_PGALLOC] = "stat-htlb-pgalloc",
|
||||
[VIRTIO_BALLOON_S_HTLB_PGFAIL] = "stat-htlb-pgfail",
|
||||
|
||||
[VIRTIO_BALLOON_S_OOM_KILL] = "stat-oom-kills",
|
||||
[VIRTIO_BALLOON_S_ALLOC_STALL] = "stat-alloc-stalls",
|
||||
[VIRTIO_BALLOON_S_ASYNC_SCAN] = "stat-async-scans",
|
||||
[VIRTIO_BALLOON_S_DIRECT_SCAN] = "stat-direct-scans",
|
||||
[VIRTIO_BALLOON_S_ASYNC_RECLAIM] = "stat-async-reclaims",
|
||||
|
||||
[VIRTIO_BALLOON_S_DIRECT_RECLAIM] = "stat-direct-reclaims",
|
||||
};
|
||||
G_STATIC_ASSERT(G_N_ELEMENTS(balloon_stat_names) == VIRTIO_BALLOON_S_NR);
|
||||
|
||||
/*
|
||||
* reset_stats - Mark all items in the stats array as unset
|
||||
*
|
||||
@@ -257,33 +232,33 @@ static void balloon_stats_get_all(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
VirtIOBalloon *s = VIRTIO_BALLOON(obj);
|
||||
bool ok = false;
|
||||
int i;
|
||||
VirtioBalloonStats stats = {
|
||||
.stat_swap_in = s->stats[VIRTIO_BALLOON_S_SWAP_IN],
|
||||
.stat_swap_out = s->stats[VIRTIO_BALLOON_S_SWAP_OUT],
|
||||
.stat_major_faults = s->stats[VIRTIO_BALLOON_S_MAJFLT],
|
||||
.stat_minor_faults = s->stats[VIRTIO_BALLOON_S_MINFLT],
|
||||
.stat_free_memory = s->stats[VIRTIO_BALLOON_S_MEMFREE],
|
||||
.stat_total_memory = s->stats[VIRTIO_BALLOON_S_MEMTOT],
|
||||
.stat_available_memory = s->stats[VIRTIO_BALLOON_S_AVAIL],
|
||||
.stat_disk_caches = s->stats[VIRTIO_BALLOON_S_CACHES],
|
||||
.stat_htlb_pgalloc = s->stats[VIRTIO_BALLOON_S_HTLB_PGALLOC],
|
||||
.stat_htlb_pgfail = s->stats[VIRTIO_BALLOON_S_HTLB_PGFAIL],
|
||||
.stat_oom_kills = s->stats[VIRTIO_BALLOON_S_OOM_KILL],
|
||||
.stat_alloc_stalls = s->stats[VIRTIO_BALLOON_S_ALLOC_STALL],
|
||||
.stat_async_scans = s->stats[VIRTIO_BALLOON_S_ASYNC_SCAN],
|
||||
.stat_direct_scans = s->stats[VIRTIO_BALLOON_S_DIRECT_SCAN],
|
||||
.stat_async_reclaims = s->stats[VIRTIO_BALLOON_S_ASYNC_RECLAIM],
|
||||
.stat_direct_reclaims = s->stats[VIRTIO_BALLOON_S_DIRECT_RECLAIM],
|
||||
};
|
||||
/* Update VirtioBalloonStats QAPI type when new stats are added */
|
||||
G_STATIC_ASSERT(VIRTIO_BALLOON_S_NR == 16);
|
||||
VirtioBalloonGuestStats guest_stats = {
|
||||
.last_update = s->stats_last_update,
|
||||
.stats = &stats,
|
||||
};
|
||||
VirtioBalloonGuestStats *argp = &guest_stats;
|
||||
|
||||
if (!visit_start_struct(v, name, NULL, 0, errp)) {
|
||||
return;
|
||||
}
|
||||
if (!visit_type_int(v, "last-update", &s->stats_last_update, errp)) {
|
||||
goto out_end;
|
||||
}
|
||||
|
||||
if (!visit_start_struct(v, "stats", NULL, 0, errp)) {
|
||||
goto out_end;
|
||||
}
|
||||
for (i = 0; i < VIRTIO_BALLOON_S_NR; i++) {
|
||||
if (!visit_type_uint64(v, balloon_stat_names[i], &s->stats[i], errp)) {
|
||||
goto out_nested;
|
||||
}
|
||||
}
|
||||
ok = visit_check_struct(v, errp);
|
||||
out_nested:
|
||||
visit_end_struct(v, NULL);
|
||||
|
||||
if (ok) {
|
||||
visit_check_struct(v, errp);
|
||||
}
|
||||
out_end:
|
||||
visit_end_struct(v, NULL);
|
||||
visit_type_VirtioBalloonGuestStats(v, name, &argp, errp);
|
||||
}
|
||||
|
||||
static void balloon_stats_get_poll_interval(Object *obj, Visitor *v,
|
||||
@@ -1037,9 +1012,11 @@ static void virtio_balloon_instance_init(Object *obj)
|
||||
s->free_page_hint_notify.notify = virtio_balloon_free_page_hint_notify;
|
||||
|
||||
object_property_add(obj, "guest-stats", "guest statistics",
|
||||
&VirtioBalloonGuestStats_type_info,
|
||||
balloon_stats_get_all, NULL, NULL, NULL);
|
||||
|
||||
object_property_add(obj, "guest-stats-polling-interval", "int",
|
||||
&int_type_info,
|
||||
balloon_stats_get_poll_interval,
|
||||
balloon_stats_set_poll_interval,
|
||||
NULL, NULL);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "virtio-mem-pci.h"
|
||||
#include "hw/mem/memory-device.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/qapi-events-machine.h"
|
||||
#include "qapi/qapi-events-misc.h"
|
||||
|
||||
@@ -212,6 +213,7 @@ static void virtio_mem_pci_instance_init(Object *obj)
|
||||
object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, OBJECT(&dev->vdev),
|
||||
VIRTIO_MEM_SIZE_PROP);
|
||||
object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size",
|
||||
&size_type_info,
|
||||
virtio_mem_pci_get_requested_size,
|
||||
virtio_mem_pci_set_requested_size, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "hw/virtio/virtio-bus.h"
|
||||
#include "hw/virtio/virtio-mem.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "migration/misc.h"
|
||||
#include "hw/core/boards.h"
|
||||
@@ -1533,12 +1534,16 @@ static void virtio_mem_instance_init(Object *obj)
|
||||
|
||||
notifier_list_init(&vmem->size_change_notifiers);
|
||||
|
||||
object_property_add(obj, VIRTIO_MEM_SIZE_PROP, "size", virtio_mem_get_size,
|
||||
object_property_add(obj, VIRTIO_MEM_SIZE_PROP, "size",
|
||||
&size_type_info,
|
||||
virtio_mem_get_size,
|
||||
NULL, NULL, NULL);
|
||||
object_property_add(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, "size",
|
||||
&size_type_info,
|
||||
virtio_mem_get_requested_size,
|
||||
virtio_mem_set_requested_size, NULL, NULL);
|
||||
object_property_add(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, "size",
|
||||
&size_type_info,
|
||||
virtio_mem_get_block_size, virtio_mem_set_block_size,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/qapi-builtin-type-infos.h"
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/core/boards.h"
|
||||
#include "hw/core/irq.h"
|
||||
@@ -414,6 +415,7 @@ void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc)
|
||||
#define OC_MEMMAP_PROP_BASE(c, prop_name, name) \
|
||||
do { \
|
||||
object_class_property_add(c, prop_name "-base", "uint64_t", \
|
||||
&uint64_type_info, \
|
||||
xen_pvh_get_ ## name ## _base, \
|
||||
xen_pvh_set_ ## name ## _base, NULL, NULL); \
|
||||
object_class_property_set_description(oc, prop_name "-base", \
|
||||
@@ -423,6 +425,7 @@ do { \
|
||||
#define OC_MEMMAP_PROP_SIZE(c, prop_name, name) \
|
||||
do { \
|
||||
object_class_property_add(c, prop_name "-size", "uint64_t", \
|
||||
&uint64_type_info, \
|
||||
xen_pvh_get_ ## name ## _size, \
|
||||
xen_pvh_set_ ## name ## _size, NULL, NULL); \
|
||||
object_class_property_set_description(oc, prop_name "-size", \
|
||||
@@ -459,6 +462,7 @@ do { \
|
||||
OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high);
|
||||
|
||||
object_class_property_add(oc, "pci-intx-irq-base", "uint32_t",
|
||||
&uint32_type_info,
|
||||
xen_pvh_get_pci_intx_irq_base,
|
||||
xen_pvh_set_pci_intx_irq_base,
|
||||
NULL, NULL);
|
||||
@@ -469,6 +473,7 @@ do { \
|
||||
#ifdef CONFIG_TPM
|
||||
if (xpc->has_tpm) {
|
||||
object_class_property_add(oc, "tpm-base-addr", "uint64_t",
|
||||
&uint64_type_info,
|
||||
xen_pvh_get_tpm_base,
|
||||
xen_pvh_set_tpm_base,
|
||||
NULL, NULL);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef QEMU_CHAR_H
|
||||
#define QEMU_CHAR_H
|
||||
|
||||
#include "qapi/qapi-type-infos-char.h"
|
||||
#include "qapi/qapi-types-char.h"
|
||||
#include "qemu/bitmap.h"
|
||||
#include "qemu/thread.h"
|
||||
@@ -357,7 +358,7 @@ static inline void chardev_vc_add_encoding_prop(ObjectClass *oc,
|
||||
void (*set)(Object *, int, Error **))
|
||||
{
|
||||
object_class_property_add_enum(oc, "encoding", "ChardevVCEncoding",
|
||||
&ChardevVCEncoding_lookup, get, set);
|
||||
&ChardevVCEncoding_type_info, get, set);
|
||||
}
|
||||
|
||||
#endif
|
||||
Loaded 100 of 163 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user