qemu: Assume QEMU_CAPS_VSERPORT_CHANGE

Introduced in QEMU's commit of v2.1.0-rc0~18^2~2 the
VSERPORT_CHANGE event is always available for all QEMU versions
we support (4.2.0, currently). Therefore, we can assume the
capability is always set and thus doesn't need to be checked for.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2022-11-07 13:13:57 +01:00
parent 05aa2e1a5d
commit 3cf0a764cd

View File

@ -214,8 +214,7 @@ qemuConnectAgent(virQEMUDriver *driver, virDomainObj *vm)
if (priv->agent)
return 0;
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VSERPORT_CHANGE) &&
config->state != VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED) {
if (config->state != VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED) {
VIR_DEBUG("Deferring connecting to guest agent");
return 0;
}
@ -230,7 +229,7 @@ qemuConnectAgent(virQEMUDriver *driver, virDomainObj *vm)
config->source,
virEventThreadGetContext(priv->eventThread),
&agentCallbacks,
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VSERPORT_CHANGE));
true);
if (!virDomainObjIsActive(vm)) {
qemuAgentClose(agent);