diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2022-07-21 11:13:01 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2022-07-21 11:13:01 +0100 |
commit | 5288bee45fbd33203b61f8c76e41b15bb5913e6e (patch) | |
tree | e1ffe86238a1f386eecf134befcfe92ba6e79d85 /accel | |
parent | fe16c833fdb74642c296fa96a472e39229cd4351 (diff) | |
parent | 3746b8ca3e8bc216d03df5813080eeb06bdafabb (diff) |
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* Boolean statistics for KVM
* Fix build on Haiku
# gpg: Signature made Tue 19 Jul 2022 10:32:34 BST
# gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg: issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1
# Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83
* tag 'for-upstream' of https://gitlab.com/bonzini/qemu:
util: Fix broken build on Haiku
kvm: add support for boolean statistics
monitor: add support for boolean statistics
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'accel')
-rw-r--r-- | accel/kvm/kvm-all.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 3187656570..99aede73b7 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3769,6 +3769,7 @@ static StatsList *add_kvmstat_entry(struct kvm_stats_desc *pdesc, case KVM_STATS_UNIT_BYTES: case KVM_STATS_UNIT_CYCLES: case KVM_STATS_UNIT_SECONDS: + case KVM_STATS_UNIT_BOOLEAN: break; default: return stats_list; @@ -3787,7 +3788,10 @@ static StatsList *add_kvmstat_entry(struct kvm_stats_desc *pdesc, stats->name = g_strdup(pdesc->name); stats->value = g_new0(StatsValue, 1);; - if (pdesc->size == 1) { + if ((pdesc->flags & KVM_STATS_UNIT_MASK) == KVM_STATS_UNIT_BOOLEAN) { + stats->value->u.boolean = *stats_data; + stats->value->type = QTYPE_QBOOL; + } else if (pdesc->size == 1) { stats->value->u.scalar = *stats_data; stats->value->type = QTYPE_QNUM; } else { @@ -3835,6 +3839,10 @@ static StatsSchemaValueList *add_kvmschema_entry(struct kvm_stats_desc *pdesc, switch (pdesc->flags & KVM_STATS_UNIT_MASK) { case KVM_STATS_UNIT_NONE: break; + case KVM_STATS_UNIT_BOOLEAN: + schema_entry->value->has_unit = true; + schema_entry->value->unit = STATS_UNIT_BOOLEAN; + break; case KVM_STATS_UNIT_BYTES: schema_entry->value->has_unit = true; schema_entry->value->unit = STATS_UNIT_BYTES; |