From: Laurent Vivier <lvivier@redhat.com>
To: Alexey Kirillov <lekiravi@yandex-team.ru>,
Eric Blake <eblake@redhat.com>, Thomas Huth <huth@tuxfamily.org>,
Markus Armbruster <armbru@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
qemu-devel@nongnu.org, "Vincenzo Maffione" <v.maffione@gmail.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"Sven Schnelle" <svens@stackframe.org>,
"Rob Herring" <robh@kernel.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Paul Durrant" <paul@xen.org>, "Joel Stanley" <joel@jms.id.au>,
"Anthony Perard" <anthony.perard@citrix.com>,
"Samuel Thibault" <samuel.thibault@ens-lyon.org>,
"Aleksandar Rikalo" <aleksandar.rikalo@rt-rk.com>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Jiri Pirko" <jiri@resnulli.us>,
yc-core@yandex-team.ru, "Stefan Weil" <sw@weilnetz.de>,
"Alistair Francis" <alistair@alistair23.me>,
"Beniamino Galvani" <b.galvani@gmail.com>,
qemu-arm@nongnu.org, "Peter Chubb" <peter.chubb@nicta.com.au>,
"Cédric Le Goater" <clg@kaod.org>,
xen-devel@lists.xenproject.org,
"Giuseppe Lettieri" <g.lettieri@iet.unipi.it>,
"Luigi Rizzo" <rizzo@iet.unipi.it>,
"Richard Henderson" <rth@twiddle.net>,
"Andrew Jeffery" <andrew@aj.id.au>,
"Michael Walle" <michael@walle.cc>,
qemu-ppc@nongnu.org,
"Aleksandar Markovic" <amarkovic@wavecomp.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH v2 1/4] qapi: net: Add query-netdevs command
Date: Wed, 4 Mar 2020 16:57:11 +0100 [thread overview]
Message-ID: <274ce4fc-f7ef-791c-7c25-c99b694c1e78@redhat.com> (raw)
In-Reply-To: <20200304130656.16859-2-lekiravi@yandex-team.ru>
On 04/03/2020 14:06, Alexey Kirillov wrote:
> Add a qmp command that provides information about currently attached
> network devices and their configuration.
>
> Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru>
> ---
> include/net/net.h | 1 +
> net/hub.c | 8 +++
> net/l2tpv3.c | 19 +++++++
> net/net.c | 91 +++++++++++++++++++++++++++++++++
> net/netmap.c | 13 +++++
> net/slirp.c | 126 ++++++++++++++++++++++++++++++++++++++++++++++
> net/socket.c | 71 ++++++++++++++++++++++++++
> net/tap-win32.c | 9 ++++
> net/tap.c | 103 +++++++++++++++++++++++++++++++++++--
> net/vde.c | 26 ++++++++++
> net/vhost-user.c | 18 +++++--
> qapi/net.json | 89 ++++++++++++++++++++++++++++++++
> 12 files changed, 566 insertions(+), 8 deletions(-)
>
...
> diff --git a/net/net.c b/net/net.c
> index 9e93c3f8a1..01e0548295 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -54,6 +54,7 @@
> #include "sysemu/sysemu.h"
> #include "net/filter.h"
> #include "qapi/string-output-visitor.h"
> +#include "qapi/clone-visitor.h"
>
> /* Net bridge is currently not supported for W32. */
> #if !defined(_WIN32)
> @@ -128,6 +129,12 @@ char *qemu_mac_strdup_printf(const uint8_t *macaddr)
>
> void qemu_format_nic_info_str(NetClientState *nc, uint8_t macaddr[6])
> {
> + g_assert(nc->stored_config);
> +
> + g_free(nc->stored_config->u.nic.macaddr);
> + nc->stored_config->u.nic.macaddr = g_strdup_printf(MAC_FMT,
> + MAC_ARG(macaddr));
> +
Why do you use this rather than the qemu_mac_strdup_printf() function
defined above?
qemu_mac_strdup_printf():
890ee6abb385 ("net: add MAC address string printer")
MAC_FMT/MAC_ARG:
6d1d4939a647 ("net: Add macros for MAC address tracing")
MAC_FMT/MAC_ARG seems to be reserved for tracing.
Thanks,
Laurent
next prev parent reply other threads:[~2020-03-04 15:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 13:06 [PATCH v2 0/4] Introducing QMP query-netdevs command Alexey Kirillov
2020-03-04 13:06 ` [PATCH v2 1/4] qapi: net: Add " Alexey Kirillov
2020-03-04 15:57 ` Laurent Vivier [this message]
2020-03-05 14:25 ` Alexey Kirillov
2020-03-05 12:02 ` Markus Armbruster
2020-03-05 14:26 ` Alexey Kirillov
2020-06-23 9:59 ` Alexey Kirillov
2020-03-04 13:06 ` [PATCH v2 2/4] tests: Add tests for " Alexey Kirillov
2020-03-04 13:06 ` [PATCH v2 3/4] hmp: Use QMP query-netdevs in hmp_info_network Alexey Kirillov
2020-03-04 13:06 ` [PATCH v2 4/4] net: Remove field info_str of NetClientState Alexey Kirillov
2020-03-04 15:41 ` Laurent Vivier
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=274ce4fc-f7ef-791c-7c25-c99b694c1e78@redhat.com \
--to=lvivier@redhat.com \
--cc=aleksandar.rikalo@rt-rk.com \
--cc=alistair@alistair23.me \
--cc=amarkovic@wavecomp.com \
--cc=andrew@aj.id.au \
--cc=anthony.perard@citrix.com \
--cc=armbru@redhat.com \
--cc=b.galvani@gmail.com \
--cc=clg@kaod.org \
--cc=david@gibson.dropbear.id.au \
--cc=dmitry.fleytman@gmail.com \
--cc=eblake@redhat.com \
--cc=edgar.iglesias@gmail.com \
--cc=g.lettieri@iet.unipi.it \
--cc=huth@tuxfamily.org \
--cc=jasowang@redhat.com \
--cc=jiri@resnulli.us \
--cc=joel@jms.id.au \
--cc=kraxel@redhat.com \
--cc=lekiravi@yandex-team.ru \
--cc=michael@walle.cc \
--cc=mst@redhat.com \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=peter.chubb@nicta.com.au \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rizzo@iet.unipi.it \
--cc=robh@kernel.org \
--cc=rth@twiddle.net \
--cc=samuel.thibault@ens-lyon.org \
--cc=sstabellini@kernel.org \
--cc=svens@stackframe.org \
--cc=sw@weilnetz.de \
--cc=v.maffione@gmail.com \
--cc=xen-devel@lists.xenproject.org \
--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).