• Unless a virtual server address was explicitly defined (which is
    impossible with the legacy -net channel format), guestfwd did not
    properly forwarded host->guest packets. This patch fixes it.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »


  • [ Applies on top of my recently posted slirp series. ]
    
    Allow tftp requests with filenames that do not start with a slash.
    
    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 »
  • Once again this was a long journey to reach the destination: Allow to
    instantiate slirp multiple times. But as in the past, the journey was
    worthwhile, cleaning up, fixing and enhancing various parts of the user
    space network stack along the way.
    
    What is this particular change good for? Multiple slirps instances
    allow separated user space networks for guests with multiple NICs. This
    is already possible, but without any slirp support for the second
    network, ie. without a chance to talk to that network from the host via
    IP. We have a legacy guest system here that benefits from this slirp
    enhancement, allowing us to run both of its NICs purely over
    unprivileged user space IP stacks.
    
    Another benefit of this patch is that it simply removes an artificial
    restriction of the configuration space qemu is providing, avoiding
    another source of surprises that users may face when playing with
    possible setups.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Allocate the internal slirp state dynamically and provide and call
    slirp_cleanup to properly release it after use. This patch finally
    unbreaks slirp release and re-instantiation via host_net_* monitor
    commands.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • This now also exports the internal state to the slirp users in qemu,
    returning it from slirp_init and expecting it along with service
    invocations. Additionally provide an opaque value interface for the
    callbacks from slirp into the qemu core.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • The essence of this patch is to stuff (almost) all global variables of
    the slirp stack into the structure Slirp. In this step, we still keep
    the structure as global variable, directly accessible by the whole
    stack. Changes to the external interface of slirp will be applied in
    the following patches.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • link_up is true once slirp is initialized, so these check are really not
    required.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Again lot of dead code. Remove it.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse Code »
  • Avoid the need for slirp_is_inited by refactoring the protected
    slirp_select_* functions. This also avoids the clearing of all fd sets
    on select errors.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Jan Kiszka authored
     
    Browse File »
  • 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 »
  • 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 File »
  • 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 »
  • 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 »

  • Work around buffer and ioctlsocket argument type signedness problems
    Suppress a prototype which is unused on mingw32
    Expand a macro to avoid warnings from some GCC versions
    
    Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
    Blue Swirl authored
     
    Browse Code »

  • This patch reorders the initialization of slirp itself as well as its
    associated features smb and redirection. So far the first reference to
    slirp triggered the initialization, independent of the actual -net user
    option which may carry additional parameters. Now we save any request to
    add a smb export or some redirections until the actual initialization of
    the stack. This also allows to move a few parameters that were passed
    via global variable into the argument list of net_slirp_init.
    
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Mark McLoughlin <markmc@redhat.com>
    Jan Kiszka authored
     
    Browse Dir »

  • In case you're wondering what connections exactly you have open
    or maybe redir'ed in the past, you can't really find out from qemu
    right now.
    
    This patch enables you to see all current connections the host
    only networking holds open, so you can kill them using the previous
    patch.
    
    Signed-off-by: Alexander Graf <agraf@suse.de>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Alexander Graf authored
     
    Browse File »

  • Using the new host_net_redir command you can easily create redirections
    on the fly while your VM is running.
    
    While that's great, it's missing the removal of redirections, in case you
    want to have a port closed again at a later point in time.
    
    This patch adds support for removal of redirections.
    
    Signed-off-by: Alexander Graf <agraf@suse.de>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Alexander Graf authored
     
    Browse Code »