Skip to content

Commit

Permalink
virt-launcher, nichotplug: Use only the auto-generated domain devices
Browse files Browse the repository at this point in the history
When reserving network interfaces, the domain configuration is created
in two steps:
- Create the domain configuration with placeholder interfaces.
- Create the domain configuration based on the auto-generated
  configuration from the previous step but without the placeholder
  interfaces.

When retrieving the auto-generated configuration, it is missing the
`qemu:commandline` section. This in practice drops configuration that
supports SLIRP and potentially other features.

Therefore, do not use the whole generated domain configuration for the
second step, just use the devices section.

Signed-off-by: Edward Haas <[email protected]>
EdDev committed Jun 4, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent e0bef51 commit 756133b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/virt-launcher/virtwrap/nichotplug.go
Original file line number Diff line number Diff line change
@@ -193,9 +193,11 @@ func withNetworkIfacesResources(vmi *v1.VirtualMachineInstance, domainSpec *api.
return nil, err
}
domainSpecWithoutIfacePlaceholders.Devices.Interfaces = domainSpec.Devices.Interfaces
domainSpecWithoutIfacePlaceholders.DeepCopyInto(domainSpec)
// Only the devices are taken into account because some parameters are not assured to be returned when
// getting the domain spec (e.g. the `qemu:commandline` section).
domainSpecWithoutIfacePlaceholders.Devices.DeepCopyInto(&domainSpec.Devices)

return f(vmi, domainSpecWithoutIfacePlaceholders)
return f(vmi, domainSpec)
}

func appendPlaceholderInterfacesToTheDomain(vmi *v1.VirtualMachineInstance, domainSpec *api.DomainSpec) *api.DomainSpec {

0 comments on commit 756133b

Please sign in to comment.