]> git.proxmox.com Git - qemu.git/commitdiff
Merge remote-tracking branch 'stefanha/net' into staging
authorAnthony Liguori <aliguori@amazon.com>
Tue, 19 Nov 2013 20:58:32 +0000 (12:58 -0800)
committerAnthony Liguori <aliguori@amazon.com>
Tue, 19 Nov 2013 20:58:32 +0000 (12:58 -0800)
# 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>
hw/net/smc91c111.c
hw/net/virtio-net.c

index f5963e2cbe12d6052c20d9840afb90e3daa47d72..a8e29b3b424cceee6a66af09f4d8a1a706d2dcb9 100644 (file)
@@ -185,6 +185,7 @@ static void smc91c111_release_packet(smc91c111_state *s, int packet)
     s->allocated &= ~(1 << packet);
     if (s->tx_alloc == 0x80)
         smc91c111_tx_alloc(s);
+    qemu_flush_queued_packets(qemu_get_queue(s->nic));
 }
 
 /* Flush the TX FIFO.  */
index 613f144d12f3373f34301d3c05b5b772cb10fb6d..b75c753305f2bf697e98bf456c967440fbdc8627 100644 (file)
@@ -200,16 +200,16 @@ static void rxfilter_notify(NetClientState *nc)
     VirtIONet *n = qemu_get_nic_opaque(nc);
 
     if (nc->rxfilter_notify_enabled) {
+        gchar *path = object_get_canonical_path(OBJECT(n->qdev));
         if (n->netclient_name) {
             event_data = qobject_from_jsonf("{ 'name': %s, 'path': %s }",
-                                    n->netclient_name,
-                                    object_get_canonical_path(OBJECT(n->qdev)));
+                                    n->netclient_name, path);
         } else {
-            event_data = qobject_from_jsonf("{ 'path': %s }",
-                                    object_get_canonical_path(OBJECT(n->qdev)));
+            event_data = qobject_from_jsonf("{ 'path': %s }", path);
         }
         monitor_protocol_event(QEVENT_NIC_RX_FILTER_CHANGED, event_data);
         qobject_decref(event_data);
+        g_free(path);
 
         /* disable event notification to avoid events flooding */
         nc->rxfilter_notify_enabled = 0;