qemuDomainChangeNet: Error when boot index changes in live XML

If the original code detected a missing or null boot index in the
new XML, it automatically added the current value. This
autocompletion was incorrect because it was impossible to
distinguish between user intent and user error - changing the
boot order itself is forbidden and should always be an error.

Resolves: https://issues.redhat.com/browse/RHEL-23416
Fixes: aa3e07caec
Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Adam Julis 2024-03-22 09:12:26 +01:00 committed by Michal Privoznik
parent a57617dca5
commit 6821271123

View File

@ -3847,8 +3847,6 @@ qemuDomainChangeNet(virQEMUDriver *driver,
goto cleanup;
}
if (newdev->info.bootIndex == 0)
newdev->info.bootIndex = olddev->info.bootIndex;
if (olddev->info.bootIndex != newdev->info.bootIndex) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify network device boot index setting"));