qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kirillov <lekiravi@yandex-team.ru>
To: Jason Wang <jasowang@redhat.com>, Markus Armbruster <armbru@redhat.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Stefan Weil <sw@weilnetz.de>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Vincenzo Maffione <v.maffione@gmail.com>,
	"yc-core@yandex-team.ru" <yc-core@yandex-team.ru>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Giuseppe Lettieri <g.lettieri@iet.unipi.it>,
	Luigi Rizzo <rizzo@iet.unipi.it>
Subject: Re: [PATCH v5 3/4] hmp: Use QMP query-netdev in hmp_info_network
Date: Wed, 16 Dec 2020 12:16:40 +0300	[thread overview]
Message-ID: <185411608109901@mail.yandex-team.ru> (raw)
In-Reply-To: <92845450.36204439.1608098282759.JavaMail.zimbra@redhat.com>


16.12.2020, 08:58, "Jason Wang" <jasowang@redhat.com>:
> ----- Original Message -----
>>  Jason Wang <jasowang@redhat.com> writes:
>>
>>  [...]
>>  > One more stupid question, instead of generating the string via hard
>>  > codes, is there any method (dict?) to iterate all the key/values
>>  > automatically?
>>
>>  QAPI visitors.
>>
>>  The lazy way: use the QObject output visitor to convert the QAPI type
>>  (here: NetdevInfo) to QObject, then qobject_to_json() to convert to
>>  JSON text.
>>
>>  If you don't want JSON, replace qobject_to_json(). Perhaps you can
>>  create something that's generally useful for HMP, not just "info
>>  network". I'd pick keyval_parse() syntax.
>>
>>  The detour through QObject creates and destroys a rather fat temporary
>>  data structure. Tolerable when the amount of data is small. An output
>>  visitor that directly creates the string is more efficient. Takes a bit
>>  more code, though. I intend to post one for JSON, to reduce QMP's
>>  malloc gluttony.
>
> Thanks a lot for the answer.
>
> Alexey, let's try what Markus suggested here.

Thanks for information.
I will do so and send a new version of the patchset.

-- 
Alexey Kirillov
Yandex.Cloud


  reply	other threads:[~2020-12-16  9:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-08 23:59 [PATCH v5 0/4] Introducing QMP query-netdev command Alexey Kirillov
2020-11-08 23:59 ` [PATCH v5 1/4] qapi: net: Add " Alexey Kirillov
2020-11-08 23:59 ` [PATCH v5 2/4] tests: Add tests for " Alexey Kirillov
2020-11-08 23:59 ` [PATCH v5 3/4] hmp: Use QMP query-netdev in hmp_info_network Alexey Kirillov
2020-12-07  5:52   ` Jason Wang
2020-12-14 17:14     ` Alexey Kirillov
2020-12-15  4:16       ` Jason Wang
2020-12-15  8:39     ` Markus Armbruster
2020-12-16  5:58       ` Jason Wang
2020-12-16  9:16         ` Alexey Kirillov [this message]
2020-11-08 23:59 ` [PATCH v5 4/4] net: Do not use legacy info_str for backends Alexey Kirillov
2020-11-23 15:19 ` [PATCH v5 0/4] Introducing QMP query-netdev command Alexey Kirillov

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=185411608109901@mail.yandex-team.ru \
    --to=lekiravi@yandex-team.ru \
    --cc=armbru@redhat.com \
    --cc=g.lettieri@iet.unipi.it \
    --cc=jasowang@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rizzo@iet.unipi.it \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=sw@weilnetz.de \
    --cc=thuth@redhat.com \
    --cc=v.maffione@gmail.com \
    --cc=yc-core@yandex-team.ru \
    /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).