conf: Assert virDomainChrDeviceState and virConnectDomainEventAgentLifecycleState enums are in sync

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 in virDomainChrDeviceState enum.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik committed 2026-05-20 14:32:16 +02:00
1 parent d9ed0a10d4
commit b0c097dde0
1 file changed
+5
+5
View File
@@ -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 {