net: Move NetClientState.info_str to dynamic allocations

The info_str field of the NetClientState structure is static and has a size
of 256 bytes. This amount is often unclaimed, and the field itself is used
exclusively for HMP "info network".

The patch translates info_str to dynamic memory allocation.

This action is also allows us to painlessly discard usage of this field
for backend devices.

Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru>
Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
Alexey Kirillov 2021-03-03 12:59:08 +03:00 committed by Jason Wang
parent 3c3b656885
commit 59b5437eb7
11 changed files with 47 additions and 49 deletions

View file

@ -94,7 +94,7 @@ struct NetClientState {
NetQueue *incoming_queue;
char *model;
char *name;
char info_str[256];
char *info_str;
NetdevInfo *stored_config;
unsigned receive_disabled : 1;
NetClientDestructor *destructor;