提交 c8eb99ee 编写于 作者: P Peter Krempa

qemu: command: Build the 'pflash' drives via -machine

The old way to instantiate a pflash device via -drive was a hack since
it's a platform device.

The modern approach calls for configuring it via -machine and takes the
node name as an argument.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 7d2f942a
......@@ -7043,7 +7043,8 @@ static int
qemuBuildMachineCommandLine(virCommandPtr cmd,
virQEMUDriverConfigPtr cfg,
const virDomainDef *def,
virQEMUCapsPtr qemuCaps)
virQEMUCapsPtr qemuCaps,
qemuDomainObjPrivatePtr priv)
{
virTristateSwitch vmport = def->features[VIR_DOMAIN_FEATURE_VMPORT];
virTristateSwitch smm = def->features[VIR_DOMAIN_FEATURE_SMM];
......@@ -7343,6 +7344,13 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
if (def->sev)
virBufferAddLit(&buf, ",memory-encryption=sev0");
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
if (priv->pflash0)
virBufferAsprintf(&buf, ",pflash0=%s", priv->pflash0->nodeformat);
if (priv->pflash1)
virBufferAsprintf(&buf, ",pflash1=%s", priv->pflash1->nodeformat);
}
virCommandAddArgBuffer(cmd, &buf);
return 0;
......@@ -10247,7 +10255,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
if (enableFips)
virCommandAddArg(cmd, "-enable-fips");
if (qemuBuildMachineCommandLine(cmd, cfg, def, qemuCaps) < 0)
if (qemuBuildMachineCommandLine(cmd, cfg, def, qemuCaps, priv) < 0)
return NULL;
qemuBuildTSEGCommandLine(cmd, def);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册