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

[Xen-devel] [PATCH] [xend] Allow adding VIF devices to VM in halted state


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Jim Fehlig <jfehlig@xxxxxxxxxx>
  • Date: Tue, 12 Dec 2006 15:42:11 -0700
  • Delivery-date: Tue, 12 Dec 2006 14:46:03 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

This patch permits VIF devices to be added to a VM in the halted state. With this patch I am finally able to build up and activate a new VM using the XenAPI c-bindings, e.g.

 xen_vm_create()
 xen_vbd_create()
 xen_vif_create()
 xen_vm_start()

Regards,
Jim
# HG changeset patch
# User jfehlig@xxxxxxxxxxxxxxxxxxxxxxxxx
# Date 1165962503 25200
# Node ID f9d831a1f09789e565d245598f652410bfb39cce
# Parent  37141c3a3d39956ad5faf2d4e2a91276eaca557b
Allow adding VIF devices to a VM when in halted state.  Do not attempt to 
create the VIF device if VM is in halted state.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>

diff -r 37141c3a3d39 -r f9d831a1f097 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Dec 11 15:06:53 2006 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Tue Dec 12 15:28:23 2006 -0700
@@ -2031,7 +2031,7 @@ class XendDomainInfo:
         if not dev_uuid:
             raise XendError('Failed to create device')
         
-        if self.state in (DOM_STATE_HALTED,):
+        if self.state in (XEN_API_VM_POWER_STATE_RUNNING,):
             sxpr = self.info.device_sxpr(dev_uuid)
             devid = self.getDeviceController('vif').createDevice(sxpr)
             raise XendError("Device creation failed")
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.