From 7ec64009461f36cd616c4f615c12b72f08bba8bb Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Mon, 16 Nov 2015 14:32:39 +0100 Subject: [PATCH 23/44] net: add trace_vhost_user_event MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-id: <1447684235-15638-17-git-send-email-mst@redhat.com> Patchwork-id: 68364 O-Subject: [PATCH RHEV 7.3/7.2.z v2 16/36] net: add trace_vhost_user_event Bugzilla: 1279388 RH-Acked-by: Xiao Wang RH-Acked-by: Victor Kaplansky RH-Acked-by: Marcel Apfelbaum RH-Acked-by: Marc-André Lureau From: Marc-André Lureau Replace error_report() and use tracing instead. It's not an error to get a connection or a disconnection, so silence this and trace it instead. Signed-off-by: Marc-André Lureau Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Tested-by: Thibaut Collet (cherry picked from commit 69b32a6ce4e1a6096a496996fcda833eb54e81b9) Signed-off-by: Miroslav Rezanina --- net/vhost-user.c | 4 ++-- trace-events | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index ee479ce..b57b064 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -15,6 +15,7 @@ #include "qemu/config-file.h" #include "qemu/error-report.h" #include "qmp-commands.h" +#include "trace.h" typedef struct VhostUserState { NetClientState nc; @@ -148,18 +149,17 @@ static void net_vhost_user_event(void *opaque, int event) NET_CLIENT_OPTIONS_KIND_NIC, MAX_QUEUE_NUM); s = DO_UPCAST(VhostUserState, nc, ncs[0]); + trace_vhost_user_event(s->chr->label, event); switch (event) { case CHR_EVENT_OPENED: if (vhost_user_start(queues, ncs) < 0) { exit(1); } qmp_set_link(name, true, &err); - error_report("chardev \"%s\" went up", s->chr->label); break; case CHR_EVENT_CLOSED: qmp_set_link(name, true, &err); vhost_user_stop(queues, ncs); - error_report("chardev \"%s\" went down", s->chr->label); break; } diff --git a/trace-events b/trace-events index b94bdbf..133b6cb 100644 --- a/trace-events +++ b/trace-events @@ -1604,3 +1604,6 @@ cpu_unhalt(int cpu_index) "unhalting cpu %d" # hw/arm/virt-acpi-build.c virt_acpi_setup(void) "No fw cfg or ACPI disabled. Bailing out." + +# net/vhost-user.c +vhost_user_event(const char *chr, int event) "chr: %s got event: %d" -- 1.8.3.1