qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: mike <qiudayu@linux.vnet.ibm.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
Date: Tue, 15 Oct 2013 11:38:37 +0800	[thread overview]
Message-ID: <525CB8BD.1020903@linux.vnet.ibm.com> (raw)
In-Reply-To: <87zjqbhqcd.fsf@blackfin.pond.sub.org>

On 10/14/2013 10:36 PM, Markus Armbruster wrote:
> Mike Qiu <qiudayu@linux.vnet.ibm.com> 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 <qiudayu@linux.vnet.ibm.com>
>> ---
>>   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"?
A good idea I think, it no need to add addition lines in one info.

But see commit id: fbe2e26c15af35e4d157874dc80f6a19eebaa83b

-            if (verbose) {
-                monitor_printf(mon, " images:\n");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-                image_info = info->value->inserted->image;
-                while (1) {
- bdrv_image_info_dump((fprintf_function)monitor_printf,
-                                             mon, image_info);
-                    if (image_info->has_backing_image) {
-                        image_info = image_info->backing_image;
-                    } else {
-                        break;
-                    }
+        if (verbose) {
+            monitor_printf(mon, "\nImages:\n");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+            image_info = info->value->inserted->image;
+            while (1) {
+ bdrv_image_info_dump((fprintf_function)monitor_printf,
+                                         mon, image_info);
+                if (image_info->has_backing_image) {
+                    image_info = image_info->backing_image;
+                } else {
+                    break;
                  }
              }
-        } else {
-            monitor_printf(mon, " [not inserted]");
          }

It was changed to add this, so there maybe some reasons I think,

Thanks
Mike
> 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.
>
>

  reply	other threads:[~2013-10-15  3:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-14 13:31 [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf() Mike Qiu
2013-10-14 14:36 ` Markus Armbruster
2013-10-15  3:38   ` mike [this message]
2013-10-15  8:58     ` Kevin Wolf
2013-10-15  9:31       ` Markus Armbruster
2013-10-15 10:12         ` mike
2013-10-15 10:07       ` mike
2013-10-15 11:14         ` Benoît Canet
2013-10-16  7:29         ` Wenchao Xia
2013-10-16  7:47           ` Markus Armbruster
2013-10-16  7:56             ` Wenchao Xia
2013-10-16  9:03               ` mike

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=525CB8BD.1020903@linux.vnet.ibm.com \
    --to=qiudayu@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).