mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
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:
parent
3c3b656885
commit
59b5437eb7
11 changed files with 47 additions and 49 deletions
|
@ -327,8 +327,7 @@ static int net_vhost_user_init(NetClientState *peer, const char *device,
|
|||
user = g_new0(struct VhostUserState, 1);
|
||||
for (i = 0; i < queues; i++) {
|
||||
nc = qemu_new_net_client(&net_vhost_user_info, peer, device, name);
|
||||
snprintf(nc->info_str, sizeof(nc->info_str), "vhost-user%d to %s",
|
||||
i, chr->label);
|
||||
nc->info_str = g_strdup_printf("vhost-user%d to %s", i, chr->label);
|
||||
nc->queue_index = i;
|
||||
if (!nc0) {
|
||||
nc0 = nc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue