From patchwork Thu May 19 11:37:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 96344 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 37715B6F81 for ; Thu, 19 May 2011 21:37:53 +1000 (EST) Received: from localhost ([::1]:46106 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN1Y6-0004C7-9f for incoming@patchwork.ozlabs.org; Thu, 19 May 2011 07:37:50 -0400 Received: from eggs.gnu.org ([140.186.70.92]:43165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN1Xe-00048N-FD for qemu-devel@nongnu.org; Thu, 19 May 2011 07:37:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QN1Xc-0002qT-EJ for qemu-devel@nongnu.org; Thu, 19 May 2011 07:37:22 -0400 Received: from oxygen.pond.sub.org ([213.239.205.148]:48506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN1Xc-0002pq-1Y for qemu-devel@nongnu.org; Thu, 19 May 2011 07:37:20 -0400 Received: from blackfin.pond.sub.org (p5B32D5F1.dip.t-dialin.net [91.50.213.241]) by oxygen.pond.sub.org (Postfix) with ESMTPA id B54D02DD49E for ; Thu, 19 May 2011 13:37:17 +0200 (CEST) Received: by blackfin.pond.sub.org (Postfix, from userid 500) id 351261D6; Thu, 19 May 2011 13:37:17 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 19 May 2011 13:37:15 +0200 Message-Id: <1305805037-17752-3-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1305805037-17752-1-git-send-email-armbru@redhat.com> References: <1305805037-17752-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 213.239.205.148 Cc: amit.shah@redhat.com, alevy@redhat.com, kraxel@redhat.com Subject: [Qemu-devel] [PATCH 2/4] virtio-serial: Clean up virtser_bus_dev_print() 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 Old version looks like this in info qtree (last four lines): dev: virtconsole, id "" dev-prop: is_console = 1 dev-prop: nr = 0 dev-prop: chardev = dev-prop: name = dev-prop-int: id: 0 dev-prop-int: guest_connected: 1 dev-prop-int: host_connected: 0 dev-prop-int: throttled: 0 Indentation is off, and "dev-prop-int" suggests these are properties you can configure with -device, which isn't the case. The other buses' print_dev() callbacks don't do that. For instance, PCI's output looks like this: class Ethernet controller, addr 00:03.0, pci id 1af4:1000 (sub 1af4:0001) bar 0: i/o at 0xffffffffffffffff [0x1e] bar 1: mem at 0xffffffffffffffff [0xffe] bar 6: mem at 0xffffffffffffffff [0xfffe] Change virtser_bus_dev_print() to that style. Result: dev: virtconsole, id "" dev-prop: is_console = 1 dev-prop: nr = 0 dev-prop: chardev = dev-prop: name = port 0, guest on, host off, throttle off Signed-off-by: Markus Armbruster --- hw/virtio-serial-bus.c | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index f10d48f..bd3121e 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -658,14 +658,11 @@ static void virtser_bus_dev_print(Monitor *mon, DeviceState *qdev, int indent) { VirtIOSerialPort *port = DO_UPCAST(VirtIOSerialPort, dev, qdev); - monitor_printf(mon, "%*s dev-prop-int: id: %u\n", - indent, "", port->id); - monitor_printf(mon, "%*s dev-prop-int: guest_connected: %d\n", - indent, "", port->guest_connected); - monitor_printf(mon, "%*s dev-prop-int: host_connected: %d\n", - indent, "", port->host_connected); - monitor_printf(mon, "%*s dev-prop-int: throttled: %d\n", - indent, "", port->throttled); + monitor_printf(mon, "%*sport %d, guest %s, host %s, throttle %s\n", + indent, "", port->id, + port->guest_connected ? "on" : "off", + port->host_connected ? "on" : "off", + port->throttled ? "on" : "off"); } /* This function is only used if a port id is not provided by the user */