[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] net: add print link status of nics in print_net
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH] net: add print link status of nics in print_net_client function |
Date: |
Fri, 20 Oct 2017 00:13:34 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 10/19/2017 11:58 PM, ZhiPeng Lu wrote:
> We can directly know the information of vm by executing "info network"
> command,
> including the link state of nics, without excuting other commands again.
"executing"
>
> Signed-off-by: ZhiPeng Lu <address@hidden>
> Reviewed-by: Jiyun Fan <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> net/net.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/net/net.c b/net/net.c
> index 39ef546..9e349cb 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -1298,10 +1298,14 @@ void print_net_client(Monitor *mon, NetClientState
> *nc)
> {
> NetFilterState *nf;
>
> - monitor_printf(mon, "%s: index=%d,type=%s,%s\n", nc->name,
> + monitor_printf(mon, "%s: index=%d,type=%s,%s", nc->name,
> nc->queue_index,
> NetClientDriver_str(nc->info->type),
> nc->info_str);
> + if (nc->info->type == NET_CLIENT_DRIVER_NIC) {
> + monitor_printf(mon, ",link status:%s", nc->link_down ? "down" :
> "up");
> + }
> + monitor_printf(mon, "\n");
> if (!QTAILQ_EMPTY(&nc->filters)) {
> monitor_printf(mon, "filters:\n");
> }
>