Ensure Macvtap NICs can use a model

Defaults to virtio like a bridged NIC. Otherwise performance is abysmal.
This commit is contained in:
2021-06-22 02:38:16 -04:00
parent 07dbd55f03
commit 7d2a3b5361
2 changed files with 4 additions and 3 deletions

View File

@ -574,9 +574,10 @@ def vm_networks_add(config, vm, network, macaddr, model, sriov, sriov_mode, rest
)
# Add a macvtap SR-IOV network
elif sriov_mode == 'macvtap':
device_string = '<interface type="direct"><mac address="{macaddr}"/><source dev="{network}" mode="passthrough"/></interface>'.format(
device_string = '<interface type="direct"><mac address="{macaddr}"/><source dev="{network}" mode="passthrough"/><model type="{model}"/></interface>'.format(
macaddr=macaddr,
network=network
network=network,
model=model
)
else:
return False, "ERROR: Invalid SR-IOV mode specified."