Skip to contentSkip to conversation

hmp: Print \n after [not inserted]

PATCH In review Lucas Meneghel Rodrigues 1 participant 2 messages Oct 3, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hmp: Print \n after [not inserted]

I've noticed this when virt-test QEMU monitor protocol code was getting all confused with output like:

'Removable device: not locked, tray closed\n [not inserted](qemu) '

Since it was breaking some assumptions on that code. I've fixed the prompt matching code to be more lenient, but here the human monitor is supposed to print the newline anyway.

---
 hmp.c        | 2 +-
 roms/seabios | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
hmp.c +1 -1
index 5891507..2d2e5f8 100644
@@ -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) {
roms/seabios +1 -1
index ece025f..7093aa5 160000
@@ -1 +1 @@
-Subproject commit ece025f5980bae88fa677bc9c0d24d2e580e205d
+Subproject commit 7093aa58046f8685025b0198708e7768733a017d
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 8 lines · Lucas Meneghel Rodrigues

I've noticed this when virt-test QEMU monitor protocol code was getting all confused with output like:

'Removable device: not locked, tray closed\n [not inserted](qemu)'

Since it was breaking some assumptions on that code. I've fixed the prompt matching code to be more lenient, but here the human monitor is supposed to print the newline anyway.

Oh well, it seems that we're not supposed to have the newline there by the look of the resulting output. Please ignore this patch.

Quoted 28 lines
---
  hmp.c        | 2 +-
  roms/seabios | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
hmp.c +1 -1
index 5891507..2d2e5f8 100644
@@ -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) {
roms/seabios +1 -1
index ece025f..7093aa5 160000
@@ -1 +1 @@
-Subproject commit ece025f5980bae88fa677bc9c0d24d2e580e205d
+Subproject commit 7093aa58046f8685025b0198708e7768733a017d