mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
Avoid embedding struct mbuf in other structures
struct mbuf uses a C99 open char array to allow inlining data. Inlining this in another structure is however a GNU extension. The inlines used so far in struct Slirp were actually only needed as head of struct mbuf lists. This replaces these inline with mere struct quehead, and use casts as appropriate. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
c17c07231e
commit
67e3eee454
5 changed files with 34 additions and 30 deletions
|
@ -82,6 +82,7 @@ void free(void *ptr);
|
|||
have different prototypes. */
|
||||
#define insque slirp_insque
|
||||
#define remque slirp_remque
|
||||
#define quehead slirp_quehead
|
||||
|
||||
#ifdef HAVE_SYS_STROPTS_H
|
||||
#include <sys/stropts.h>
|
||||
|
@ -197,12 +198,13 @@ struct Slirp {
|
|||
struct ex_list *exec_list;
|
||||
|
||||
/* mbuf states */
|
||||
struct mbuf m_freelist, m_usedlist;
|
||||
struct quehead m_freelist;
|
||||
struct quehead m_usedlist;
|
||||
int mbuf_alloced;
|
||||
|
||||
/* if states */
|
||||
struct mbuf if_fastq; /* fast queue (for interactive data) */
|
||||
struct mbuf if_batchq; /* queue for non-interactive data */
|
||||
struct quehead if_fastq; /* fast queue (for interactive data) */
|
||||
struct quehead if_batchq; /* queue for non-interactive data */
|
||||
struct mbuf *next_m; /* pointer to next mbuf to output */
|
||||
bool if_start_busy; /* avoid if_start recursion */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue