Patchwork [FOR,0.12,03/18] monitor: Fix double-prompt after "change vnc passwd BLA"

login
register
mail settings
Submitter Markus Armbruster
Date Dec. 7, 2009, 8:37 p.m.
Message ID <1260218236-22143-4-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/40542/
State New
Headers show

Comments

Markus Armbruster - Dec. 7, 2009, 8:37 p.m.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 monitor.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

Patch

diff --git a/monitor.c b/monitor.c
index 50c616d..b9d3d92 100644
--- a/monitor.c
+++ b/monitor.c
@@ -845,12 +845,17 @@  static void do_change_block(Monitor *mon, const char *device,
     monitor_read_bdrv_key_start(mon, bs, NULL, NULL);
 }
 
-static void change_vnc_password_cb(Monitor *mon, const char *password,
-                                   void *opaque)
+static void change_vnc_password(Monitor *mon, const char *password)
 {
     if (vnc_display_password(NULL, password) < 0)
         monitor_printf(mon, "could not set VNC server password\n");
 
+}
+
+static void change_vnc_password_cb(Monitor *mon, const char *password,
+                                   void *opaque)
+{
+    change_vnc_password(mon, password);
     monitor_read_command(mon, 1);
 }
 
@@ -862,7 +867,7 @@  static void do_change_vnc(Monitor *mon, const char *target, const char *arg)
             char password[9];
             strncpy(password, arg, sizeof(password));
             password[sizeof(password) - 1] = '\0';
-            change_vnc_password_cb(mon, password, NULL);
+            change_vnc_password(mon, password);
         } else {
             monitor_read_password(mon, change_vnc_password_cb, NULL);
         }