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-devel

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

To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] [xend] Allow adding VIF devices to VM in halted state
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Tue, 12 Dec 2006 15:42:11 -0700
Delivery-date: Tue, 12 Dec 2006 14:46:03 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.8 (X11/20061025)
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
<Prev in Thread] Current Thread [Next in Thread>