Skip to content

Commit

Permalink
core: revert back to direct update in all cases
Browse files Browse the repository at this point in the history
Now that there is a lock on the command preventing VmDevicesMonitoring
from running while the command is working, there should be no race
between the command and VmDevicesMonitoring.

Change-Id: I7837dc642c7c55634bc6a7ad69a79049cc291726
Signed-off-by: Eitan Raviv <eraviv@redhat.com>
  • Loading branch information
erav committed Jul 18, 2022
1 parent 916418c commit 2834041
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,8 @@ private NetworkProviderProxy getProviderProxy() {
}

private void updateDevice() {
if (getParameters().getAction() == PlugAction.PLUG
&& hotPlugVmNicRequired(getVm().getStatus())) {
VmDevicesMonitoring.Change change = vmDevicesMonitoring.createChange(getVdsId(), System.nanoTime());
change.updateVm(getVmId(), VmDevicesMonitoring.UPDATE_HASH);
change.flush();
} else {
vmDevice.setPlugged(getParameters().getAction() == PlugAction.PLUG);
vmDeviceDao.update(vmDevice);
}
vmDevice.setPlugged(getParameters().getAction() == PlugAction.PLUG);
vmDeviceDao.update(vmDevice);
}

private boolean handleFailoverIfNeeded() {
Expand Down

0 comments on commit 2834041

Please sign in to comment.