提交 5bf86904 编写于 作者: E Eric Blake

xenapi: support xenapi 5.6.0 headers

* src/xenapi/xenapi_driver.c (xenapiDomainGetInfo): Avoid using
XEN_VM_POWER_STATE_UNKNOWN, which disappeared in newer xenapi.
* src/xenapi/xenapi_utils.c (mapPowerState): Likewise.
上级 6e44ec7a
......@@ -966,7 +966,7 @@ xenapiDomainGetInfo (virDomainPtr dom, virDomainInfoPtr info)
vm = vms->contents[0];
xen_vm_get_memory_static_max(session, &maxmem, vm);
info->maxMem = (maxmem / 1024);
enum xen_vm_power_state state = XEN_VM_POWER_STATE_UNKNOWN;
enum xen_vm_power_state state = XEN_VM_POWER_STATE_UNDEFINED;
xen_vm_get_power_state(session, &state, vm);
info->state = mapPowerState(state);
xen_vm_get_record(session, &record, vm);
......
......@@ -344,11 +344,10 @@ mapPowerState(enum xen_vm_power_state state)
case XEN_VM_POWER_STATE_RUNNING:
virState = VIR_DOMAIN_RUNNING;
break;
case XEN_VM_POWER_STATE_UNKNOWN:
case XEN_VM_POWER_STATE_UNDEFINED:
virState = VIR_DOMAIN_NOSTATE;
break;
default:
/* Includes XEN_VM_POWER_STATE_UNKNOWN from libxenserver
* 5.5.0, which is gone in 5.6.0. */
virState = VIR_DOMAIN_NOSTATE;
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册