Skip to contentSkip to conversation

Allow adding VIF devices to VM in halted state

PATCH Applied Jim Fehlig 2 participants 2 messages Dec 12, 2006 – Dec 13, 2006

lore
Share & tools
lore

Jim Fehlig

author
#0 lore raw

PATCH 1/1 Allow adding VIF devices to VM in halted state

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 [email protected]
# 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.

tools/python/xen/xend/XendDomainInfo.py +1 -1
diff -r 37141c3a3d39 -r f9d831a1f097 tools/python/xen/xend/XendDomainInfo.py
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

Applied
#1 lore raw
Quoted 12 lines · Jim Fehlig

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

Quoted 8 lines

# HG changeset patch
# User [email protected]
# 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.

Applied, thanks Jim.

Ewan.