[PATCH] 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 Fixies: Commit hash aa3e07caec6179dfa6479deab14a21a493637d53 Signed-off-by: Adam Julis <ajulis@redhat.com> --- src/qemu/qemu_hotplug.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index b9c502613c..62dc879ed4 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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")); -- 2.44.0

On 3/22/24 09:12, Adam Julis wrote:
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
Fixies: Commit hash aa3e07caec6179dfa6479deab14a21a493637d53
Nit pick: s/Fixies/Fixes/ and s/Commit hash//
Signed-off-by: Adam Julis <ajulis@redhat.com> --- src/qemu/qemu_hotplug.c | 2 -- 1 file changed, 2 deletions(-)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> and merged. Michal

On a Friday in 2024, Adam Julis wrote:
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
This is also true for other attributes qemuDomainChangeNet copies over from the old definition. If you're feeling brave, you can clean those up too. I'm not sure what the risks are of someone relying on net-update working with an incomplete XML definition are, but: 1) we amended the API documentation to say it needs the full device XML: commit 2864b4cd1ccda9c12f0c0ceb340836c42a2a0e52 CommitDate: 2018-09-04 10:28:40 +0200 virDomainDetachDeviceFlags: Clarify update semantics 2) we did not extend the "autocompletion" to other attributes, so over time the likelihood of net-update doing the right thing has decreased Jano
boot order itself is forbidden and should always be an error.
Resolves: https://issues.redhat.com/browse/RHEL-23416
Fixies: Commit hash aa3e07caec6179dfa6479deab14a21a493637d53 Signed-off-by: Adam Julis <ajulis@redhat.com> --- src/qemu/qemu_hotplug.c | 2 -- 1 file changed, 2 deletions(-)
participants (3)
-
Adam Julis
-
Ján Tomko
-
Michal Prívozník