Revert "qapi: net: Add query-netdev command"

Several issues has been reported for query-netdev series. Consider
it's late in the rc, this reverts commit
d32ad10a14.

Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
Jason Wang 2021-04-02 11:05:20 +08:00
parent 22317309df
commit f9bb0c1f98
12 changed files with 9 additions and 477 deletions

View file

@ -36,6 +36,7 @@
#include "monitor/monitor.h"
#include "qemu/help_option.h"
#include "qapi/qapi-commands-net.h"
#include "qapi/qapi-visit-net.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
@ -352,7 +353,6 @@ static void qemu_free_net_client(NetClientState *nc)
}
g_free(nc->name);
g_free(nc->model);
qapi_free_NetdevInfo(nc->stored_config);
if (nc->destructor) {
nc->destructor(nc);
}
@ -1289,34 +1289,6 @@ RxFilterInfoList *qmp_query_rx_filter(bool has_name, const char *name,
return filter_list;
}
NetdevInfoList *qmp_query_netdev(Error **errp)
{
NetdevInfoList *list = NULL;
NetClientState *nc;
QTAILQ_FOREACH(nc, &net_clients, next) {
/*
* Only look at netdevs (backend network devices), not for each queue
* or NIC / hubport
*/
if (nc->stored_config) {
NetdevInfo *element = QAPI_CLONE(NetdevInfo, nc->stored_config);
g_free(element->id); /* Need to dealloc empty id after clone */
element->id = g_strdup(nc->name);
element->has_peer_id = nc->peer != NULL;
if (element->has_peer_id) {
element->peer_id = g_strdup(nc->peer->name);
}
QAPI_LIST_PREPEND(list, element);
}
}
return list;
}
void hmp_info_network(Monitor *mon, const QDict *qdict)
{
NetClientState *nc, *peer;