From f0dbbaff90b48a1248f8df07828e87e2233e8d5b Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Thu, 13 Feb 2020 18:38:40 +0100 Subject: [PATCH] ampere: falcon/hawk: Add padding for IPMI raw cmds Ampere HAWK platform requires that certain IPMI raw commands be padded to a fixed number of bytes with zeroes. Co-authored-by: Jimmy Lafontaine Rivera Signed-off-by: Alexandru Avadanii Change-Id: I6f68ed0d4c2b010760fef9109beb14d6da4ae813 --- ironic-virtmedia-driver.spec | 2 +- src/ironic_virtmedia_driver/vendors/ampere/falcon.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ironic-virtmedia-driver.spec b/ironic-virtmedia-driver.spec index 998e1b1..4587ecd 100644 --- a/ironic-virtmedia-driver.spec +++ b/ironic-virtmedia-driver.spec @@ -15,7 +15,7 @@ Name: ironic-virtmedia-driver Version: %{_version} -Release: 2%{?dist} +Release: 3%{?dist} Summary: Contains ironic drivers for virtualmedia based deployment License: %{_platform_licence} Source0: %{name}-%{version}.tar.gz diff --git a/src/ironic_virtmedia_driver/vendors/ampere/falcon.py b/src/ironic_virtmedia_driver/vendors/ampere/falcon.py index 9f05326..6842262 100644 --- a/src/ironic_virtmedia_driver/vendors/ampere/falcon.py +++ b/src/ironic_virtmedia_driver/vendors/ampere/falcon.py @@ -40,7 +40,7 @@ RAW_RESTART_VMEDIA = '0x32 0xcb 0x0a 0x01' # Remote Image Service commands RAW_RESTART_RIS_CD = '0x32 0x9f 0x01 0x0b 0x01' -RAW_SET_RIS_NFS = '0x32 0x9f 0x01 0x05 0x00 0x6e 0x66 0x73' +RAW_SET_RIS_NFS = '0x32 0x9f 0x01 0x05 0x00 0x6e 0x66 0x73 0x00 0x00 0x00' RAW_SET_RIS_NFS_IP = '0x32 0x9f 0x01 0x02 0x00 %s' RAW_SET_RIS_NFS_PATH = '0x32 0x9f 0x01 0x01 0x01 %s' RAW_SET_RIS_PROGRESS = '0x32 0x9f 0x01 0x01 0x00 %s' @@ -51,7 +51,6 @@ RAW_GET_MOUNTED_IMG_COUNT = '0x32 0xd8 0x00 0x01' RAW_SET_IMG_NAME = '0x32 0xd7 0x01 0x01 0x01 0x01 %s' RAW_STOP_REDIRECT = '0x32 0xd7 0x01 0x01 0x01 0x00 %s' - class FALCON(OpenBMCIronicVirtMediaHW): def __init__(self, log): super(FALCON, self).__init__(log) @@ -200,7 +199,7 @@ class FALCON(OpenBMCIronicVirtMediaHW): def _set_nfs_server_ip(self, driver_info, task): try: - cmd = RAW_SET_RIS_NFS_IP % (self.hex_convert(driver_info['provisioning_server'])) + cmd = RAW_SET_RIS_NFS_IP % (self.hex_convert(driver_info['provisioning_server'], True, 63)) self.log.debug('Virtual media server "%s"' % driver_info['provisioning_server']) ipmitool.send_raw(task, cmd) except Exception as err: @@ -231,7 +230,7 @@ class FALCON(OpenBMCIronicVirtMediaHW): ipmitool.send_raw(task, cmd) time.sleep(2) - cmd = RAW_SET_RIS_NFS_PATH % (self.hex_convert(self.remote_share)) + cmd = RAW_SET_RIS_NFS_PATH % (self.hex_convert(self.remote_share, True, 64)) ipmitool.send_raw(task, cmd) time.sleep(2) @@ -306,7 +305,7 @@ class FALCON(OpenBMCIronicVirtMediaHW): def _set_image_name(self, image_filename, task): try: - cmd = RAW_SET_IMG_NAME % (self.hex_convert(image_filename)) + cmd = RAW_SET_IMG_NAME % (self.hex_convert(image_filename, True, 64)) self.log.debug('Setting virtual media image: %s' % image_filename) ipmitool.send_raw(task, cmd) except Exception as err: -- 2.16.6