On a Tuesday in 2022, Peter Krempa wrote:
From: Shaleen Bathla <shaleen.bathla@xxxxxxxxxx> Use of qemuDomainValidateVcpuInfo in the helpers for hotplug and unplug of vCPUs can lead to spurious errors reported such as: internal error: qemu didn't report thread id for vcpu 'XX'" The reason for this is that qemuDomainValidateVcpuInfo validates the state of all vCPUs against the expected state of vCPUs. If an unplug operation completed before libvirt was unable to process it yet the expected state could not reflect the current state. To avoid spurious errors the qemuDomainHotplugAddVcpu and qemuDomainRemoveVcpu functions are modified to do localized validation only for the vCPUs they actually modify. We also now ensure that the cgroups are modified before bailing out on error for any vCPUs which passed validation. Additionally in order for qemuDomainRemoveVcpuAlias to be able to find the unplugged vCPU we must ensure that qemuDomainRefreshVcpuInfo does not clear out the alias in case when the vCPU is no longer reported by qemu. Co-authored-by: Partha Satapathy <partha.satapathy@xxxxxxxxxx> Signed-off-by: Shaleen Bathla <shaleen.bathla@xxxxxxxxxx> Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- v3 addresses my review feedback of the original patch, as well as rewrites the commit message for more clarity. src/qemu/qemu_domain.c | 6 +++-- src/qemu/qemu_hotplug.c | 53 ++++++++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 24 deletions(-)
Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx> Jano
Attachment:
signature.asc
Description: PGP signature