}
+static int
+qemuBuildSysinfoCommandLine(virCommandPtr cmd,
+ virQEMUCapsPtr qemuCaps,
+ const virDomainDef *def)
+{
+ size_t i;
+
+ /* We need to handle VIR_SYSINFO_FWCFG here, because
+ * VIR_SYSINFO_SMBIOS is handled in qemuBuildSmbiosCommandLine() */
+ for (i = 0; i < def->nsysinfo; i++) {
+ size_t j;
+
+ if (def->sysinfo[i]->type != VIR_SYSINFO_FWCFG)
+ continue;
+
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_FW_CFG)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("fw_cfg is not supported with this QEMU"));
+ return -1;
+ }
+
+ for (j = 0; j < def->sysinfo[i]->nfw_cfgs; j++) {
+ const virSysinfoFWCfgDef *f = &def->sysinfo[i]->fw_cfgs[j];
+ g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
+
+ virBufferAsprintf(&buf, "name=%s", f->name);
+
+ if (f->value)
+ virBufferEscapeString(&buf, ",string=%s", f->value);
+ else
+ virBufferEscapeString(&buf, ",file=%s", f->file);
+
+ virCommandAddArg(cmd, "-fw_cfg");
+ virCommandAddArgBuffer(cmd, &buf);
+ }
+ }
+
+ return 0;
+}
+
+
static int
qemuBuildVMGenIDCommandLine(virCommandPtr cmd,
const virDomainDef *def)
if (qemuBuildSmbiosCommandLine(cmd, driver, def) < 0)
return NULL;
+ if (qemuBuildSysinfoCommandLine(cmd, qemuCaps, def) < 0)
+ return NULL;
+
if (qemuBuildVMGenIDCommandLine(cmd, def) < 0)
return NULL;
--- /dev/null
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-smbios 'type=0,vendor=LENOVO,version=6FET82WW (3.12 )' \
+-smbios 'type=1,manufacturer=Fedora,product=Virt-Manager,version=0.8.2-3.fc14,\
+serial=32dfcb37-5af1-552b-357c-be8c3aa38310,\
+uuid=c7a5fdbd-edaf-9455-926a-d65c16db1809,sku=1234567890,family=Red Hat' \
+-smbios 'type=2,manufacturer=Lenovo,product=20BE0061MC,version=0B98401 Pro,\
+serial=W1KS427111E,location=Not Available' \
+-fw_cfg 'name=opt/com.example/name,string=example value' \
+-fw_cfg name=opt/com.coreos/config,file=/tmp/provision.ign \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3