@@ -128,21 +128,25 @@ def get_base_config(self, instance, mac, image_meta,
128
128
model = None
129
129
driver = None
130
130
vhost_queues = None
131
+ rx_queue_size = None
132
+
133
+ # NOTE(stephenfin): Skip most things here as only apply to virtio
134
+ # devices
135
+ if vnic_type in network_model .VNIC_TYPES_DIRECT_PASSTHROUGH :
136
+ designer .set_vif_guest_frontend_config (
137
+ conf , mac , model , driver , vhost_queues , rx_queue_size )
138
+ return conf
131
139
132
140
# If the user has specified a 'vif_model' against the
133
141
# image then honour that model
134
142
if image_meta :
135
143
model = osinfo .HardwareProperties (image_meta ).network_model
136
144
137
- # Note(moshele): Skip passthough vnic_types as they don't support
138
- # virtio model.
139
- if vnic_type not in network_model .VNIC_TYPES_DIRECT_PASSTHROUGH :
140
- # Else if the virt type is KVM/QEMU/VZ(Parallels), then use virtio
141
- # according to the global config parameter
142
- if (model is None and
143
- virt_type in ('kvm' , 'qemu' , 'parallels' ) and
144
- CONF .libvirt .use_virtio_for_bridges ):
145
- model = network_model .VIF_MODEL_VIRTIO
145
+ # If the virt type is KVM/QEMU/VZ(Parallels), then use virtio according
146
+ # to the global config parameter
147
+ if (model is None and virt_type in ('kvm' , 'qemu' , 'parallels' ) and
148
+ CONF .libvirt .use_virtio_for_bridges ):
149
+ model = network_model .VIF_MODEL_VIRTIO
146
150
147
151
# Workaround libvirt bug, where it mistakenly
148
152
# enables vhost mode, even for non-KVM guests
@@ -167,7 +171,6 @@ def get_base_config(self, instance, mac, image_meta,
167
171
# use vhost and not None.
168
172
driver = vhost_drv or driver
169
173
170
- rx_queue_size = None
171
174
# Note(moshele): rx_queue_size is support only for virtio model
172
175
if model == network_model .VIF_MODEL_VIRTIO :
173
176
if driver == 'vhost' or driver is None :
0 commit comments