From patchwork Fri Apr 14 12:52:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 126095 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 69DEF42941; Fri, 14 Apr 2023 14:53:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65B9842C54; Fri, 14 Apr 2023 14:53:19 +0200 (CEST) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 51BD042C54 for ; Fri, 14 Apr 2023 14:53:17 +0200 (CEST) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1a67d2601b3so4419515ad.0 for ; Fri, 14 Apr 2023 05:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1681476796; x=1684068796; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wzInD470+r5hSOxmm44I1QzAlVJnCocu8eZvnBHJQEk=; b=26COP3CjtZq4jMhkbHLZS6+52rlLTmNc8jFyo2BdbgmlagQMGzkExRgEGM2Y01NriA NyuScOmePzi1Qs+OgDEkhantEof2O4g7TBNOhBCxZwbDbM7NboTxRGfkJbyNJ75OEFcZ Mll/JFa2c/0T2JMTirFsJXHmjI2GlIdgFpX71ot600jD/y3Nf8oi13cYMKFRapSDHBaI 9MEr3HjpgwDe9SgcxOFGl9dEjgzgXeHcQXWy0knKH025vOfNbTCJfWA+T48XgTTnhokz ilNJQzmP674okIN28sKgIMz4S+RI+jnd/6bJ6BHX7RPrudeHQm8L3NGZtLHtEuPg+3ms Iu3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681476796; x=1684068796; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wzInD470+r5hSOxmm44I1QzAlVJnCocu8eZvnBHJQEk=; b=antu8TB3iEFO6Tjpgibns+RiIKPCYRS3HuUS7ITRK5r4LqjkrKnhstqBVqbNeZcHYw xZHFyK9d1Q1L/mYM2D9V3wBVZ2iXzqErDTfomcrlnyCoAy72x2QIDFGbSMJV+fzy8IAo 6+JhxlJImfY33uQutCaCuqbuz1G1V6H8LO7nZQqZnjLIsV7T6Xr97/yx4fqQDLKjbyvS +1gQtD1l5vJYPQPvFYxshg1qjX6d57mY99m0WWKN07qaFvHFm/ruOWSZR9LlySyBRaGM rW9LPcOqwouX9R3aVT+i1P4MeP3K/4Akc7Y6l+OOb7vo3w0CumZtzZwSOG01/VWhISFU AytA== X-Gm-Message-State: AAQBX9fJ68GD8SZ7NFzca/1CFFFkfOIo92sgjxGTzU3I5XqZjJd0JSUl JxmiMCieL/MLfAxrY2CSQsjeBTg5EaC4ScW5/2A= X-Google-Smtp-Source: AKy350YiEClo2odsA0zDkRvvY4NxZbRlF/RBPwHf54eAXOK3itVZzhsBtGfiI7VcyGtmjr2m9fUk8Q== X-Received: by 2002:a05:6a00:1307:b0:62d:cfd4:e440 with SMTP id j7-20020a056a00130700b0062dcfd4e440mr8177639pfu.8.1681476796413; Fri, 14 Apr 2023 05:53:16 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id u21-20020a62ed15000000b00627df85cd72sm2961787pfh.199.2023.04.14.05.53.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 05:53:16 -0700 (PDT) From: Akihiko Odaki To: Cc: dts@dpdk.org, Akihiko Odaki Subject: [PATCH 5/7] nics/system_info: Accept memory with unknown speed Date: Fri, 14 Apr 2023 21:52:53 +0900 Message-Id: <20230414125255.67812-6-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230414125255.67812-1-akihiko.odaki@daynix.com> References: <20230414125255.67812-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org 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 --- 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])