mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
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: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
7d2f942af9
commit
c8eb99eebf
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user