From: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: dts@dpdk.org, Akihiko Odaki <akihiko.odaki@daynix.com>
Subject: [PATCH 5/7] nics/system_info: Accept memory with unknown speed
Date: Fri, 14 Apr 2023 21:52:53 +0900 [thread overview]
Message-ID: <20230414125255.67812-6-akihiko.odaki@daynix.com> (raw)
In-Reply-To: <20230414125255.67812-1-akihiko.odaki@daynix.com>
A virtual machine may only have memories with unknown speed. Rejecting
memories with unknown speed cause an exception in such a case because
_strip_memory() expects there is one valid memory at least.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
nics/system_info.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/nics/system_info.py b/nics/system_info.py
index 3e80d4bd..c841a505 100644
--- a/nics/system_info.py
+++ b/nics/system_info.py
@@ -57,7 +57,7 @@ class SystemInfo(object):
speed_regex = r"(\s+)Speed: (.*)"
size = ""
locate = ""
- speed = "Unknown"
+ speed = None
memory_infos = []
memory_channel = set()
lines = memories.split("\r\n")
@@ -75,10 +75,10 @@ class SystemInfo(object):
s_m = re.match(speed_regex, line)
if s_m:
speed = s_m.group(2)
- if speed != "Unknown":
+ if speed is not None:
memory = {"Size": size, "Locate": locate, "Speed": speed}
memory_infos.append(memory)
- speed = "Unknown"
+ speed = None
total_size += int(size)
memory_channel.add(locate[0])
--
2.40.0
next prev parent reply other threads:[~2023-04-14 12:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 12:52 [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
2023-04-14 12:52 ` [PATCH 1/7] Replace Pcapy with Pcapyplus Akihiko Odaki
2023-04-14 12:52 ` [PATCH 2/7] Update numpy from 1.18.5 to 1.24.2 Akihiko Odaki
2023-04-14 12:52 ` [PATCH 3/7] framework/ssh_pexpect: Remove duplicate regex flags Akihiko Odaki
2023-04-14 12:52 ` [PATCH 4/7] framework: Remove unused variable Akihiko Odaki
2023-04-14 12:52 ` Akihiko Odaki [this message]
2023-04-14 12:52 ` [PATCH 6/7] framework/packet: Fix tcpdump help parse Akihiko Odaki
2023-04-14 12:52 ` [PATCH 7/7] tests/ip_pipeline: Use common tcpdump methods Akihiko Odaki
2023-05-25 2:52 ` lijuan.tu
2023-05-06 7:27 ` [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230414125255.67812-6-akihiko.odaki@daynix.com \
--to=akihiko.odaki@daynix.com \
--cc=dts@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).