From patchwork Wed Mar 13 13:59:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 227295 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D1F622C0085 for ; Thu, 14 Mar 2013 00:58:43 +1100 (EST) Received: from localhost ([::1]:59351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFmCY-0002TK-54 for incoming@patchwork.ozlabs.org; Wed, 13 Mar 2013 09:58:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFmAb-0007jr-FI for qemu-devel@nongnu.org; Wed, 13 Mar 2013 09:56:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFmAY-0002h1-E4 for qemu-devel@nongnu.org; Wed, 13 Mar 2013 09:56:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFmAY-0002gn-5x for qemu-devel@nongnu.org; Wed, 13 Mar 2013 09:56:38 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2DDubrK029018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 13 Mar 2013 09:56:37 -0400 Received: from shalem.localdomain.com (vpn1-7-240.ams2.redhat.com [10.36.7.240]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2DDuSJk003674; Wed, 13 Mar 2013 09:56:35 -0400 From: Hans de Goede To: qemu-devel@nongnu.org Date: Wed, 13 Mar 2013 14:59:44 +0100 Message-Id: <1363183187-16258-5-git-send-email-hdegoede@redhat.com> In-Reply-To: <1363183187-16258-1-git-send-email-hdegoede@redhat.com> References: <1363183187-16258-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Amit Shah , Hans de Goede , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [Qemu-devel] [PATCH 4/7] spice-qemu-char: Remove dead debugging code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Since commit d62e5f7036a018b2ad09f17ebd481bd28953d783 "chardev: add spice support to qapi" It is impossible to set the debug parameter, so all the dprintf calls are essentially nops. Since we've not needed the debug parameter in ages this is not a problem, if it later turns out we do need some more debugging options we can add more trace-points. Signed-off-by: Hans de Goede --- spice-qemu-char.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/spice-qemu-char.c b/spice-qemu-char.c index a94f76b..8a9236d 100644 --- a/spice-qemu-char.c +++ b/spice-qemu-char.c @@ -8,14 +8,6 @@ #include "qemu/osdep.h" -#define dprintf(_scd, _level, _fmt, ...) \ - do { \ - static unsigned __dprintf_counter = 0; \ - if (_scd->debug >= _level) { \ - fprintf(stderr, "scd: %3d: " _fmt, ++__dprintf_counter, ## __VA_ARGS__);\ - } \ - } while (0) - typedef struct SpiceCharDriver { CharDriverState* chr; SpiceCharDeviceInstance sin; @@ -24,7 +16,6 @@ typedef struct SpiceCharDriver { uint8_t *buffer; uint8_t *datapos; ssize_t bufsize, datalen; - uint32_t debug; QLIST_ENTRY(SpiceCharDriver) next; } SpiceCharDriver; @@ -49,7 +40,6 @@ static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len) p += last_out; } - dprintf(scd, 3, "%s: %zu/%zd\n", __func__, out, len + out); trace_spice_vmc_write(out, len + out); return out; } @@ -59,7 +49,6 @@ static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len) SpiceCharDriver *scd = container_of(sin, SpiceCharDriver, sin); int bytes = MIN(len, scd->datalen); - dprintf(scd, 2, "%s: %p %d/%d/%zd\n", __func__, scd->datapos, len, bytes, scd->datalen); if (bytes > 0) { memcpy(buf, scd->datapos, bytes); scd->datapos += bytes; @@ -84,11 +73,9 @@ static void vmc_event(SpiceCharDeviceInstance *sin, uint8_t event) chr_event = CHR_EVENT_BREAK; break; default: - dprintf(scd, 2, "%s: unknown %d\n", __func__, event); return; } - dprintf(scd, 2, "%s: %d\n", __func__, event); trace_spice_vmc_event(chr_event); qemu_chr_be_event(scd->chr, chr_event); } @@ -141,7 +128,6 @@ static void vmc_register_interface(SpiceCharDriver *scd) if (scd->active) { return; } - dprintf(scd, 1, "%s\n", __func__); scd->sin.base.sif = &vmc_interface.base; qemu_spice_add_interface(&scd->sin.base); scd->active = true; @@ -153,7 +139,6 @@ static void vmc_unregister_interface(SpiceCharDriver *scd) if (!scd->active) { return; } - dprintf(scd, 1, "%s\n", __func__); spice_server_remove_interface(&scd->sin.base); scd->active = false; trace_spice_vmc_unregister_interface(scd); @@ -164,7 +149,6 @@ static int spice_chr_write(CharDriverState *chr, const uint8_t *buf, int len) { SpiceCharDriver *s = chr->opaque; - dprintf(s, 2, "%s: %d\n", __func__, len); vmc_register_interface(s); assert(s->datalen == 0); if (s->bufsize < len) { @@ -182,7 +166,6 @@ static void spice_chr_close(struct CharDriverState *chr) { SpiceCharDriver *s = chr->opaque; - printf("%s\n", __func__); vmc_unregister_interface(s); QLIST_REMOVE(s, next);