Remove the VDI.parent and VDI.children fields -- this needs more thinking out,
authorEwan Mellor <ewan@xensource.com>
Mon, 29 Jan 2007 12:19:40 +0000 (12:19 +0000)
committerEwan Mellor <ewan@xensource.com>
Mon, 29 Jan 2007 12:19:40 +0000 (12:19 +0000)
and cannot be supported in this form.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
docs/xen-api/xenapi-datamodel.tex
tools/libxen/include/xen_vdi.h
tools/libxen/src/xen_vdi.c
tools/python/xen/xend/XendAPI.py
tools/python/xen/xend/XendVDI.py

index 821ba54685af551e69250f1a5efd66f989b48a10..82fe1475506220b4f238f127d4447529f46b994f 100644 (file)
@@ -47,7 +47,6 @@ Fields that are bound together are shown in the following table:
 
 \hline
 VDI.VBDs & VBD.VDI & many-to-one\\
-VDI.parent & VDI.children & one-to-many\\
 VBD.VM & VM.VBDs & one-to-many\\
 VIF.VM & VM.VIFs & one-to-many\\
 VIF.network & network.VIFs & one-to-many\\
@@ -7703,8 +7702,6 @@ $\mathit{RW}$ &  {\tt virtual\_size} & int & size of disk as presented to the gu
 $\mathit{RO}_\mathit{run}$ &  {\tt physical\_utilisation} & int & amount of physical space that the disk image is currently taking up on the storage repository (in bytes) \\
 $\mathit{RO}_\mathit{ins}$ &  {\tt sector\_size} & int & sector size of VDI (in bytes) \\
 $\mathit{RO}_\mathit{ins}$ &  {\tt type} & vdi\_type & type of the VDI \\
-$\mathit{RO}_\mathit{ins}$ &  {\tt parent} & VDI ref & parent disk (e.g. in the case of copy on write) \\
-$\mathit{RO}_\mathit{run}$ &  {\tt children} & (VDI ref) Set & child disks (e.g. in the case of copy on write) \\
 $\mathit{RW}$ &  {\tt sharable} & bool & true if this disk may be shared \\
 $\mathit{RW}$ &  {\tt read\_only} & bool & true if this disk may ONLY be mounted read-only \\
 \hline
@@ -8196,70 +8193,6 @@ vdi\_type
 }
 
 
-value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~get\_parent}
-
-{\bf Overview:} 
-Get the parent field of the given VDI.
-
- \noindent {\bf Signature:} 
-\begin{verbatim} (VDI ref) get_parent (session_id s, VDI 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 VDI ref } & self & reference to the object \\ \hline 
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:} 
-{\tt 
-VDI ref
-}
-
-
-value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~get\_children}
-
-{\bf Overview:} 
-Get the children field of the given VDI.
-
- \noindent {\bf Signature:} 
-\begin{verbatim} ((VDI ref) Set) get_children (session_id s, VDI 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 VDI ref } & self & reference to the object \\ \hline 
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:} 
-{\tt 
-(VDI ref) Set
-}
-
-
 value of the field
 \vspace{0.3cm}
 \vspace{0.3cm}
index cfdbc6a61cefe1c024d41ee4aae2b319df90c26c..74780854641c65f69fcab18d42a52a173aa6b92b 100644 (file)
@@ -27,8 +27,8 @@
 
 
 /*
- * The VDI class. 
- *  
+ * The VDI class.
+ * 
  * A virtual disk image.
  */
 
@@ -73,8 +73,6 @@ typedef struct xen_vdi_record
     int64_t physical_utilisation;
     int64_t sector_size;
     enum xen_vdi_type type;
-    struct xen_vdi_record_opt *parent;
-    struct xen_vdi_record_opt_set *children;
     bool sharable;
     bool read_only;
 } xen_vdi_record;
@@ -256,20 +254,6 @@ extern bool
 xen_vdi_get_type(xen_session *session, enum xen_vdi_type *result, xen_vdi vdi);
 
 
-/**
- * Get the parent field of the given VDI.
- */
-extern bool
-xen_vdi_get_parent(xen_session *session, xen_vdi *result, xen_vdi vdi);
-
-
-/**
- * Get the children field of the given VDI.
- */
-extern bool
-xen_vdi_get_children(xen_session *session, struct xen_vdi_set **result, xen_vdi vdi);
-
-
 /**
  * Get the sharable field of the given VDI.
  */
index a8d157d23220545078238c9e0761d04f359a7709..ea15c408d23c70e483dcd107e14455181868e96c 100644 (file)
@@ -66,12 +66,6 @@ static const struct_member xen_vdi_record_struct_members[] =
         { .key = "type",
           .type = &xen_vdi_type_abstract_type_,
           .offset = offsetof(xen_vdi_record, type) },
-        { .key = "parent",
-          .type = &abstract_type_ref,
-          .offset = offsetof(xen_vdi_record, parent) },
-        { .key = "children",
-          .type = &abstract_type_ref_set,
-          .offset = offsetof(xen_vdi_record, children) },
         { .key = "sharable",
           .type = &abstract_type_bool,
           .offset = offsetof(xen_vdi_record, sharable) },
@@ -103,8 +97,6 @@ xen_vdi_record_free(xen_vdi_record *record)
     free(record->name_description);
     xen_sr_record_opt_free(record->sr);
     xen_vbd_record_opt_set_free(record->vbds);
-    xen_vdi_record_opt_free(record->parent);
-    xen_vdi_record_opt_set_free(record->children);
     free(record);
 }
 
@@ -330,40 +322,6 @@ xen_vdi_get_type(xen_session *session, enum xen_vdi_type *result, xen_vdi vdi)
 }
 
 
-bool
-xen_vdi_get_parent(xen_session *session, xen_vdi *result, xen_vdi vdi)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vdi }
-        };
-
-    abstract_type result_type = abstract_type_string;
-
-    *result = NULL;
-    XEN_CALL_("VDI.get_parent");
-    return session->ok;
-}
-
-
-bool
-xen_vdi_get_children(xen_session *session, struct xen_vdi_set **result, xen_vdi vdi)
-{
-    abstract_value param_values[] =
-        {
-            { .type = &abstract_type_string,
-              .u.string_val = vdi }
-        };
-
-    abstract_type result_type = abstract_type_string_set;
-
-    *result = NULL;
-    XEN_CALL_("VDI.get_children");
-    return session->ok;
-}
-
-
 bool
 xen_vdi_get_sharable(xen_session *session, bool *result, xen_vdi vdi)
 {
index 98377d939628a5ca1885f0854a96da956efe48bb..972c2b230bf639e301e4309e19b2f7d5c566c9f8 100644 (file)
@@ -1548,9 +1548,7 @@ class XendAPI(object):
     VDI_attr_ro = ['VBDs',
                    'physical_utilisation',
                    'sector_size',
-                   'type',
-                   'parent',
-                   'children']
+                   'type']
     VDI_attr_rw = ['name_label',
                    'name_description',
                    'SR',
@@ -1579,12 +1577,6 @@ class XendAPI(object):
     def VDI_get_type(self, session, vdi_ref):
         return xen_api_success(self._get_VDI(vdi_ref).type)
     
-    def VDI_get_parent(self, session, vdi_ref):
-        return xen_api_success(self._get_VDI(vdi_ref).parent)        
-    
-    def VDI_get_children(self, session, vdi_ref):
-        return xen_api_success(self._get_VDI(vdi_ref).children)        
-    
     def VDI_get_name_label(self, session, vdi_ref):
         return xen_api_success(self._get_VDI(vdi_ref).name_label)
 
@@ -1646,8 +1638,6 @@ class XendAPI(object):
             'physical_utilisation': image.physical_utilisation,
             'sector_size': image.sector_size,
             'type': image.type,
-            'parent': image.parent,
-            'children': image.children,
             'sharable': image.sharable,
             'read_only': image.read_only,
             })
index f1ea99e26bcc78269a23e8509f3f84a914bdcaaf..0868814c8f72cc3a824b2b9c9e198d8ec01d46b5 100644 (file)
@@ -57,8 +57,6 @@ class XendVDI(AutoSaveObject):
                  'sector_size',
                  'virtual_size',
                  'physical_utilisation',
-                 'parent',
-                 'children',
                  'sharable',
                  'read_only']
 
@@ -72,8 +70,6 @@ class XendVDI(AutoSaveObject):
         self.sector_size = 1024
         self.virtual_size = 0
         self.physical_utilisation = 0
-        self.parent = None
-        self.children = []
         self.sharable = False
         self.read_only = False
         self.type = "system"
@@ -148,8 +144,6 @@ class XendVDI(AutoSaveObject):
                 'virtual_size': self.virtual_size,
                 'physical_utilisation': self.physical_utilisation,
                 'sector_size': self.sector_size,
-                'parent': None,
-                'children': [],
                 'sharable': False,
                 'readonly': False,
                 'SR': self.sr_uuid,