[RFC] virsysinfo: Try reading DMI table

This patch intends to add DMI support to libvirt for RISC-V and mips. This is based on commit ec6ce6363, which added ARM support. This is untested, as I've been unable to find hardware to test this on. src/util/virsysinfo.c | 2 ++ 1 file changed, 2 insertions(+) Cheers, Brett Holman P.S. This is my first post on this mailing list, I believe that I've followed

From: Brett Holman <brett.holman@canonical.com> The SMBIOS specification[1] includes RISC-V and mips, and some systems have SMBIOS info. Attempt to read dmidecode and fall back to old behavior if that fails. [1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.4.0.p... Signed-off-by: Brett Holman <brett.holman@canonical.com> --- src/util/virsysinfo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 36a861c53f..d8d660d694 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -1248,6 +1248,8 @@ virSysinfoRead(void) #elif !defined(WIN32) && \ (defined(__x86_64__) || \ defined(__i386__) || \ + defined(__mips__) || \ + defined(__riscv__) || \ defined(__amd64__)) return virSysinfoReadDMI(); #else /* WIN32 || not supported arch */ -- 2.43.0

My apologies for this duplicate, please direct reviews to this thread -> https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/G6GPD...

This patch intends to add DMI support to libvirt for RISC-V and mips. This change is based on commit ec6ce6363, which added ARM support. This is not tested on the target arches, as I've been unable to find hardware to test this on. src/util/virsysinfo.c | 2 ++ 1 file changed, 2 insertions(+) V1->V2: 1. Update commit message to clarify Loongson->mips relationship. 2. Rebase onto recent LoongArch merge. Cheers, Brett Holman

From: Brett Holman <brett.holman@canonical.com> Add DMI support for risc-v and mips. Attempt to read dmidecode and fall back to old behavior if that fails. The SMBIOS specification[1] officially supports both RISC-V and LoongArch. Some mips-based Loongson-3 processors also have SMBIOS. [1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.0.p... Signed-off-by: Brett Holman <brett.holman@canonical.com> --- src/util/virsysinfo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 4a03fc3246..0d9083c891 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -1249,6 +1249,8 @@ virSysinfoRead(void) (defined(__x86_64__) || \ defined(__i386__) || \ defined(__amd64__) || \ + defined(__riscv__) || \ + defined(__mips__) || \ defined(__loongarch__)) return virSysinfoReadDMI(); #else /* WIN32 || not supported arch */ -- 2.43.0

On Tue, Mar 26, 2024 at 8:45 PM <brett.holman@canonical.com> wrote:
From: Brett Holman <brett.holman@canonical.com>
Add DMI support for risc-v and mips. Attempt to read dmidecode and fall back to old behavior if that fails.
The SMBIOS specification[1] officially supports both RISC-V and LoongArch. Some mips-based Loongson-3 processors also have SMBIOS.
[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.0.p...
Signed-off-by: Brett Holman <brett.holman@canonical.com> --- src/util/virsysinfo.c | 2 ++ 1 file changed, 2 insertions(+)
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>

On 3/26/24 13:38, brett.holman@canonical.com wrote:
From: Brett Holman <brett.holman@canonical.com>
Add DMI support for risc-v and mips. Attempt to read dmidecode and fall back to old behavior if that fails.
The SMBIOS specification[1] officially supports both RISC-V and LoongArch. Some mips-based Loongson-3 processors also have SMBIOS.
[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.0.p...
Signed-off-by: Brett Holman <brett.holman@canonical.com>
Hi Brett, A colleague asked about the status of this patch and it's availability in downstream openSUSE packages. I took a peek and LGTM. I then noticed Kristina has also reviewed the patch. I've added both R-B to the commit and pushed it. This appears to be your first commit to the libvirt project. Congratulations! :-) Regards, Jim
--- src/util/virsysinfo.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 4a03fc3246..0d9083c891 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -1249,6 +1249,8 @@ virSysinfoRead(void) (defined(__x86_64__) || \ defined(__i386__) || \ defined(__amd64__) || \ + defined(__riscv__) || \ + defined(__mips__) || \ defined(__loongarch__)) return virSysinfoReadDMI(); #else /* WIN32 || not supported arch */

A colleague asked about the status of this patch and it's availability in downstream openSUSE packages. I took a peek and LGTM. I then noticed Kristina has also reviewed the patch. I've added both R-B to the commit and pushed it.
I appreciate the review and push \o/ Should I have resubmitted with the R-B in the commit message after Kristina's review? Mailing list contribution process is still very unfamiliar to me.
This appears to be your first commit to the libvirt project. Congratulations! :-)
Thanks :-) On Tue, Apr 2, 2024 at 5:13 PM Jim Fehlig <jfehlig@suse.com> wrote:
On 3/26/24 13:38, brett.holman@canonical.com wrote:
From: Brett Holman <brett.holman@canonical.com>
Add DMI support for risc-v and mips. Attempt to read dmidecode and fall back to old behavior if that fails.
The SMBIOS specification[1] officially supports both RISC-V and LoongArch. Some mips-based Loongson-3 processors also have SMBIOS.
[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.0.p...
Signed-off-by: Brett Holman <brett.holman@canonical.com>
Hi Brett,
A colleague asked about the status of this patch and it's availability in downstream openSUSE packages. I took a peek and LGTM. I then noticed Kristina has also reviewed the patch. I've added both R-B to the commit and pushed it.
This appears to be your first commit to the libvirt project. Congratulations! :-)
Regards, Jim
--- src/util/virsysinfo.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 4a03fc3246..0d9083c891 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -1249,6 +1249,8 @@ virSysinfoRead(void) (defined(__x86_64__) || \ defined(__i386__) || \ defined(__amd64__) || \ + defined(__riscv__) || \ + defined(__mips__) || \ defined(__loongarch__)) return virSysinfoReadDMI(); #else /* WIN32 || not supported arch */

On 4/5/24 23:12, Brett Holman wrote:
A colleague asked about the status of this patch and it's availability in downstream openSUSE packages. I took a peek and LGTM. I then noticed Kristina has also reviewed the patch. I've added both R-B to the commit and pushed it.
I appreciate the review and push \o/
Should I have resubmitted with the R-B in the commit message after Kristina's review? Mailing list contribution process is still very unfamiliar to me.
No need. Unfortunately, things lined up 'badly'. I mean, Kristina gave her reviewed-by during freeze period in which we try to stabilize libvirt and prepare it for upcoming release. Therefore, we do not merge new features, just bug fixes. And since she doesn't have commit access to the repo, she did not merge the patch once after the release. I knew I wanted to do it, but then Easter happened (public holiday) and quite frankly - just forgot, once I was back. Thanks Jim for keeping an eye on this!
This appears to be your first commit to the libvirt project. Congratulations! :-)
Indeed, congratulations! Michal
participants (5)
-
Brett Holman
-
brett.holman@canonical.com
-
Jim Fehlig
-
Kristina Hanicova
-
Michal Prívozník