and cannot be supported in this form.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
\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\\
$\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
}
-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}
/*
- * The VDI class.
- *
+ * The VDI class.
+ *
* A virtual disk image.
*/
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;
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.
*/
{ .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) },
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);
}
}
-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)
{
VDI_attr_ro = ['VBDs',
'physical_utilisation',
'sector_size',
- 'type',
- 'parent',
- 'children']
+ 'type']
VDI_attr_rw = ['name_label',
'name_description',
'SR',
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)
'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,
})
'sector_size',
'virtual_size',
'physical_utilisation',
- 'parent',
- 'children',
'sharable',
'read_only']
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"
'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,