| 39 | } |
| 40 | |
| 41 | VmMutablePatch BuildVmPatch(const VmEditForm& form, const VmSpec& current_spec) { |
| 42 | VmMutablePatch patch; |
| 43 | patch.apply_on_next_boot = form.apply_on_next_boot; |
| 44 | if (form.name != current_spec.name) { |
| 45 | patch.name = form.name; |
| 46 | } |
| 47 | if (form.debug_mode != current_spec.debug_mode) { |
| 48 | patch.debug_mode = form.debug_mode; |
| 49 | } |
| 50 | if (!SameForwards(form.host_forwards, current_spec.host_forwards)) { |
| 51 | patch.host_forwards = form.host_forwards; |
| 52 | } |
| 53 | if (form.memory_mb != current_spec.memory_mb) { |
| 54 | patch.memory_mb = form.memory_mb; |
| 55 | } |
| 56 | if (form.cpu_count != current_spec.cpu_count) { |
| 57 | patch.cpu_count = form.cpu_count; |
| 58 | } |
| 59 | return patch; |
| 60 | } |
no test coverage detected