@@ -36,6 +36,16 @@
#define VMPORT_ENTRIES 0x2c
#define VMPORT_MAGIC 0x564D5868
+/* Enum taken from open-vm-tools lib/include/vm_vmx_type.h */
+typedef enum {
+ VMX_TYPE_UNSET = 0,
+ VMX_TYPE_EXPRESS, /* Deprecated type used for VMware Express */
+ VMX_TYPE_SCALABLE_SERVER, /* VMware ESX server */
+ VMX_TYPE_WGS, /* Deprecated type used for VMware Server */
+ VMX_TYPE_WORKSTATION,
+ VMX_TYPE_WORKSTATION_ENTERPRISE /* Deprecated type used for ACE 1.x */
+} VMXType;
+
#define VMPORT(obj) OBJECT_CHECK(VMPortState, (obj), TYPE_VMPORT)
typedef struct VMPortState {
@@ -46,6 +56,7 @@ typedef struct VMPortState {
void *opaque[VMPORT_ENTRIES];
uint32_t vmx_version;
+ uint8_t vmx_type;
uint8_t version;
} VMPortState;
@@ -125,6 +136,9 @@ static uint32_t vmport_cmd_get_version(void *opaque, uint32_t addr)
X86CPU *cpu = X86_CPU(current_cpu);
cpu->env.regs[R_EBX] = VMPORT_MAGIC;
+ if (port_state->version > 1) {
+ cpu->env.regs[R_ECX] = port_state->vmx_type;
+ }
return port_state->vmx_version;
}
@@ -191,6 +205,8 @@ static Property vmport_properties[] = {
/* Default value taken from open-vm-tools code VERSION_MAGIC definition */
DEFINE_PROP_UINT32("vmx-version", VMPortState, vmx_version, 6),
+ DEFINE_PROP_UINT8("vmx-type", VMPortState, vmx_type,
+ VMX_TYPE_SCALABLE_SERVER),
DEFINE_PROP_END_OF_LIST(),
};