Skip to content

Commit

Permalink
Merge pull request #3959 from liang-cong-red-hat/utils-zcrypt_add_cry…
Browse files Browse the repository at this point in the history
…pto_dev_info_entry

Add crypto device sestat entry in secure guest for S390
  • Loading branch information
chunfuwen committed Sep 11, 2024
2 parents accb025 + 7bdb11c commit 9403e81
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion virttest/utils_zcrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def __init__(self):
self.qdepth = None
self.functions = None
self.driver = None
self.sestat = None

@property
def id(self):
Expand Down Expand Up @@ -196,6 +197,13 @@ def from_string(line):
:return: device info entry
"""
r = CryptoDeviceInfoEntry()
crypto_dev_info = line.split()
crypto_dev_act_attr_num = len(crypto_dev_info)
crypto_dev_exp_attr_num = len(vars(r)) - 1
if crypto_dev_act_attr_num < crypto_dev_exp_attr_num:
crypto_dev_info.extend(
[None] * (crypto_dev_exp_attr_num - crypto_dev_act_attr_num)
)
(
r.id,
r.type,
Expand All @@ -207,7 +215,8 @@ def from_string(line):
r.qdepth,
r.functions,
r.driver,
) = line.split()
r.sestat,
) = crypto_dev_info
return r


Expand Down

0 comments on commit 9403e81

Please sign in to comment.