dump.c (cebea510579ed43724156cc596a8ff14ba208740) dump.c (f394b2e20d9a666fb194fb692179a0eeaca5daea)
1/*
2 * QEMU System Emulator
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 158 unchanged lines hidden (view full) ---

167static void dumpclient_cleanup(NetClientState *nc)
168{
169 DumpNetClient *dc = DO_UPCAST(DumpNetClient, nc, nc);
170
171 dump_cleanup(&dc->ds);
172}
173
174static NetClientInfo net_dump_info = {
1/*
2 * QEMU System Emulator
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 158 unchanged lines hidden (view full) ---

167static void dumpclient_cleanup(NetClientState *nc)
168{
169 DumpNetClient *dc = DO_UPCAST(DumpNetClient, nc, nc);
170
171 dump_cleanup(&dc->ds);
172}
173
174static NetClientInfo net_dump_info = {
175 .type = NET_CLIENT_OPTIONS_KIND_DUMP,
175 .type = NET_CLIENT_DRIVER_DUMP,
176 .size = sizeof(DumpNetClient),
177 .receive = dumpclient_receive,
178 .receive_iov = dumpclient_receive_iov,
179 .cleanup = dumpclient_cleanup,
180};
181
182int net_init_dump(const Netdev *netdev, const char *name,
183 NetClientState *peer, Error **errp)
184{
185 int len, rc;
186 const char *file;
187 char def_file[128];
188 const NetdevDumpOptions *dump;
189 NetClientState *nc;
190 DumpNetClient *dnc;
191
176 .size = sizeof(DumpNetClient),
177 .receive = dumpclient_receive,
178 .receive_iov = dumpclient_receive_iov,
179 .cleanup = dumpclient_cleanup,
180};
181
182int net_init_dump(const Netdev *netdev, const char *name,
183 NetClientState *peer, Error **errp)
184{
185 int len, rc;
186 const char *file;
187 char def_file[128];
188 const NetdevDumpOptions *dump;
189 NetClientState *nc;
190 DumpNetClient *dnc;
191
192 assert(netdev->opts->type == NET_CLIENT_OPTIONS_KIND_DUMP);
193 dump = netdev->opts->u.dump.data;
192 assert(netdev->type == NET_CLIENT_DRIVER_DUMP);
193 dump = &netdev->u.dump;
194
195 assert(peer);
196
197 if (dump->has_file) {
198 file = dump->file;
199 } else {
200 int id;
201 int ret;

--- 163 unchanged lines hidden ---
194
195 assert(peer);
196
197 if (dump->has_file) {
198 file = dump->file;
199 } else {
200 int id;
201 int ret;

--- 163 unchanged lines hidden ---