Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmsdk: fix the obj init for unknown cc environment #70

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion vmsdk/python/cctrusted_vm/cvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,15 @@ def dump(self):
def inst():
"""Singleton interface for the instance of CcLinuxStub"""
if ConfidentialVM._inst is None:
obj = None
cc_type = ConfidentialVM.detect_cc_type()
if cc_type is ConfidentialVM.TYPE_CC_TDX:
obj = TdxVM()
if obj.init():
else:
LOG.error("Unsupported confidential environment.")
return None

if obj is not None and obj.init():
ConfidentialVM._inst = obj
else:
LOG.error("Fail to initialize the confidential VM.")
Expand Down
Loading