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

[Xen-changelog] [xen-unstable] Implement the VM.auto_power_on field.



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID 737c1c11497d172d48c752cfbd05726ee44a431b
# Parent  5fc7ac854bce656f265489994679fa1645969ff3
Implement the VM.auto_power_on field.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/libxen/include/xen_vm.h |   15 +++++++++++++++
 tools/libxen/src/xen_vm.c     |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)

diff -r 5fc7ac854bce -r 737c1c11497d tools/libxen/include/xen_vm.h
--- a/tools/libxen/include/xen_vm.h     Fri Dec 08 10:57:14 2006 +0000
+++ b/tools/libxen/include/xen_vm.h     Fri Dec 08 10:59:18 2006 +0000
@@ -79,6 +79,7 @@ typedef struct xen_vm_record
     char *name_description;
     int64_t user_version;
     bool is_a_template;
+    bool auto_power_on;
     struct xen_host_record_opt *resident_on;
     int64_t memory_static_max;
     int64_t memory_dynamic_max;
@@ -277,6 +278,13 @@ xen_vm_get_is_a_template(xen_session *se
 
 
 /**
+ * Get the auto_power_on field of the given VM.
+ */
+extern bool
+xen_vm_get_auto_power_on(xen_session *session, bool *result, xen_vm vm);
+
+
+/**
  * Get the resident_on field of the given VM.
  */
 extern bool
@@ -561,6 +569,13 @@ xen_vm_set_user_version(xen_session *ses
  */
 extern bool
 xen_vm_set_is_a_template(xen_session *session, xen_vm vm, bool is_a_template);
+
+
+/**
+ * Set the auto_power_on field of the given VM.
+ */
+extern bool
+xen_vm_set_auto_power_on(xen_session *session, xen_vm vm, bool auto_power_on);
 
 
 /**
diff -r 5fc7ac854bce -r 737c1c11497d tools/libxen/src/xen_vm.c
--- a/tools/libxen/src/xen_vm.c Fri Dec 08 10:57:14 2006 +0000
+++ b/tools/libxen/src/xen_vm.c Fri Dec 08 10:59:18 2006 +0000
@@ -67,6 +67,9 @@ static const struct_member xen_vm_record
         { .key = "is_a_template",
           .type = &abstract_type_bool,
           .offset = offsetof(xen_vm_record, is_a_template) },
+        { .key = "auto_power_on",
+          .type = &abstract_type_bool,
+          .offset = offsetof(xen_vm_record, auto_power_on) },
         { .key = "resident_on",
           .type = &abstract_type_ref,
           .offset = offsetof(xen_vm_record, resident_on) },
@@ -399,6 +402,22 @@ xen_vm_get_is_a_template(xen_session *se
 
 
 bool
+xen_vm_get_auto_power_on(xen_session *session, bool *result, xen_vm vm)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm }
+        };
+
+    abstract_type result_type = abstract_type_bool;
+
+    XEN_CALL_("VM.get_auto_power_on");
+    return session->ok;
+}
+
+
+bool
 xen_vm_get_resident_on(xen_session *session, xen_host *result, xen_vm vm)
 {
     abstract_value param_values[] =
@@ -1082,6 +1101,22 @@ xen_vm_set_is_a_template(xen_session *se
 
 
 bool
+xen_vm_set_auto_power_on(xen_session *session, xen_vm vm, bool auto_power_on)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm },
+            { .type = &abstract_type_bool,
+              .u.bool_val = auto_power_on }
+        };
+
+    xen_call_(session, "VM.set_auto_power_on", param_values, 2, NULL, NULL);
+    return session->ok;
+}
+
+
+bool
 xen_vm_set_memory_dynamic_max(xen_session *session, xen_vm vm, int64_t 
dynamic_max)
 {
     abstract_value param_values[] =

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


 


Rackspace

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