Commit 783527a9ef5429837685744b3661318588f07890

Authored by Mark McLoughlin
Committed by Anthony Liguori
1 parent 0df0ff6d

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>
Showing 2 changed files with 3 additions and 3 deletions
@@ -472,7 +472,7 @@ void qemu_flush_queued_packets(VLANClientState *vc) @@ -472,7 +472,7 @@ void qemu_flush_queued_packets(VLANClientState *vc)
472 } 472 }
473 473
474 if (packet->sent_cb) 474 if (packet->sent_cb)
475 - packet->sent_cb(packet->sender); 475 + packet->sent_cb(packet->sender, ret);
476 476
477 qemu_free(packet); 477 qemu_free(packet);
478 } 478 }
@@ -1138,7 +1138,7 @@ static ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen) @@ -1138,7 +1138,7 @@ static ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen)
1138 } 1138 }
1139 #endif 1139 #endif
1140 1140
1141 -static void tap_send_completed(VLANClientState *vc) 1141 +static void tap_send_completed(VLANClientState *vc, ssize_t len)
1142 { 1142 {
1143 TAPState *s = vc->opaque; 1143 TAPState *s = vc->opaque;
1144 tap_read_poll(s, 1); 1144 tap_read_poll(s, 1);
@@ -32,7 +32,7 @@ struct VLANClientState { @@ -32,7 +32,7 @@ struct VLANClientState {
32 32
33 typedef struct VLANPacket VLANPacket; 33 typedef struct VLANPacket VLANPacket;
34 34
35 -typedef void (NetPacketSent) (VLANClientState *); 35 +typedef void (NetPacketSent) (VLANClientState *, ssize_t);
36 36
37 struct VLANPacket { 37 struct VLANPacket {
38 struct VLANPacket *next; 38 struct VLANPacket *next;