virsysinfo: Parse OEM strings

Setting OEM strings for a domain was introduced in
v4.1.0-rc1~315. However, any application that wanted to use them
(e.g. to point to an URL where a config file is stored) had to
'dmidecode -u --oem-string N' (where N is index of the string).
Well, we can expose them under our <sysinfo/> XML and if the
domain is running Libvirt inside it can be obtained using
virConnectGetSysinfo() API.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Michal Privoznik
2020-06-02 10:15:38 +02:00
parent 994e56ba42
commit b44898dd31
4 changed files with 138 additions and 5 deletions

View File

@@ -81,3 +81,9 @@ Memory Device
Serial Number: 29057112
Asset Tag: 0839
Part Number: IMSH2GS13A1F1C-10F
OEM Strings
String 1: Hello
String 2: World
String 3: Ha ha ha try parsing\n. String 3: this correctly. String 4:then
String 4: This is, more tricky value=escaped

View File

@@ -50,4 +50,12 @@
<entry name='serial_number'>29057112</entry>
<entry name='part_number'>IMSH2GS13A1F1C-10F</entry>
</memory_device>
<oemStrings>
<entry>Hello</entry>
<entry>World</entry>
<entry>Ha ha ha try parsing\n
String 3: this correctly
String 4:then</entry>
<entry>This is, more tricky value=escaped</entry>
</oemStrings>
</sysinfo>