libvirt/76977061-qemu-smbios-oem-strings.patch
James Fehlig a48acb127a Accepting request 569996 from home:jfehlig:branches:Virtualization
- qemu: Support setting OEM strings in SMBIOS
  68eed56b-conf-smbios-oem-strings.patch,
  76977061-qemu-smbios-oem-strings.patch
  FATE#323624
- libxl: resume lock process after failed migration
  0c710a37-libxl-resume-lock-on-mig-failure.patch
  bsc#1076861

- qemu hook: Change shebang to /usr/bin/python3
- spec: Require python lxml in daemon-hooks subpackage

OBS-URL: https://build.opensuse.org/request/show/569996
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=665
2018-01-26 17:16:35 +00:00

111 lines
3.8 KiB
Diff

commit 7697706135562121732a5ddb5574a4afb269645f
Author: Daniel P. Berrange <berrange@redhat.com>
Date: Wed Jan 17 17:35:13 2018 +0000
qemu: add support for generating SMBIOS OEM strings command line
This wires up the previously added OEM strings XML schema to be able to
generate comamnd line args for QEMU. This requires QEMU >= 2.12 release
containing this patch:
commit 2d6dcbf93fb01b4a7f45a93d276d4d74b16392dd
Author: Daniel P. Berrange <berrange@redhat.com>
Date: Sat Oct 28 21:51:36 2017 +0100
smbios: support setting OEM strings table
Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Index: libvirt-4.0.0/src/qemu/qemu_command.c
===================================================================
--- libvirt-4.0.0.orig/src/qemu/qemu_command.c
+++ libvirt-4.0.0/src/qemu/qemu_command.c
@@ -6142,6 +6142,26 @@ qemuBuildSmbiosBaseBoardStr(virSysinfoBa
}
+static char *
+qemuBuildSmbiosOEMStringsStr(virSysinfoOEMStringsDefPtr def)
+{
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+ size_t i;
+
+ if (!def)
+ return NULL;
+
+ virBufferAddLit(&buf, "type=11");
+
+ for (i = 0; i < def->nvalues; i++) {
+ virBufferAddLit(&buf, ",value=");
+ virQEMUBuildBufferEscapeComma(&buf, def->values[i]);
+ }
+
+ return virBufferContentAndReset(&buf);
+}
+
+
static int
qemuBuildSmbiosCommandLine(virCommandPtr cmd,
virQEMUDriverPtr driver,
@@ -6210,6 +6230,14 @@ qemuBuildSmbiosCommandLine(virCommandPtr
return -1;
virCommandAddArgList(cmd, "-smbios", smbioscmd, NULL);
+ VIR_FREE(smbioscmd);
+ }
+
+ if (source->oemStrings) {
+ if (!(smbioscmd = qemuBuildSmbiosOEMStringsStr(source->oemStrings)))
+ return -1;
+
+ virCommandAddArgList(cmd, "-smbios", smbioscmd, NULL);
VIR_FREE(smbioscmd);
}
}
Index: libvirt-4.0.0/tests/qemuxml2argvdata/smbios.args
===================================================================
--- libvirt-4.0.0.orig/tests/qemuxml2argvdata/smbios.args
+++ libvirt-4.0.0/tests/qemuxml2argvdata/smbios.args
@@ -17,6 +17,8 @@ serial=32dfcb37-5af1-552b-357c-be8c3aa38
uuid=c7a5fdbd-edaf-9455-926a-d65c16db1809,sku=1234567890,family=Red Hat' \
-smbios 'type=2,manufacturer=Hewlett-Packard,product=0B4Ch,version=D,\
serial=CZC1065993,asset=CZC1065993,location=Upside down' \
+-smbios 'type=11,value=Hello,value=World,value=This is,,\
+ more tricky value=escaped' \
-nographic \
-nodefaults \
-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
Index: libvirt-4.0.0/tests/qemuxml2argvdata/smbios.xml
===================================================================
--- libvirt-4.0.0.orig/tests/qemuxml2argvdata/smbios.xml
+++ libvirt-4.0.0/tests/qemuxml2argvdata/smbios.xml
@@ -26,6 +26,11 @@
<entry name='asset'>CZC1065993</entry>
<entry name='location'>Upside down</entry>
</baseBoard>
+ <oemStrings>
+ <entry>Hello</entry>
+ <entry>World</entry>
+ <entry>This is, more tricky value=escaped</entry>
+ </oemStrings>
</sysinfo>
<os>
<type arch='i686' machine='pc'>hvm</type>
Index: libvirt-4.0.0/tests/qemuxml2xmloutdata/smbios.xml
===================================================================
--- libvirt-4.0.0.orig/tests/qemuxml2xmloutdata/smbios.xml
+++ libvirt-4.0.0/tests/qemuxml2xmloutdata/smbios.xml
@@ -26,6 +26,11 @@
<entry name='asset'>CZC1065993</entry>
<entry name='location'>Upside down</entry>
</baseBoard>
+ <oemStrings>
+ <entry>Hello</entry>
+ <entry>World</entry>
+ <entry>This is, more tricky value=escaped</entry>
+ </oemStrings>
</sysinfo>
<os>
<type arch='i686' machine='pc'>hvm</type>