runtime: do not add virtio-rng-pci device for confidential guests

Adding:
"-object rng-random,id=rng0,filename=/dev/urandom -device
virtio-rng-pci,rng=rng0"

for confidential guests is not necessary as the RNG source cannot
be trusted and the guest kernel has the driver already disable as well.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
This commit is contained in:
Mikko Ylinen
2025-05-09 16:12:36 +03:00
parent a44dfb8d37
commit ab29c8c979

View File

@@ -806,8 +806,8 @@ func (q *qemu) CreateVM(ctx context.Context, id string, network Network, hypervi
qemuConfig.IOThreads = []govmmQemu.IOThread{*ioThread}
}
// Add RNG device to hypervisor
// Skip for s390x as CPACF is used
if machine.Type != QemuCCWVirtio {
// Skip for s390x (as CPACF is used) or when Confidential Guest is enabled
if machine.Type != QemuCCWVirtio && !q.config.ConfidentialGuest {
rngDev := config.RNGDev{
ID: rngID,
Filename: q.config.EntropySource,