• Each of the graphical frontends #include a .c file, for keymap code
    resulting in duplicated definitions & duplicated compiled code. A
    couple of small changes allowed this to be sanitized, so instead of
    doing a #include "keymaps.c", duplicating all code, we can have a
    shared keymaps.h file, and only compile code once. This allows the
    next patch to move the VncState struct out into a header file without
    causing clashing definitions.
    
    
     Makefile      |    9 +++++---
     b/keymaps.h   |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     curses.c      |    3 --
     curses_keys.h |    9 +++-----
     keymaps.c     |   45 ++++++++++++++++---------------------------
     sdl.c         |    3 --
     sdl_keysym.h  |    7 ++----
     vnc.c         |    5 +---
     vnc_keysym.h  |    7 ++----
     9 files changed, 97 insertions(+), 51 deletions(-)
    
       Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6721 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • The current 'info vnc' monitor output just displays the VNC server address
    as provided by the -vnc command line flag. This isn't particularly useful
    since it doesn't tell you what VNC is actually listening on. eg, if you
    use '-vnc :1' it is useful to know whether this translated to '0.0.0.0:5901'
    or chose IPv6 ':::5901'.  It is also useful to know the address of the
    client that is currently connected. It is also useful to know the active
    authentication (if any).
    
    This patch tweaks the monitor output to look like:
    
       (qemu) info vnc
        Server:
             address: 0.0.0.0:5902
                auth: vencrypt+x509
        Client: none
    
    And when 2 clients are connected
    
       (qemu) info vnc
        Server:
             address: 0.0.0.0:5902
                auth: vencrypt+x509
        Client:
             address: 10.33.6.67:38621
        Client:
             address: 10.33.6.63:38620
    
    More data will be added to this later in the patch series...
    
    The 'addr_to_string' helper method in this patch is overly generic
    for the needs of this patch alone. This is because it will be re-used
    by the later SASL patches in this series, where the flexibility is
    important.
    
    
     vnc.c |  137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
     1 file changed, 127 insertions(+), 10 deletions(-)
    
       Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6720 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • This patch was previously posted here:
    
      http://lists.gnu.org/archive/html/qemu-devel/2009-02/msg00820.html
    
    In the case where the TLS handshake does *not* block on I/O, QEMU
    sends the next 'start sub-auth' message twice. This seriously confuses
    the VNC client :-) Fortunately the chances of the handshake not blocking
    are close to zero for a TCP socket, which is why it has not been noticed
    thus far. Even with both client & server on localhost, I can only hit the
    bug 1 time in 20.
    
    NB, the diff context here is not too informative. If you look at the
    full code you'll see that a few lines early we called vnc_start_tls()
    which called vnc_continue_handshake() which called the method
    start_auth_vencrypt_subauth(). Hence, fixing the bug, just involves
    removing the 2nd bogus call to start_auth_vencrypt_subauth() as per
    this patch.
    
    
     vnc.c |    8 --------
     1 file changed, 8 deletions(-)
    
       Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6719 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »

  • Create a monitor terminal and pass it through the gdbstub. This allows
    to use gdb's monitor command to access the QEMU monitor. Works for all
    commands except for non-detached migration and password retrieval (user
    will receive error messages instead).
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6718 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • This allows to create monitor terminals that do not make use of the
    interactive readline back-end but rather send complete commands. The
    pass-through monitor interface of the gdbstub will be an example.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6717 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Up to now, you never really knew if you already switched the console
    after pressing CTRL-A C or if you mistyped it again. This patch
    clarifies the situation by providing a prompt in a new line and
    injecting a linebreak when switching away again. For this purpose, the
    two events CHR_EVENT_MUX_IN and CHR_EVENT_MUX_OUT are introduced and
    distributed on focus switches.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6716 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Currently all registered (and activate) monitor terminals work in
    broadcast mode: Everyone sees what someone else types on some other
    terminal and what the monitor reports back. This model is broken when
    you have a management monitor terminal that is automatically operated
    and some other terminal used for independent guest inspection. Such
    additional terminals can be multiplexed device channels or a gdb
    frontend connected to QEMU's stub.
    
    Therefore, this patch decouples the buffers and states of all monitor
    terminals, allowing the user to operate them independently. It finally
    starts to use the 'mon' parameter that was introduced earlier with the
    API rework. It also defines the default monitor: the first instantance
    that has the MONITOR_IS_DEFAULT flag set, and that is the monitor
    created via the "-monitor" command line switch (or "vc" if none is
    given).
    
    As the patch requires to rework the monitor suspension interface, it
    also takes the freedom to make it "truely" suspending (so far suspending
    meant suppressing the prompt, but inputs were still processed).
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6715 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • As another step towards decoupled monitor terminals encapsulate the
    state of the readline processor in a separate data structure called
    ReadLineState and adapt all interfaces appropriately. For now the
    monitor continues to instantiate just a single readline state.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6714 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • There is no use for the hide/show banner option, and it is applied
    inconsistently anyway (or what makes the difference between
     -serial mon:stdio and -nographic for the monitor?). So drop this mode.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6713 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Remove the static MAX_MON limit by managing monitor terminals in a
    linked list.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6712 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Refactor the monitor API and prepare it for decoupled terminals:
    term_print functions are renamed to monitor_* and all monitor services
    gain a new parameter (mon) that will once refer to the monitor instance
    the output is supposed to appear on. However, the argument remains
    unused for now. All monitor command callbacks are also extended by a mon
    parameter so that command handlers are able to pass an appropriate
    reference to monitor output services.
    
    For the case that monitor outputs so far happen without clearly
    identifiable context, the global variable cur_mon is introduced that
    shall once provide a pointer either to the current active monitor (while
    processing commands) or to the default one. On the mid or long term,
    those use case will be obsoleted so that this variable can be removed
    again.
    
    Due to the broad usage of the monitor interface, this patch mostly deals
    with converting users of the monitor API. A few of them are already
    extended to pass 'mon' from the command handler further down to internal
    functions that invoke monitor_printf.
    
    At this chance, monitor-related prototypes are moved from console.h to
    a new monitor.h. The same is done for the readline API.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6711 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Currently, waiting for the user to type in some password blocks the
    whole VM because monitor_readline starts its own I/O loop. And this loop
    also screws up reading passwords from virtual console.
    
    Patch below fixes the shortcomings by using normal I/O processing also
    for waiting on a password. To keep to modal property for the monitor
    terminal, the command handler is temporarily replaced by a password
    handler and a callback infrastructure is established to process the
    result before switching back to command mode.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6710 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Break readline_show_prompt out of readline_start so that (re-)printing
    the prompt can be controlled in a more fine-grained way.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6709 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Drop the hack to query passwords on all monitor terminals now that they
    are requested when the user initially enters 'continue'.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6708 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Reading the passwords for encrypted hard disks during early startup is
    broken (I guess for quiet a while now):
     - No monitor terminal is ready for input at this point
     - Forcing all mux'ed terminals into monitor mode can confuse other
       users of that channels
    
    To overcome these issues and to lay the ground for a clean decoupling of
    monitor terminals, this patch changes the initial password inquiry as
    follows:
     - Prevent autostart if there is some encrypted disk
     - Once the user tries to resume the VM, prompt for all missing
       passwords
     - Only resume if all passwords were accepted
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6707 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • If the backing file is encrypted, 'info block' currently does not report
    the disk as encrypted. Fix this by using the standard API to check disk
    encryption mode. Moreover, switch to a canonical output format.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6706 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • If a target uses a tiny display (like the MusicPal), the default monitor
    is currently set to the same size. Fix this by applying the same
    defaults like already used serial and virtio consoles.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6705 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Introduce bdrv_get_encrypted_filename service to allow more informative
    password prompting.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6704 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Make bdrv_iterate more useful by passing the BlockDriverState to the
    iterator instead of the device name.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6703 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Make sure that we always delete temporary disk images on error, remove
    obsolete malloc error checks and return proper error codes.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6702 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Currently, the intermediate input buffer of mux'ed character devices
    records data across all sub-devices. This has the side effect that we
    easily leak data recorded over one sub-devices to another once we switch
    the focus. Avoid data loss and confusion by defining exclusive buffers.
    
    Note: In contrast to the original author's claim, the buffering concept
    still breaks down when the fifo of the currently active sub-device is
    full. As we cannot accept futher data from this point on without risking
    to loose it, we will also miss escape sequences, just like without all
    that buffering. In short: There is no reliable escape sequence handling
    without infinite buffers or the risk of loosing some data.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6701 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Recent changes to the graphical console initialization broke the initial
    CHR_EVENT_RESET distribution. The reset BHs generated on char device
    initialization are now already consumed during machine init (ide init
    ... -> qemu_aio_wait -> qemu_bh_poll). Therefore, this patch moves the
    initial qemu_chr_reset calls into a separate funtion which is called
    after machine init.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6700 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • Cpuid should return into vec, not overwrite past address in count.
    Changeset 6565 broke this.
    
    Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6689 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »
  • SLES10 SP2 installer complains when probing a scsi disk and exits qemu
    when failing to read one of the registers.
    
    lsi_scsi: error: readb 0x15
    
    
    -- 
    Ryan Harper
    Software Engineer; Linux Technology Center
    IBM Corp., Austin, Tx
    ryanh@us.ibm.com
    
    
    
    diffstat output:
     lsi53c895a.c |    2 ++
     1 files changed, 2 insertions(+)
    
    Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
    ---
    Subject: [PATCH] lsi: add ISTAT1 register read
    From: Ryan Harper <ryanh@us.ibm.com>
    Cc: kvm@vger.kernel.org
    
    SLES10 SP2 installer complains when probing a scsi disk and exits qemu when
    failing to read one of the registers.
    
    lsi_scsi: error: readb 0x15
    
    Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6688 c046a42c-6fe2-441c-8c8c-71466251a162
    aliguori authored
     
    Browse Code »