Skip to content

Commit 3143a1b

Browse files
committed
Remove no longer valid optimization.
1 parent 4bcbafb commit 3143a1b

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

  • org.jdrupes.vmoperator.runner.qemu/src/org/jdrupes/vmoperator/runner/qemu

org.jdrupes.vmoperator.runner.qemu/src/org/jdrupes/vmoperator/runner/qemu/StatusUpdater.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ public class StatusUpdater extends VmDefUpdater {
7676
private static final ObjectMapper objectMapper
7777
= new ObjectMapper().registerModule(new JavaTimeModule());
7878

79-
private long observedGeneration;
8079
private boolean guestShutdownStops;
8180
private boolean shutdownByGuest;
8281
private VmDefinitionStub vmStub;
@@ -131,7 +130,6 @@ public void onStart(Start event) {
131130
if (vmDef == null) {
132131
return;
133132
}
134-
observedGeneration = vmDef.getMetadata().getGeneration();
135133
vmStub.updateStatus(from -> {
136134
JsonObject status = from.statusJson();
137135
status.addProperty(Status.RUNNER_VERSION, Optional.ofNullable(
@@ -166,21 +164,6 @@ public void onConfigureQemu(ConfigureQemu event)
166164
if (vmStub == null) {
167165
return;
168166
}
169-
170-
// A change of the runner configuration is typically caused
171-
// by a new version of the CR. So we update only if we have
172-
// a new version of the CR. There's one exception: the display
173-
// password is configured by a file, not by the CR.
174-
var vmDef = vmStub.model().orElse(null);
175-
if (vmDef == null) {
176-
return;
177-
}
178-
if (vmDef.metadata().getGeneration() == observedGeneration
179-
&& (event.configuration().hasDisplayPassword
180-
|| vmDef.statusJson().getAsJsonPrimitive(
181-
Status.DISPLAY_PASSWORD_SERIAL).getAsInt() == -1)) {
182-
return;
183-
}
184167
vmStub.updateStatus(from -> {
185168
JsonObject status = from.statusJson();
186169
if (!event.configuration().hasDisplayPassword) {
@@ -194,7 +177,7 @@ public void onConfigureQemu(ConfigureQemu event)
194177
from.getMetadata().getGeneration()));
195178
updateUserLoggedIn(from);
196179
return status;
197-
}, vmDef);
180+
});
198181
}
199182

200183
/**

0 commit comments

Comments
 (0)