From patchwork Tue May 28 10:27:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 246819 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 ECE7E2C02C7 for ; Tue, 28 May 2013 20:28:29 +1000 (EST) Received: from localhost ([::1]:54398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhH8m-0000Vr-3O for incoming@patchwork.ozlabs.org; Tue, 28 May 2013 06:28:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhH8R-0000Vl-S2 for qemu-devel@nongnu.org; Tue, 28 May 2013 06:28:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhH8N-0008KB-CM for qemu-devel@nongnu.org; Tue, 28 May 2013 06:28:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhH8N-0008K0-5P; Tue, 28 May 2013 06:28:03 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4SAS2rr012791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 28 May 2013 06:28:02 -0400 Received: from rincewind.home.kraxel.org (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4SAS1D5010162; Tue, 28 May 2013 06:28:01 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id BF2F141659; Tue, 28 May 2013 12:27:59 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 28 May 2013 12:27:59 +0200 Message-Id: <1369736879-16503-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1369736879-16503-1-git-send-email-kraxel@redhat.com> References: <1369736879-16503-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori , seabios@seabios.org, qemu-stable@nongnu.org, Gerd Hoffmann Subject: [Qemu-devel] [PATCH 2/2] chardev: fix "info chardev" output 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 Fill unset CharDriverState->filename with the backend name, so 'info chardev' will return at least the chardev type. Don't touch it in case the chardev init function filled it already, like the socket+pty chardevs do for example. Signed-off-by: Gerd Hoffmann --- qemu-char.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu-char.c b/qemu-char.c index f825294..d04b429 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3801,6 +3801,9 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend, chr->label = g_strdup(id); chr->avail_connections = (backend->kind == CHARDEV_BACKEND_KIND_MUX) ? MAX_MUX : 1; + if (!chr->filename) { + chr->filename = g_strdup(ChardevBackendKind_lookup[backend->kind]); + } QTAILQ_INSERT_TAIL(&chardevs, chr, next); return ret; } else {