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] [xen-unstable] Raise the VM_BAD_POWER_STATE error with V

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Raise the VM_BAD_POWER_STATE error with VM.send_sysrq if the domain is not
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Mar 2007 21:50:18 -0700
Delivery-date: Thu, 15 Mar 2007 21:49:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1173996912 0
# Node ID 3c418dbb71b29ececbe82351b963f9f90ff2fc3e
# Parent  edccebeea4a3e75fb5b536c294c821cbd5435c08
Raise the VM_BAD_POWER_STATE error with VM.send_sysrq if the domain is not
running.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendAPI.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff -r edccebeea4a3 -r 3c418dbb71b2 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Thu Mar 15 21:59:34 2007 +0000
+++ b/tools/python/xen/xend/XendAPI.py  Thu Mar 15 22:15:12 2007 +0000
@@ -1515,10 +1515,15 @@ class XendAPI(object):
                                      "domain_unpause", vm_ref)
 
     def VM_send_sysrq(self, _, vm_ref, req):
-        xendom = XendDomain.instance()
-        xeninfo = xendom.get_vm_by_uuid(vm_ref)
+        xeninfo = XendDomain.instance().get_vm_by_uuid(vm_ref)
+        if xeninfo.state != XEN_API_VM_POWER_STATE_RUNNING:
+            return xen_api_error(
+                ['VM_BAD_POWER_STATE', vm_ref,
+                 XendDomain.POWER_STATE_NAMES[XEN_API_VM_POWER_STATE_RUNNING],
+                 XendDomain.POWER_STATE_NAMES[xeninfo.state]])
         xeninfo.send_sysrq(req)
         return xen_api_success_void()
+
 
     # Xen API: Class VM_metrics
     # ----------------------------------------------------------------

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Raise the VM_BAD_POWER_STATE error with VM.send_sysrq if the domain is not, Xen patchbot-unstable <=