• Drop redundant typecasts in both variants and remove the pointless
    round-up in the UNIX version.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Currently, ip_id is always initialized to 0 on slirp startup (despite
    the broken attempt to derive it from the clock). This is good for
    reproducibility. But it is not preserved across save/restore. This patch
    therefore drops the dead initialization code from ip_init and introduces
    ip_id to the persistent slirp state.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • In order to prepare re-initialization and multi-instance slirp, factor
    out init code that is of global scope and (at least for now) only need
    to be run once.
    
    This also fixes the potentially uninitialized use of our_addr in
    get_dns_addr.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • This changes the filename handling from a static buffer in tftp_session
    for the client-provided name + prefix to a dynamically allocated buffer
    that keeps the combined path in one place.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Specifically make the filename extraction more readable, and always
    report errors back to the client.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • The return code of tftp_send_error is not used, drop it. And also make
    sure to always terminate the session.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Perform check for set prefix early (if it's not given, tftp is disabled)
    and drop redundant second check.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • As agreed on the mailing list, there is no interest in keeping the
    usually disabled slirp statistics in the tree. So this patch removes
    them.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • After all its years inside the qemu tree, there is no point in keeping
    the dead code paths of slirp. This patch is a first round of removing
    usually commented out code parts. More cleanups need to follow (and
    maybe finally a proper reindention).
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Break out sockstats from the slirp statistics and present them under the
    new info category "usernet". This patch also improves the current output
    /wrt proper reporting connection source and destination.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Required for pretty-printing.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Prevent that the users accidentally shoots down dynamic sockets. This
    allows to remove looping for removals as there can now only be one
    match.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Mark sockets that describe host forwardings. This is required for their
    (and only their) proper deletion and for pretty-printing.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • This prepares for adding flags to socket.so_state that must not be
    removed during the lifetime of a socket.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Extend the hostfwd rule format so that the user can specify on which
    host interface qemu should listen for incoming connections. If omitted,
    binding will takes place against all interfaces.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Improve the monitor interface for adding and removing host forwarding
    rules by splitting it up in two commands and rename them to hostfwd_add
    and hostfwd_remove. Also split up the paths taken for legacy -redir
    support and the monitor add command as the latter will be extended later
    on.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • For UDP host forwardings, fport is not stable, every outgoing packet of
    the redirection can modify it. Use getsockname instead to look up the
    port that is actually used on the host side.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • With the internal IP configuration made more flexible, we can now
    enhance the user interface. This patch adds a number of new options to
    "-net user": net (address and mask), host, dhcpstart, dns and smbserver.
    It also renames "redir" to "hostfwd" and "channel" to "guestfwd" in
    order to (hopefully) clarify their meanings. The format of guestfwd is
    extended so that the user can define not only the port but also the
    virtual server's IP address the forwarding starts from.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • The user mode IP stack is currently only minimally configurable /wrt to
    its virtual IP addresses. This is unfortunate if some guest has a fixed
    idea of which IP addresses to use.
    
    Therefore this patch prepares the stack for fully configurable IP
    addresses and masks. The user interface and default addresses remain
    untouched in this step, they will be enhanced in the following patch.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • So far a couple of slirp-related parameters were expressed via
    stand-alone command line options. This it inconsistent and unintuitive.
    Moreover, it prevents both dynamically reconfigured (host_net_add/
    delete) and multi-instance slirp.
    
    This patch refactors the configuration by turning -smb, -redir, -tftp
    and -bootp as well as -net channel into options of "-net user". The old
    stand-alone command line options are still processed, but no longer
    advertised. This allows smooth migration of management applications to
    to the new syntax and also the extension of that syntax later in this
    series.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • In order to parse multiple instances of the same param=value pair,
    introduce get_next_param_value which can pass back to string parsing
    position after reading a parameter value.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • This reverts commit 1c6ed9f3.
    
    It's redundant to slirp statistics, which are going to be split up /
    reworked later on.
    
    Conflicts:
    
    	monitor.c
    	net.c
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • The socket faddr/fport is already updated a few lines below, so these
    are completely redundant.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Hi all,
    this patch implements zooming capabilities for the sdl interface.
    A new sdl_zoom_blit function is added that is able to scale and blit a
    portion of a surface into another.
    This way we can enable SDL_RESIZABLE and have a real_screen surface with
    a different size than the guest surface and let sdl_zoom_blit take care
    of the problem.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Stefano Stabellini authored
     
    Browse Code »
  • Updated to use C99 comments.
    
    Signed-off-by: Filip Navara <filip.navara@gmail.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Filip Navara authored
     
    Browse Code »