@@ -145,21 +145,25 @@ def get_base_config(self, instance, mac, image_meta,
145
145
model = None
146
146
driver = None
147
147
vhost_queues = None
148
+ rx_queue_size = None
149
+
150
+ # NOTE(stephenfin): Skip most things here as only apply to virtio
151
+ # devices
152
+ if vnic_type in network_model .VNIC_TYPES_DIRECT_PASSTHROUGH :
153
+ designer .set_vif_guest_frontend_config (
154
+ conf , mac , model , driver , vhost_queues , rx_queue_size )
155
+ return conf
148
156
149
157
# If the user has specified a 'vif_model' against the
150
158
# image then honour that model
151
159
if image_meta :
152
160
model = osinfo .HardwareProperties (image_meta ).network_model
153
161
154
- # Note(moshele): Skip passthough vnic_types as they don't support
155
- # virtio model.
156
- if vnic_type not in network_model .VNIC_TYPES_DIRECT_PASSTHROUGH :
157
- # Else if the virt type is KVM/QEMU/VZ(Parallels), then use virtio
158
- # according to the global config parameter
159
- if (model is None and
160
- virt_type in ('kvm' , 'qemu' , 'parallels' ) and
161
- CONF .libvirt .use_virtio_for_bridges ):
162
- model = network_model .VIF_MODEL_VIRTIO
162
+ # If the virt type is KVM/QEMU/VZ(Parallels), then use virtio according
163
+ # to the global config parameter
164
+ if (model is None and virt_type in ('kvm' , 'qemu' , 'parallels' ) and
165
+ CONF .libvirt .use_virtio_for_bridges ):
166
+ model = network_model .VIF_MODEL_VIRTIO
163
167
164
168
# Workaround libvirt bug, where it mistakenly
165
169
# enables vhost mode, even for non-KVM guests
@@ -184,7 +188,6 @@ def get_base_config(self, instance, mac, image_meta,
184
188
# use vhost and not None.
185
189
driver = vhost_drv or driver
186
190
187
- rx_queue_size = None
188
191
# Note(moshele): rx_queue_size is support only for virtio model
189
192
if model == network_model .VIF_MODEL_VIRTIO :
190
193
if driver == 'vhost' or driver is None :
0 commit comments