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] Added host.enabled flag.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Added host.enabled flag.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Apr 2007 07:30:19 -0700
Delivery-date: Wed, 18 Apr 2007 07:32:15 -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@xxxxxxxxxxxxxxxxxxxxx
# Date 1176754239 14400
# Node ID ed29a1d721f83424ba097385fe50204b9a46de44
# Parent  8ea56a6141dd80acbccfb71b343f93249199aef0
Added host.enabled flag.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 docs/xen-api/xenapi-datamodel.tex |   33 +++++++++++++++++++++++++++++++++
 tools/libxen/include/xen_host.h   |    8 ++++++++
 tools/libxen/src/xen_host.c       |   19 +++++++++++++++++++
 tools/python/xen/xend/XendAPI.py  |    7 ++++---
 4 files changed, 64 insertions(+), 3 deletions(-)

diff -r 8ea56a6141dd -r ed29a1d721f8 docs/xen-api/xenapi-datamodel.tex
--- a/docs/xen-api/xenapi-datamodel.tex Fri Apr 13 16:54:03 2007 +0100
+++ b/docs/xen-api/xenapi-datamodel.tex Mon Apr 16 16:10:39 2007 -0400
@@ -5086,6 +5086,7 @@ Quals & Field & Type & Description \\
 $\mathit{RO}_\mathit{run}$ &  {\tt API\_version/minor} & int & minor version 
number \\
 $\mathit{RO}_\mathit{run}$ &  {\tt API\_version/vendor} & string & 
identification of vendor \\
 $\mathit{RO}_\mathit{run}$ &  {\tt API\_version/vendor\_implementation} & 
(string $\rightarrow$ string) Map & details of vendor implementation \\
+$\mathit{RO}_\mathit{run}$ &  {\tt enabled} & bool & True if the host is 
currently enabled \\
 $\mathit{RO}_\mathit{run}$ &  {\tt software\_version} & (string $\rightarrow$ 
string) Map & version strings \\
 $\mathit{RW}$ &  {\tt other\_config} & (string $\rightarrow$ string) Map & 
additional configuration \\
 $\mathit{RO}_\mathit{run}$ &  {\tt capabilities} & string Set & Xen 
capabilities \\
@@ -5691,6 +5692,38 @@ Get the API\_version/vendor\_implementat
  \noindent {\bf Return Type:} 
 {\tt 
 (string $\rightarrow$ string) Map
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_enabled}
+
+{\bf Overview:} 
+Get the enabled field of the given host.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} bool get_enabled (session_id s, host ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+bool
 }
 
 
diff -r 8ea56a6141dd -r ed29a1d721f8 tools/libxen/include/xen_host.h
--- a/tools/libxen/include/xen_host.h   Fri Apr 13 16:54:03 2007 +0100
+++ b/tools/libxen/include/xen_host.h   Mon Apr 16 16:10:39 2007 -0400
@@ -76,6 +76,7 @@ typedef struct xen_host_record
     int64_t api_version_minor;
     char *api_version_vendor;
     xen_string_string_map *api_version_vendor_implementation;
+    bool enabled;
     xen_string_string_map *software_version;
     xen_string_string_map *other_config;
     struct xen_string_set *capabilities;
@@ -242,6 +243,13 @@ xen_host_get_api_version_vendor_implemen
 
 
 /**
+ * Get the enabled field of the given host.
+ */
+extern bool
+xen_host_get_enabled(xen_session *session, bool *result, xen_host host);
+
+
+/**
  * Get the software_version field of the given host.
  */
 extern bool
diff -r 8ea56a6141dd -r ed29a1d721f8 tools/libxen/src/xen_host.c
--- a/tools/libxen/src/xen_host.c       Fri Apr 13 16:54:03 2007 +0100
+++ b/tools/libxen/src/xen_host.c       Mon Apr 16 16:10:39 2007 -0400
@@ -64,6 +64,9 @@ static const struct_member xen_host_reco
         { .key = "API_version_vendor_implementation",
           .type = &abstract_type_string_string_map,
           .offset = offsetof(xen_host_record, 
api_version_vendor_implementation) },
+        { .key = "enabled",
+          .type = &abstract_type_bool,
+          .offset = offsetof(xen_host_record, enabled) },
         { .key = "software_version",
           .type = &abstract_type_string_string_map,
           .offset = offsetof(xen_host_record, software_version) },
@@ -307,6 +310,22 @@ xen_host_get_api_version_vendor_implemen
 
 
 bool
+xen_host_get_enabled(xen_session *session, bool *result, xen_host host)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = host }
+        };
+
+    abstract_type result_type = abstract_type_bool;
+
+    XEN_CALL_("host.get_enabled");
+    return session->ok;
+}
+
+
+bool
 xen_host_get_software_version(xen_session *session, xen_string_string_map 
**result, xen_host host)
 {
     abstract_value param_values[] =
diff -r 8ea56a6141dd -r ed29a1d721f8 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Fri Apr 13 16:54:03 2007 +0100
+++ b/tools/python/xen/xend/XendAPI.py  Mon Apr 16 16:10:39 2007 -0400
@@ -876,7 +876,8 @@ class XendAPI(object):
                     'API_version_major',
                     'API_version_minor',
                     'API_version_vendor',
-                    'API_version_vendor_implementation']
+                    'API_version_vendor_implementation',
+                    'enabled']
     
     host_attr_rw = ['name_label',
                     'name_description',
@@ -933,8 +934,8 @@ class XendAPI(object):
         return xen_api_success(XEN_API_VERSION_VENDOR)
     def host_get_API_version_vendor_implementation(self, _, ref):
         return xen_api_success(XEN_API_VERSION_VENDOR_IMPLEMENTATION)
-    def host_get_software_version(self, session, host_ref):
-        return xen_api_success(XendNode.instance().xen_version())
+    def host_get_enabled(self, _, _):
+        return xen_api_success(XendDomain.instance().allow_new_domains())
     def host_get_resident_VMs(self, session, host_ref):
         return xen_api_success(XendDomain.instance().get_domain_refs())
     def host_get_PBDs(self, _, ref):

_______________________________________________
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] Added host.enabled flag., Xen patchbot-unstable <=