qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Mark Kanda <mark.kanda@oracle.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH v2 0/3] Support fd-based KVM stats
Date: Sat, 15 Jan 2022 17:22:55 +0100	[thread overview]
Message-ID: <4f7c1039-a602-fdc1-e5ad-0fab7100a917@redhat.com> (raw)
In-Reply-To: <20211119195153.11815-1-mark.kanda@oracle.com>

On 11/19/21 20:51, Mark Kanda wrote:
> v2: [Paolo]
> - generalize the interface
> - add support for querying stat schema and instances
> - add additional HMP semantic processing for a few exponent/unit
>    combinations (related to seconds and bytes)
> 
> This patchset adds QEMU support for querying fd-based KVM stats. The
> kernel support was introduced by:
> 
> cb082bfab59a ("KVM: stats: Add fd-based API to read binary stats data")

Hi Mark,

sorry for the late review.  Fortunately there's very little that I'd change.

In particular:

* please change the callbacks to accept a NULL name and type, instead of 
having the "bool"/"const char *" pair.  You can probably benefit from a 
function to cutils.c like

     bool qemu_match_string(const char *value, const char *request) {
         return !request || g_str_equal(value, request);
     }

* please pass a single const struct to add_stats_callbacks, using GList 
so that the struct can be const.

Putting both together it would be something like:

typedef struct StatsCallbacks {
     char *name;
     StatsList *(*get_values)(StatsList *list, const char *name,
                            const char *type, Error **errp);
     StatsSchemaList *(*get_schemas)(StatsSchemaList *list,
                                     const char *name, Error **errp);
     StatsInstanceList *(*get_instances)(StatsInstanceList *list,
                                         Error **errp);
} StatsCallbacks;

Finally, please put everything in a new header include/monitor/stats.h, 
so that we can document everything and please it in docs/devel.  I can 
take care of that though.

Thanks,

Paolo

> 
> Mark Kanda (3):
>    qmp: Support for querying stats
>    hmp: Support for querying stats
>    kvm: Support for querying fd-based stats
> 
>   accel/kvm/kvm-all.c       | 399 ++++++++++++++++++++++++++++++++++++++
>   hmp-commands-info.hx      |  40 ++++
>   include/monitor/hmp.h     |   3 +
>   include/monitor/monitor.h |  27 +++
>   monitor/hmp-cmds.c        | 125 ++++++++++++
>   monitor/qmp-cmds.c        |  71 +++++++
>   qapi/misc.json            | 142 ++++++++++++++
>   7 files changed, 807 insertions(+)
> 



  parent reply	other threads:[~2022-01-15 16:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 19:51 [PATCH v2 0/3] Support fd-based KVM stats Mark Kanda
2021-11-19 19:51 ` [PATCH v2 1/3] qmp: Support for querying stats Mark Kanda
2021-12-07 18:42   ` Daniel P. Berrangé
2022-01-17 12:05     ` Paolo Bonzini
2022-01-17 15:17       ` Mark Kanda
2022-01-18 12:26         ` Paolo Bonzini
2022-01-18 12:52           ` Daniel P. Berrangé
2022-01-18 13:59             ` Mark Kanda
2022-01-19  8:48               ` Paolo Bonzini
2022-01-18 14:47             ` Igor Mammedov
2022-01-19  8:43               ` Paolo Bonzini
2022-01-19  9:11                 ` Daniel P. Berrangé
2021-11-19 19:51 ` [PATCH v2 2/3] hmp: " Mark Kanda
2021-11-19 19:51 ` [PATCH v2 3/3] kvm: Support for querying fd-based stats Mark Kanda
2022-01-15 16:22 ` Paolo Bonzini [this message]
2022-01-16 23:17   ` [PATCH v2 0/3] Support fd-based KVM stats Mark Kanda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f7c1039-a602-fdc1-e5ad-0fab7100a917@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=mark.kanda@oracle.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).