Skip to content

Commit

Permalink
core: Don’t mark TPM device as special
Browse files Browse the repository at this point in the history
TPM device has its own special handling and thus is not a special
device with general properties.
  • Loading branch information
mz-pdm committed Aug 10, 2022
1 parent 98810c0 commit 4e90f71
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ public static boolean isSpecialDevice(String device, VmDeviceGeneralType type, b
switch(type) {
case MDEV:
case SOUND:
case TPM:
return true;
case CONSOLE:
return VmDeviceType.CONSOLE.getName().equals(device);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ private VmDevice readOtherHardwareItem(XmlNode node) {
.forValue(String.valueOf(selectSingleNode(node, VMD_TYPE, _xmlNS).innerText));
String device = selectSingleNode(node, VMD_DEVICE, _xmlNS).innerText;
// special devices are treated as managed devices but still have the OTHER OVF ResourceType
managed = VmDeviceCommonUtils.isSpecialDevice(device, type, true);
managed = VmDeviceCommonUtils.isSpecialDevice(device, type, true) || type == VmDeviceGeneralType.TPM;
}

return managed ? readManagedVmDevice(node, readDeviceId(node))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,6 @@ private void writeOtherDevices() {
// mdev_type predefined property is written instead
continue;
}
if (device.getType() == VmDeviceGeneralType.TPM) {
// TPM device has its own write method
continue;
}
devices.add(device);
}
}
Expand Down

0 comments on commit 4e90f71

Please sign in to comment.