net: add packet length to NetPacketSent callback
virtio-net needs this - for the same purpose that it currently uses the return value from qemu_sendv_packet(). Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
0df0ff6de7
commit
783527a9ef
4
net.c
4
net.c
@ -472,7 +472,7 @@ void qemu_flush_queued_packets(VLANClientState *vc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (packet->sent_cb)
|
if (packet->sent_cb)
|
||||||
packet->sent_cb(packet->sender);
|
packet->sent_cb(packet->sender, ret);
|
||||||
|
|
||||||
qemu_free(packet);
|
qemu_free(packet);
|
||||||
}
|
}
|
||||||
@ -1138,7 +1138,7 @@ static ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void tap_send_completed(VLANClientState *vc)
|
static void tap_send_completed(VLANClientState *vc, ssize_t len)
|
||||||
{
|
{
|
||||||
TAPState *s = vc->opaque;
|
TAPState *s = vc->opaque;
|
||||||
tap_read_poll(s, 1);
|
tap_read_poll(s, 1);
|
||||||
|
2
net.h
2
net.h
@ -32,7 +32,7 @@ struct VLANClientState {
|
|||||||
|
|
||||||
typedef struct VLANPacket VLANPacket;
|
typedef struct VLANPacket VLANPacket;
|
||||||
|
|
||||||
typedef void (NetPacketSent) (VLANClientState *);
|
typedef void (NetPacketSent) (VLANClientState *, ssize_t);
|
||||||
|
|
||||||
struct VLANPacket {
|
struct VLANPacket {
|
||||||
struct VLANPacket *next;
|
struct VLANPacket *next;
|
||||||
|
Loading…
Reference in New Issue
Block a user