From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpU15-0003aC-PJ for qemu-devel@nongnu.org; Wed, 19 Jun 2013 21:50:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpU12-0008Sq-N9 for qemu-devel@nongnu.org; Wed, 19 Jun 2013 21:50:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpU12-0008Se-Do for qemu-devel@nongnu.org; Wed, 19 Jun 2013 21:50:24 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5K1oNka010865 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 19 Jun 2013 21:50:23 -0400 Date: Thu, 20 Jun 2013 09:50:22 +0800 From: Fam Zheng Message-ID: <20130620015022.GA2870@localhost.nay.redhat.com> References: <1371651055-1621-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1371651055-1621-1-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH] hmp: Make "info block" output more readable Reply-To: famz@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com On Wed, 06/19 16:10, Kevin Wolf wrote: > HMP is meant for humans and you should notice it. > > This changes the output format to use a bit more space to display the > information more readable and leaves out irrelevant information (e.g. > mention only that an image is encrypted, but not when it's not; display > I/O limits only if throttling is in effect; ...) > > Before: > > (qemu) info block > ide0-hd0: removable=0 io-status=ok file=/tmp/overlay.qcow2 > backing_file=/tmp/backing.img backing_file_depth=1 ro=0 drv=qcow2 > encrypted=1 bps=0 bps_rd=0 bps_wr=0 iops=1024 iops_rd=0 iops_wr=0 > ide1-cd0: removable=1 locked=0 tray-open=0 io-status=ok > file=/home/kwolf/images/iso/Fedora-18-x86_64-Live-Desktop.iso ro=1 > drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0 > floppy0: removable=1 locked=0 tray-open=0 [not inserted] > sd0: removable=1 locked=0 tray-open=0 [not inserted] > > After: > > (qemu) info block > ide0-hd0: /tmp/overlay.qcow2 (qcow2, encrypted) > Backing file: /tmp/backing.img (chain depth: 1) > I/O limits: bps=0 bps_rd=0 bps_wr=0 iops=1024 iops_rd=0 iops_wr=0 > > ide1-cd0: /home/kwolf/images/iso/Fedora-18-x86_64-Live-Desktop.iso (raw, read-only) > Removable device: not locked, tray closed > > floppy0: [not inserted] > Removable device: not locked, tray closed > > sd0: [not inserted] > Removable device: not locked, tray closed > > Signed-off-by: Kevin Wolf > + if (info->value->has_io_status && info->value->io_status != BLOCK_DEVICE_IO_STATUS_OK) { > + monitor_printf(mon, " I/O Status: %s\n", Would lowercase be more consistent? s/Status/status/ This is getting much readable! Reviewed-by: Fam Zheng