Received: from eggs.gnu.org ([2001:4830:134:3::10]:36871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVjG1-0005vx-5A for qemu-devel@nongnu.org; Mon, 14 Oct 2013 10:36:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVjFv-0004UR-5G for qemu-devel@nongnu.org; Mon, 14 Oct 2013 10:36:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVjFu-0004UJ-Rr for qemu-devel@nongnu.org; Mon, 14 Oct 2013 10:36:23 -0400 From: Markus Armbruster References: <1381757489-3310-1-git-send-email-qiudayu@linux.vnet.ibm.com> Date: Mon, 14 Oct 2013 16:36:18 +0200 In-Reply-To: <1381757489-3310-1-git-send-email-qiudayu@linux.vnet.ibm.com> (Mike Qiu's message of "Mon, 14 Oct 2013 09:31:29 -0400") Message-ID: <87zjqbhqcd.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mike Qiu Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com Mike Qiu writes: > Without this, output of 'info block' > > scsi0-hd0: /images/f18-ppc64.qcow2 (qcow2) > [not inserted] > scsi0-cd2: [not inserted] > Removable device: not locked, tray closed > > floppy0: [not inserted] > Removable device: not locked, tray closed > > sd0: [not inserted] > Removable device: not locked, tray closed > > There will be no additional lines between scsi0-hd0 scsi0-cd2, > and break the info style. Just saw a similar one: (qemu) info block disk0: test.img (raw) [not inserted] cd: [not inserted] Removable device: not locked, tray closed foo: tmp.img (raw) Removable device: not locked, tray closed [not inserted](qemu) > This patch is to solve this. > > Signed-off-by: Mike Qiu > --- > hmp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hmp.c b/hmp.c > index 5891507..2d2e5f8 100644 > --- a/hmp.c > +++ b/hmp.c > @@ -367,7 +367,7 @@ void hmp_info_block(Monitor *mon, const QDict *qdict) > info->value->inserted->iops_wr_max, > info->value->inserted->iops_size); > } else { > - monitor_printf(mon, " [not inserted]"); > + monitor_printf(mon, " [not inserted]\n"); > } > > if (verbose) { monitor_printf(mon, "\nImages:\n"); What about removing the newline before "Images"? I think we should also drop this newline: if (info->value->removable) { monitor_printf(mon, " Removable device: %slocked, tray %s\n", info->value->locked ? "" : "not ", info->value->tray_open ? "open" : "closed"); } Maybe more. The function probably needs a systematic newline review.