From: Michal Privoznik <[email protected]> When QEMU driver emits agent connected/disconnected events (inside of processSerialChangedEvent()) it declares a variable of virDomainChrDeviceState enum, and then passes this variable to virDomainEventAgentLifecycleNewFromObj(). But we document the agent lifecycle state to be of virConnectDomainEventAgentLifecycleState enum.
Therefore, make sure values from virConnectDomainEventAgentLifecycleState enum are of the same value as those invirDomainChrDeviceState enum. Signed-off-by: Michal Privoznik <[email protected]> --- src/conf/domain_conf.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index bdfb99ed1d..d17f6352bd 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1243,6 +1243,11 @@ typedef enum { VIR_DOMAIN_CHR_DEVICE_STATE_LAST } virDomainChrDeviceState; +G_STATIC_ASSERT((int)VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED == + (int)VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED); +G_STATIC_ASSERT((int)VIR_DOMAIN_CHR_DEVICE_STATE_DISCONNECTED == + (int)VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED); + VIR_ENUM_DECL(virDomainChrDeviceState); typedef enum { -- 2.53.0
