← All changes
Harvester UI · Reviewed

Saving an unchanged VM no longer asks for a restart

With the PCI Devices add-on on, opening Edit Config on a running VM and clicking Save without changing anything asked the user to restart the VM. The fix stops the form from adding an empty device list on its own, so an unchanged VM saves quietly.

Review done · approved PR 1206 ↗ Issue 12057 ↗ PR 1175 (depends on this) ↗
What changes for the user

The flow

1

Open Edit Config and change nothing

We open a running VM that has no PCI or USB devices and stay about 8 seconds on the form, like a user reading it.

The Edit Config form on the USB Devices tab, nothing selected, before and after
The form looks the same on both sides. No device is selected and we touch nothing.
2

Click Save: no more restart prompt

Before, Save asked to restart the running VM. After, the VM is saved and we are back on the list.

Before: Restart Virtual Machine dialog. After: back on the VM list, no dialog
Before, the form quietly added an empty device list to the VM. The VM looked changed, so Harvester asked for a restart. After the fix nothing is added, so there is nothing to restart for.
3

Adding a USB device is still saved

We pick a USB device and save. Both versions save it and ask for a restart, which is expected for new hardware.

A USB device selected and saved, same before and after
Same result on both sides: the save includes the new USB device.
4

Removing the last USB device is still saved

On a VM that has one USB device, we remove it and save. Both versions save the removal.

The USB device removed and saved, same before and after
The fix only skips the empty list when the VM never had devices. A real removal still goes through.

Video (optional)

0:00 Before · 0:22 After · 0:49 Adding a device still works

Notes