Skip to content

Commit 83040a8

Browse files
authored
virsh: add nodedev-update (avocado-framework#4164)
* virsh: add nodedev-update Add nodedev-update function. This is needed to test the update of a passed through crypto device on s390x. Signed-off-by: Sebastian Mitterle <smitterl@redhat.com> * utils_zcrypt: add string representation For easier debugging use "card.domain" as the string representation of an entry in the logs. Signed-off-by: Sebastian Mitterle <smitterl@redhat.com> --------- Signed-off-by: Sebastian Mitterle <smitterl@redhat.com>
1 parent 4326b46 commit 83040a8

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

virttest/utils_zcrypt.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ def __init__(self):
155155
self.driver = None
156156
self.sestat = None
157157

158+
def __str__(self):
159+
"""
160+
string representation of entry
161+
"""
162+
return f"{self._card}.{self._domain}"
163+
158164
@property
159165
def id(self):
160166
"""

virttest/virsh.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4321,6 +4321,23 @@ def nodedev_define(xml_file, **dargs):
43214321
return command(cmd, **dargs)
43224322

43234323

4324+
def nodedev_update(nodedev_name, xml_file, options=None, **dargs):
4325+
"""
4326+
Return cmd result of the device to be update by an XML file
4327+
4328+
:param nodedev_name: node device name for update
4329+
:param xml_file: device XML file
4330+
:param dargs: standardized virsh function API keywords
4331+
:return: CmdResult object
4332+
"""
4333+
cmd = "nodedev-update %s %s" % (nodedev_name, xml_file)
4334+
if options is not None:
4335+
cmd += " %s" % options
4336+
4337+
LOG.debug("Updated the device from %s", xml_file)
4338+
return command(cmd, **dargs)
4339+
4340+
43244341
def nodedev_create(xml_file, options=None, **dargs):
43254342
"""
43264343
Return cmd result of the device to be created by an XML file

0 commit comments

Comments
 (0)