|
|
0a122b |
From 7bbc53ba5ca8c488498cc1f8a66de4e3bad5372c Mon Sep 17 00:00:00 2001
|
|
|
0a122b |
Message-Id: <7bbc53ba5ca8c488498cc1f8a66de4e3bad5372c.1387276076.git.minovotn@redhat.com>
|
|
|
0a122b |
In-Reply-To: <e610718166120379517e80d1a7aa12d60294209b.1387276076.git.minovotn@redhat.com>
|
|
|
0a122b |
References: <e610718166120379517e80d1a7aa12d60294209b.1387276076.git.minovotn@redhat.com>
|
|
|
0a122b |
From: Amos Kong <akong@redhat.com>
|
|
|
0a122b |
Date: Sat, 23 Nov 2013 03:17:43 +0100
|
|
|
0a122b |
Subject: [PATCH 03/16] virtio-net: fix the memory leak in rxfilter_notify()
|
|
|
0a122b |
MIME-Version: 1.0
|
|
|
0a122b |
Content-Type: text/plain; charset=UTF-8
|
|
|
0a122b |
Content-Transfer-Encoding: 8bit
|
|
|
0a122b |
|
|
|
0a122b |
RH-Author: Amos Kong <akong@redhat.com>
|
|
|
0a122b |
Message-id: <1385176664-3852-2-git-send-email-akong@redhat.com>
|
|
|
0a122b |
Patchwork-id: 55866
|
|
|
0a122b |
O-Subject: [RHEL-7.0 qemu-kvm PATCH 1/2] virtio-net: fix the memory leak in rxfilter_notify()
|
|
|
0a122b |
Bugzilla: 1033810
|
|
|
0a122b |
RH-Acked-by: Vlad Yasevich <vyasevic@redhat.com>
|
|
|
0a122b |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
0a122b |
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
|
|
|
0a122b |
|
|
|
0a122b |
object_get_canonical_path() returns a gchar*, it should be freed by the
|
|
|
0a122b |
caller.
|
|
|
0a122b |
|
|
|
0a122b |
Signed-off-by: Amos Kong <akong@redhat.com>
|
|
|
0a122b |
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
0a122b |
Reviewed-by: Vlad Yasevich <vyasevic@redhat.com>
|
|
|
0a122b |
Reviewed-by: Andreas Färber <afaerber@suse.de>
|
|
|
0a122b |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
0a122b |
(cherry picked from commit 96e35046e4a97df5b4e1e24e217eb1e1701c7c71)
|
|
|
0a122b |
---
|
|
|
0a122b |
hw/net/virtio-net.c | 8 ++++----
|
|
|
0a122b |
1 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
0a122b |
|
|
|
0a122b |
Signed-off-by: Michal Novotny <minovotn@redhat.com>
|
|
|
0a122b |
---
|
|
|
0a122b |
hw/net/virtio-net.c | 8 ++++----
|
|
|
0a122b |
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
0a122b |
|
|
|
0a122b |
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
|
|
|
0a122b |
index 3bc1eed..915aa70 100644
|
|
|
0a122b |
--- a/hw/net/virtio-net.c
|
|
|
0a122b |
+++ b/hw/net/virtio-net.c
|
|
|
0a122b |
@@ -200,16 +200,16 @@ static void rxfilter_notify(NetClientState *nc)
|
|
|
0a122b |
VirtIONet *n = qemu_get_nic_opaque(nc);
|
|
|
0a122b |
|
|
|
0a122b |
if (nc->rxfilter_notify_enabled) {
|
|
|
0a122b |
+ gchar *path = object_get_canonical_path(OBJECT(n->qdev));
|
|
|
0a122b |
if (n->netclient_name) {
|
|
|
0a122b |
event_data = qobject_from_jsonf("{ 'name': %s, 'path': %s }",
|
|
|
0a122b |
- n->netclient_name,
|
|
|
0a122b |
- object_get_canonical_path(OBJECT(n->qdev)));
|
|
|
0a122b |
+ n->netclient_name, path);
|
|
|
0a122b |
} else {
|
|
|
0a122b |
- event_data = qobject_from_jsonf("{ 'path': %s }",
|
|
|
0a122b |
- object_get_canonical_path(OBJECT(n->qdev)));
|
|
|
0a122b |
+ event_data = qobject_from_jsonf("{ 'path': %s }", path);
|
|
|
0a122b |
}
|
|
|
0a122b |
monitor_protocol_event(QEVENT_NIC_RX_FILTER_CHANGED, event_data);
|
|
|
0a122b |
qobject_decref(event_data);
|
|
|
0a122b |
+ g_free(path);
|
|
|
0a122b |
|
|
|
0a122b |
/* disable event notification to avoid events flooding */
|
|
|
0a122b |
nc->rxfilter_notify_enabled = 0;
|
|
|
0a122b |
--
|
|
|
0a122b |
1.7.11.7
|
|
|
0a122b |
|