WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Added network-attach and network-detach. Fixes bug #300.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Added network-attach and network-detach. Fixes bug #300.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 30 Oct 2005 22:34:17 +0000
Delivery-date: Sun, 30 Oct 2005 22:33:05 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID f3ebb4d6baaba2be00e6083a0769b6c940fcf448
# Parent  e0ea9320c3513b78c3aca003ba904cb9d1798d41
Added network-attach and network-detach.  Fixes bug #300.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r e0ea9320c351 -r f3ebb4d6baab tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Sun Oct 30 15:43:52 2005
+++ b/tools/python/xen/xm/main.py       Sun Oct 30 15:44:47 2005
@@ -112,6 +112,12 @@
                                    where <DevId> may either be the device ID
                                    or the device name as mounted in the guest.
     block-list    <DomId>          List virtual block devices for a domain
+
+    network-attach  <DomID> [script=<script>] [ip=<ip>] [mac=<mac>]
+                            [bridge=<bridge>] [backend=<backDomID>]
+        Create a new virtual network device 
+    network-detach  <DomId> <DevId>  Destroy a domain's virtual network
+                                     device, where <DevId> is the device ID.
     network-limit   <DomId> <Vif> <Credit> <Period>
         Limit the transmission rate of a virtual network interface
     network-list    <DomId>        List virtual network interfaces for a domain
@@ -588,14 +594,39 @@
     from xen.xend.XendClient import server
     server.xend_domain_device_create(dom, vbd)
 
+
+def xm_network_attach(args):
+    n = len(args)
+    if n == 0:
+        usage("network-attach")
+        
+    dom = args[0]
+    vif = ['vif']
+
+    for a in args[1:]:
+        vif.append(a.split("="))
+
+    from xen.xend.XendClient import server
+    server.xend_domain_device_create(dom, vif)
+
+
+def detach(args, command, deviceClass):
+    arg_check(args, 2, command)
+
+    dom = args[0]
+    dev = args[1]
+
+    from xen.xend.XendClient import server
+    server.xend_domain_device_destroy(dom, deviceClass, dev)
+
+
 def xm_block_detach(args):
-    arg_check(args,2,"block-detach")
-
-    dom = args[0]
-    dev = args[1]
-
-    from xen.xend.XendClient import server
-    server.xend_domain_device_destroy(dom, 'vbd', dev)
+    detach(args, 'block-detach', 'vbd')
+
+
+def xm_network_detach(args):
+    detach(args, 'network-detach', 'vif')
+
 
 def xm_vnet_list(args):
     from xen.xend.XendClient import server
@@ -673,6 +704,8 @@
     "block-detach": xm_block_detach,
     "block-list": xm_block_list,
     # network
+    "network-attach": xm_network_attach,
+    "network-detach": xm_network_detach,
     "network-limit": xm_network_limit,
     "network-list": xm_network_list,
     # vnet

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Added network-attach and network-detach. Fixes bug #300., Xen patchbot -unstable <=