All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH 06/14] monitor: expose readline state
Date: Wed, 18 Jan 2012 15:41:16 -0200	[thread overview]
Message-ID: <1326908484-13389-7-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1326908484-13389-1-git-send-email-lcapitulino@redhat.com>

From: Anthony Liguori <aliguori@us.ibm.com>

HMP is now implemented in terms of QMP.  The monitor has a bunch of logic to
deal with HMP right now like readline support.  Export it from the monitor so
we can consume it in hmp.c.

In short time, hmp.c will take over all of the readline bits.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 monitor.c |   11 ++++++++---
 monitor.h |    5 +++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/monitor.c b/monitor.c
index aa7259c..bd4bc4f 100644
--- a/monitor.c
+++ b/monitor.c
@@ -227,7 +227,7 @@ int monitor_cur_is_qmp(void)
     return cur_mon && monitor_ctrl_mode(cur_mon);
 }
 
-static void monitor_read_command(Monitor *mon, int show_prompt)
+void monitor_read_command(Monitor *mon, int show_prompt)
 {
     if (!mon->rs)
         return;
@@ -237,8 +237,8 @@ static void monitor_read_command(Monitor *mon, int show_prompt)
         readline_show_prompt(mon->rs);
 }
 
-static int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
-                                 void *opaque)
+int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
+                          void *opaque)
 {
     if (monitor_ctrl_mode(mon)) {
         qerror_report(QERR_MISSING_PARAMETER, "password");
@@ -4664,6 +4664,11 @@ static void bdrv_password_cb(Monitor *mon, const char *password, void *opaque)
     monitor_read_command(mon, 1);
 }
 
+ReadLineState *monitor_get_rs(Monitor *mon)
+{
+    return mon->rs;
+}
+
 int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
                                 BlockDriverCompletionFunc *completion_cb,
                                 void *opaque)
diff --git a/monitor.h b/monitor.h
index cfa2f67..887c472 100644
--- a/monitor.h
+++ b/monitor.h
@@ -6,6 +6,7 @@
 #include "qerror.h"
 #include "qdict.h"
 #include "block.h"
+#include "readline.h"
 
 extern Monitor *cur_mon;
 extern Monitor *default_mon;
@@ -66,6 +67,10 @@ int monitor_get_cpu_index(void);
 typedef void (MonitorCompletion)(void *opaque, QObject *ret_data);
 
 void monitor_set_error(Monitor *mon, QError *qerror);
+void monitor_read_command(Monitor *mon, int show_prompt);
+ReadLineState *monitor_get_rs(Monitor *mon);
+int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
+                          void *opaque);
 
 int qmp_qom_set(Monitor *mon, const QDict *qdict, QObject **ret);
 
-- 
1.7.9.rc0.dirty

  parent reply	other threads:[~2012-01-18 17:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 17:41 [Qemu-devel] [PULL 00/14]: QMP queue Luiz Capitulino
2012-01-18 17:41 ` [Qemu-devel] [PATCH 01/14] vnc: Simplify vnc_display_password() Luiz Capitulino
2012-01-18 17:41 ` [Qemu-devel] [PATCH 02/14] qapi: Convert set_password Luiz Capitulino
2012-01-18 17:41 ` [Qemu-devel] [PATCH 03/14] qapi: Convert expire_password Luiz Capitulino
2012-01-18 17:41 ` [Qemu-devel] [PATCH 04/14] block: eject_device(): Use error_set() Luiz Capitulino
2012-01-18 17:41 ` [Qemu-devel] [PATCH 05/14] qapi: Convert eject Luiz Capitulino
2012-01-18 17:41 ` Luiz Capitulino [this message]
2012-01-18 17:41 ` [Qemu-devel] [PATCH 07/14] qapi: Introduce change-vnc-password Luiz Capitulino
2012-01-18 17:41 ` [Qemu-devel] [PATCH 08/14] qerror: Extend QERR_DEVICE_ENCRYPTED Luiz Capitulino
2012-01-18 17:41 ` [Qemu-devel] [PATCH 09/14] qapi: Convert change Luiz Capitulino
2012-01-18 17:41 ` [Qemu-devel] [PATCH 10/14] qapi: Convert block_set_io_throttle Luiz Capitulino
2012-01-18 17:41 ` [Qemu-devel] [PATCH 11/14] qmp: Add missing gcc format attribute and fix format string Luiz Capitulino
2012-01-18 17:41 ` [Qemu-devel] [PATCH 12/14] qerror: add check-qerror.sh to verify alphabetical order Luiz Capitulino
2012-01-18 17:41 ` [Qemu-devel] [PATCH 13/14] qerror: restore alphabetical order over qerrors Luiz Capitulino
2012-01-18 17:41 ` [Qemu-devel] [PATCH 14/14] block: use proper qerrors in qmp_block_resize Luiz Capitulino
2012-01-24  9:35   ` Markus Armbruster
2012-01-19 18:47 ` [Qemu-devel] [PULL 00/14]: QMP queue Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2011-08-24 18:42 [Qemu-devel] [PATCH 00/14] Convert commands to QAPI (batch 1) Anthony Liguori
2011-08-24 18:43 ` [Qemu-devel] [PATCH 06/14] monitor: expose readline state Anthony Liguori

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=1326908484-13389-7-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=aliguori@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.