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

[Xen-changelog] [xen-unstable] Rename VM.otherConfig to VM.other_config, for consistency with the other fields,



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1170072673 0
# Node ID ae881e7b0c5ed3a784a89cffadfbd180081188e0
# Parent  bb15af2c2b4a52ef8a3ce9646507b956e6eae322
Rename VM.otherConfig to VM.other_config, for consistency with the other fields,
and implement add_to_other_config and remove_from_other_config in the C
bindings.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 docs/xen-api/xenapi-datamodel.tex |   59 +++++++++++++++++++-------------------
 tools/libxen/include/xen_vm.h     |   35 ++++++++++++++++------
 tools/libxen/src/xen_vm.c         |   54 ++++++++++++++++++++++++++++------
 tools/python/xen/xend/XendAPI.py  |   20 ++++++------
 4 files changed, 110 insertions(+), 58 deletions(-)

diff -r bb15af2c2b4a -r ae881e7b0c5e docs/xen-api/xenapi-datamodel.tex
--- a/docs/xen-api/xenapi-datamodel.tex Mon Jan 29 00:05:40 2007 +0000
+++ b/docs/xen-api/xenapi-datamodel.tex Mon Jan 29 12:11:13 2007 +0000
@@ -1122,7 +1122,7 @@ Quals & Field & Type & Description \\
 $\mathit{RW}$ &  {\tt platform/enable\_audio} & bool & emulate audio \\
 $\mathit{RO}_\mathit{ins}$ &  {\tt PCI\_bus} & string & PCI bus path for 
pass-through devices \\
 $\mathit{RO}_\mathit{run}$ &  {\tt tools\_version} & (string $\rightarrow$ 
string) Map & versions of installed paravirtualised drivers \\
-$\mathit{RW}$ &  {\tt otherConfig} & (string $\rightarrow$ string) Map & 
additional configuration \\
+$\mathit{RW}$ &  {\tt other\_config} & (string $\rightarrow$ string) Map & 
additional configuration \\
 \hline
 \end{longtable}
 \subsection{Additional RPCs associated with class: VM}
@@ -3895,13 +3895,13 @@ value of the field
 \vspace{0.3cm}
 \vspace{0.3cm}
 \vspace{0.3cm}
-\subsubsection{RPC name:~get\_otherConfig}
-
-{\bf Overview:} 
-Get the otherConfig field of the given VM.
-
- \noindent {\bf Signature:} 
-\begin{verbatim} ((string -> string) Map) get_otherConfig (session_id s, VM 
ref self)\end{verbatim}
+\subsubsection{RPC name:~get\_other\_config}
+
+{\bf Overview:} 
+Get the other\_config field of the given VM.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} ((string -> string) Map) get_other_config (session_id s, VM 
ref self)\end{verbatim}
 
 
 \noindent{\bf Arguments:}
@@ -3927,13 +3927,13 @@ value of the field
 \vspace{0.3cm}
 \vspace{0.3cm}
 \vspace{0.3cm}
-\subsubsection{RPC name:~set\_otherConfig}
-
-{\bf Overview:} 
-Set the otherConfig field of the given VM.
-
- \noindent {\bf Signature:} 
-\begin{verbatim} void set_otherConfig (session_id s, VM ref self, (string -> 
string) Map value)\end{verbatim}
+\subsubsection{RPC name:~set\_other\_config}
+
+{\bf Overview:} 
+Set the other\_config field of the given VM.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} void set_other_config (session_id s, VM ref self, (string -> 
string) Map value)\end{verbatim}
 
 
 \noindent{\bf Arguments:}
@@ -3961,13 +3961,13 @@ void
 \vspace{0.3cm}
 \vspace{0.3cm}
 \vspace{0.3cm}
-\subsubsection{RPC name:~add\_to\_otherConfig}
-
-{\bf Overview:} 
-map add message derived from field otherConfig of object VM
-
- \noindent {\bf Signature:} 
-\begin{verbatim} void add_to_otherConfig (session_id s, VM ref self, string 
key, string value)\end{verbatim}
+\subsubsection{RPC name:~add\_to\_other\_config}
+
+{\bf Overview:} 
+Add the given key-value pair to the other\_config field of the given VM.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} void add_to_other_config (session_id s, VM ref self, string 
key, string value)\end{verbatim}
 
 
 \noindent{\bf Arguments:}
@@ -3997,13 +3997,14 @@ void
 \vspace{0.3cm}
 \vspace{0.3cm}
 \vspace{0.3cm}
-\subsubsection{RPC name:~remove\_from\_otherConfig}
-
-{\bf Overview:} 
-map remove message derived from field otherConfig of object VM
-
- \noindent {\bf Signature:} 
-\begin{verbatim} void remove_from_otherConfig (session_id s, VM ref self, 
string key)\end{verbatim}
+\subsubsection{RPC name:~remove\_from\_other\_config}
+
+{\bf Overview:} 
+Remove the given key and its corresponding value from the other\_config
+field of the given VM.  If the key is not in that Map, then do nothing.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} void remove_from_other_config (session_id s, VM ref self, 
string key)\end{verbatim}
 
 
 \noindent{\bf Arguments:}
diff -r bb15af2c2b4a -r ae881e7b0c5e tools/libxen/include/xen_vm.h
--- a/tools/libxen/include/xen_vm.h     Mon Jan 29 00:05:40 2007 +0000
+++ b/tools/libxen/include/xen_vm.h     Mon Jan 29 12:11:13 2007 +0000
@@ -141,7 +141,7 @@ typedef struct xen_vm_record
     bool platform_enable_audio;
     char *pci_bus;
     xen_string_string_map *tools_version;
-    xen_string_string_map *otherconfig;
+    xen_string_string_map *other_config;
 } xen_vm_record;
 
 /**
@@ -555,10 +555,10 @@ xen_vm_get_tools_version(xen_session *se
 
 
 /**
- * Get the otherConfig field of the given VM.
- */
-extern bool
-xen_vm_get_otherconfig(xen_session *session, xen_string_string_map **result, 
xen_vm vm);
+ * Get the other_config field of the given VM.
+ */
+extern bool
+xen_vm_get_other_config(xen_session *session, xen_string_string_map **result, 
xen_vm vm);
 
 
 /**
@@ -783,10 +783,27 @@ xen_vm_set_platform_enable_audio(xen_ses
 
 
 /**
- * Set the otherConfig field of the given VM.
- */
-extern bool
-xen_vm_set_otherconfig(xen_session *session, xen_vm vm, xen_string_string_map 
*otherconfig);
+ * Set the other_config field of the given VM.
+ */
+extern bool
+xen_vm_set_other_config(xen_session *session, xen_vm vm, xen_string_string_map 
*other_config);
+
+
+/**
+ * Add the given key-value pair to the other_config field of the given
+ * VM.
+ */
+extern bool
+xen_vm_add_to_other_config(xen_session *session, xen_vm vm, char *key, char 
*value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * other_config field of the given VM.  If the key is not in that Map, then do
+ * nothing.
+ */
+extern bool
+xen_vm_remove_from_other_config(xen_session *session, xen_vm vm, char *key);
 
 
 /**
diff -r bb15af2c2b4a -r ae881e7b0c5e tools/libxen/src/xen_vm.c
--- a/tools/libxen/src/xen_vm.c Mon Jan 29 00:05:40 2007 +0000
+++ b/tools/libxen/src/xen_vm.c Mon Jan 29 12:11:13 2007 +0000
@@ -174,9 +174,9 @@ static const struct_member xen_vm_record
         { .key = "tools_version",
           .type = &abstract_type_string_string_map,
           .offset = offsetof(xen_vm_record, tools_version) },
-        { .key = "otherConfig",
+        { .key = "other_config",
           .type = &abstract_type_string_string_map,
-          .offset = offsetof(xen_vm_record, otherconfig) }
+          .offset = offsetof(xen_vm_record, other_config) }
     };
 
 const abstract_type xen_vm_record_abstract_type_ =
@@ -221,7 +221,7 @@ xen_vm_record_free(xen_vm_record *record
     free(record->platform_serial);
     free(record->pci_bus);
     xen_string_string_map_free(record->tools_version);
-    xen_string_string_map_free(record->otherconfig);
+    xen_string_string_map_free(record->other_config);
     free(record);
 }
 
@@ -989,7 +989,7 @@ xen_vm_get_tools_version(xen_session *se
 
 
 bool
-xen_vm_get_otherconfig(xen_session *session, xen_string_string_map **result, 
xen_vm vm)
+xen_vm_get_other_config(xen_session *session, xen_string_string_map **result, 
xen_vm vm)
 {
     abstract_value param_values[] =
         {
@@ -1000,7 +1000,7 @@ xen_vm_get_otherconfig(xen_session *sess
     abstract_type result_type = abstract_type_string_string_map;
 
     *result = NULL;
-    XEN_CALL_("VM.get_otherConfig");
+    XEN_CALL_("VM.get_other_config");
     return session->ok;
 }
 
@@ -1502,17 +1502,51 @@ xen_vm_set_platform_enable_audio(xen_ses
 
 
 bool
-xen_vm_set_otherconfig(xen_session *session, xen_vm vm, xen_string_string_map 
*otherconfig)
+xen_vm_set_other_config(xen_session *session, xen_vm vm, xen_string_string_map 
*other_config)
 {
     abstract_value param_values[] =
         {
             { .type = &abstract_type_string,
               .u.string_val = vm },
             { .type = &abstract_type_string_string_map,
-              .u.set_val = (arbitrary_set *)otherconfig }
-        };
-
-    xen_call_(session, "VM.set_otherConfig", param_values, 2, NULL, NULL);
+              .u.set_val = (arbitrary_set *)other_config }
+        };
+
+    xen_call_(session, "VM.set_other_config", param_values, 2, NULL, NULL);
+    return session->ok;
+}
+
+
+bool
+xen_vm_add_to_other_config(xen_session *session, xen_vm vm, char *key, char 
*value)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm },
+            { .type = &abstract_type_string,
+              .u.string_val = key },
+            { .type = &abstract_type_string,
+              .u.string_val = value }
+        };
+
+    xen_call_(session, "VM.add_to_other_config", param_values, 3, NULL, NULL);
+    return session->ok;
+}
+
+
+bool
+xen_vm_remove_from_other_config(xen_session *session, xen_vm vm, char *key)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm },
+            { .type = &abstract_type_string,
+              .u.string_val = key }
+        };
+
+    xen_call_(session, "VM.remove_from_other_config", param_values, 2, NULL, 
NULL);
     return session->ok;
 }
 
diff -r bb15af2c2b4a -r ae881e7b0c5e tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Mon Jan 29 00:05:40 2007 +0000
+++ b/tools/python/xen/xend/XendAPI.py  Mon Jan 29 12:11:13 2007 +0000
@@ -868,7 +868,7 @@ class XendAPI(object):
                   'platform_clock_offset',
                   'platform_enable_audio',
                   'platform_keymap',
-                  'otherConfig']
+                  'other_config']
 
     VM_methods = [('clone', 'VM'),
                   ('start', None),
@@ -880,8 +880,8 @@ class XendAPI(object):
                   ('hard_reboot', None),
                   ('suspend', None),
                   ('resume', None),
-                  ('add_to_otherConfig', None),
-                  ('remove_from_otherConfig', None)]
+                  ('add_to_other_config', None),
+                  ('remove_from_other_config', None)]
     
     VM_funcs  = [('create', 'VM'),
                  ('get_by_name_label', 'Set(VM)')]
@@ -920,7 +920,7 @@ class XendAPI(object):
         'platform_keymap',
         'grub_cmdline',
         'PCI_bus',
-        'otherConfig']
+        'other_config']
         
     def VM_get(self, name, session, vm_ref):
         return xen_api_success(
@@ -1092,8 +1092,8 @@ class XendAPI(object):
         dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
         return xen_api_success(dom.get_platform_keymap())
     
-    def VM_get_otherConfig(self, session, vm_ref):
-        return self.VM_get('otherConfig', session, vm_ref)        
+    def VM_get_other_config(self, session, vm_ref):
+        return self.VM_get('otherconfig', session, vm_ref)        
 
     def VM_set_name_label(self, session, vm_ref, label):
         dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
@@ -1192,16 +1192,16 @@ class XendAPI(object):
     def VM_set_platform_enable_audio(self, session, vm_ref, value):
         return self.VM_set('platform_enable_audio', session, vm_ref, value)
     
-    def VM_set_otherConfig(self, session, vm_ref, value):
+    def VM_set_other_config(self, session, vm_ref, value):
         return self.VM_set('otherconfig', session, vm_ref, value)
 
-    def VM_add_to_otherConfig(self, session, vm_ref, key, value):
+    def VM_add_to_other_config(self, session, vm_ref, key, value):
         dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
         if dom and 'otherconfig' in dom.info:
             dom.info['otherconfig'][key] = value
         return xen_api_success_void()
 
-    def VM_remove_from_otherConfig(self, session, vm_ref, key):
+    def VM_remove_from_other_config(self, session, vm_ref, key):
         dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
         if dom and 'otherconfig' in dom.info \
                and key in dom.info['otherconfig']:
@@ -1277,7 +1277,7 @@ class XendAPI(object):
             'platform_keymap': xeninfo.get_platform_keymap(),
             'PCI_bus': xeninfo.get_pci_bus(),
             'tools_version': xeninfo.get_tools_version(),
-            'otherConfig': xeninfo.info.get('otherconfig'),
+            'other_config': xeninfo.info.get('otherconfig'),
         }
         return xen_api_success(record)
 

_______________________________________________
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®.