qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] -net user options for setting subnet and hostname


From: Ed Swierk
Subject: [Qemu-devel] [PATCH] -net user options for setting subnet and hostname
Date: Wed, 12 Apr 2006 15:20:09 -0700

Currently the user-level networking (slirp) code in qemu uses subnet
10.0.2.0/24. Changing this hardcoded value, which can be desirable if
that subnet is already used for other purposes, requires recompiling
qemu.

The attached patch makes the subnet configurable on the command line
via a new "subnet" option to "-net user". The subnet must be specified
as "X.X.X.X/24".

This change also affected the handling of "-redir", since qemu uses
X.X.X.15 as the target address if the user does not specify one. Since
qemu parses command-line options immediately but defers acting on
"-net" options, net_slirp_redir() wouldn't know what subnet to use. It
seems that "-redir", "-smb" and "-tftp", which are all slirp-specific,
logically belong under "-net user" anyway, so I converted them into
"-net user" options. Doing so cleans up the code quite a bit, as slirp
gets initialized only by net_client_init().

Finally, the patch includes the "hostname" option to "-net user",
which I posted in a previous patch.

Comments and suggestions would be welcome.

--Ed

Attachment: qemu-slirp-options.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]