[PATCH v2 1/6] domain: introduce constants for virVcpuInfo->cpu state values

Matt Coleman mcoleman at datto.com
Thu Nov 12 17:10:29 UTC 2020


Signed-off-by: Matt Coleman <matt at datto.com>
---
 include/libvirt/libvirt-domain.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index b3310729bf..e1095a193d 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -1910,12 +1910,17 @@ typedef enum {
 # endif
 } virVcpuState;
 
+typedef enum {
+    VIR_VCPU_INFO_CPU_OFFLINE     = -1, /* the vCPU is offline */
+    VIR_VCPU_INFO_CPU_UNAVAILABLE = -2, /* the hypervisor does not expose real CPU information */
+} virVcpuHostCpuState;
+
 typedef struct _virVcpuInfo virVcpuInfo;
 struct _virVcpuInfo {
     unsigned int number;        /* virtual CPU number */
     int state;                  /* value from virVcpuState */
     unsigned long long cpuTime; /* CPU time used, in nanoseconds */
-    int cpu;                    /* real CPU number, or -1 if offline */
+    int cpu;                    /* real CPU number, or one of the values from virVcpuHostCpuState */
 };
 typedef virVcpuInfo *virVcpuInfoPtr;
 
-- 
2.27.0





More information about the libvir-list mailing list