$\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 other\_config} & (string $\rightarrow$ string) Map & additional configuration \\
+$\mathit{RO}_\mathit{run}$ & {\tt is\_control\_domain} & bool & true if this is a control domain (domain 0 or a driver domain) \\
\hline
\end{longtable}
\subsection{Additional RPCs associated with class: VM}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_is\_control\_domain}
+
+{\bf Overview:}
+Get the is\_control\_domain field of the given VM.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} bool get_is_control_domain (session_id s, VM 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 VM ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+bool
+}
+
+
+value of the field
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
$\mathit{RO}_\mathit{ins}$ & {\tt VM} & VM ref & the virtual machine \\
$\mathit{RO}_\mathit{ins}$ & {\tt backend} & VM ref & the domain where the backend is located \\
-$\mathit{RO}_\mathit{ins}$ & {\tt instance} & int & the instance number the virtual TPM represents \\
\hline
\end{longtable}
\subsection{Additional RPCs associated with class: VTPM}
char *pci_bus;
xen_string_string_map *tools_version;
xen_string_string_map *other_config;
+ bool is_control_domain;
} xen_vm_record;
/**
xen_vm_get_other_config(xen_session *session, xen_string_string_map **result, xen_vm vm);
+/**
+ * Get the is_control_domain field of the given VM.
+ */
+extern bool
+xen_vm_get_is_control_domain(xen_session *session, bool *result, xen_vm vm);
+
+
/**
* Set the name/label field of the given VM.
*/
.offset = offsetof(xen_vm_record, tools_version) },
{ .key = "other_config",
.type = &abstract_type_string_string_map,
- .offset = offsetof(xen_vm_record, other_config) }
+ .offset = offsetof(xen_vm_record, other_config) },
+ { .key = "is_control_domain",
+ .type = &abstract_type_bool,
+ .offset = offsetof(xen_vm_record, is_control_domain) }
};
const abstract_type xen_vm_record_abstract_type_ =
}
+bool
+xen_vm_get_is_control_domain(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_is_control_domain");
+ return session->ok;
+}
+
+
bool
xen_vm_set_name_label(xen_session *session, xen_vm vm, char *label)
{
'VTPMs',
'PCI_bus',
'tools_version',
+ 'is_control_domain',
]
VM_attr_rw = ['name_label',
def VM_get_other_config(self, session, vm_ref):
return self.VM_get('otherconfig', session, vm_ref)
+ def VM_get_is_control_domain(self, session, vm_ref):
+ xd = XendDomain.instance()
+ return xen_api_success(
+ xd.get_vm_by_uuid(vm_ref) == xd.privilegedDomain())
+
def VM_set_name_label(self, session, vm_ref, label):
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
dom.setName(label)
'PCI_bus': xeninfo.get_pci_bus(),
'tools_version': xeninfo.get_tools_version(),
'other_config': xeninfo.info.get('otherconfig'),
+ 'is_control_domain': xeninfo == xendom.privilegedDomain(),
}
return xen_api_success(record)