mirror of
https://git.proxmox.com/git/qemu
synced 2025-07-19 14:01:56 +00:00
Merge remote-tracking branch 'stefanha/net' into staging
# By Amos Kong (1) and Sebastian Huber (1) # Via Stefan Hajnoczi * stefanha/net: virtio-net: fix the memory leak in rxfilter_notify() smc91c111: Fix receive starvation Message-id: 1384532032-19057-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
This commit is contained in:
commit
88a47b9de2
@ -185,6 +185,7 @@ static void smc91c111_release_packet(smc91c111_state *s, int packet)
|
|||||||
s->allocated &= ~(1 << packet);
|
s->allocated &= ~(1 << packet);
|
||||||
if (s->tx_alloc == 0x80)
|
if (s->tx_alloc == 0x80)
|
||||||
smc91c111_tx_alloc(s);
|
smc91c111_tx_alloc(s);
|
||||||
|
qemu_flush_queued_packets(qemu_get_queue(s->nic));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flush the TX FIFO. */
|
/* Flush the TX FIFO. */
|
||||||
|
@ -200,16 +200,16 @@ static void rxfilter_notify(NetClientState *nc)
|
|||||||
VirtIONet *n = qemu_get_nic_opaque(nc);
|
VirtIONet *n = qemu_get_nic_opaque(nc);
|
||||||
|
|
||||||
if (nc->rxfilter_notify_enabled) {
|
if (nc->rxfilter_notify_enabled) {
|
||||||
|
gchar *path = object_get_canonical_path(OBJECT(n->qdev));
|
||||||
if (n->netclient_name) {
|
if (n->netclient_name) {
|
||||||
event_data = qobject_from_jsonf("{ 'name': %s, 'path': %s }",
|
event_data = qobject_from_jsonf("{ 'name': %s, 'path': %s }",
|
||||||
n->netclient_name,
|
n->netclient_name, path);
|
||||||
object_get_canonical_path(OBJECT(n->qdev)));
|
|
||||||
} else {
|
} else {
|
||||||
event_data = qobject_from_jsonf("{ 'path': %s }",
|
event_data = qobject_from_jsonf("{ 'path': %s }", path);
|
||||||
object_get_canonical_path(OBJECT(n->qdev)));
|
|
||||||
}
|
}
|
||||||
monitor_protocol_event(QEVENT_NIC_RX_FILTER_CHANGED, event_data);
|
monitor_protocol_event(QEVENT_NIC_RX_FILTER_CHANGED, event_data);
|
||||||
qobject_decref(event_data);
|
qobject_decref(event_data);
|
||||||
|
g_free(path);
|
||||||
|
|
||||||
/* disable event notification to avoid events flooding */
|
/* disable event notification to avoid events flooding */
|
||||||
nc->rxfilter_notify_enabled = 0;
|
nc->rxfilter_notify_enabled = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user