* [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
@ 2013-10-14 13:31 Mike Qiu
2013-10-14 14:36 ` Markus Armbruster
0 siblings, 1 reply; 12+ messages in thread
From: Mike Qiu @ 2013-10-14 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Mike Qiu, lcapitulino
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.
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) {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
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
0 siblings, 1 reply; 12+ messages in thread
From: Markus Armbruster @ 2013-10-14 14:36 UTC (permalink / raw)
To: Mike Qiu; +Cc: qemu-devel, lcapitulino
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"?
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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
2013-10-14 14:36 ` Markus Armbruster
@ 2013-10-15 3:38 ` mike
2013-10-15 8:58 ` Kevin Wolf
0 siblings, 1 reply; 12+ messages in thread
From: mike @ 2013-10-15 3:38 UTC (permalink / raw)
To: Markus Armbruster; +Cc: kwolf, qemu-devel, lcapitulino
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.
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
2013-10-15 3:38 ` mike
@ 2013-10-15 8:58 ` Kevin Wolf
2013-10-15 9:31 ` Markus Armbruster
2013-10-15 10:07 ` mike
0 siblings, 2 replies; 12+ messages in thread
From: Kevin Wolf @ 2013-10-15 8:58 UTC (permalink / raw)
To: mike; +Cc: lcapitulino, benoit, Markus Armbruster, stefanha, qemu-devel
Am 15.10.2013 um 05:38 hat mike geschrieben:
> 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
> [...]
> It was changed to add this, so there maybe some reasons I think,
Like everything else in that commit, I did that change because I found it
more readable.
The problem seems to be commit 3e9fab69 ('block: Add support for
throttling burst max in QMP and the command line'), which added a bogus
"[not inserted]" message. We simply need to drop it altogether instead of
adding a newline.
> > 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");
> > }
Why? Look:
(qemu) info block
scsi0-cd0: /tmp/cdrom.qcow2 (qcow2)
Removable device: not locked, tray closed
Backing file: /home/kwolf/images/iso/Fedora-18-x86_64-Live-Desktop.iso (chain depth: 1)
I/O throttling: bps=1048576 bps_rd=0 bps_wr=0 bps_max=104857 bps_rd_max=0 bps_wr_max=0 iops=0 iops_rd=0 iops_wr=0 iops_max=0 iops_rd_max=0 iops_wr_max=0 iops_size=0
Do you really want to remove the newline?
Kevin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
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
1 sibling, 1 reply; 12+ messages in thread
From: Markus Armbruster @ 2013-10-15 9:31 UTC (permalink / raw)
To: Kevin Wolf; +Cc: benoit, mike, qemu-devel, stefanha, lcapitulino
Kevin Wolf <kwolf@redhat.com> writes:
> Am 15.10.2013 um 05:38 hat mike geschrieben:
>> 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
>> [...]
>> It was changed to add this, so there maybe some reasons I think,
>
> Like everything else in that commit, I did that change because I found it
> more readable.
>
> The problem seems to be commit 3e9fab69 ('block: Add support for
> throttling burst max in QMP and the command line'), which added a bogus
> "[not inserted]" message. We simply need to drop it altogether instead of
> adding a newline.
>
>> > 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");
>> > }
>
> Why? Look:
>
> (qemu) info block
> scsi0-cd0: /tmp/cdrom.qcow2 (qcow2)
> Removable device: not locked, tray closed
> Backing file: /home/kwolf/images/iso/Fedora-18-x86_64-Live-Desktop.iso (chain depth: 1)
> I/O throttling: bps=1048576 bps_rd=0 bps_wr=0 bps_max=104857 bps_rd_max=0 bps_wr_max=0 iops=0 iops_rd=0 iops_wr=0 iops_max=0 iops_rd_max=0 iops_wr_max=0 iops_size=0
>
> Do you really want to remove the newline?
This one made me think I do:
foo: tmp.img (raw)
Removable device: not locked, tray closed
[not inserted](qemu)
If the '[not inserted]' is wrong and needs to go, then I actually don't.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
2013-10-15 8:58 ` Kevin Wolf
2013-10-15 9:31 ` Markus Armbruster
@ 2013-10-15 10:07 ` mike
2013-10-15 11:14 ` Benoît Canet
2013-10-16 7:29 ` Wenchao Xia
1 sibling, 2 replies; 12+ messages in thread
From: mike @ 2013-10-15 10:07 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, Markus Armbruster, benoit, stefanha, lcapitulino
On 10/15/2013 04:58 PM, Kevin Wolf wrote:
> Am 15.10.2013 um 05:38 hat mike geschrieben:
>> 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
>> [...]
>> It was changed to add this, so there maybe some reasons I think,
> Like everything else in that commit, I did that change because I found it
> more readable.
>
> The problem seems to be commit 3e9fab69 ('block: Add support for
> throttling burst max in QMP and the command line'), which added a bogus
> "[not inserted]" message. We simply need to drop it altogether instead of
> adding a newline.
>
Yes, I agree with you. but maybe need the author of the commit 3e9fab69
('block: Add support for throttling burst max in QMP and the command line')
to have some comments on this line, I think.
>>> 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");
>>> }
> Why? Look:
>
> (qemu) info block
> scsi0-cd0: /tmp/cdrom.qcow2 (qcow2)
> Removable device: not locked, tray closed
> Backing file: /home/kwolf/images/iso/Fedora-18-x86_64-Live-Desktop.iso (chain depth: 1)
> I/O throttling: bps=1048576 bps_rd=0 bps_wr=0 bps_max=104857 bps_rd_max=0 bps_wr_max=0 iops=0 iops_rd=0 iops_wr=0 iops_max=0 iops_rd_max=0 iops_wr_max=0 iops_size=0
>
> Do you really want to remove the newline?
I'm not, but Markus suggest to do so.
Thanks
Mike
> Kevin
>
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
2013-10-15 9:31 ` Markus Armbruster
@ 2013-10-15 10:12 ` mike
0 siblings, 0 replies; 12+ messages in thread
From: mike @ 2013-10-15 10:12 UTC (permalink / raw)
To: Markus Armbruster; +Cc: Kevin Wolf, lcapitulino, benoit, stefanha, qemu-devel
On 10/15/2013 05:31 PM, Markus Armbruster wrote:
> Kevin Wolf <kwolf@redhat.com> writes:
>
>> Am 15.10.2013 um 05:38 hat mike geschrieben:
>>> 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
>>> [...]
>>> It was changed to add this, so there maybe some reasons I think,
>> Like everything else in that commit, I did that change because I found it
>> more readable.
>>
>> The problem seems to be commit 3e9fab69 ('block: Add support for
>> throttling burst max in QMP and the command line'), which added a bogus
>> "[not inserted]" message. We simply need to drop it altogether instead of
>> adding a newline.
>>
>>>> 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");
>>>> }
>> Why? Look:
>>
>> (qemu) info block
>> scsi0-cd0: /tmp/cdrom.qcow2 (qcow2)
>> Removable device: not locked, tray closed
>> Backing file: /home/kwolf/images/iso/Fedora-18-x86_64-Live-Desktop.iso (chain depth: 1)
>> I/O throttling: bps=1048576 bps_rd=0 bps_wr=0 bps_max=104857 bps_rd_max=0 bps_wr_max=0 iops=0 iops_rd=0 iops_wr=0 iops_max=0 iops_rd_max=0 iops_wr_max=0 iops_size=0
>>
>> Do you really want to remove the newline?
> This one made me think I do:
>
> foo: tmp.img (raw)
> Removable device: not locked, tray closed
> [not inserted](qemu)
>
> If the '[not inserted]' is wrong and needs to go, then I actually don't.
Here '[not inserted]' is very strange, if the commit author has some
reasonable reasons,
we can keep it, otherwise, I think we should remove it.
Thanks
Mike
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
2013-10-15 10:07 ` mike
@ 2013-10-15 11:14 ` Benoît Canet
2013-10-16 7:29 ` Wenchao Xia
1 sibling, 0 replies; 12+ messages in thread
From: Benoît Canet @ 2013-10-15 11:14 UTC (permalink / raw)
To: mike; +Cc: Kevin Wolf, lcapitulino, qemu-devel, stefanha, Markus Armbruster
Hello,
>Le Tuesday 15 Oct 2013 à 18:07:16 (+0800), mike a écrit :
> On 10/15/2013 04:58 PM, Kevin Wolf wrote:
> >Am 15.10.2013 um 05:38 hat mike geschrieben:
> >>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
> >>[...]
> >>It was changed to add this, so there maybe some reasons I think,
> >Like everything else in that commit, I did that change because I found it
> >more readable.
> >
> >The problem seems to be commit 3e9fab69 ('block: Add support for
> >throttling burst max in QMP and the command line'), which added a bogus
> >"[not inserted]" message. We simply need to drop it altogether instead of
> >adding a newline.
> >
> Yes, I agree with you. but maybe need the author of the commit 3e9fab69
> ('block: Add support for throttling burst max in QMP and the command line')
> to have some comments on this line, I think.
Hello,
I do not remember even thinking about adding this monitor_printf in 3e9fab69.
It must be the result of a bad conflict resolve or something like that.
Sorry for adding this.
Do you want me to send a two liner to remove this ?
Best regards
Benoît
> >>>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");
> >>> }
> >Why? Look:
> >
> >(qemu) info block
> >scsi0-cd0: /tmp/cdrom.qcow2 (qcow2)
> > Removable device: not locked, tray closed
> > Backing file: /home/kwolf/images/iso/Fedora-18-x86_64-Live-Desktop.iso (chain depth: 1)
> > I/O throttling: bps=1048576 bps_rd=0 bps_wr=0 bps_max=104857 bps_rd_max=0 bps_wr_max=0 iops=0 iops_rd=0 iops_wr=0 iops_max=0 iops_rd_max=0 iops_wr_max=0 iops_size=0
> >
> >Do you really want to remove the newline?
> I'm not, but Markus suggest to do so.
>
> Thanks
> Mike
> >Kevin
> >
> >
> >
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
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
1 sibling, 1 reply; 12+ messages in thread
From: Wenchao Xia @ 2013-10-16 7:29 UTC (permalink / raw)
To: mike
Cc: Kevin Wolf, benoit, Markus Armbruster, qemu-devel, lcapitulino,
stefanha
于 2013/10/15 18:07, mike 写道:
> On 10/15/2013 04:58 PM, Kevin Wolf wrote:
>> Am 15.10.2013 um 05:38 hat mike geschrieben:
>>> 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
>>> [...]
>>> It was changed to add this, so there maybe some reasons I think,
>> Like everything else in that commit, I did that change because I
>> found it
>> more readable.
>>
>> The problem seems to be commit 3e9fab69 ('block: Add support for
>> throttling burst max in QMP and the command line'), which added a bogus
>> "[not inserted]" message. We simply need to drop it altogether
>> instead of
>> adding a newline.
>>
> Yes, I agree with you. but maybe need the author of the commit 3e9fab69
> ('block: Add support for throttling burst max in QMP and the command
> line')
> to have some comments on this line, I think.
>>>> 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");
>>>> }
>> Why? Look:
>>
>> (qemu) info block
>> scsi0-cd0: /tmp/cdrom.qcow2 (qcow2)
>> Removable device: not locked, tray closed
>> Backing file:
>> /home/kwolf/images/iso/Fedora-18-x86_64-Live-Desktop.iso (chain
>> depth: 1)
>> I/O throttling: bps=1048576 bps_rd=0 bps_wr=0 bps_max=104857
>> bps_rd_max=0 bps_wr_max=0 iops=0 iops_rd=0 iops_wr=0 iops_max=0
>> iops_rd_max=0 iops_wr_max=0 iops_size=0
>>
>> Do you really want to remove the newline?
> I'm not, but Markus suggest to do so.
>
> Thanks
> Mike
>> Kevin
>>
>>
>>
>
>
Why the new line matters? I think there is a QMP interface available, so
the hmp output format
would not bother much, just need to tip clear the info.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
2013-10-16 7:29 ` Wenchao Xia
@ 2013-10-16 7:47 ` Markus Armbruster
2013-10-16 7:56 ` Wenchao Xia
0 siblings, 1 reply; 12+ messages in thread
From: Markus Armbruster @ 2013-10-16 7:47 UTC (permalink / raw)
To: Wenchao Xia; +Cc: Kevin Wolf, benoit, qemu-devel, lcapitulino, mike, stefanha
Wenchao Xia <xiawenc@linux.vnet.ibm.com> writes:
> 于 2013/10/15 18:07, mike 写道:
>> On 10/15/2013 04:58 PM, Kevin Wolf wrote:
>>> Am 15.10.2013 um 05:38 hat mike geschrieben:
>>>> 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
>>>> [...]
>>>> It was changed to add this, so there maybe some reasons I think,
>>> Like everything else in that commit, I did that change because I
>>> found it
>>> more readable.
>>>
>>> The problem seems to be commit 3e9fab69 ('block: Add support for
>>> throttling burst max in QMP and the command line'), which added a bogus
>>> "[not inserted]" message. We simply need to drop it altogether
>>> instead of
>>> adding a newline.
>>>
>> Yes, I agree with you. but maybe need the author of the commit 3e9fab69
>> ('block: Add support for throttling burst max in QMP and the command
>> line')
>> to have some comments on this line, I think.
>>>>> 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");
>>>>> }
>>> Why? Look:
>>>
>>> (qemu) info block
>>> scsi0-cd0: /tmp/cdrom.qcow2 (qcow2)
>>> Removable device: not locked, tray closed
>>> Backing file:
>>> /home/kwolf/images/iso/Fedora-18-x86_64-Live-Desktop.iso (chain
>>> depth: 1)
>>> I/O throttling: bps=1048576 bps_rd=0 bps_wr=0 bps_max=104857
>>> bps_rd_max=0 bps_wr_max=0 iops=0 iops_rd=0 iops_wr=0 iops_max=0
>>> iops_rd_max=0 iops_wr_max=0 iops_size=0
>>>
>>> Do you really want to remove the newline?
>> I'm not, but Markus suggest to do so.
>>
> Why the new line matters? I think there is a QMP interface available,
> so the hmp output format
> would not bother much, just need to tip clear the info.
I want this fixed:
$ qemu -nodefaults -nographic -monitor stdio -S -drive if=none,file=tmp.img
QEMU 1.6.50 monitor - type 'help' for more information
(qemu) info block
none0: tmp.img (raw)
Removable device: not locked, tray closed
[not inserted](qemu)
Output doesn't end with newline, messing up the prompt.
Elswhere in the thread, we concluded that the offending '[not inserted]'
is bogus, and should be dropped.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
2013-10-16 7:47 ` Markus Armbruster
@ 2013-10-16 7:56 ` Wenchao Xia
2013-10-16 9:03 ` mike
0 siblings, 1 reply; 12+ messages in thread
From: Wenchao Xia @ 2013-10-16 7:56 UTC (permalink / raw)
To: Markus Armbruster
Cc: Kevin Wolf, benoit, qemu-devel, lcapitulino, mike, stefanha
于 2013/10/16 15:47, Markus Armbruster 写道:
> Wenchao Xia<xiawenc@linux.vnet.ibm.com> writes:
>
>> 于 2013/10/15 18:07, mike 写道:
>>> On 10/15/2013 04:58 PM, Kevin Wolf wrote:
>>>> Am 15.10.2013 um 05:38 hat mike geschrieben:
>>>>> 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
>>>>> [...]
>>>>> It was changed to add this, so there maybe some reasons I think,
>>>> Like everything else in that commit, I did that change because I
>>>> found it
>>>> more readable.
>>>>
>>>> The problem seems to be commit 3e9fab69 ('block: Add support for
>>>> throttling burst max in QMP and the command line'), which added a bogus
>>>> "[not inserted]" message. We simply need to drop it altogether
>>>> instead of
>>>> adding a newline.
>>>>
>>> Yes, I agree with you. but maybe need the author of the commit 3e9fab69
>>> ('block: Add support for throttling burst max in QMP and the command
>>> line')
>>> to have some comments on this line, I think.
>>>>>> 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");
>>>>>> }
>>>> Why? Look:
>>>>
>>>> (qemu) info block
>>>> scsi0-cd0: /tmp/cdrom.qcow2 (qcow2)
>>>> Removable device: not locked, tray closed
>>>> Backing file:
>>>> /home/kwolf/images/iso/Fedora-18-x86_64-Live-Desktop.iso (chain
>>>> depth: 1)
>>>> I/O throttling: bps=1048576 bps_rd=0 bps_wr=0 bps_max=104857
>>>> bps_rd_max=0 bps_wr_max=0 iops=0 iops_rd=0 iops_wr=0 iops_max=0
>>>> iops_rd_max=0 iops_wr_max=0 iops_size=0
>>>>
>>>> Do you really want to remove the newline?
>>> I'm not, but Markus suggest to do so.
>>>
>> Why the new line matters? I think there is a QMP interface available,
>> so the hmp output format
>> would not bother much, just need to tip clear the info.
> I want this fixed:
>
> $ qemu -nodefaults -nographic -monitor stdio -S -drive if=none,file=tmp.img
> QEMU 1.6.50 monitor - type 'help' for more information
> (qemu) info block
> none0: tmp.img (raw)
> Removable device: not locked, tray closed
> [not inserted](qemu)
>
> Output doesn't end with newline, messing up the prompt.
>
I see, no end with newline is bad, should fix.
> Elswhere in the thread, we concluded that the offending '[not inserted]'
> is bogus, and should be dropped.
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()
2013-10-16 7:56 ` Wenchao Xia
@ 2013-10-16 9:03 ` mike
0 siblings, 0 replies; 12+ messages in thread
From: mike @ 2013-10-16 9:03 UTC (permalink / raw)
To: Wenchao Xia
Cc: Kevin Wolf, benoit, Markus Armbruster, qemu-devel, lcapitulino,
stefanha
On 10/16/2013 03:56 PM, Wenchao Xia wrote:
> 于 2013/10/16 15:47, Markus Armbruster 写道:
>> Wenchao Xia<xiawenc@linux.vnet.ibm.com> writes:
>>
>>> 于 2013/10/15 18:07, mike 写道:
>>>> On 10/15/2013 04:58 PM, Kevin Wolf wrote:
>>>>> Am 15.10.2013 um 05:38 hat mike geschrieben:
>>>>>> 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
>>>>>> [...]
>>>>>> It was changed to add this, so there maybe some reasons I think,
>>>>> Like everything else in that commit, I did that change because I
>>>>> found it
>>>>> more readable.
>>>>>
>>>>> The problem seems to be commit 3e9fab69 ('block: Add support for
>>>>> throttling burst max in QMP and the command line'), which added a
>>>>> bogus
>>>>> "[not inserted]" message. We simply need to drop it altogether
>>>>> instead of
>>>>> adding a newline.
>>>>>
>>>> Yes, I agree with you. but maybe need the author of the commit
>>>> 3e9fab69
>>>> ('block: Add support for throttling burst max in QMP and the command
>>>> line')
>>>> to have some comments on this line, I think.
>>>>>>> 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");
>>>>>>> }
>>>>> Why? Look:
>>>>>
>>>>> (qemu) info block
>>>>> scsi0-cd0: /tmp/cdrom.qcow2 (qcow2)
>>>>> Removable device: not locked, tray closed
>>>>> Backing file:
>>>>> /home/kwolf/images/iso/Fedora-18-x86_64-Live-Desktop.iso (chain
>>>>> depth: 1)
>>>>> I/O throttling: bps=1048576 bps_rd=0 bps_wr=0 bps_max=104857
>>>>> bps_rd_max=0 bps_wr_max=0 iops=0 iops_rd=0 iops_wr=0 iops_max=0
>>>>> iops_rd_max=0 iops_wr_max=0 iops_size=0
>>>>>
>>>>> Do you really want to remove the newline?
>>>> I'm not, but Markus suggest to do so.
>>>>
>>> Why the new line matters? I think there is a QMP interface available,
>>> so the hmp output format
>>> would not bother much, just need to tip clear the info.
>> I want this fixed:
>>
>> $ qemu -nodefaults -nographic -monitor stdio -S -drive
>> if=none,file=tmp.img
>> QEMU 1.6.50 monitor - type 'help' for more information
>> (qemu) info block
>> none0: tmp.img (raw)
>> Removable device: not locked, tray closed
>> [not inserted](qemu)
>>
>> Output doesn't end with newline, messing up the prompt.
>>
> I see, no end with newline is bad, should fix.
>
>
OK, I will make a patch to drop this ' [not inserted]' line instead of
add a new line.
Thanks
Mike
>> Elswhere in the thread, we concluded that the offending '[not inserted]'
>> is bogus, and should be dropped.
>>
>
>
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2013-10-16 9:04 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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).