From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzcQI-00049x-FV for qemu-devel@nongnu.org; Wed, 07 Apr 2010 17:04:30 -0400 Received: from [140.186.70.92] (port=35134 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzcQH-00049G-6w for qemu-devel@nongnu.org; Wed, 07 Apr 2010 17:04:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzcQF-0003DR-DE for qemu-devel@nongnu.org; Wed, 07 Apr 2010 17:04:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9157) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzcQF-0003DG-2K for qemu-devel@nongnu.org; Wed, 07 Apr 2010 17:04:27 -0400 From: Amit Shah Date: Thu, 8 Apr 2010 02:32:32 +0530 Message-Id: <1270674156-9345-5-git-send-email-amit.shah@redhat.com> In-Reply-To: <1270674156-9345-4-git-send-email-amit.shah@redhat.com> References: <1270674156-9345-1-git-send-email-amit.shah@redhat.com> <1270674156-9345-2-git-send-email-amit.shah@redhat.com> <1270674156-9345-3-git-send-email-amit.shah@redhat.com> <1270674156-9345-4-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH 4/8] virtio-serial: Bus info message for showing port's throttled status List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Amit Shah , Paul Brook , "Michael S. Tsirkin" , Gerd Hoffmann , Juan Quintela Show whether a port is throttled in 'info qtree'. Also reduce LOC by 1 by assigning 'throttled' status just once. Signed-off-by: Amit Shah --- hw/virtio-serial-bus.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index c0044b3..9c3a913 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -240,12 +240,11 @@ void virtio_serial_throttle_port(VirtIOSerialPort *port, bool throttle) return; } + port->throttled = throttle; if (throttle) { - port->throttled = true; return; } - port->throttled = false; flush_queued_data(port, false); } @@ -595,6 +594,8 @@ static void virtser_bus_dev_print(Monitor *mon, DeviceState *qdev, int indent) 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); } /* This function is only used if a port id is not provided by the user */ -- 1.6.2.5