From: Daniel Stekloff Subject: [PATCH][XM-TEST][1/3] New Network Infrastructure for Xm-Test Date: Mon, 24 Apr 2006 16:34:25 -0700 Message-ID: <1145921666.4390.26.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-FpyeFZxpuqEJGW3v6LOs" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ewan Mellor , xen-devel Cc: Dan Smith List-Id: xen-devel@lists.xenproject.org --=-FpyeFZxpuqEJGW3v6LOs Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, This patch and the two that will follow add a new network infrastructure to xm-test. The goal is to make writing tests with networking easy. The patches add a new XenDevice class and NetConfig class. The XenDevice and the XenNetDevice subclass represent devices in xm-test and are linked to the XenDomains. The NetConfig class manages xm-test's network configuration. The patches make it possible to easily create a domain with a network device. The XmTestNetDomain class creates a domain with a single ethernet device. It automatically grabs an IP and runs the necessary commands on the guest domain - ifconfig - for you. Or, you can create domains with XmTestDomain and then use the new device factory to add new devices to the domain: domain = XmTestDomain() domain.newDevice(XenNetDevice, "eth0") Xm-test networking must be configured when it's made. There are new options for configure that set IP address range - it uses the zeroconf range as default, IP network address, and IP netmask. Xm-test refers to this range for grabbing and configuring IPs for test domains. NOTE: Xm-Test with these patches will only support a bridged environment and the range of addresses provided. Features that need to be added following this set: 1) DHCP - setting configuration to use DHCP for IPs rather than a configured range. 2) NAT environment 3) Routed environment 4) Attaching and detaching devices to existing domains. The first patch, which is included, creates a domain type attribute for XenDomain, marking the domain as either PV for Para-virt domU or HVM for a fully virtualized domain. The XenNetDevice checks to see what the current domain is to set specific parameters. All comments are welcome. Thanks, Dan --=-FpyeFZxpuqEJGW3v6LOs Content-Disposition: attachment; filename=xmtest-add-domain-type-1.patch Content-Type: text/x-patch; name=xmtest-add-domain-type-1.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit # HG changeset patch # User stekloff@dyn9047022152.beaverton.ibm.com # Node ID 5562ee51bb7506266dc6d422af028a9e566d5305 # Parent a5fcffc826f3c77a8b28a78fbf099fde7ea27f0b First step to network infrastructure, add a type to XenDomain to identify it as HVM or PV rather than using the config time option. The forthcoming XenNetDevice will need to check. This is also the first step toward running PV and HVM domains at the same time. Signed-off-by: Daniel Stekloff diff -r a5fcffc826f3 -r 5562ee51bb75 tools/xm-test/lib/XmTestLib/XenDomain.py --- a/tools/xm-test/lib/XmTestLib/XenDomain.py Mon Apr 24 17:07:27 2006 +++ b/tools/xm-test/lib/XmTestLib/XenDomain.py Mon Apr 24 21:41:58 2006 @@ -193,6 +193,12 @@ self.name = getUniqueName() self.config = config + # Set domain type, either PV for ParaVirt domU or HVM for + # FullVirt domain + if ENABLE_HVM_SUPPORT: + self.type = "HVM" + else: + self.type = "PV" def start(self): @@ -203,6 +209,10 @@ extra=output, errorcode=ret) + # HVM domains require waiting for boot + if self.getDomainType() == "HVM": + waitForBoot() + def stop(self): prog = "xm" cmd = " shutdown " @@ -224,6 +234,9 @@ def getId(self): return domid(self.getName()); + + def getDomainType(self): + return self.type class XmTestDomain(XenDomain): @@ -246,11 +259,6 @@ XenDomain.__init__(self, config.getOpt("name"), config=config) - def start(self): - XenDomain.start(self) - if ENABLE_HVM_SUPPORT: - waitForBoot() - def minSafeMem(self): return 32 --=-FpyeFZxpuqEJGW3v6LOs Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-FpyeFZxpuqEJGW3v6LOs--