direct-io.hg

changeset 14141:c2e7bacf0919

Fix missing bits of the docs from cset 14020, and match that change by removing
the similar fields on host_metrics, PIF_metrics, and VM_guest_metrics.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Feb 27 01:52:27 2007 +0000 (2007-02-27)
parents 42dd9055ee1f
children 1c5e6239a8d0 ffe7e8ef2c98
files docs/xen-api/xenapi-datamodel.tex tools/libxen/include/xen_host_metrics.h tools/libxen/include/xen_pif_metrics.h tools/libxen/include/xen_vm_guest_metrics.h tools/libxen/src/xen_host_metrics.c tools/libxen/src/xen_pif_metrics.c tools/libxen/src/xen_vm_guest_metrics.c tools/python/xen/xend/XendAPI.py
line diff
     1.1 --- a/docs/xen-api/xenapi-datamodel.tex	Tue Feb 27 01:05:32 2007 +0000
     1.2 +++ b/docs/xen-api/xenapi-datamodel.tex	Tue Feb 27 01:52:27 2007 +0000
     1.3 @@ -62,8 +62,6 @@ VBD.VM & VM.VBDs & one-to-many\\
     1.4  crashdump.VM & VM.crash\_dumps & one-to-many\\
     1.5  VIF.VM & VM.VIFs & one-to-many\\
     1.6  VIF.network & network.VIFs & one-to-many\\
     1.7 -host.metrics & host\_metrics.host & one-to-one\\
     1.8 -PIF.metrics & PIF\_metrics.PIF & one-to-one\\
     1.9  PIF.host & host.PIFs & one-to-many\\
    1.10  PIF.network & network.PIFs & one-to-many\\
    1.11  SR.VDIs & VDI.SR & many-to-one\\
    1.12 @@ -4475,7 +4473,6 @@ The metrics reported by the guest (as op
    1.13  Quals & Field & Type & Description \\
    1.14  \hline
    1.15  $\mathit{RO}_\mathit{run}$ &  {\tt uuid} & string & unique identifier/object reference \\
    1.16 -$\mathit{RO}_\mathit{ins}$ &  {\tt VM} & VM ref & VM to which these metrics apply \\
    1.17  $\mathit{RO}_\mathit{run}$ &  {\tt os\_version} & (string $\rightarrow$ string) Map & version of the OS \\
    1.18  $\mathit{RO}_\mathit{run}$ &  {\tt PV\_drivers\_version} & (string $\rightarrow$ string) Map & version of the PV drivers \\
    1.19  $\mathit{RO}_\mathit{run}$ &  {\tt memory} & (string $\rightarrow$ string) Map & free/used/total memory \\
    1.20 @@ -4538,38 +4535,6 @@ value of the field
    1.21  \vspace{0.3cm}
    1.22  \vspace{0.3cm}
    1.23  \vspace{0.3cm}
    1.24 -\subsubsection{RPC name:~get\_VM}
    1.25 -
    1.26 -{\bf Overview:} 
    1.27 -Get the VM field of the given VM\_guest\_metrics.
    1.28 -
    1.29 - \noindent {\bf Signature:} 
    1.30 -\begin{verbatim} (VM ref) get_VM (session_id s, VM_guest_metrics ref self)\end{verbatim}
    1.31 -
    1.32 -
    1.33 -\noindent{\bf Arguments:}
    1.34 -
    1.35 - 
    1.36 -\vspace{0.3cm}
    1.37 -\begin{tabular}{|c|c|p{7cm}|}
    1.38 - \hline
    1.39 -{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.40 -{\tt VM\_guest\_metrics ref } & self & reference to the object \\ \hline 
    1.41 -
    1.42 -\end{tabular}
    1.43 -
    1.44 -\vspace{0.3cm}
    1.45 -
    1.46 - \noindent {\bf Return Type:} 
    1.47 -{\tt 
    1.48 -VM ref
    1.49 -}
    1.50 -
    1.51 -
    1.52 -value of the field
    1.53 -\vspace{0.3cm}
    1.54 -\vspace{0.3cm}
    1.55 -\vspace{0.3cm}
    1.56  \subsubsection{RPC name:~get\_os\_version}
    1.57  
    1.58  {\bf Overview:} 
    1.59 @@ -6109,7 +6074,6 @@ The metrics associated with a host.}} \\
    1.60  Quals & Field & Type & Description \\
    1.61  \hline
    1.62  $\mathit{RO}_\mathit{run}$ &  {\tt uuid} & string & unique identifier/object reference \\
    1.63 -$\mathit{RO}_\mathit{ins}$ &  {\tt host} & host ref & Host to which these metrics apply \\
    1.64  $\mathit{RO}_\mathit{run}$ &  {\tt memory/total} & int & Host's total memory (bytes) \\
    1.65  $\mathit{RO}_\mathit{run}$ &  {\tt memory/free} & int & Host's free memory (bytes) \\
    1.66  \hline
    1.67 @@ -6168,38 +6132,6 @@ value of the field
    1.68  \vspace{0.3cm}
    1.69  \vspace{0.3cm}
    1.70  \vspace{0.3cm}
    1.71 -\subsubsection{RPC name:~get\_host}
    1.72 -
    1.73 -{\bf Overview:} 
    1.74 -Get the host field of the given host\_metrics.
    1.75 -
    1.76 - \noindent {\bf Signature:} 
    1.77 -\begin{verbatim} (host ref) get_host (session_id s, host_metrics ref self)\end{verbatim}
    1.78 -
    1.79 -
    1.80 -\noindent{\bf Arguments:}
    1.81 -
    1.82 - 
    1.83 -\vspace{0.3cm}
    1.84 -\begin{tabular}{|c|c|p{7cm}|}
    1.85 - \hline
    1.86 -{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.87 -{\tt host\_metrics ref } & self & reference to the object \\ \hline 
    1.88 -
    1.89 -\end{tabular}
    1.90 -
    1.91 -\vspace{0.3cm}
    1.92 -
    1.93 - \noindent {\bf Return Type:} 
    1.94 -{\tt 
    1.95 -host ref
    1.96 -}
    1.97 -
    1.98 -
    1.99 -value of the field
   1.100 -\vspace{0.3cm}
   1.101 -\vspace{0.3cm}
   1.102 -\vspace{0.3cm}
   1.103  \subsubsection{RPC name:~get\_memory\_total}
   1.104  
   1.105  {\bf Overview:} 
   1.106 @@ -8783,7 +8715,6 @@ The metrics associated with a physical n
   1.107  Quals & Field & Type & Description \\
   1.108  \hline
   1.109  $\mathit{RO}_\mathit{run}$ &  {\tt uuid} & string & unique identifier/object reference \\
   1.110 -$\mathit{RO}_\mathit{ins}$ &  {\tt PIF} & PIF ref & PIF to which these metrics apply \\
   1.111  $\mathit{RO}_\mathit{run}$ &  {\tt io/read\_kbs} & float & Read bandwidth (KiB/s) \\
   1.112  $\mathit{RO}_\mathit{run}$ &  {\tt io/write\_kbs} & float & Write bandwidth (KiB/s) \\
   1.113  \hline
   1.114 @@ -8842,38 +8773,6 @@ value of the field
   1.115  \vspace{0.3cm}
   1.116  \vspace{0.3cm}
   1.117  \vspace{0.3cm}
   1.118 -\subsubsection{RPC name:~get\_PIF}
   1.119 -
   1.120 -{\bf Overview:} 
   1.121 -Get the PIF field of the given PIF\_metrics.
   1.122 -
   1.123 - \noindent {\bf Signature:} 
   1.124 -\begin{verbatim} (PIF ref) get_PIF (session_id s, PIF_metrics ref self)\end{verbatim}
   1.125 -
   1.126 -
   1.127 -\noindent{\bf Arguments:}
   1.128 -
   1.129 - 
   1.130 -\vspace{0.3cm}
   1.131 -\begin{tabular}{|c|c|p{7cm}|}
   1.132 - \hline
   1.133 -{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.134 -{\tt PIF\_metrics ref } & self & reference to the object \\ \hline 
   1.135 -
   1.136 -\end{tabular}
   1.137 -
   1.138 -\vspace{0.3cm}
   1.139 -
   1.140 - \noindent {\bf Return Type:} 
   1.141 -{\tt 
   1.142 -PIF ref
   1.143 -}
   1.144 -
   1.145 -
   1.146 -value of the field
   1.147 -\vspace{0.3cm}
   1.148 -\vspace{0.3cm}
   1.149 -\vspace{0.3cm}
   1.150  \subsubsection{RPC name:~get\_io\_read\_kbs}
   1.151  
   1.152  {\bf Overview:} 
     2.1 --- a/tools/libxen/include/xen_host_metrics.h	Tue Feb 27 01:05:32 2007 +0000
     2.2 +++ b/tools/libxen/include/xen_host_metrics.h	Tue Feb 27 01:52:27 2007 +0000
     2.3 @@ -20,7 +20,6 @@
     2.4  #define XEN_HOST_METRICS_H
     2.5  
     2.6  #include "xen_common.h"
     2.7 -#include "xen_host_decl.h"
     2.8  #include "xen_host_metrics_decl.h"
     2.9  
    2.10  
    2.11 @@ -63,7 +62,6 @@ typedef struct xen_host_metrics_record
    2.12  {
    2.13      xen_host_metrics handle;
    2.14      char *uuid;
    2.15 -    struct xen_host_record_opt *host;
    2.16      int64_t memory_total;
    2.17      int64_t memory_free;
    2.18  } xen_host_metrics_record;
    2.19 @@ -170,13 +168,6 @@ xen_host_metrics_get_uuid(xen_session *s
    2.20  
    2.21  
    2.22  /**
    2.23 - * Get the host field of the given host_metrics.
    2.24 - */
    2.25 -extern bool
    2.26 -xen_host_metrics_get_host(xen_session *session, xen_host *result, xen_host_metrics host_metrics);
    2.27 -
    2.28 -
    2.29 -/**
    2.30   * Get the memory/total field of the given host_metrics.
    2.31   */
    2.32  extern bool
     3.1 --- a/tools/libxen/include/xen_pif_metrics.h	Tue Feb 27 01:05:32 2007 +0000
     3.2 +++ b/tools/libxen/include/xen_pif_metrics.h	Tue Feb 27 01:52:27 2007 +0000
     3.3 @@ -20,7 +20,6 @@
     3.4  #define XEN_PIF_METRICS_H
     3.5  
     3.6  #include "xen_common.h"
     3.7 -#include "xen_pif_decl.h"
     3.8  #include "xen_pif_metrics_decl.h"
     3.9  
    3.10  
    3.11 @@ -63,7 +62,6 @@ typedef struct xen_pif_metrics_record
    3.12  {
    3.13      xen_pif_metrics handle;
    3.14      char *uuid;
    3.15 -    struct xen_pif_record_opt *pif;
    3.16      double io_read_kbs;
    3.17      double io_write_kbs;
    3.18  } xen_pif_metrics_record;
    3.19 @@ -169,13 +167,6 @@ xen_pif_metrics_get_uuid(xen_session *se
    3.20  
    3.21  
    3.22  /**
    3.23 - * Get the PIF field of the given PIF_metrics.
    3.24 - */
    3.25 -extern bool
    3.26 -xen_pif_metrics_get_pif(xen_session *session, xen_pif *result, xen_pif_metrics pif_metrics);
    3.27 -
    3.28 -
    3.29 -/**
    3.30   * Get the io/read_kbs field of the given PIF_metrics.
    3.31   */
    3.32  extern bool
     4.1 --- a/tools/libxen/include/xen_vm_guest_metrics.h	Tue Feb 27 01:05:32 2007 +0000
     4.2 +++ b/tools/libxen/include/xen_vm_guest_metrics.h	Tue Feb 27 01:52:27 2007 +0000
     4.3 @@ -21,7 +21,6 @@
     4.4  
     4.5  #include "xen_common.h"
     4.6  #include "xen_string_string_map.h"
     4.7 -#include "xen_vm_decl.h"
     4.8  #include "xen_vm_guest_metrics_decl.h"
     4.9  
    4.10  
    4.11 @@ -64,7 +63,6 @@ typedef struct xen_vm_guest_metrics_reco
    4.12  {
    4.13      xen_vm_guest_metrics handle;
    4.14      char *uuid;
    4.15 -    struct xen_vm_record_opt *vm;
    4.16      xen_string_string_map *os_version;
    4.17      xen_string_string_map *pv_drivers_version;
    4.18      xen_string_string_map *memory;
    4.19 @@ -176,13 +174,6 @@ xen_vm_guest_metrics_get_uuid(xen_sessio
    4.20  
    4.21  
    4.22  /**
    4.23 - * Get the VM field of the given VM_guest_metrics.
    4.24 - */
    4.25 -extern bool
    4.26 -xen_vm_guest_metrics_get_vm(xen_session *session, xen_vm *result, xen_vm_guest_metrics vm_guest_metrics);
    4.27 -
    4.28 -
    4.29 -/**
    4.30   * Get the os_version field of the given VM_guest_metrics.
    4.31   */
    4.32  extern bool
    4.33 @@ -225,7 +216,8 @@ xen_vm_guest_metrics_get_other(xen_sessi
    4.34  
    4.35  
    4.36  /**
    4.37 - * Return a list of all the VM_guest_metrics instances known to the system.
    4.38 + * Return a list of all the VM_guest_metrics instances known to the
    4.39 + * system.
    4.40   */
    4.41  extern bool
    4.42  xen_vm_guest_metrics_get_all(xen_session *session, struct xen_vm_guest_metrics_set **result);
     5.1 --- a/tools/libxen/src/xen_host_metrics.c	Tue Feb 27 01:05:32 2007 +0000
     5.2 +++ b/tools/libxen/src/xen_host_metrics.c	Tue Feb 27 01:52:27 2007 +0000
     5.3 @@ -21,7 +21,6 @@
     5.4  #include <stdlib.h>
     5.5  
     5.6  #include "xen_common.h"
     5.7 -#include "xen_host.h"
     5.8  #include "xen_host_metrics.h"
     5.9  #include "xen_internal.h"
    5.10  
    5.11 @@ -40,9 +39,6 @@ static const struct_member xen_host_metr
    5.12          { .key = "uuid",
    5.13            .type = &abstract_type_string,
    5.14            .offset = offsetof(xen_host_metrics_record, uuid) },
    5.15 -        { .key = "host",
    5.16 -          .type = &abstract_type_ref,
    5.17 -          .offset = offsetof(xen_host_metrics_record, host) },
    5.18          { .key = "memory_total",
    5.19            .type = &abstract_type_int,
    5.20            .offset = offsetof(xen_host_metrics_record, memory_total) },
    5.21 @@ -70,7 +66,6 @@ xen_host_metrics_record_free(xen_host_me
    5.22      }
    5.23      free(record->handle);
    5.24      free(record->uuid);
    5.25 -    xen_host_record_opt_free(record->host);
    5.26      free(record);
    5.27  }
    5.28  
    5.29 @@ -116,23 +111,6 @@ xen_host_metrics_get_by_uuid(xen_session
    5.30  
    5.31  
    5.32  bool
    5.33 -xen_host_metrics_get_host(xen_session *session, xen_host *result, xen_host_metrics host_metrics)
    5.34 -{
    5.35 -    abstract_value param_values[] =
    5.36 -        {
    5.37 -            { .type = &abstract_type_string,
    5.38 -              .u.string_val = host_metrics }
    5.39 -        };
    5.40 -
    5.41 -    abstract_type result_type = abstract_type_string;
    5.42 -
    5.43 -    *result = NULL;
    5.44 -    XEN_CALL_("host_metrics.get_host");
    5.45 -    return session->ok;
    5.46 -}
    5.47 -
    5.48 -
    5.49 -bool
    5.50  xen_host_metrics_get_memory_total(xen_session *session, int64_t *result, xen_host_metrics host_metrics)
    5.51  {
    5.52      abstract_value param_values[] =
     6.1 --- a/tools/libxen/src/xen_pif_metrics.c	Tue Feb 27 01:05:32 2007 +0000
     6.2 +++ b/tools/libxen/src/xen_pif_metrics.c	Tue Feb 27 01:52:27 2007 +0000
     6.3 @@ -22,7 +22,6 @@
     6.4  
     6.5  #include "xen_common.h"
     6.6  #include "xen_internal.h"
     6.7 -#include "xen_pif.h"
     6.8  #include "xen_pif_metrics.h"
     6.9  
    6.10  
    6.11 @@ -40,9 +39,6 @@ static const struct_member xen_pif_metri
    6.12          { .key = "uuid",
    6.13            .type = &abstract_type_string,
    6.14            .offset = offsetof(xen_pif_metrics_record, uuid) },
    6.15 -        { .key = "PIF",
    6.16 -          .type = &abstract_type_ref,
    6.17 -          .offset = offsetof(xen_pif_metrics_record, pif) },
    6.18          { .key = "io_read_kbs",
    6.19            .type = &abstract_type_float,
    6.20            .offset = offsetof(xen_pif_metrics_record, io_read_kbs) },
    6.21 @@ -70,7 +66,6 @@ xen_pif_metrics_record_free(xen_pif_metr
    6.22      }
    6.23      free(record->handle);
    6.24      free(record->uuid);
    6.25 -    xen_pif_record_opt_free(record->pif);
    6.26      free(record);
    6.27  }
    6.28  
    6.29 @@ -116,23 +111,6 @@ xen_pif_metrics_get_by_uuid(xen_session 
    6.30  
    6.31  
    6.32  bool
    6.33 -xen_pif_metrics_get_pif(xen_session *session, xen_pif *result, xen_pif_metrics pif_metrics)
    6.34 -{
    6.35 -    abstract_value param_values[] =
    6.36 -        {
    6.37 -            { .type = &abstract_type_string,
    6.38 -              .u.string_val = pif_metrics }
    6.39 -        };
    6.40 -
    6.41 -    abstract_type result_type = abstract_type_string;
    6.42 -
    6.43 -    *result = NULL;
    6.44 -    XEN_CALL_("PIF_metrics.get_PIF");
    6.45 -    return session->ok;
    6.46 -}
    6.47 -
    6.48 -
    6.49 -bool
    6.50  xen_pif_metrics_get_io_read_kbs(xen_session *session, double *result, xen_pif_metrics pif_metrics)
    6.51  {
    6.52      abstract_value param_values[] =
     7.1 --- a/tools/libxen/src/xen_vm_guest_metrics.c	Tue Feb 27 01:05:32 2007 +0000
     7.2 +++ b/tools/libxen/src/xen_vm_guest_metrics.c	Tue Feb 27 01:52:27 2007 +0000
     7.3 @@ -23,7 +23,6 @@
     7.4  #include "xen_common.h"
     7.5  #include "xen_internal.h"
     7.6  #include "xen_string_string_map.h"
     7.7 -#include "xen_vm.h"
     7.8  #include "xen_vm_guest_metrics.h"
     7.9  
    7.10  
    7.11 @@ -41,9 +40,6 @@ static const struct_member xen_vm_guest_
    7.12          { .key = "uuid",
    7.13            .type = &abstract_type_string,
    7.14            .offset = offsetof(xen_vm_guest_metrics_record, uuid) },
    7.15 -        { .key = "VM",
    7.16 -          .type = &abstract_type_ref,
    7.17 -          .offset = offsetof(xen_vm_guest_metrics_record, vm) },
    7.18          { .key = "os_version",
    7.19            .type = &abstract_type_string_string_map,
    7.20            .offset = offsetof(xen_vm_guest_metrics_record, os_version) },
    7.21 @@ -83,7 +79,6 @@ xen_vm_guest_metrics_record_free(xen_vm_
    7.22      }
    7.23      free(record->handle);
    7.24      free(record->uuid);
    7.25 -    xen_vm_record_opt_free(record->vm);
    7.26      xen_string_string_map_free(record->os_version);
    7.27      xen_string_string_map_free(record->pv_drivers_version);
    7.28      xen_string_string_map_free(record->memory);
    7.29 @@ -135,23 +130,6 @@ xen_vm_guest_metrics_get_by_uuid(xen_ses
    7.30  
    7.31  
    7.32  bool
    7.33 -xen_vm_guest_metrics_get_vm(xen_session *session, xen_vm *result, xen_vm_guest_metrics vm_guest_metrics)
    7.34 -{
    7.35 -    abstract_value param_values[] =
    7.36 -        {
    7.37 -            { .type = &abstract_type_string,
    7.38 -              .u.string_val = vm_guest_metrics }
    7.39 -        };
    7.40 -
    7.41 -    abstract_type result_type = abstract_type_string;
    7.42 -
    7.43 -    *result = NULL;
    7.44 -    XEN_CALL_("VM_guest_metrics.get_VM");
    7.45 -    return session->ok;
    7.46 -}
    7.47 -
    7.48 -
    7.49 -bool
    7.50  xen_vm_guest_metrics_get_os_version(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics)
    7.51  {
    7.52      abstract_value param_values[] =
     8.1 --- a/tools/python/xen/xend/XendAPI.py	Tue Feb 27 01:05:32 2007 +0000
     8.2 +++ b/tools/python/xen/xend/XendAPI.py	Tue Feb 27 01:52:27 2007 +0000
     8.3 @@ -802,8 +802,7 @@ class XendAPI(object):
     8.4      # ----------------------------------------------------------------
     8.5  
     8.6      host_metrics_attr_ro = ['memory_total',
     8.7 -                            'memory_free',
     8.8 -                            'host']
     8.9 +                            'memory_free']
    8.10      host_metrics_attr_rw = []
    8.11      host_metrics_methods = []
    8.12  
    8.13 @@ -816,14 +815,10 @@ class XendAPI(object):
    8.14      def host_metrics_get_record(self, _, ref):
    8.15          return xen_api_success({
    8.16              'uuid'         : ref,
    8.17 -            'host'         : XendNode.instance().uuid,
    8.18              'memory_total' : self._host_metrics_get_memory_total(),
    8.19              'memory_free'  : self._host_metrics_get_memory_free(),
    8.20              })
    8.21  
    8.22 -    def host_metrics_get_host(self, _, ref):
    8.23 -        return xen_api_success(XendNode.instance().uuid)
    8.24 -
    8.25      def host_metrics_get_memory_total(self, _, ref):
    8.26          return xen_api_success(self._host_metrics_get_memory_total())
    8.27  
    8.28 @@ -968,8 +963,7 @@ class XendAPI(object):
    8.29      # Xen API: Class PIF_metrics
    8.30      # ----------------------------------------------------------------
    8.31  
    8.32 -    PIF_metrics_attr_ro = ['PIF',
    8.33 -                           'io_read_kbs',
    8.34 +    PIF_metrics_attr_ro = ['io_read_kbs',
    8.35                             'io_write_kbs']
    8.36      PIF_metrics_attr_rw = []
    8.37      PIF_methods = []
    8.38 @@ -983,9 +977,6 @@ class XendAPI(object):
    8.39      def PIF_metrics_get_record(self, _, ref):
    8.40          return xen_api_success(self._PIF_metrics_get(ref).get_record())
    8.41  
    8.42 -    def PIF_metrics_get_PIF(self, _, ref):
    8.43 -        return xen_api_success(self._PIF_metrics_get(ref).pif.uuid)
    8.44 -
    8.45      def PIF_metrics_get_io_read_kbs(self, _, ref):
    8.46          return xen_api_success(self._PIF_metrics_get(ref).get_io_read_kbs())
    8.47