\hline
\end{longtable}
-\vspace{1cm}
-\begin{longtable}{|ll|}
-\hline
-{\tt enum cpu\_feature} & \\
-\hline
-\hspace{0.5cm}{\tt FPU} & Onboard FPU \\
-\hspace{0.5cm}{\tt VME} & Virtual Mode Extensions \\
-\hspace{0.5cm}{\tt DE} & Debugging Extensions \\
-\hspace{0.5cm}{\tt PSE} & Page Size Extensions \\
-\hspace{0.5cm}{\tt TSC} & Time Stamp Counter \\
-\hspace{0.5cm}{\tt MSR} & Model-Specific Registers, RDMSR, WRMSR \\
-\hspace{0.5cm}{\tt PAE} & Physical Address Extensions \\
-\hspace{0.5cm}{\tt MCE} & Machine Check Architecture \\
-\hspace{0.5cm}{\tt CX8} & CMPXCHG8 instruction \\
-\hspace{0.5cm}{\tt APIC} & Onboard APIC \\
-\hspace{0.5cm}{\tt SEP} & SYSENTER/SYSEXIT \\
-\hspace{0.5cm}{\tt MTRR} & Memory Type Range Registers \\
-\hspace{0.5cm}{\tt PGE} & Page Global Enable \\
-\hspace{0.5cm}{\tt MCA} & Machine Check Architecture \\
-\hspace{0.5cm}{\tt CMOV} & CMOV instruction (FCMOVCC and FCOMI too if FPU present) \\
-\hspace{0.5cm}{\tt PAT} & Page Attribute Table \\
-\hspace{0.5cm}{\tt PSE36} & 36-bit PSEs \\
-\hspace{0.5cm}{\tt PN} & Processor serial number \\
-\hspace{0.5cm}{\tt CLFLSH} & Supports the CLFLUSH instruction \\
-\hspace{0.5cm}{\tt DTES} & Debug Trace Store \\
-\hspace{0.5cm}{\tt ACPI} & ACPI via MSR \\
-\hspace{0.5cm}{\tt MMX} & Multimedia Extensions \\
-\hspace{0.5cm}{\tt FXSR} & FXSAVE and FXRSTOR instructions (fast save and restore \\
-\hspace{0.5cm}{\tt XMM} & Streaming SIMD Extensions \\
-\hspace{0.5cm}{\tt XMM2} & Streaming SIMD Extensions-2 \\
-\hspace{0.5cm}{\tt SELFSNOOP} & CPU self snoop \\
-\hspace{0.5cm}{\tt HT} & Hyper-Threading \\
-\hspace{0.5cm}{\tt ACC} & Automatic clock control \\
-\hspace{0.5cm}{\tt IA64} & IA-64 processor \\
-\hspace{0.5cm}{\tt SYSCALL} & SYSCALL/SYSRET \\
-\hspace{0.5cm}{\tt MP} & MP Capable. \\
-\hspace{0.5cm}{\tt NX} & Execute Disable \\
-\hspace{0.5cm}{\tt MMXEXT} & AMD MMX extensions \\
-\hspace{0.5cm}{\tt LM} & Long Mode (x86-64) \\
-\hspace{0.5cm}{\tt THREEDNOWEXT} & AMD 3DNow! extensions \\
-\hspace{0.5cm}{\tt THREEDNOW} & 3DNow! \\
-\hspace{0.5cm}{\tt RECOVERY} & CPU in recovery mode \\
-\hspace{0.5cm}{\tt LONGRUN} & Longrun power control \\
-\hspace{0.5cm}{\tt LRTI} & LongRun table interface \\
-\hspace{0.5cm}{\tt CXMMX} & Cyrix MMX extensions \\
-\hspace{0.5cm}{\tt K6\_MTRR} & AMD K6 nonstandard MTRRs \\
-\hspace{0.5cm}{\tt CYRIX\_ARR} & Cyrix ARRs (= MTRRs) \\
-\hspace{0.5cm}{\tt CENTAUR\_MCR} & Centaur MCRs (= MTRRs) \\
-\hspace{0.5cm}{\tt K8} & Opteron, Athlon64 \\
-\hspace{0.5cm}{\tt K7} & Athlon \\
-\hspace{0.5cm}{\tt P3} & P3 \\
-\hspace{0.5cm}{\tt P4} & P4 \\
-\hspace{0.5cm}{\tt CONSTANT\_TSC} & TSC ticks at a constant rate \\
-\hspace{0.5cm}{\tt FXSAVE\_LEAK} & FXSAVE leaks FOP/FIP/FOP \\
-\hspace{0.5cm}{\tt XMM3} & Streaming SIMD Extensions-3 \\
-\hspace{0.5cm}{\tt MWAIT} & Monitor/Mwait support \\
-\hspace{0.5cm}{\tt DSCPL} & CPL Qualified Debug Store \\
-\hspace{0.5cm}{\tt EST} & Enhanced SpeedStep \\
-\hspace{0.5cm}{\tt TM2} & Thermal Monitor 2 \\
-\hspace{0.5cm}{\tt CID} & Context ID \\
-\hspace{0.5cm}{\tt CX16} & CMPXCHG16B \\
-\hspace{0.5cm}{\tt XTPR} & Send Task Priority Messages \\
-\hspace{0.5cm}{\tt XSTORE} & on-CPU RNG present (xstore insn) \\
-\hspace{0.5cm}{\tt XSTORE\_EN} & on-CPU RNG enabled \\
-\hspace{0.5cm}{\tt XCRYPT} & on-CPU crypto (xcrypt insn) \\
-\hspace{0.5cm}{\tt XCRYPT\_EN} & on-CPU crypto enabled \\
-\hspace{0.5cm}{\tt LAHF\_LM} & LAHF/SAHF in long mode \\
-\hspace{0.5cm}{\tt CMP\_LEGACY} & If yes HyperThreading not valid \\
-\hspace{0.5cm}{\tt VMX} & VMX instruction set \\
-\hline
-\end{longtable}
-
\vspace{1cm}
\begin{longtable}{|ll|}
\hline
$\mathit{RW}$ & {\tt VCPUs/params} & string & string-encoded parameters passed to selected VCPU policy \\
$\mathit{RW}$ & {\tt VCPUs/number} & int & Current number of VCPUs \\
$\mathit{RO}_\mathit{run}$ & {\tt VCPUs/utilisation} & (int $\rightarrow$ float) Map & Utilisation for all of guest's current VCPUs \\
-$\mathit{RO}_\mathit{ins}$ & {\tt VCPUs/features/required} & (cpu\_feature) Set & CPU features the guest demands the host supports \\
-$\mathit{RO}_\mathit{ins}$ & {\tt VCPUs/features/can\_use} & (cpu\_feature) Set & CPU features the guest can use if available \\
-$\mathit{RW}$ & {\tt VCPUs/features/force\_on} & (cpu\_feature) Set & CPU features to expose to the guest above the bare minimum \\
-$\mathit{RW}$ & {\tt VCPUs/features/force\_off} & (cpu\_feature) Set & CPU features to hide to the guest \\
$\mathit{RW}$ & {\tt actions/after\_shutdown} & on\_normal\_exit & action to take after the guest has shutdown itself \\
$\mathit{RW}$ & {\tt actions/after\_reboot} & on\_normal\_exit & action to take after the guest has rebooted itself \\
$\mathit{RW}$ & {\tt actions/after\_suspend} & on\_normal\_exit & action to take after the guest has suspended itself \\
value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~get\_VCPUs\_features\_required}
-
-{\bf Overview:}
-Get the VCPUs/features/required field of the given VM.
-
- \noindent {\bf Signature:}
-\begin{verbatim} ((cpu_feature) Set) get_VCPUs_features_required (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
-(cpu\_feature) Set
-}
-
-
-value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~get\_VCPUs\_features\_can\_use}
-
-{\bf Overview:}
-Get the VCPUs/features/can\_use field of the given VM.
-
- \noindent {\bf Signature:}
-\begin{verbatim} ((cpu_feature) Set) get_VCPUs_features_can_use (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
-(cpu\_feature) Set
-}
-
-
-value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~get\_VCPUs\_features\_force\_on}
-
-{\bf Overview:}
-Get the VCPUs/features/force\_on field of the given VM.
-
- \noindent {\bf Signature:}
-\begin{verbatim} ((cpu_feature) Set) get_VCPUs_features_force_on (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
-(cpu\_feature) Set
-}
-
-
-value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~set\_VCPUs\_features\_force\_on}
-
-{\bf Overview:}
-Set the VCPUs/features/force\_on field of the given VM.
-
- \noindent {\bf Signature:}
-\begin{verbatim} void set_VCPUs_features_force_on (session_id s, VM ref self, (cpu_feature) Set value)\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
-
-{\tt (cpu\_feature) Set } & value & New value to set \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-void
-}
-
-
-
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~add\_VCPUs\_features\_force\_on}
-
-{\bf Overview:}
-Add the given value to the VCPUs/features/force\_on field of the given VM.
-If the value is already in that Set, then do nothing.
-
- \noindent {\bf Signature:}
-\begin{verbatim} void add_VCPUs_features_force_on (session_id s, VM ref self, cpu_feature value)\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
-
-{\tt cpu\_feature } & value & New value to add \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-void
-}
-
-
-
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~remove\_VCPUs\_features\_force\_on}
-
-{\bf Overview:}
-Remove the given value from the VCPUs/features/force\_on field of the given
-VM. If the value is not in that Set, then do nothing.
-
- \noindent {\bf Signature:}
-\begin{verbatim} void remove_VCPUs_features_force_on (session_id s, VM ref self, cpu_feature value)\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
-
-{\tt cpu\_feature } & value & Value to remove \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-void
-}
-
-
-
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~get\_VCPUs\_features\_force\_off}
-
-{\bf Overview:}
-Get the VCPUs/features/force\_off field of the given VM.
-
- \noindent {\bf Signature:}
-\begin{verbatim} ((cpu_feature) Set) get_VCPUs_features_force_off (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
-(cpu\_feature) Set
-}
-
-
-value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~set\_VCPUs\_features\_force\_off}
-
-{\bf Overview:}
-Set the VCPUs/features/force\_off field of the given VM.
-
- \noindent {\bf Signature:}
-\begin{verbatim} void set_VCPUs_features_force_off (session_id s, VM ref self, (cpu_feature) Set value)\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
-
-{\tt (cpu\_feature) Set } & value & New value to set \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-void
-}
-
-
-
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~add\_VCPUs\_features\_force\_off}
-
-{\bf Overview:}
-Add the given value to the VCPUs/features/force\_off field of the given VM.
- If the value is already in that Set, then do nothing.
-
- \noindent {\bf Signature:}
-\begin{verbatim} void add_VCPUs_features_force_off (session_id s, VM ref self, cpu_feature value)\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
-
-{\tt cpu\_feature } & value & New value to add \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-void
-}
-
-
-
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~remove\_VCPUs\_features\_force\_off}
-
-{\bf Overview:}
-Remove the given value from the VCPUs/features/force\_off field of the
-given VM. If the value is not in that Set, then do nothing.
-
- \noindent {\bf Signature:}
-\begin{verbatim} void remove_VCPUs_features_force_off (session_id s, VM ref self, cpu_feature value)\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
-
-{\tt cpu\_feature } & value & Value to remove \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-void
-}
-
-
-
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
$\mathit{RO}_\mathit{ins}$ & {\tt vendor} & string & the vendor of the physical CPU \\
$\mathit{RO}_\mathit{ins}$ & {\tt speed} & int & the speed of the physical CPU \\
$\mathit{RO}_\mathit{ins}$ & {\tt modelname} & string & the model name of the physical CPU \\
-$\mathit{RO}_\mathit{ins}$ & {\tt features} & (cpu\_feature) Set & the features supported by the CPU \\
$\mathit{RO}_\mathit{run}$ & {\tt utilisation} & float & the current CPU utilisation \\
\hline
\end{longtable}
}
-value of the field
-\vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
-\subsubsection{RPC name:~get\_features}
-
-{\bf Overview:}
-Get the features field of the given host\_cpu.
-
- \noindent {\bf Signature:}
-\begin{verbatim} ((cpu_feature) Set) get_features (session_id s, host_cpu 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 host\_cpu ref } & self & reference to the object \\ \hline
-
-\end{tabular}
-
-\vspace{0.3cm}
-
- \noindent {\bf Return Type:}
-{\tt
-(cpu\_feature) Set
-}
-
-
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
+++ /dev/null
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef XEN_CPU_FEATURE_H
-#define XEN_CPU_FEATURE_H
-
-
-#include "xen_common.h"
-
-
-enum xen_cpu_feature
-{
- /**
- * Onboard FPU
- */
- XEN_CPU_FEATURE_FPU,
-
- /**
- * Virtual Mode Extensions
- */
- XEN_CPU_FEATURE_VME,
-
- /**
- * Debugging Extensions
- */
- XEN_CPU_FEATURE_DE,
-
- /**
- * Page Size Extensions
- */
- XEN_CPU_FEATURE_PSE,
-
- /**
- * Time Stamp Counter
- */
- XEN_CPU_FEATURE_TSC,
-
- /**
- * Model-Specific Registers, RDMSR, WRMSR
- */
- XEN_CPU_FEATURE_MSR,
-
- /**
- * Physical Address Extensions
- */
- XEN_CPU_FEATURE_PAE,
-
- /**
- * Machine Check Architecture
- */
- XEN_CPU_FEATURE_MCE,
-
- /**
- * CMPXCHG8 instruction
- */
- XEN_CPU_FEATURE_CX8,
-
- /**
- * Onboard APIC
- */
- XEN_CPU_FEATURE_APIC,
-
- /**
- * SYSENTER/SYSEXIT
- */
- XEN_CPU_FEATURE_SEP,
-
- /**
- * Memory Type Range Registers
- */
- XEN_CPU_FEATURE_MTRR,
-
- /**
- * Page Global Enable
- */
- XEN_CPU_FEATURE_PGE,
-
- /**
- * Machine Check Architecture
- */
- XEN_CPU_FEATURE_MCA,
-
- /**
- * CMOV instruction (FCMOVCC and FCOMI too if FPU present)
- */
- XEN_CPU_FEATURE_CMOV,
-
- /**
- * Page Attribute Table
- */
- XEN_CPU_FEATURE_PAT,
-
- /**
- * 36-bit PSEs
- */
- XEN_CPU_FEATURE_PSE36,
-
- /**
- * Processor serial number
- */
- XEN_CPU_FEATURE_PN,
-
- /**
- * Supports the CLFLUSH instruction
- */
- XEN_CPU_FEATURE_CLFLSH,
-
- /**
- * Debug Trace Store
- */
- XEN_CPU_FEATURE_DTES,
-
- /**
- * ACPI via MSR
- */
- XEN_CPU_FEATURE_ACPI,
-
- /**
- * Multimedia Extensions
- */
- XEN_CPU_FEATURE_MMX,
-
- /**
- * FXSAVE and FXRSTOR instructions (fast save and restore
- */
- XEN_CPU_FEATURE_FXSR,
-
- /**
- * Streaming SIMD Extensions
- */
- XEN_CPU_FEATURE_XMM,
-
- /**
- * Streaming SIMD Extensions-2
- */
- XEN_CPU_FEATURE_XMM2,
-
- /**
- * CPU self snoop
- */
- XEN_CPU_FEATURE_SELFSNOOP,
-
- /**
- * Hyper-Threading
- */
- XEN_CPU_FEATURE_HT,
-
- /**
- * Automatic clock control
- */
- XEN_CPU_FEATURE_ACC,
-
- /**
- * IA-64 processor
- */
- XEN_CPU_FEATURE_IA64,
-
- /**
- * SYSCALL/SYSRET
- */
- XEN_CPU_FEATURE_SYSCALL,
-
- /**
- * MP Capable.
- */
- XEN_CPU_FEATURE_MP,
-
- /**
- * Execute Disable
- */
- XEN_CPU_FEATURE_NX,
-
- /**
- * AMD MMX extensions
- */
- XEN_CPU_FEATURE_MMXEXT,
-
- /**
- * Long Mode (x86-64)
- */
- XEN_CPU_FEATURE_LM,
-
- /**
- * AMD 3DNow! extensions
- */
- XEN_CPU_FEATURE_THREEDNOWEXT,
-
- /**
- * 3DNow!
- */
- XEN_CPU_FEATURE_THREEDNOW,
-
- /**
- * CPU in recovery mode
- */
- XEN_CPU_FEATURE_RECOVERY,
-
- /**
- * Longrun power control
- */
- XEN_CPU_FEATURE_LONGRUN,
-
- /**
- * LongRun table interface
- */
- XEN_CPU_FEATURE_LRTI,
-
- /**
- * Cyrix MMX extensions
- */
- XEN_CPU_FEATURE_CXMMX,
-
- /**
- * AMD K6 nonstandard MTRRs
- */
- XEN_CPU_FEATURE_K6_MTRR,
-
- /**
- * Cyrix ARRs (= MTRRs)
- */
- XEN_CPU_FEATURE_CYRIX_ARR,
-
- /**
- * Centaur MCRs (= MTRRs)
- */
- XEN_CPU_FEATURE_CENTAUR_MCR,
-
- /**
- * Opteron, Athlon64
- */
- XEN_CPU_FEATURE_K8,
-
- /**
- * Athlon
- */
- XEN_CPU_FEATURE_K7,
-
- /**
- * P3
- */
- XEN_CPU_FEATURE_P3,
-
- /**
- * P4
- */
- XEN_CPU_FEATURE_P4,
-
- /**
- * TSC ticks at a constant rate
- */
- XEN_CPU_FEATURE_CONSTANT_TSC,
-
- /**
- * FXSAVE leaks FOP/FIP/FOP
- */
- XEN_CPU_FEATURE_FXSAVE_LEAK,
-
- /**
- * Streaming SIMD Extensions-3
- */
- XEN_CPU_FEATURE_XMM3,
-
- /**
- * Monitor/Mwait support
- */
- XEN_CPU_FEATURE_MWAIT,
-
- /**
- * CPL Qualified Debug Store
- */
- XEN_CPU_FEATURE_DSCPL,
-
- /**
- * Enhanced SpeedStep
- */
- XEN_CPU_FEATURE_EST,
-
- /**
- * Thermal Monitor 2
- */
- XEN_CPU_FEATURE_TM2,
-
- /**
- * Context ID
- */
- XEN_CPU_FEATURE_CID,
-
- /**
- * CMPXCHG16B
- */
- XEN_CPU_FEATURE_CX16,
-
- /**
- * Send Task Priority Messages
- */
- XEN_CPU_FEATURE_XTPR,
-
- /**
- * on-CPU RNG present (xstore insn)
- */
- XEN_CPU_FEATURE_XSTORE,
-
- /**
- * on-CPU RNG enabled
- */
- XEN_CPU_FEATURE_XSTORE_EN,
-
- /**
- * on-CPU crypto (xcrypt insn)
- */
- XEN_CPU_FEATURE_XCRYPT,
-
- /**
- * on-CPU crypto enabled
- */
- XEN_CPU_FEATURE_XCRYPT_EN,
-
- /**
- * LAHF/SAHF in long mode
- */
- XEN_CPU_FEATURE_LAHF_LM,
-
- /**
- * If yes HyperThreading not valid
- */
- XEN_CPU_FEATURE_CMP_LEGACY,
-
- /**
- * VMX instruction set
- */
- XEN_CPU_FEATURE_VMX
-};
-
-
-typedef struct xen_cpu_feature_set
-{
- size_t size;
- enum xen_cpu_feature contents[];
-} xen_cpu_feature_set;
-
-/**
- * Allocate a xen_cpu_feature_set of the given size.
- */
-extern xen_cpu_feature_set *
-xen_cpu_feature_set_alloc(size_t size);
-
-/**
- * Free the given xen_cpu_feature_set. The given set must have been
- * allocated by this library.
- */
-extern void
-xen_cpu_feature_set_free(xen_cpu_feature_set *set);
-
-
-/**
- * Return the name corresponding to the given code. This string must
- * not be modified or freed.
- */
-extern const char *
-xen_cpu_feature_to_string(enum xen_cpu_feature val);
-
-
-/**
- * Return the correct code for the given string, or set the session
- * object to failure and return an undefined value if the given string does
- * not match a known code.
- */
-extern enum xen_cpu_feature
-xen_cpu_feature_from_string(xen_session *session, const char *str);
-
-
-#endif
+++ /dev/null
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-/*
- * Declarations of the abstract types used during demarshalling of enum
- * xen_cpu_feature. Internal to this library -- do not use from outside.
- */
-
-
-#ifndef XEN_CPU_FEATURE_INTERNAL_H
-#define XEN_CPU_FEATURE_INTERNAL_H
-
-
-#include "xen_internal.h"
-
-
-extern const abstract_type xen_cpu_feature_abstract_type_;
-extern const abstract_type xen_cpu_feature_set_abstract_type_;
-
-
-#endif
#define XEN_HOST_CPU_H
#include "xen_common.h"
-#include "xen_cpu_feature.h"
#include "xen_host_cpu_decl.h"
#include "xen_host_decl.h"
char *vendor;
int64_t speed;
char *modelname;
- struct xen_cpu_feature_set *features;
double utilisation;
} xen_host_cpu_record;
xen_host_cpu_get_modelname(xen_session *session, char **result, xen_host_cpu host_cpu);
-/**
- * Get the features field of the given host_cpu.
- */
-extern bool
-xen_host_cpu_get_features(xen_session *session, struct xen_cpu_feature_set **result, xen_host_cpu host_cpu);
-
-
/**
* Get the utilisation field of the given host_cpu.
*/
#include "xen_common.h"
#include "xen_console_decl.h"
-#include "xen_cpu_feature.h"
#include "xen_host_decl.h"
#include "xen_int_float_map.h"
#include "xen_on_crash_behaviour.h"
char *vcpus_params;
int64_t vcpus_number;
xen_int_float_map *vcpus_utilisation;
- struct xen_cpu_feature_set *vcpus_features_required;
- struct xen_cpu_feature_set *vcpus_features_can_use;
- struct xen_cpu_feature_set *vcpus_features_force_on;
- struct xen_cpu_feature_set *vcpus_features_force_off;
enum xen_on_normal_exit actions_after_shutdown;
enum xen_on_normal_exit actions_after_reboot;
enum xen_on_normal_exit actions_after_suspend;
xen_vm_get_vcpus_utilisation(xen_session *session, xen_int_float_map **result, xen_vm vm);
-/**
- * Get the VCPUs/features/required field of the given VM.
- */
-extern bool
-xen_vm_get_vcpus_features_required(xen_session *session, struct xen_cpu_feature_set **result, xen_vm vm);
-
-
-/**
- * Get the VCPUs/features/can_use field of the given VM.
- */
-extern bool
-xen_vm_get_vcpus_features_can_use(xen_session *session, struct xen_cpu_feature_set **result, xen_vm vm);
-
-
-/**
- * Get the VCPUs/features/force_on field of the given VM.
- */
-extern bool
-xen_vm_get_vcpus_features_force_on(xen_session *session, struct xen_cpu_feature_set **result, xen_vm vm);
-
-
-/**
- * Get the VCPUs/features/force_off field of the given VM.
- */
-extern bool
-xen_vm_get_vcpus_features_force_off(xen_session *session, struct xen_cpu_feature_set **result, xen_vm vm);
-
-
/**
* Get the actions/after_shutdown field of the given VM.
*/
xen_vm_set_vcpus_number(xen_session *session, xen_vm vm, int64_t number);
-/**
- * Set the VCPUs/features/force_on field of the given VM.
- */
-extern bool
-xen_vm_set_vcpus_features_force_on(xen_session *session, xen_vm vm, struct xen_cpu_feature_set *force_on);
-
-
-/**
- * Add the given value to the VCPUs/features/force_on field of the
- * given VM. If the value is already in that Set, then do nothing.
- */
-extern bool
-xen_vm_add_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value);
-
-
-/**
- * Remove the given value from the VCPUs/features/force_on field of the
- * given VM. If the value is not in that Set, then do nothing.
- */
-extern bool
-xen_vm_remove_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value);
-
-
-/**
- * Set the VCPUs/features/force_off field of the given VM.
- */
-extern bool
-xen_vm_set_vcpus_features_force_off(xen_session *session, xen_vm vm, struct xen_cpu_feature_set *force_off);
-
-
-/**
- * Add the given value to the VCPUs/features/force_off field of the
- * given VM. If the value is already in that Set, then do nothing.
- */
-extern bool
-xen_vm_add_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value);
-
-
-/**
- * Remove the given value from the VCPUs/features/force_off field of
- * the given VM. If the value is not in that Set, then do nothing.
- */
-extern bool
-xen_vm_remove_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value);
-
-
/**
* Set the actions/after_shutdown field of the given VM.
*/
+++ /dev/null
-/*
- * Copyright (c) 2006, XenSource Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <string.h>
-
-#include "xen_internal.h"
-#include "xen_cpu_feature.h"
-#include "xen_cpu_feature_internal.h"
-
-
-/*
- * Maintain this in the same order as the enum declaration!
- */
-static const char *lookup_table[] =
-{
- "FPU",
- "VME",
- "DE",
- "PSE",
- "TSC",
- "MSR",
- "PAE",
- "MCE",
- "CX8",
- "APIC",
- "SEP",
- "MTRR",
- "PGE",
- "MCA",
- "CMOV",
- "PAT",
- "PSE36",
- "PN",
- "CLFLSH",
- "DTES",
- "ACPI",
- "MMX",
- "FXSR",
- "XMM",
- "XMM2",
- "SELFSNOOP",
- "HT",
- "ACC",
- "IA64",
- "SYSCALL",
- "MP",
- "NX",
- "MMXEXT",
- "LM",
- "THREEDNOWEXT",
- "THREEDNOW",
- "RECOVERY",
- "LONGRUN",
- "LRTI",
- "CXMMX",
- "K6_MTRR",
- "CYRIX_ARR",
- "CENTAUR_MCR",
- "K8",
- "K7",
- "P3",
- "P4",
- "CONSTANT_TSC",
- "FXSAVE_LEAK",
- "XMM3",
- "MWAIT",
- "DSCPL",
- "EST",
- "TM2",
- "CID",
- "CX16",
- "XTPR",
- "XSTORE",
- "XSTORE_EN",
- "XCRYPT",
- "XCRYPT_EN",
- "LAHF_LM",
- "CMP_LEGACY",
- "VMX"
-};
-
-
-extern xen_cpu_feature_set *
-xen_cpu_feature_set_alloc(size_t size)
-{
- return calloc(1, sizeof(xen_cpu_feature_set) +
- size * sizeof(enum xen_cpu_feature));
-}
-
-
-extern void
-xen_cpu_feature_set_free(xen_cpu_feature_set *set)
-{
- free(set);
-}
-
-
-const char *
-xen_cpu_feature_to_string(enum xen_cpu_feature val)
-{
- return lookup_table[val];
-}
-
-
-extern enum xen_cpu_feature
-xen_cpu_feature_from_string(xen_session *session, const char *str)
-{
- return ENUM_LOOKUP(session, str, lookup_table);
-}
-
-
-const abstract_type xen_cpu_feature_abstract_type_ =
- {
- .typename = ENUM,
- .enum_marshaller =
- (const char *(*)(int))&xen_cpu_feature_to_string,
- .enum_demarshaller =
- (int (*)(xen_session *, const char *))&xen_cpu_feature_from_string
- };
-
-
-const abstract_type xen_cpu_feature_set_abstract_type_ =
- {
- .typename = SET,
- .child = &xen_cpu_feature_abstract_type_
- };
-
-
#include <stdlib.h>
#include "xen_common.h"
-#include "xen_cpu_feature.h"
-#include "xen_cpu_feature_internal.h"
#include "xen_host.h"
#include "xen_host_cpu.h"
#include "xen_internal.h"
{ .key = "modelname",
.type = &abstract_type_string,
.offset = offsetof(xen_host_cpu_record, modelname) },
- { .key = "features",
- .type = &xen_cpu_feature_set_abstract_type_,
- .offset = offsetof(xen_host_cpu_record, features) },
{ .key = "utilisation",
.type = &abstract_type_float,
.offset = offsetof(xen_host_cpu_record, utilisation) }
xen_host_record_opt_free(record->host);
free(record->vendor);
free(record->modelname);
- xen_cpu_feature_set_free(record->features);
free(record);
}
}
-bool
-xen_host_cpu_get_features(xen_session *session, struct xen_cpu_feature_set **result, xen_host_cpu host_cpu)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = host_cpu }
- };
-
- abstract_type result_type = xen_cpu_feature_set_abstract_type_;
-
- *result = NULL;
- XEN_CALL_("host_cpu.get_features");
- return session->ok;
-}
-
-
bool
xen_host_cpu_get_utilisation(xen_session *session, double *result, xen_host_cpu host_cpu)
{
#include "xen_common.h"
#include "xen_console.h"
-#include "xen_cpu_feature.h"
-#include "xen_cpu_feature_internal.h"
#include "xen_host.h"
#include "xen_int_float_map.h"
#include "xen_internal.h"
{ .key = "VCPUs_utilisation",
.type = &abstract_type_int_float_map,
.offset = offsetof(xen_vm_record, vcpus_utilisation) },
- { .key = "VCPUs_features_required",
- .type = &xen_cpu_feature_set_abstract_type_,
- .offset = offsetof(xen_vm_record, vcpus_features_required) },
- { .key = "VCPUs_features_can_use",
- .type = &xen_cpu_feature_set_abstract_type_,
- .offset = offsetof(xen_vm_record, vcpus_features_can_use) },
- { .key = "VCPUs_features_force_on",
- .type = &xen_cpu_feature_set_abstract_type_,
- .offset = offsetof(xen_vm_record, vcpus_features_force_on) },
- { .key = "VCPUs_features_force_off",
- .type = &xen_cpu_feature_set_abstract_type_,
- .offset = offsetof(xen_vm_record, vcpus_features_force_off) },
{ .key = "actions_after_shutdown",
.type = &xen_on_normal_exit_abstract_type_,
.offset = offsetof(xen_vm_record, actions_after_shutdown) },
free(record->vcpus_policy);
free(record->vcpus_params);
xen_int_float_map_free(record->vcpus_utilisation);
- xen_cpu_feature_set_free(record->vcpus_features_required);
- xen_cpu_feature_set_free(record->vcpus_features_can_use);
- xen_cpu_feature_set_free(record->vcpus_features_force_on);
- xen_cpu_feature_set_free(record->vcpus_features_force_off);
xen_console_record_opt_set_free(record->consoles);
xen_vif_record_opt_set_free(record->vifs);
xen_vbd_record_opt_set_free(record->vbds);
}
-bool
-xen_vm_get_vcpus_features_required(xen_session *session, struct xen_cpu_feature_set **result, xen_vm vm)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = vm }
- };
-
- abstract_type result_type = xen_cpu_feature_set_abstract_type_;
-
- *result = NULL;
- XEN_CALL_("VM.get_VCPUs_features_required");
- return session->ok;
-}
-
-
-bool
-xen_vm_get_vcpus_features_can_use(xen_session *session, struct xen_cpu_feature_set **result, xen_vm vm)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = vm }
- };
-
- abstract_type result_type = xen_cpu_feature_set_abstract_type_;
-
- *result = NULL;
- XEN_CALL_("VM.get_VCPUs_features_can_use");
- return session->ok;
-}
-
-
-bool
-xen_vm_get_vcpus_features_force_on(xen_session *session, struct xen_cpu_feature_set **result, xen_vm vm)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = vm }
- };
-
- abstract_type result_type = xen_cpu_feature_set_abstract_type_;
-
- *result = NULL;
- XEN_CALL_("VM.get_VCPUs_features_force_on");
- return session->ok;
-}
-
-
-bool
-xen_vm_get_vcpus_features_force_off(xen_session *session, struct xen_cpu_feature_set **result, xen_vm vm)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = vm }
- };
-
- abstract_type result_type = xen_cpu_feature_set_abstract_type_;
-
- *result = NULL;
- XEN_CALL_("VM.get_VCPUs_features_force_off");
- return session->ok;
-}
-
-
bool
xen_vm_get_actions_after_shutdown(xen_session *session, enum xen_on_normal_exit *result, xen_vm vm)
{
}
-bool
-xen_vm_set_vcpus_features_force_on(xen_session *session, xen_vm vm, struct xen_cpu_feature_set *force_on)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = vm },
- { .type = &xen_cpu_feature_set_abstract_type_,
- .u.set_val = (arbitrary_set *)force_on }
- };
-
- xen_call_(session, "VM.set_VCPUs_features_force_on", param_values, 2, NULL, NULL);
- return session->ok;
-}
-
-
-bool
-xen_vm_add_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = vm },
- { .type = &xen_cpu_feature_abstract_type_,
- .u.string_val = xen_cpu_feature_to_string(value) }
- };
-
- xen_call_(session, "VM.add_VCPUs_features_force_on", param_values, 2, NULL, NULL);
- return session->ok;
-}
-
-
-bool
-xen_vm_remove_vcpus_features_force_on(xen_session *session, xen_vm vm, enum xen_cpu_feature value)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = vm },
- { .type = &xen_cpu_feature_abstract_type_,
- .u.string_val = xen_cpu_feature_to_string(value) }
- };
-
- xen_call_(session, "VM.remove_VCPUs_features_force_on", param_values, 2, NULL, NULL);
- return session->ok;
-}
-
-
-bool
-xen_vm_set_vcpus_features_force_off(xen_session *session, xen_vm vm, struct xen_cpu_feature_set *force_off)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = vm },
- { .type = &xen_cpu_feature_set_abstract_type_,
- .u.set_val = (arbitrary_set *)force_off }
- };
-
- xen_call_(session, "VM.set_VCPUs_features_force_off", param_values, 2, NULL, NULL);
- return session->ok;
-}
-
-
-bool
-xen_vm_add_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = vm },
- { .type = &xen_cpu_feature_abstract_type_,
- .u.string_val = xen_cpu_feature_to_string(value) }
- };
-
- xen_call_(session, "VM.add_VCPUs_features_force_off", param_values, 2, NULL, NULL);
- return session->ok;
-}
-
-
-bool
-xen_vm_remove_vcpus_features_force_off(xen_session *session, xen_vm vm, enum xen_cpu_feature value)
-{
- abstract_value param_values[] =
- {
- { .type = &abstract_type_string,
- .u.string_val = vm },
- { .type = &xen_cpu_feature_abstract_type_,
- .u.string_val = xen_cpu_feature_to_string(value) }
- };
-
- xen_call_(session, "VM.remove_VCPUs_features_force_off", param_values, 2, NULL, NULL);
- return session->ok;
-}
-
-
bool
xen_vm_set_actions_after_shutdown(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_shutdown)
{
host_cpu_attr_ro = ['host',
'number',
- 'features',
'utilisation']
# attributes
def host_cpu_get_host(self, session, host_cpu_ref):
return xen_api_success(XendNode.instance().uuid)
- def host_cpu_get_features(self, session, host_cpu_ref):
- features = XendNode.instance().get_host_cpu_features(host_cpu_ref)
- return xen_api_success(features)
def host_cpu_get_utilisation(self, session, host_cpu_ref):
util = XendNode.instance().get_host_cpu_load(host_cpu_ref)
return xen_api_success(util)
record = {'uuid': host_cpu_ref,
'host': node.uuid,
'number': node.get_host_cpu_number(host_cpu_ref),
- 'features': node.get_host_cpu_features(host_cpu_ref),
'utilisation': node.get_host_cpu_load(host_cpu_ref)}
return xen_api_success(record)
'memory_static_min',
'VCPUs_number',
'VCPUs_utilisation',
- 'VCPUs_features_required',
- 'VCPUs_can_use',
'consoles',
'VIFs',
'VBDs',
'memory_dynamic_min',
'VCPUs_policy',
'VCPUs_params',
- 'VCPUs_features_force_on',
- 'VCPUs_features_force_off',
'actions_after_shutdown',
'actions_after_reboot',
'actions_after_suspend',
'memory_static_min',
'VCPUs_policy',
'VCPUs_params',
- 'VCPUs_features_required',
- 'VCPUs_features_can_use',
- 'VCPUs_features_force_on',
- 'VCPUs_features_force_off',
'actions_after_shutdown',
'actions_after_reboot',
'actions_after_suspend',
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
return xen_api_success(dom.get_vcpus_util())
- def VM_get_VCPUs_features_required(self, session, vm_ref):
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
- return xen_api_todo() # unsupported by xc
-
- def VM_get_VCPUs_can_use(self, session, vm_ref):
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
- return xen_api_todo() # unsupported by xc
-
def VM_get_VIFs(self, session, vm_ref):
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
return xen_api_success(dom.get_vifs())
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
return xen_api_todo() # need access to scheduler
- def VM_get_VCPUs_features_force_on(self, session, vm_ref):
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
- return xen_api_todo()
-
- def VM_get_VCPUs_features_force_off(self, session, vm_ref):
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
- return xen_api_todo()
-
def VM_get_actions_after_shutdown(self, session, vm_ref):
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
return xen_api_success(dom.get_on_shutdown())
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
return xen_api_todo()
- def VM_set_VCPUs_features_force_on(self, session, vm_ref, features):
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
- return xen_api_todo()
-
- def VM_set_VCPUs_features_force_off(self, session, vm_ref, features):
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
- return xen_api_todo()
-
def VM_set_actions_after_shutdown(self, session, vm_ref, action):
if action not in XEN_API_ON_NORMAL_EXIST:
return xen_api_error(['VM_ON_NORMAL_EXIT_INVALID', vm_ref])
'VCPUs_params': xeninfo.get_vcpus_params(),
'VCPUs_number': xeninfo.getVCpuCount(),
'VCPUs_utilisation': xeninfo.get_vcpus_util(),
- 'VCPUs_features_required': [],
- 'VCPUs_features_can_use': [],
- 'VCPUs_features_force_on': [],
- 'VCPUs_features_force_off': [],
'actions_after_shutdown': xeninfo.get_on_shutdown(),
'actions_after_reboot': xeninfo.get_on_reboot(),
'actions_after_suspend': xeninfo.get_on_suspend(),