All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH V5 1/7] monitor: avoid direct use of global *cur_mon in completion functions
Date: Wed, 10 Jul 2013 14:06:58 +0800	[thread overview]
Message-ID: <51DCFA02.4030202@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130709101439.4e1d45b3@redhat.com>

于 2013-7-9 22:14, Luiz Capitulino 写道:
> On Tue, 09 Jul 2013 22:03:42 +0800
> Wenchao Xia <xiawenc@linux.vnet.ibm.com> wrote:
>
>>
>>>> You could pass cur_mon to readline_completion() in readline_handle_byte()
>>>> to avoid all this, but it would be preferable to clarify the matter.
>>>>
>>>> This is also another benefit of having readline_completion() in a
>>>> different patch, you can (and should!) clarify this point in the commit
>>>> log along with testing results.
>>>>
>>>     OK, I'll test multiple monitors case.
>>>
>>>
>>>
>>     Do you have an example about how invoke qemu with multiple monitor?
>> Do you have recommendation about the way to connect to qemu's moniotr?
>> I tried pty with minicom but it seems not good, so wonder your method.
>
> You can open telnet sessions:
>
>   -monitor tcp:0:4444,server,nowait,telnet \
>   -monitor tcp:0:4445,server,nowait,telnet
>
> But note that, besides testing, I'd like to see an explanation on
> the commitlog as to why dropping cur_mon doesn't brake the current
> code.
>

   Thanks for the info, it works now.
   After re-check the code in readline_completion(), I think current
code with cur_mon, is redundant:

     mon = cur_mon;
     ...

     } else {
         monitor_printf(mon, "\n");
         ...
          ...
         for(i = 0; i < rs->nb_completions; i++) {
             monitor_printf(rs->mon, "%-*s", max_width, rs->completions[i]);
             if (++j == nb_cols || i == (rs->nb_completions - 1)) {
                 monitor_printf(rs->mon, "\n");
                 j = 0;
             }
         }
         readline_show_prompt(rs);
     }

   You can see later, it uses rs->mon to printf the auto completion
result, so the first 'monitor_printf(mon, "\n");', is used to start
a new line for the completion result, so mon should always be equal
to rs->mon, I can't think out a case that one monitor instance does
not print tips in new line while another monitor instance does. I'll
add a few line for it in commit message.

   About pass cur_mon to readline_completion(), I think parameter *rs
already have member rs->mon, allowing specify *mon would specify
the encapsulation a bit.

-- 
Best Regards

Wenchao Xia

  reply	other threads:[~2013-07-10  6:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-29  3:52 [Qemu-devel] [PATCH V5 0/7] monitor: support sub command group in auto completion and help Wenchao Xia
2013-06-29  3:52 ` [Qemu-devel] [PATCH V5 1/7] monitor: avoid direct use of global *cur_mon in completion functions Wenchao Xia
2013-07-08 15:17   ` Luiz Capitulino
2013-07-09  2:06     ` Wenchao Xia
2013-07-09 14:03       ` Wenchao Xia
2013-07-09 14:14         ` Luiz Capitulino
2013-07-10  6:06           ` Wenchao Xia [this message]
2013-06-29  3:52 ` [Qemu-devel] [PATCH V5 2/7] monitor: avoid direct use of global variable *mon_cmds Wenchao Xia
2013-07-08 15:29   ` Luiz Capitulino
2013-06-29  3:52 ` [Qemu-devel] [PATCH V5 3/7] monitor: code move for parse_cmdline() Wenchao Xia
2013-07-08 15:26   ` Luiz Capitulino
2013-06-29  3:52 ` [Qemu-devel] [PATCH V5 4/7] monitor: avoid direct use of global *info_cmds in help functions Wenchao Xia
2013-07-08 15:45   ` Luiz Capitulino
2013-07-10  6:45     ` Wenchao Xia
2013-06-29  3:52 ` [Qemu-devel] [PATCH V5 5/7] monitor: support sub commands in auto completion Wenchao Xia
2013-06-29  3:53 ` [Qemu-devel] [PATCH V5 6/7] monitor: improve "help" in auto completion for sub command Wenchao Xia
2013-07-08 16:09   ` Luiz Capitulino
2013-07-10  6:46     ` Wenchao Xia
2013-06-29  3:53 ` [Qemu-devel] [PATCH V5 7/7] monitor: improve "help" to allow show details of single command in sub group Wenchao Xia
2013-07-08 16:17   ` Luiz Capitulino
2013-07-10  6:47     ` Wenchao Xia
2013-07-07 22:39 ` [Qemu-devel] [PATCH V5 0/7] monitor: support sub command group in auto completion and help Wenchao Xia
2013-07-08 13:33   ` Luiz Capitulino

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=51DCFA02.4030202@linux.vnet.ibm.com \
    --to=xiawenc@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@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 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.